Commit eacbb34f authored by François Cartegnie's avatar François Cartegnie 🤞

expose demux_New

parent c24a40ba
......@@ -183,7 +183,47 @@ enum demux_query_e
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 )
{
......@@ -205,10 +245,6 @@ static inline void demux_UpdateTitleFromStream( demux_t *demux )
}
}
/*************************************************************************
* Miscellaneous helpers for demuxers
*************************************************************************/
VLC_USED
static inline bool demux_IsPathExtension( demux_t *p_demux, const char *psz_extension )
{
......
......@@ -72,15 +72,28 @@ static const char *demux_FromContentType(const char *mime)
return (type != NULL) ? type->demux : "any";
}
#undef demux_New
/*****************************************************************************
* demux_New:
* if s is NULL then load a access_demux
*****************************************************************************/
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_location,
stream_t *s, es_out_t *out, bool b_quick )
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_location,
stream_t *s, es_out_t *out, bool b_quick )
{
demux_t *p_demux = vlc_custom_create( p_obj, sizeof( *p_demux ), "demux" );
if( unlikely(p_demux == NULL) )
......
......@@ -31,31 +31,8 @@
#include "stream.h"
/* 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 );
#define demux_New( a, b, c, d, e, f, g, h ) demux_New(VLC_OBJECT(a),b,c,d,e,f,g,h)
void demux_Delete( demux_t * );
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;
}
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_path, stream_t *s, es_out_t *out, bool );
#define demux_NewAdvanced( a, b, c, d, e, f, g, h ) demux_NewAdvanced(VLC_OBJECT(a),b,c,d,e,f,g,h)
#endif
......@@ -2169,8 +2169,8 @@ static int InputSourceInit( input_thread_t *p_input,
}
/* Try access_demux first */
in->p_demux = demux_New( p_input, p_input, psz_access, psz_demux,
psz_path, NULL, p_input->p->p_es_out, false );
in->p_demux = demux_NewAdvanced( p_input, p_input, psz_access, psz_demux,
psz_path, NULL, p_input->p->p_es_out, false );
}
else
{
......@@ -2341,9 +2341,9 @@ static int InputSourceInit( input_thread_t *p_input,
if( psz_path == NULL )
psz_path = "";
in->p_demux = demux_New( p_input, p_input, psz_access, psz_demux,
psz_path, p_stream, p_input->p->p_es_out,
p_input->b_preparsing );
in->p_demux = demux_NewAdvanced( p_input, p_input, psz_access, psz_demux,
psz_path, p_stream, p_input->p->p_es_out,
p_input->b_preparsing );
if( in->p_demux == NULL )
{
......
......@@ -248,8 +248,8 @@ static void* DStreamThread( void *obj )
demux_t *p_demux;
/* Create the demuxer */
p_demux = demux_New( s, s->p_input, "", p_sys->psz_name, "", s, p_sys->out,
false );
p_demux = demux_NewAdvanced( s, s->p_input, "", p_sys->psz_name, "",
s, p_sys->out, false );
if( p_demux == NULL )
return NULL;
......
......@@ -88,8 +88,10 @@ decoder_SynchroReset
decoder_SynchroTrash
decode_URI
decode_URI_duplicate
demux_Delete
demux_PacketizerDestroy
demux_PacketizerNew
demux_New
demux_vaControlHelper
dialog_ExtensionUpdate
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