]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/transcode.c
#transcode{vfilter=...} only works with video filter2 filters.
[vlc] / modules / stream_out / transcode.c
index 469d403eb78ea390bdd13cc029281a45b0e8e51c..450f4ba8ccea35ebca69144339a8b76837680b12 100644 (file)
@@ -217,7 +217,7 @@ vlc_module_begin();
                  MAXWIDTH_LONGTEXT, VLC_TRUE );
     add_integer( SOUT_CFG_PREFIX "maxheight", 0, NULL, MAXHEIGHT_TEXT,
                  MAXHEIGHT_LONGTEXT, VLC_TRUE );
-    add_module_list_cat( SOUT_CFG_PREFIX "vfilter", SUBCAT_VIDEO_VFILTER,
+    add_module_list_cat( SOUT_CFG_PREFIX "vfilter", SUBCAT_VIDEO_VFILTER2,
                      NULL, NULL,
                      VFILTER_TEXT, VFILTER_LONGTEXT, VLC_FALSE );
 
@@ -1292,7 +1292,7 @@ static int transcode_audio_new( sout_stream_t *p_stream,
         module_Need( id->p_encoder, "encoder", p_sys->psz_aenc, VLC_TRUE );
     if( !id->p_encoder->p_module )
     {
-        msg_Err( p_stream, "cannot find encoder" );
+        msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_aenc );
         module_Unneed( id->p_decoder, id->p_decoder->p_module );
         id->p_decoder->p_module = 0;
         return VLC_EGENERIC;
@@ -1419,12 +1419,18 @@ static int transcode_audio_process( sout_stream_t *p_stream,
     block_t *p_block, *p_audio_block;
     int i;
     *out = NULL;
+    input_thread_t *p_input = NULL;
+    
+    if( p_stream->p_parent->p_parent && p_stream->p_parent->p_parent->
+                                i_object_type == VLC_OBJECT_INPUT )
+        p_input = (input_thread_t *)p_stream->p_parent->p_parent;
 
     while( (p_audio_buf = id->p_decoder->pf_decode_audio( id->p_decoder,
                                                           &in )) )
     {
-        stats_UpdateInteger( p_stream->p_parent->p_parent, STATS_DECODED_AUDIO,
-                             1, NULL );
+        if( p_input )
+            stats_UpdateInteger( p_input, p_input->counters.p_decoded_audio,
+                                 1, NULL );
         if( p_sys->b_master_sync )
         {
             mtime_t i_dts = date_Get( &id->interpolated_pts ) + 1;
@@ -1588,7 +1594,7 @@ static int transcode_video_new( sout_stream_t *p_stream, sout_stream_id_t *id )
         module_Need( id->p_encoder, "encoder", p_sys->psz_venc, VLC_TRUE );
     if( !id->p_encoder->p_module )
     {
-        msg_Err( p_stream, "cannot find encoder" );
+        msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_venc );
         module_Unneed( id->p_decoder, id->p_decoder->p_module );
         id->p_decoder->p_module = 0;
         return VLC_EGENERIC;
@@ -1901,7 +1907,7 @@ static int transcode_video_encoder_open( sout_stream_t *p_stream,
         module_Need( id->p_encoder, "encoder", p_sys->psz_venc, VLC_TRUE );
     if( !id->p_encoder->p_module )
     {
-        msg_Err( p_stream, "cannot find encoder" );
+        msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_venc );
         return VLC_EGENERIC;
     }
 
@@ -2006,12 +2012,18 @@ static int transcode_video_process( sout_stream_t *p_stream,
     int i_duplicate = 1, i;
     picture_t *p_pic, *p_pic2 = NULL;
     *out = NULL;
+    input_thread_t *p_input = NULL;
+    if( p_stream->p_parent->p_parent && p_stream->p_parent->p_parent->
+                                i_object_type == VLC_OBJECT_INPUT )
+        p_input = (input_thread_t *)p_stream->p_parent->p_parent;
+
 
     while( (p_pic = id->p_decoder->pf_decode_video( id->p_decoder, &in )) )
     {
         subpicture_t *p_subpic = 0;
-        stats_UpdateInteger( p_stream->p_parent->p_parent, STATS_DECODED_VIDEO,
-                              1, NULL );
+        if( p_input )
+            stats_UpdateInteger( p_input, p_input->counters.p_decoded_video,
+                                 1, NULL );
 
         if( p_stream->p_sout->i_out_pace_nocontrol && p_sys->b_hurry_up )
         {
@@ -2577,7 +2589,7 @@ static int transcode_spu_new( sout_stream_t *p_stream, sout_stream_id_t *id )
         if( !id->p_encoder->p_module )
         {
             module_Unneed( id->p_decoder, id->p_decoder->p_module );
-            msg_Err( p_stream, "cannot find encoder" );
+            msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_senc );
             return VLC_EGENERIC;
         }
     }
@@ -2713,7 +2725,7 @@ static int transcode_osd_new( sout_stream_t *p_stream, sout_stream_id_t *id )
 
         if( !id->p_encoder->p_module )
         {
-            msg_Err( p_stream, "cannot find encoder" );
+            msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_osdenc );
             goto error;
         }