]> git.sesse.net Git - vlc/commitdiff
All decoders/encoders MUST set output format category (AUDIO/VIDEO/SPU_ES)
authorLaurent Aimar <fenrir@videolan.org>
Sat, 14 Feb 2009 18:57:15 +0000 (19:57 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 14 Feb 2009 23:22:15 +0000 (00:22 +0100)
16 files changed:
modules/codec/cc.c
modules/codec/cmml/cmml.c
modules/codec/csri.c
modules/codec/cvdsub.c
modules/codec/dvbsub.c
modules/codec/libass.c
modules/codec/libmpeg2.c
modules/codec/quicktime.c
modules/codec/shine/shine_mod.c
modules/codec/subtitles/subsdec.c
modules/codec/subtitles/subsusf.c
modules/codec/subtitles/t140.c
modules/codec/telx.c
modules/codec/twolame.c
modules/codec/x264.c
modules/codec/xvmc/xxmc.c

index af479914cbc19fa559a5f127e2a0ee115aad70b5..9895add9b2911d12a824a5f6e102c57cae258ea6 100644 (file)
@@ -209,6 +209,9 @@ static int Open( vlc_object_t *p_this )
 
     Eia608Init( &p_sys->eia608 );
 
+    p_dec->fmt_out.i_cat = SPU_ES;
+    p_dec->fmt_out.i_codec = VLC_FOURCC('T','E','X','T');
+
     return VLC_SUCCESS;
 }
 
index 36e327078c80c96ed662752ce89b87abda17032d..5be64f4992f0e2747bd122da949cf2ed7497cd75 100644 (file)
@@ -128,6 +128,9 @@ static int OpenDecoder( vlc_object_t *p_this )
     if( p_sys->p_intf )
         intf_RunThread( p_sys->p_intf );
 
+    p_dec->fmt_out.i_cat = SPU_ES;
+    p_dec->fmt_out.i_codec = 0;
+
     return VLC_SUCCESS;
 }
 
index 8d3f9e3a123a8eb1b4274facb5b1ec85a24404e5..3802f4a3322a7d95d9f0e65125257f1830fa770c 100644 (file)
@@ -130,6 +130,9 @@ static int Create( vlc_object_t *p_this )
                                                    p_dec->fmt_in.p_extra,
                                                    p_dec->fmt_in.p_extra ? strnlen( p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra ) : 0,
                                                    NULL);
+    p_dec->fmt_out.i_cat = SPU_ES;
+    p_dec->fmt_out.i_codec = VLC_FOURCC('R','G','B','A');
+
     return VLC_SUCCESS;
 }
 
index b3e1456c782c9c5c3189dbf1f7fd822a8659ff80..dbd59164dc718ef19ce7bc339ed0386a40b5ebb4 100644 (file)
@@ -125,11 +125,12 @@ static int DecoderOpen( vlc_object_t *p_this )
     p_sys->i_state = SUBTITLE_BLOCK_EMPTY;
     p_sys->p_spu   = NULL;
 
-    es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_FOURCC( 'c','v','d',' ' ) );
-
     p_dec->pf_decode_sub = Decode;
     p_dec->pf_packetize  = Packetize;
 
+    p_dec->fmt_out.i_cat = SPU_ES;
+    p_dec->fmt_out.i_codec = VLC_FOURCC('Y','U','V','P');
+
     return VLC_SUCCESS;
 }
 
index cc1fc4b3312d348d7db42aabb4f6c72d11485a41..b102cd069c810500b6cc883c54448476fc9aeb69 100644 (file)
@@ -340,7 +340,8 @@ static int Open( vlc_object_t *p_this )
         p_sys->i_spu_y = i_posy;
     }
 
-    es_format_Init( &p_dec->fmt_out, SPU_ES, VLC_FOURCC( 'd','v','b','s' ) );
+    p_dec->fmt_out.i_cat = SPU_ES;
+    p_dec->fmt_out.i_codec = 0;
 
     default_clut_init( p_dec );
 
index 4d1e35c9e0ca19afc4d31591e7f8bdd3cffbaf70..7e3cbf0164eb35136e541395e7aa0fe964876aa0 100644 (file)
@@ -167,6 +167,9 @@ static int Create( vlc_object_t *p_this )
     ass_process_codec_private( p_track, p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra );
     vlc_mutex_unlock( &libass_lock );
 
