Commit eacbb34f authored by Francois Cartegnie's avatar Francois Cartegnie

expose demux_New

parent c24a40ba
...@@ -183,7 +183,47 @@ enum demux_query_e ...@@ -183,7 +183,47 @@ enum demux_query_e
DEMUX_NAV_RIGHT, /* res=can fail */ DEMUX_NAV_RIGHT, /* res=can fail */
}; };
VLC_API int demux_vaControlHelper( stream_t *, int64_t i_start, int64_t i_end, int64_t i_bitrate, int i_align, int i_query, va_list args ); /*************************************************************************
* Main Demux
*************************************************************************/
/* stream_t *s could be null and then it mean a access+demux in one */
VLC_API demux_t *demux_New( vlc_object_t *p_obj, const char *psz_name,
const char *psz_path, stream_t *s, es_out_t *out );
VLC_API void demux_Delete( demux_t * );
VLC_API int demux_vaControlHelper( stream_t *, int64_t i_start, int64_t i_end,
int64_t i_bitrate, int i_align, int i_query, va_list args );
VLC_USED static inline int demux_Demux( demux_t *p_demux )
{
if( !p_demux->pf_demux )
return 1;
return p_demux->pf_demux( p_demux );
}
static inline int demux_vaControl( demux_t *p_demux, int i_query, va_list args )
{
return p_demux->pf_control( p_demux, i_query, args );
}
static inline int demux_Control( demux_t *p_demux, int i_query, ... )
{
va_list args;
int i_result;
va_start( args, i_query );
i_result = demux_vaControl( p_demux, i_query, args );
va_end( args );
return i_result;
}
/*************************************************************************
* Miscellaneous helpers for demuxers
*************************************************************************/
static inline void demux_UpdateTitleFromStream( demux_t *demux ) static inline void demux_UpdateTitleFromStream( demux_t *demux )
{ {
...@@ -205,10 +245,6 @@ static inline void demux_UpdateTitleFromStream( demux_t *demux ) ...@@ -205,10 +245,6 @@ static inline void demux_UpdateTitleFromStream( demux_t *demux )
} }
} }
/*************************************************************************
* Miscellaneous helpers for demuxers
*************************************************************************/
VLC_USED VLC_USED
static inline bool demux_IsPathExtension( demux_t *p_demux, const char *psz_extension ) static inline bool demux_IsPathExtension( demux_t *p_demux, const char *psz_extension )
{ {
......
...@@ -72,12 +72,25 @@ static const char *demux_FromContentType(const char *mime) ...@@ -72,12 +72,25 @@ static const char *demux_FromContentType(const char *mime)
return (type != NULL) ? type->demux : "any"; return (type != NULL) ? type->demux : "any";
} }
#undef demux_New
/***************************************************************************** /*****************************************************************************
* demux_New: * demux_New:
* if s is NULL then load a access_demux * if s is NULL then load a access_demux
*****************************************************************************/ *****************************************************************************/
demux_t *demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input, demux_t *demux_New( vlc_object_t *p_obj, const char *psz_name,
const char *psz_location, stream_t *s, es_out_t *out )
{
return demux_NewAdvanced( p_obj, NULL,
(s == NULL) ? psz_name : "",
(s != NULL) ? psz_name : "",
psz_location, s, out, false );
}
/*****************************************************************************
* demux_NewAdvanced:
* if s is NULL then load a access_demux
*****************************************************************************/
#undef demux_NewAdvanced
demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
const char *psz_access, const char *psz_demux, const char *psz_access, const char *psz_demux,
const char *psz_location, const char *psz_location,
stream_t *s, es_out_t *out, bool b_quick ) stream_t *s, es_out_t *out, bool b_quick )
......
...@@ -31,31 +31,8 @@ ...@@ -31,31 +31,8 @@
#include "stream.h" #include "stream.h"
/* stream_t *s could be null and then it mean a access+demux in one */ /* stream_t *s could be null and then it mean a access+demux in one */
demux_t *demux_New( vlc_object_t *p_obj, input_thread_t *p_parent_input, const char *psz_access, const char *psz_demux, const char *psz_path, stream_t *s, es_out_t *out, bool ); demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
#define demux_New( a, b, c, d, e, f, g, h ) demux_New(VLC_OBJECT(a),b,c,d,e,f,g,h) const char *psz_access, const char *psz_demux,
const char *psz_path, stream_t *s, es_out_t *out, bool );
void demux_Delete( demux_t * ); #define demux_NewAdvanced( a, b, c, d, e, f, g, h ) demux_NewAdvanced(VLC_OBJECT(a),b,c,d,e,f,g,h)
static inline int demux_Demux( demux_t *p_demux )
{
if( !p_demux->pf_demux )
return 1;
return p_demux->pf_demux( p_demux );
}
static inline int demux_vaControl( demux_t *p_demux, int i_query, va_list args )
{
return p_demux->pf_control( p_demux, i_query, args );
}
static inline int demux_Control( demux_t *p_demux, int i_query, ... )
{
va_list args;
int i_result;
va_start( args, i_query );
i_result = demux_vaControl( p_demux, i_query, args );
va_end( args );
return i_result;
}
#endif #endif
...@@ -2169,7 +2169,7 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -2169,7 +2169,7 @@ static int InputSourceInit( input_thread_t *p_input,
} }
/* Try access_demux first */ /* Try access_demux first */
in->p_demux = demux_New( p_input, p_input, psz_access, psz_demux, in->p_demux = demux_NewAdvanced( p_input, p_input, psz_access, psz_demux,
psz_path, NULL, p_input->p->p_es_out, false ); psz_path, NULL, p_input->p->p_es_out, false );
} }
else else
...@@ -2341,7 +2341,7 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -2341,7 +2341,7 @@ static int InputSourceInit( input_thread_t *p_input,
if( psz_path == NULL ) if( psz_path == NULL )
psz_path = ""; psz_path = "";
in->p_demux = demux_New( p_input, p_input, psz_access, psz_demux, in->p_demux = demux_NewAdvanced( p_input, p_input, psz_access, psz_demux,
psz_path, p_stream, p_input->p->p_es_out, psz_path, p_stream, p_input->p->p_es_out,
p_input->b_preparsing ); p_input->b_preparsing );
......
...@@ -248,8 +248,8 @@ static void* DStreamThread( void *obj ) ...@@ -248,8 +248,8 @@ static void* DStreamThread( void *obj )
demux_t *p_demux; demux_t *p_demux;
/* Create the demuxer */ /* Create the demuxer */
p_demux = demux_New( s, s->p_input, "", p_sys->psz_name, "", s, p_sys->out, p_demux = demux_NewAdvanced( s, s->p_input, "", p_sys->psz_name, "",
false ); s, p_sys->out, false );
if( p_demux == NULL ) if( p_demux == NULL )
return NULL; return NULL;
......
...@@ -88,8 +88,10 @@ decoder_SynchroReset ...@@ -88,8 +88,10 @@ decoder_SynchroReset
decoder_SynchroTrash decoder_SynchroTrash
decode_URI decode_URI
decode_URI_duplicate decode_URI_duplicate
demux_Delete
demux_PacketizerDestroy demux_PacketizerDestroy
demux_PacketizerNew demux_PacketizerNew
demux_New
demux_vaControlHelper demux_vaControlHelper
dialog_ExtensionUpdate dialog_ExtensionUpdate
dialog_Login dialog_Login
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment