[vlc-devel] commit: Implement ACCESS_OUT_CONTROLS_PACE as needed ( Rémi Denis-Courmont )
git version control
git at videolan.org
Fri Aug 29 17:52:58 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Fri Aug 29 18:50:00 2008 +0300| [42051dfb80a09dbf24fcd1f2e8101a35bf0b63af] | committer: Rémi Denis-Courmont
Implement ACCESS_OUT_CONTROLS_PACE as needed
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=42051dfb80a09dbf24fcd1f2e8101a35bf0b63af
---
modules/access_output/file.c | 27 +++++++++++++++++++--------
modules/access_output/http.c | 25 ++++++++++++++++++-------
modules/access_output/shout.c | 19 +++++++++++++++++++
modules/access_output/udp.c | 23 ++++++++++++++++++-----
4 files changed, 74 insertions(+), 20 deletions(-)
diff --git a/modules/access_output/file.c b/modules/access_output/file.c
index 9abce9b..56ccd02 100644
--- a/modules/access_output/file.c
+++ b/modules/access_output/file.c
@@ -89,6 +89,7 @@ static const char *const ppsz_sout_options[] = {
static ssize_t Write( sout_access_out_t *, block_t * );
static int Seek ( sout_access_out_t *, off_t );
static ssize_t Read ( sout_access_out_t *, block_t * );
+static int Control( sout_access_out_t *, int, va_list );
struct sout_access_out_sys_t
{
@@ -140,16 +141,13 @@ static int Open( vlc_object_t *p_this )
p_access->pf_write = Write;
p_access->pf_read = Read;
p_access->pf_seek = Seek;
+ p_access->pf_control = Control;
p_access->p_sys = (void *)(intptr_t)fd;
msg_Dbg( p_access, "file access output opened (%s)", p_access->psz_path );
if (append)
lseek (fd, 0, SEEK_END);
- /* Update pace control flag */
- if( p_access->psz_access && !strcmp( p_access->psz_access, "stream" ) )
- p_access->p_sout->i_out_pace_nocontrol++;
-
return VLC_SUCCESS;
}
@@ -162,13 +160,26 @@ static void Close( vlc_object_t * p_this )
close( (intptr_t)p_access->p_sys );
- /* Update pace control flag */
- if( p_access->psz_access && !strcmp( p_access->psz_access, "stream" ) )
- p_access->p_sout->i_out_pace_nocontrol--;
-
msg_Dbg( p_access, "file access output closed" );
}
+static int Control( sout_access_out_t *p_access, int i_query, va_list args )
+{
+ switch( i_query )
+ {
+ case ACCESS_OUT_CONTROLS_PACE:
+ {
+ bool *pb = va_arg( args, bool * );
+ *pb = strcmp( p_access->psz_access, "stream" );
+ break;
+ }
+
+ default:
+ return VLC_EGENERIC;
+ }
+ return VLC_SUCCESS;
+}
+
/*****************************************************************************
* Read: standard read on a file descriptor.
*****************************************************************************/
diff --git a/modules/access_output/http.c b/modules/access_output/http.c
index fbb2ab0..705955d 100644
--- a/modules/access_output/http.c
+++ b/modules/access_output/http.c
@@ -129,6 +129,7 @@ static const char *const ppsz_sout_options[] = {
static ssize_t Write( sout_access_out_t *, block_t * );
static int Seek ( sout_access_out_t *, off_t );
+static int Control( sout_access_out_t *, int, va_list );
struct sout_access_out_sys_t
{
@@ -343,10 +344,7 @@ static int Open( vlc_object_t *p_this )
p_access->pf_write = Write;
p_access->pf_seek = Seek;
-
-
- /* update p_sout->i_out_pace_nocontrol */
- p_access->p_sout->i_out_pace_nocontrol++;
+ p_access->pf_control = Control;
return VLC_SUCCESS;
}
@@ -364,9 +362,6 @@ static void Close( vlc_object_t * p_this )
bonjour_stop_service( p_sys->p_bonjour );
#endif
- /* update p_sout->i_out_pace_nocontrol */
- p_access->p_sout->i_out_pace_nocontrol--;
-
httpd_StreamDelete( p_sys->p_httpd_stream );
httpd_HostDelete( p_sys->p_httpd_host );
@@ -377,6 +372,22 @@ static void Close( vlc_object_t * p_this )
free( p_sys );
}
+static int Control( sout_access_out_t *p_access, int i_query, va_list args )
+{
+ (void)p_access;
+
+ switch( i_query )
+ {
+ case ACCESS_OUT_CONTROLS_PACE:
+ *va_arg( args, bool * ) = false;
+ break;
+
+ default:
+ return VLC_EGENERIC;
+ }
+ return VLC_SUCCESS;
+}
+
/*****************************************************************************
* Write:
*****************************************************************************/
diff --git a/modules/access_output/shout.c b/modules/access_output/shout.c
index c51704a..601e6d7 100644
--- a/modules/access_output/shout.c
+++ b/modules/access_output/shout.c
@@ -151,6 +151,7 @@ static const char *const ppsz_sout_options[] = {
*****************************************************************************/
static ssize_t Write( sout_access_out_t *, block_t * );
static int Seek ( sout_access_out_t *, off_t );
+static int Control( sout_access_out_t *, int, va_list );
struct sout_access_out_sys_t
{
@@ -459,6 +460,7 @@ static int Open( vlc_object_t *p_this )
p_access->pf_write = Write;
p_access->pf_seek = Seek;
+ p_access->pf_control = Control;
msg_Dbg( p_access, "shout access output opened (%s@%s:%i/%s)",
psz_user, psz_host, i_port, psz_mount );
@@ -497,6 +499,23 @@ static void Close( vlc_object_t * p_this )
msg_Dbg( p_access, "shout access output closed" );
}
+static int Control( sout_access_out_t *p_access, int i_query, va_list args )
+{
+ switch( i_query )
+ {
+ case ACCESS_OUT_CONTROLS_PACE:
+ {
+ bool *pb = va_arg( args, bool * );
+ *pb = strcmp( p_access->psz_access, "stream" );
+ break;
+ }
+
+ default:
+ return VLC_EGENERIC;
+ }
+ return VLC_SUCCESS;
+}
+
/*****************************************************************************
* Write: standard write
*****************************************************************************/
diff --git a/modules/access_output/udp.c b/modules/access_output/udp.c
index 8319e68..9cc5d11 100644
--- a/modules/access_output/udp.c
+++ b/modules/access_output/udp.c
@@ -113,6 +113,7 @@ static const char *const ppsz_core_options[] = {
static ssize_t Write ( sout_access_out_t *, block_t * );
static int Seek ( sout_access_out_t *, off_t );
+static int Control( sout_access_out_t *, int, va_list );
static void* ThreadWrite( vlc_object_t * );
static block_t *NewUDPPacket( sout_access_out_t *, mtime_t );
@@ -260,9 +261,7 @@ static int Open( vlc_object_t *p_this )
p_access->pf_write = Write;
p_access->pf_seek = Seek;
-
- /* update p_sout->i_out_pace_nocontrol */
- p_access->p_sout->i_out_pace_nocontrol++;
+ p_access->pf_control = Control;
return VLC_SUCCESS;
}
@@ -298,13 +297,27 @@ static void Close( vlc_object_t * p_this )
vlc_object_detach( p_sys->p_thread );
vlc_object_release( p_sys->p_thread );
- /* update p_sout->i_out_pace_nocontrol */
- p_access->p_sout->i_out_pace_nocontrol--;
msg_Dbg( p_access, "UDP access output closed" );
free( p_sys );
}
+static int Control( sout_access_out_t *p_access, int i_query, va_list args )
+{
+ (void)p_access;
+
+ switch( i_query )
+ {
+ case ACCESS_OUT_CONTROLS_PACE:
+ *va_arg( args, bool * ) = false;
+ break;
+
+ default:
+ return VLC_EGENERIC;
+ }
+ return VLC_SUCCESS;
+}
+
/*****************************************************************************
* Write: standard write on a file descriptor.
*****************************************************************************/
More information about the vlc-devel
mailing list