+    p_dec->fmt_out.i_cat = SPU_ES;
+    p_dec->fmt_out.i_codec = VLC_FOURCC('R','G','B','A');
+
     return VLC_SUCCESS;
 }
 
index 11dbb2fec20c14224edf744c0c7e8a69f8fa4792..4b6f282b7ea9a08f9e958f0a93734384ea70c243 100644 (file)
@@ -129,12 +129,10 @@ static int OpenDecoder( vlc_object_t *p_this )
     }
 
     /* Allocate the memory needed to store the decoder's structure */
-    if( ( p_dec->p_sys = p_sys =
-          (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
+    if( ( p_dec->p_sys = p_sys = calloc( 1, sizeof(*p_sys)) ) == NULL )
         return VLC_ENOMEM;
 
     /* Initialize the thread properties */
-    memset( p_sys, 0, sizeof(decoder_sys_t) );
     p_sys->p_mpeg2dec = NULL;
     p_sys->p_synchro  = NULL;
     p_sys->p_info     = NULL;
@@ -200,6 +198,8 @@ static int OpenDecoder( vlc_object_t *p_this )
     p_sys->p_info = mpeg2_info( p_sys->p_mpeg2dec );
 
     p_dec->pf_decode_video = DecodeBlock;
+    p_dec->fmt_out.i_cat = VIDEO_ES;
+    p_dec->fmt_out.i_codec = 0;
 
     return VLC_SUCCESS;
 }
index 9692208759f6b5528ca57647e785ba90e76c7ce3..fd75b64ed25ab76b3427a271f2dc6734d39a1a5a 100644 (file)
@@ -265,6 +265,7 @@ static int Open( vlc_object_t *p_this )
 #ifdef LOADER
         p_dec->p_sys = NULL;
         p_dec->pf_decode_video = DecodeVideo;
+        p_dec->fmt_out.i_cat = VIDEO_ES;
         return VLC_SUCCESS;
 #else
         return OpenVideo( p_dec );
@@ -303,6 +304,7 @@ static int Open( vlc_object_t *p_this )
 #ifdef LOADER
         p_dec->p_sys = NULL;
         p_dec->pf_decode_audio = DecodeAudio;
+        p_dec->fmt_out.i_cat = AUDIO_ES;
         return VLC_SUCCESS;
 #else
 
index 94de78ef7732300be190b7bbe1985be8b953b999..ec460c52574b069454355cffb33a0ee0bdec8dc6 100644 (file)
@@ -96,10 +96,9 @@ static int OpenEncoder( vlc_object_t *p_this )
              p_enc->fmt_out.i_bitrate, p_enc->fmt_out.audio.i_rate,
              p_enc->fmt_out.audio.i_channels );
 
-    p_sys = p_enc->p_sys = malloc( sizeof( encoder_sys_t ) );
+    p_enc->p_sys = p_sys = calloc( 1, sizeof( *p_sys ) );
     if( !p_sys )
         return VLC_ENOMEM;
-    memset( p_sys, 0, sizeof( encoder_sys_t ) );
 
     if( !( p_sys->p_fifo = block_FifoNew() ) )
     {
@@ -111,6 +110,7 @@ static int OpenEncoder( vlc_object_t *p_this )
         p_enc->fmt_out.audio.i_channels, p_enc->fmt_out.i_bitrate / 1000 );
 
     p_enc->pf_encode_audio = EncodeFrame;
+    p_enc->fmt_out.i_cat = AUDIO_ES;
 
     return VLC_SUCCESS;
 }
index 59c1f895af07ccf75f1bed9d1fa82433727d9787..d7c6dd616d07e663f50404de69f3d949b2a1f2d5 100644 (file)
@@ -156,14 +156,15 @@ static int OpenDecoder( vlc_object_t *p_this )
     }
 
     p_dec->pf_decode_sub = DecodeBlock;
+    p_dec->fmt_out.i_cat = SPU_ES;
+    p_dec->fmt_out.i_codec = 0;
 
     /* Allocate the memory needed to store the decoder's structure */
-    p_dec->p_sys = p_sys = malloc( sizeof( *p_sys ) );
+    p_dec->p_sys = p_sys = calloc( 1, sizeof( *p_sys ) );
     if( p_sys == NULL )
         return VLC_ENOMEM;
 
     /* init of p_sys */
-    memset( p_sys, 0, sizeof( *p_sys ) );
     p_sys->i_align = 0;
     p_sys->iconv_handle = (vlc_iconv_t)-1;
     p_sys->b_autodetect_utf8 = false;
