Commit 132b8e6f authored by Laurent Aimar's avatar Laurent Aimar

Allow decoder/packetizer to output meta data.

They are ignored for now.
parent da0ee427
...@@ -62,10 +62,10 @@ struct decoder_t ...@@ -62,10 +62,10 @@ struct decoder_t
es_format_t fmt_out; es_format_t fmt_out;
/* Some decoders only accept packetized data (ie. not truncated) */ /* Some decoders only accept packetized data (ie. not truncated) */
bool b_need_packetized; bool b_need_packetized;
/* Tell the decoder if it is allowed to drop frames */ /* Tell the decoder if it is allowed to drop frames */
bool b_pace_control; bool b_pace_control;
/* */ /* */
picture_t * ( * pf_decode_video )( decoder_t *, block_t ** ); picture_t * ( * pf_decode_video )( decoder_t *, block_t ** );
...@@ -81,6 +81,12 @@ struct decoder_t ...@@ -81,6 +81,12 @@ struct decoder_t
* globaly, not necessary for the current packet */ * globaly, not necessary for the current packet */
block_t * ( * pf_get_cc ) ( decoder_t *, bool pb_present[4] ); block_t * ( * pf_get_cc ) ( decoder_t *, bool pb_present[4] );
/* Meta data at codec level
* The decoder owner set it back to NULL once it has retreived what it needs.
* The decoder owner is responsible of its release except when you overwrite it.
*/
vlc_meta_t *p_description;
/* /*
* Owner fields * Owner fields
* XXX You MUST not use them directly. * XXX You MUST not use them directly.
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <vlc_sout.h> #include <vlc_sout.h>
#include <vlc_block.h> #include <vlc_block.h>
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_meta.h>
#include <vlc_image.h> #include <vlc_image.h>
#include <vlc_filter.h> #include <vlc_filter.h>
...@@ -473,6 +474,9 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id ) ...@@ -473,6 +474,9 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
if( p_sys->p_decoder->p_module ) if( p_sys->p_decoder->p_module )
module_unneed( p_sys->p_decoder, p_sys->p_decoder->p_module ); module_unneed( p_sys->p_decoder, p_sys->p_decoder->p_module );
if( p_sys->p_decoder->p_description )
vlc_meta_Delete( p_sys->p_decoder->p_description );
vlc_object_detach( p_sys->p_decoder ); vlc_object_detach( p_sys->p_decoder );
vlc_object_release( p_sys->p_decoder ); vlc_object_release( p_sys->p_decoder );
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <vlc_aout.h> #include <vlc_aout.h>
#include <vlc_vout.h> #include <vlc_vout.h>
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_meta.h>
#include <vlc_block.h> #include <vlc_block.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_osd.h> #include <vlc_osd.h>
...@@ -1275,6 +1276,10 @@ static void transcode_audio_close( sout_stream_id_t *id ) ...@@ -1275,6 +1276,10 @@ static void transcode_audio_close( sout_stream_id_t *id )
module_unneed( id->p_decoder, id->p_decoder->p_module ); module_unneed( id->p_decoder, id->p_decoder->p_module );
id->p_decoder->p_module = NULL; id->p_decoder->p_module = NULL;
if( id->p_decoder->p_description )
vlc_meta_Delete( id->p_decoder->p_description );
id->p_decoder->p_description = NULL;
/* Close encoder */ /* Close encoder */
if( id->p_encoder->p_module ) if( id->p_encoder->p_module )
module_unneed( id->p_encoder, id->p_encoder->p_module ); module_unneed( id->p_encoder, id->p_encoder->p_module );
...@@ -1770,6 +1775,8 @@ static void transcode_video_close( sout_stream_t *p_stream, ...@@ -1770,6 +1775,8 @@ static void transcode_video_close( sout_stream_t *p_stream,
/* Close decoder */ /* Close decoder */
if( id->p_decoder->p_module ) if( id->p_decoder->p_module )
module_unneed( id->p_decoder, id->p_decoder->p_module ); module_unneed( id->p_decoder, id->p_decoder->p_module );
if( id->p_decoder->p_description )
vlc_meta_Delete( id->p_decoder->p_description );
if( id->p_decoder->p_owner ) if( id->p_decoder->p_owner )
{ {
...@@ -2315,6 +2322,8 @@ static void transcode_spu_close( sout_stream_id_t *id) ...@@ -2315,6 +2322,8 @@ static void transcode_spu_close( sout_stream_id_t *id)
/* Close decoder */ /* Close decoder */
if( id->p_decoder->p_module ) if( id->p_decoder->p_module )
module_unneed( id->p_decoder, id->p_decoder->p_module ); module_unneed( id->p_decoder, id->p_decoder->p_module );
if( id->p_decoder->p_description )
vlc_meta_Delete( id->p_decoder->p_description );
/* Close encoder */ /* Close encoder */
if( id->p_encoder->p_module ) if( id->p_encoder->p_module )
......
...@@ -687,13 +687,15 @@ static decoder_t * CreateDecoder( input_thread_t *p_input, ...@@ -687,13 +687,15 @@ static decoder_t * CreateDecoder( input_thread_t *p_input,
p_dec->pf_get_cc = NULL; p_dec->pf_get_cc = NULL;
p_dec->pf_packetize = NULL; p_dec->pf_packetize = NULL;
/* Initialize the decoder fifo */ /* Initialize the decoder */
p_dec->p_module = NULL; p_dec->p_module = NULL;
memset( &null_es_format, 0, sizeof(es_format_t) ); memset( &null_es_format, 0, sizeof(es_format_t) );
es_format_Copy( &p_dec->fmt_in, fmt ); es_format_Copy( &p_dec->fmt_in, fmt );
es_format_Copy( &p_dec->fmt_out, &null_es_format ); es_format_Copy( &p_dec->fmt_out, &null_es_format );
p_dec->p_description = NULL;
/* Allocate our private structure for the decoder */ /* Allocate our private structure for the decoder */
p_dec->p_owner = p_owner = malloc( sizeof( decoder_owner_sys_t ) ); p_dec->p_owner = p_owner = malloc( sizeof( decoder_owner_sys_t ) );
if( p_dec->p_owner == NULL ) if( p_dec->p_owner == NULL )
...@@ -2053,6 +2055,9 @@ static void DeleteDecoder( decoder_t * p_dec ) ...@@ -2053,6 +2055,9 @@ static void DeleteDecoder( decoder_t * p_dec )
es_format_Clean( &p_dec->fmt_in ); es_format_Clean( &p_dec->fmt_in );
es_format_Clean( &p_dec->fmt_out ); es_format_Clean( &p_dec->fmt_out );
if( p_dec->p_description )
vlc_meta_Delete( p_dec->p_description );
es_format_Clean( &p_owner->fmt_description );
if( p_owner->p_packetizer ) if( p_owner->p_packetizer )
{ {
...@@ -2060,12 +2065,12 @@ static void DeleteDecoder( decoder_t * p_dec ) ...@@ -2060,12 +2065,12 @@ static void DeleteDecoder( decoder_t * p_dec )
p_owner->p_packetizer->p_module ); p_owner->p_packetizer->p_module );
es_format_Clean( &p_owner->p_packetizer->fmt_in ); es_format_Clean( &p_owner->p_packetizer->fmt_in );
es_format_Clean( &p_owner->p_packetizer->fmt_out ); es_format_Clean( &p_owner->p_packetizer->fmt_out );
if( p_owner->p_packetizer->p_description )
vlc_meta_Delete( p_owner->p_packetizer->p_description );
vlc_object_detach( p_owner->p_packetizer ); vlc_object_detach( p_owner->p_packetizer );
vlc_object_release( p_owner->p_packetizer ); vlc_object_release( p_owner->p_packetizer );
} }
es_format_Clean( &p_owner->fmt_description );
vlc_cond_destroy( &p_owner->wait ); vlc_cond_destroy( &p_owner->wait );
vlc_mutex_destroy( &p_owner->lock ); vlc_mutex_destroy( &p_owner->lock );
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "demux.h" #include "demux.h"
#include <libvlc.h> #include <libvlc.h>
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_meta.h>
static bool SkipID3Tag( demux_t * ); static bool SkipID3Tag( demux_t * );
static bool SkipAPETag( demux_t *p_demux ); static bool SkipAPETag( demux_t *p_demux );
...@@ -602,6 +603,8 @@ void demux_PacketizerDestroy( decoder_t *p_packetizer ) ...@@ -602,6 +603,8 @@ void demux_PacketizerDestroy( decoder_t *p_packetizer )
if( p_packetizer->p_module ) if( p_packetizer->p_module )
module_unneed( p_packetizer, p_packetizer->p_module ); module_unneed( p_packetizer, p_packetizer->p_module );
es_format_Clean( &p_packetizer->fmt_in ); es_format_Clean( &p_packetizer->fmt_in );
if( p_packetizer->p_description )
vlc_meta_Delete( p_packetizer->p_description );
vlc_object_release( p_packetizer ); vlc_object_release( p_packetizer );
} }
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_meta.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_es.h> #include <vlc_es.h>
#include <vlc_image.h> #include <vlc_image.h>
...@@ -642,6 +643,9 @@ static void DeleteDecoder( decoder_t * p_dec ) ...@@ -642,6 +643,9 @@ static void DeleteDecoder( decoder_t * p_dec )
es_format_Clean( &p_dec->fmt_in ); es_format_Clean( &p_dec->fmt_in );
es_format_Clean( &p_dec->fmt_out ); es_format_Clean( &p_dec->fmt_out );
if( p_dec->p_description )
vlc_meta_Delete( p_dec->p_description );
vlc_object_release( p_dec ); vlc_object_release( p_dec );
p_dec = NULL; p_dec = NULL;
} }
......
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