[vlc-devel] commit: Allow decoder/packetizer to output meta data. (Laurent Aimar )
git version control
git at videolan.org
Tue Dec 9 21:40:20 CET 2008
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Dec 5 10:47:31 2008 +0100| [132b8e6f80921f117f0045b804d692fdcec3c602] | committer: Laurent Aimar
Allow decoder/packetizer to output meta data.
They are ignored for now.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=132b8e6f80921f117f0045b804d692fdcec3c602
---
include/vlc_codec.h | 10 ++++++++--
modules/stream_out/mosaic_bridge.c | 4 ++++
modules/stream_out/transcode.c | 9 +++++++++
src/input/decoder.c | 11 ++++++++---
src/input/demux.c | 3 +++
src/misc/image.c | 4 ++++
6 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/include/vlc_codec.h b/include/vlc_codec.h
index 5003e63..291581c 100644
--- a/include/vlc_codec.h
+++ b/include/vlc_codec.h
@@ -62,10 +62,10 @@ struct decoder_t
es_format_t fmt_out;
/* 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 */
- bool b_pace_control;
+ bool b_pace_control;
/* */
picture_t * ( * pf_decode_video )( decoder_t *, block_t ** );
@@ -81,6 +81,12 @@ struct decoder_t
* globaly, not necessary for the current packet */
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
* XXX You MUST not use them directly.
diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index daec5cd..6d18e07 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -37,6 +37,7 @@
#include <vlc_sout.h>
#include <vlc_block.h>
#include <vlc_codec.h>
+#include <vlc_meta.h>
#include <vlc_image.h>
#include <vlc_filter.h>
@@ -473,6 +474,9 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
if( 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_release( p_sys->p_decoder );
diff --git a/modules/stream_out/transcode.c b/modules/stream_out/transcode.c
index e081a0c..4a7680e 100644
--- a/modules/stream_out/transcode.c
+++ b/modules/stream_out/transcode.c
@@ -38,6 +38,7 @@
#include <vlc_aout.h>
#include <vlc_vout.h>
#include <vlc_codec.h>
+#include <vlc_meta.h>
#include <vlc_block.h>
#include <vlc_filter.h>
#include <vlc_osd.h>
@@ -1275,6 +1276,10 @@ static void transcode_audio_close( sout_stream_id_t *id )
module_unneed( id->p_decoder, id->p_decoder->p_module );
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 */
if( 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,
/* Close decoder */
if( 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 )
{
@@ -2315,6 +2322,8 @@ static void transcode_spu_close( sout_stream_id_t *id)
/* Close decoder */
if( 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 */
if( id->p_encoder->p_module )
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 615a730..12e6dd7 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -687,13 +687,15 @@ static decoder_t * CreateDecoder( input_thread_t *p_input,
p_dec->pf_get_cc = NULL;
p_dec->pf_packetize = NULL;
- /* Initialize the decoder fifo */
+ /* Initialize the decoder */
p_dec->p_module = NULL;
memset( &null_es_format, 0, sizeof(es_format_t) );
es_format_Copy( &p_dec->fmt_in, fmt );
es_format_Copy( &p_dec->fmt_out, &null_es_format );
+ p_dec->p_description = NULL;
+
/* Allocate our private structure for the decoder */
p_dec->p_owner = p_owner = malloc( sizeof( decoder_owner_sys_t ) );
if( p_dec->p_owner == NULL )
@@ -2053,6 +2055,9 @@ static void DeleteDecoder( decoder_t * p_dec )
es_format_Clean( &p_dec->fmt_in );
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 )
{
@@ -2060,12 +2065,12 @@ static void DeleteDecoder( decoder_t * p_dec )
p_owner->p_packetizer->p_module );
es_format_Clean( &p_owner->p_packetizer->fmt_in );
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_release( p_owner->p_packetizer );
}
- es_format_Clean( &p_owner->fmt_description );
-
vlc_cond_destroy( &p_owner->wait );
vlc_mutex_destroy( &p_owner->lock );
diff --git a/src/input/demux.c b/src/input/demux.c
index 49fdf28..9ed4eec 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -28,6 +28,7 @@
#include "demux.h"
#include <libvlc.h>
#include <vlc_codec.h>
+#include <vlc_meta.h>
static bool SkipID3Tag( demux_t * );
static bool SkipAPETag( demux_t *p_demux );
@@ -602,6 +603,8 @@ void demux_PacketizerDestroy( decoder_t *p_packetizer )
if( p_packetizer->p_module )
module_unneed( p_packetizer, p_packetizer->p_module );
es_format_Clean( &p_packetizer->fmt_in );
+ if( p_packetizer->p_description )
+ vlc_meta_Delete( p_packetizer->p_description );
vlc_object_release( p_packetizer );
}
diff --git a/src/misc/image.c b/src/misc/image.c
index d4746f9..a28b119 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -39,6 +39,7 @@
#include <vlc_common.h>
#include <vlc_codec.h>
+#include <vlc_meta.h>
#include <vlc_filter.h>
#include <vlc_es.h>
#include <vlc_image.h>
@@ -642,6 +643,9 @@ static void DeleteDecoder( decoder_t * p_dec )
es_format_Clean( &p_dec->fmt_in );
es_format_Clean( &p_dec->fmt_out );
+ if( p_dec->p_description )
+ vlc_meta_Delete( p_dec->p_description );
+
vlc_object_release( p_dec );
p_dec = NULL;
}
More information about the vlc-devel
mailing list