index ab7756bc5a4d16a423c36d98d4486bae872aa4aa..dfb0db2c26b22951ff797d1bd171d4523d5f07b1 100644 (file)
@@ -76,6 +76,8 @@ static int OpenDecoder( vlc_object_t *p_this )
         return VLC_ENOMEM;
 
     p_dec->pf_decode_sub = DecodeBlock;
+    p_dec->fmt_out.i_cat = SPU_ES;
+    p_dec->fmt_out.i_codec = 0;
 
     /* Unused fields of p_sys - not needed for USF decoding */
     p_sys->b_ass = false;
index 76ae1ef1f15fefbebec8b0cfc6dc1d89c0ae9c9c..5e0c25a0a8bce8704f2e2f486e5b808a40407014 100644 (file)
@@ -70,6 +70,7 @@ static int Open( vlc_object_t *p_this )
     p_enc->p_sys = NULL;
 
     p_enc->pf_encode_sub = Encode;
+    p_enc->fmt_out.i_cat = SPU_ES;
     return VLC_SUCCESS;
 }
 
index 33b1fa33d98bf2d0b6d2cf749adc833e2226ba7f..07fd4cf883d24894205dfec2addc1afd69c39d8b 100644 (file)
@@ -181,11 +181,11 @@ static int Open( vlc_object_t *p_this )
     }
 
     p_dec->pf_decode_sub = Decode;
-    p_sys = p_dec->p_sys = malloc( sizeof(decoder_sys_t) );
+    p_sys = p_dec->p_sys = calloc( 1, sizeof(*p_sys) );
     if( p_sys == NULL )
         return VLC_ENOMEM;
-
-    memset( p_sys, 0, sizeof(decoder_sys_t) );
+    p_dec->fmt_out.i_cat = SPU_ES;
+    p_dec->fmt_out.i_codec = 0;
 
     p_sys->i_align = 0;
     for ( i = 0; i < 9; i++ )
index 8ce4fd2538345b378a8a0ea17db38515eaf6181d..787cbf87fe94864872c735e70b1ab3b89d027876 100644 (file)
@@ -165,6 +165,8 @@ static int OpenEncoder( vlc_object_t *p_this )
 
     p_enc->pf_encode_audio = Encode;
     p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
+
+    p_enc->fmt_out.i_cat = AUDIO_ES;
     p_enc->fmt_out.i_codec = VLC_FOURCC('m','p','g','a');
 
     config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
index 378fb79cdd4be42a9d7fc08853281b2fd1633c57..b2ddf23befc25fc316c84b4932b8325720cbdd7c 100644 (file)
@@ -780,6 +780,7 @@ static int  Open ( vlc_object_t *p_this )
 
     config_ChainParse( p_enc, SOUT_CFG_PREFIX, ppsz_sout_options, p_enc->p_cfg );
 
+    p_enc->fmt_out.i_cat = VIDEO_ES;
     p_enc->fmt_out.i_codec = VLC_FOURCC( 'h', '2', '6', '4' );
     p_enc->fmt_in.i_codec = VLC_FOURCC('I','4','2','0');
 
index e502780c4efeca83d362eabd1db670cbafd977af..efa6d5f8b975bedbee9f7b558a9ef075dfe010f1 100644 (file)
@@ -137,12 +137,11 @@ static int OpenDecoder( vlc_object_t *p_this )
     msg_Dbg(p_dec, "OpenDecoder Entering");
 
     /* Allocate the memory needed to store the decoder's structure */
-    p_dec->p_sys = p_sys = (decoder_sys_t *)malloc(sizeof(decoder_sys_t));
+    p_dec->p_sys = p_sys = calloc( 1, sizeof(*p_sys) );
     if( !p_sys )
         return VLC_ENOMEM;
 
     /* Initialize the thread properties */
-    memset( p_sys, 0, sizeof(decoder_sys_t) );
     p_sys->p_mpeg2dec = NULL;
     p_sys->p_synchro  = NULL;
     p_sys->p_info     = NULL;
@@ -199,6 +198,8 @@ static int OpenDecoder( vlc_object_t *p_this )
     p_sys->p_info = mpeg2_info( p_sys->p_mpeg2dec );
 
     p_dec->pf_decode_video = DecodeBlock;
+    p_dec->fmt_out.i_cat = VIDEO_ES;
+    p_dec->fmt_out.i_codec = 0;
 
     f_wd_dec = fopen("/vlc/dec_pid", "w");
     if (f_wd_dec != NULL)