]> git.sesse.net Git - vlc/commitdiff
Moved vout_synchro to decoder_synchro.
authorLaurent Aimar <fenrir@videolan.org>
Tue, 2 Oct 2007 18:43:23 +0000 (18:43 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 2 Oct 2007 18:43:23 +0000 (18:43 +0000)
include/vlc_codec_synchro.h [moved from include/vlc_vout_synchro.h with 64% similarity]
modules/codec/libmpeg2.c
modules/codec/xvmc/xxmc.c
src/Makefile.am
src/input/decoder_synchro.c [moved from src/video_output/vout_synchro.c with 91% similarity]

similarity index 64%
rename from include/vlc_vout_synchro.h
rename to include/vlc_codec_synchro.h
index 54d4b639f8ca460a4a151e3cf85670c9c54505eb..ce07fb263895f74446b70824b3bcbf2432601967 100644 (file)
@@ -1,6 +1,5 @@
 /*****************************************************************************
- * vout_synchro.h: frame-dropping structures
- * Only used in libmpeg2 decoder at the moment
+ * vlc_codec_synchro.h: frame-dropping structures
  *****************************************************************************
  * Copyright (C) 1999-2005 the VideoLAN team
  * $Id$
@@ -29,9 +28,9 @@
 #endif
 
 /*****************************************************************************
- * vout_synchro_t : timers for the video synchro
+ * decoder_synchro_t : timers for the video synchro
  *****************************************************************************/
-/* Read the discussion on top of vout_synchro.c for more information. */
+/* Read the discussion on top of decoder_synchro.c for more information. */
 /* Pictures types */
 #define I_CODING_TYPE           1
 #define P_CODING_TYPE           2
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
-#define vout_SynchroInit(a,b) __vout_SynchroInit(VLC_OBJECT(a),b)
-VLC_EXPORT( vout_synchro_t *, __vout_SynchroInit, ( vlc_object_t *, int ) );
-VLC_EXPORT( void, vout_SynchroRelease,        ( vout_synchro_t * ) );
-VLC_EXPORT( void, vout_SynchroReset,          ( vout_synchro_t * ) );
-VLC_EXPORT( vlc_bool_t, vout_SynchroChoose,   ( vout_synchro_t *, int, int, vlc_bool_t ) );
-VLC_EXPORT( void, vout_SynchroTrash,          ( vout_synchro_t * ) );
-VLC_EXPORT( void, vout_SynchroDecode,         ( vout_synchro_t * ) );
-VLC_EXPORT( void, vout_SynchroEnd,            ( vout_synchro_t *, int, vlc_bool_t ) );
-VLC_EXPORT( mtime_t, vout_SynchroDate,        ( vout_synchro_t * ) );
-VLC_EXPORT( void, vout_SynchroNewPicture,     ( vout_synchro_t *, int, int, mtime_t, mtime_t, int, vlc_bool_t ) );
+VLC_EXPORT( decoder_synchro_t *, decoder_SynchroInit, ( decoder_t *, int ) );
+VLC_EXPORT( void, decoder_SynchroRelease,        ( decoder_synchro_t * ) );
+VLC_EXPORT( void, decoder_SynchroReset,          ( decoder_synchro_t * ) );
+VLC_EXPORT( vlc_bool_t, decoder_SynchroChoose,   ( decoder_synchro_t *, int, int, vlc_bool_t ) );
+VLC_EXPORT( void, decoder_SynchroTrash,          ( decoder_synchro_t * ) );
+VLC_EXPORT( void, decoder_SynchroDecode,         ( decoder_synchro_t * ) );
+VLC_EXPORT( void, decoder_SynchroEnd,            ( decoder_synchro_t *, int, vlc_bool_t ) );
+VLC_EXPORT( mtime_t, decoder_SynchroDate,        ( decoder_synchro_t * ) );
+VLC_EXPORT( void, decoder_SynchroNewPicture,     ( decoder_synchro_t *, int, int, mtime_t, mtime_t, int, vlc_bool_t ) );
 
index d335571f8285330be2d1e0610422496c0c96efdc..607d7ca552cf0f192ec91a7ff74a5f4a74818fb5 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <mpeg2dec/mpeg2.h>
 
-#include <vlc_vout_synchro.h>
+#include <vlc_codec_synchro.h>
 
 /* Aspect ratio (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
 #define AR_SQUARE_PICTURE       1                           /* square pixels */
@@ -71,7 +71,7 @@ struct decoder_sys_t
     /*
      * Output properties
      */
-    vout_synchro_t *p_synchro;
+    decoder_synchro_t *p_synchro;
     int            i_aspect;
     int            i_sar_num;
     int            i_sar_den;
@@ -228,7 +228,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 p_sys->p_info->sequence &&
                 p_sys->p_info->sequence->width != (unsigned)-1 )
             {
-                vout_SynchroReset( p_sys->p_synchro );
+                decoder_SynchroReset( p_sys->p_synchro );
                 if( p_sys->p_info->current_fbuf != NULL
                     && p_sys->p_info->current_fbuf->id != NULL )
                 {
@@ -248,11 +248,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
                 if ( p_sys->b_slice_i )
                 {
-                    vout_SynchroNewPicture( p_sys->p_synchro,
+                    decoder_SynchroNewPicture( p_sys->p_synchro,
                         I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate,
                         p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY );
-                    vout_SynchroDecode( p_sys->p_synchro );
-                    vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
+                    decoder_SynchroDecode( p_sys->p_synchro );
+                    decoder_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
                 }
             }
 
@@ -264,7 +264,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             {
                 p_sys->b_preroll = VLC_FALSE;
                 /* Reset synchro */
-                vout_SynchroReset( p_sys->p_synchro );
+                decoder_SynchroReset( p_sys->p_synchro );
             }
 
 #ifdef PIC_FLAG_PTS
@@ -333,9 +333,9 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
             if( p_sys->p_synchro )
             {
-                vout_SynchroRelease( p_sys->p_synchro );
+                decoder_SynchroRelease( p_sys->p_synchro );
             }
-            p_sys->p_synchro = vout_SynchroInit( p_dec,
+            p_sys->p_synchro = decoder_SynchroInit( p_dec,
                 (uint32_t)((uint64_t)1001000000 * 27 /
                 p_sys->p_info->sequence->frame_period) );
             p_sys->b_after_sequence_header = 1;
@@ -358,11 +358,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             {
                 /* Intra-slice refresh. Simulate a blank I picture. */
                 msg_Dbg( p_dec, "intra-slice refresh stream" );
-                vout_SynchroNewPicture( p_sys->p_synchro,
+                decoder_SynchroNewPicture( p_sys->p_synchro,
                     I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate,
                     p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY );
-                vout_SynchroDecode( p_sys->p_synchro );
-                vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
+                decoder_SynchroDecode( p_sys->p_synchro );
+                decoder_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
                 p_sys->b_slice_i = 1;
             }
             p_sys->b_after_sequence_header = 0;
@@ -401,11 +401,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
             /* If nb_fields == 1, it is a field picture, and it will be
              * followed by another field picture for which we won't call
-             * vout_SynchroNewPicture() because this would have other
+             * decoder_SynchroNewPicture() because this would have other
              * problems, so we take it into account here.
              * This kind of sucks, but I didn't think better. --Meuuh
              */
-            vout_SynchroNewPicture( p_sys->p_synchro,
+            decoder_SynchroNewPicture( p_sys->p_synchro,
                 p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE,
                 p_sys->p_info->current_picture->nb_fields == 1 ? 2 :
                 p_sys->p_info->current_picture->nb_fields, i_pts, i_dts,
@@ -416,7 +416,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 !(p_sys->b_slice_i
                    && ((p_sys->p_info->current_picture->flags
                          & PIC_MASK_CODING_TYPE) == P_CODING_TYPE))
-                   && !vout_SynchroChoose( p_sys->p_synchro,
+                   && !decoder_SynchroChoose( p_sys->p_synchro,
                               p_sys->p_info->current_picture->flags
                                 & PIC_MASK_CODING_TYPE,
                               /*p_sys->p_vout->render_time*/ 0 /*FIXME*/,
@@ -424,14 +424,14 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             {
                 mpeg2_skip( p_sys->p_mpeg2dec, 1 );
                 p_sys->b_skip = 1;
-                vout_SynchroTrash( p_sys->p_synchro );
+                decoder_SynchroTrash( p_sys->p_synchro );
                 mpeg2_set_buf( p_sys->p_mpeg2dec, buf, NULL );
             }
             else
             {
                 mpeg2_skip( p_sys->p_mpeg2dec, 0 );
                 p_sys->b_skip = 0;
-                vout_SynchroDecode( p_sys->p_synchro );
+                decoder_SynchroDecode( p_sys->p_synchro );
 
                 if( (p_pic = GetNewPicture( p_dec, buf )) == NULL )
                 {
@@ -453,7 +453,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             {
                 p_pic = (picture_t *)p_sys->p_info->display_fbuf->id;
 
-                vout_SynchroEnd( p_sys->p_synchro,
+                decoder_SynchroEnd( p_sys->p_synchro,
                             p_sys->p_info->display_picture->flags
                              & PIC_MASK_CODING_TYPE,
                             p_sys->b_garbage_pic );
@@ -461,7 +461,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
                 if ( p_sys->p_picture_to_destroy != p_pic )
                 {
-                    p_pic->date = vout_SynchroDate( p_sys->p_synchro );
+                    p_pic->date = decoder_SynchroDate( p_sys->p_synchro );
                 }
                 else
                 {
@@ -502,7 +502,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                ( ( p_sys->p_info->current_picture->flags &
                    PIC_MASK_CODING_TYPE) != B_CODING_TYPE ) )
             {
-                if( p_sys->p_synchro ) vout_SynchroReset( p_sys->p_synchro );
+                if( p_sys->p_synchro ) decoder_SynchroReset( p_sys->p_synchro );
             }
             mpeg2_skip( p_sys->p_mpeg2dec, 1 );
             p_sys->b_skip = 1;
@@ -538,11 +538,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
             if( p_sys->b_slice_i )
             {
-                vout_SynchroNewPicture( p_sys->p_synchro,
+                decoder_SynchroNewPicture( p_sys->p_synchro,
                         I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate,
                         p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY );
-                vout_SynchroDecode( p_sys->p_synchro );
-                vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
+                decoder_SynchroDecode( p_sys->p_synchro );
+                decoder_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
             }
             break;
         }
@@ -564,7 +564,7 @@ static void CloseDecoder( vlc_object_t *p_this )
     decoder_t *p_dec = (decoder_t *)p_this;
     decoder_sys_t *p_sys = p_dec->p_sys;
 
-    if( p_sys->p_synchro ) vout_SynchroRelease( p_sys->p_synchro );
+    if( p_sys->p_synchro ) decoder_SynchroRelease( p_sys->p_synchro );
 
     if( p_sys->p_mpeg2dec ) mpeg2_close( p_sys->p_mpeg2dec );
 
index da60436e1414a3ab7008d79100a7bf3a75bb4f4a..cd4b1bbff68913a7e0a8eeb89824ef0d020f6284 100644 (file)
@@ -28,7 +28,7 @@
 #include <vlc/vlc.h>
 #include <vlc_vout.h>
 #include <vlc_codec.h>
-#include <vlc_vout_synchro.h>
+#include <vlc_codec_synchro.h>
 
 #include <unistd.h>
 #include <mcheck.h>
@@ -74,7 +74,7 @@ struct decoder_sys_t
     /*
      * Output properties
      */
-    vout_synchro_t *p_synchro;
+    decoder_synchro_t *p_synchro;
     int            i_aspect;
     mtime_t        i_last_frame_pts;
 
@@ -251,7 +251,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                     p_sys->p_info->sequence &&
                     p_sys->p_info->sequence->width != (unsigned int)-1 )
                 {
-                    vout_SynchroReset( p_sys->p_synchro );
+                    decoder_SynchroReset( p_sys->p_synchro );
                     if( p_sys->p_info->current_fbuf != NULL
                         && p_sys->p_info->current_fbuf->id != NULL )
                     {
@@ -270,11 +270,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
                     if ( p_sys->b_slice_i )
                     {
-                        vout_SynchroNewPicture( p_sys->p_synchro,
+                        decoder_SynchroNewPicture( p_sys->p_synchro,
                             I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate,
                             p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY );
-                        vout_SynchroDecode( p_sys->p_synchro );
-                        vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
+                        decoder_SynchroDecode( p_sys->p_synchro );
+                        decoder_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
                     }
                 }
 
@@ -377,9 +377,9 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
                 if( p_sys->p_synchro )
                 {
-                    vout_SynchroRelease( p_sys->p_synchro );
+                    decoder_SynchroRelease( p_sys->p_synchro );
                 }
-                p_sys->p_synchro = vout_SynchroInit( p_dec,
+                p_sys->p_synchro = decoder_SynchroInit( p_dec,
                     (uint32_t)((uint64_t)1001000000 * 27 /
                     p_sys->p_info->sequence->frame_period) );
                 p_sys->b_after_sequence_header = 1;
@@ -387,7 +387,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             break;
 
             case STATE_PICTURE_2ND:
-                vout_SynchroNewPicture( p_sys->p_synchro,
+                decoder_SynchroNewPicture( p_sys->p_synchro,
                         p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE,
                         p_sys->p_info->current_picture->nb_fields,
                         0, 0, p_sys->i_current_rate,
@@ -395,11 +395,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
                 if( p_sys->b_skip )
                 {
-                    vout_SynchroTrash( p_sys->p_synchro );
+                    decoder_SynchroTrash( p_sys->p_synchro );
                 }
                 else
                 {
-                    vout_SynchroDecode( p_sys->p_synchro );
+                    decoder_SynchroDecode( p_sys->p_synchro );
                 }
                 break;
 
@@ -415,11 +415,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 {
                     /* Intra-slice refresh. Simulate a blank I picture. */
                     msg_Dbg( p_dec, "intra-slice refresh stream" );
-                    vout_SynchroNewPicture( p_sys->p_synchro,
+                    decoder_SynchroNewPicture( p_sys->p_synchro,
                         I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate,
                         p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY );
-                    vout_SynchroDecode( p_sys->p_synchro );
-                    vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
+                    decoder_SynchroDecode( p_sys->p_synchro );
+                    decoder_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
                     p_sys->b_slice_i = 1;
                 }
                 p_sys->b_after_sequence_header = 0;
@@ -448,7 +448,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 p_block->i_pts = p_block->i_dts = 0;
                 /* End hack */
 
-                vout_SynchroNewPicture( p_sys->p_synchro,
+                decoder_SynchroNewPicture( p_sys->p_synchro,
                     p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE,
                     p_sys->p_info->current_picture->nb_fields, i_pts,
                     0, p_sys->i_current_rate,
@@ -457,7 +457,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 if ( !(p_sys->b_slice_i
                     && ((p_sys->p_info->current_picture->flags
                             & PIC_MASK_CODING_TYPE) == P_CODING_TYPE))
-                    && !vout_SynchroChoose( p_sys->p_synchro,
+                    && !decoder_SynchroChoose( p_sys->p_synchro,
                                 p_sys->p_info->current_picture->flags
                                     & PIC_MASK_CODING_TYPE,
                                 /*FindVout(p_dec)->render_time*/ 0 /*FIXME*/,
@@ -465,14 +465,14 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 {
                     mpeg2_skip( p_sys->p_mpeg2dec, 1 );
                     p_sys->b_skip = 1;
-                    vout_SynchroTrash( p_sys->p_synchro );
+                    decoder_SynchroTrash( p_sys->p_synchro );
                     mpeg2_set_buf( p_sys->p_mpeg2dec, buf, NULL );
                 }
                 else
                 {
                     mpeg2_skip( p_sys->p_mpeg2dec, 0 );
                     p_sys->b_skip = 0;
-                    vout_SynchroDecode( p_sys->p_synchro );
+                    decoder_SynchroDecode( p_sys->p_synchro );
 
                     if( (p_pic = GetNewPicture( p_dec, buf )) == NULL )
                     {
@@ -506,7 +506,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 {
                     p_pic = (picture_t *)p_sys->p_info->display_fbuf->id;
 
-                    vout_SynchroEnd( p_sys->p_synchro,
+                    decoder_SynchroEnd( p_sys->p_synchro,
                                 p_sys->p_info->display_picture->flags
                                 & PIC_MASK_CODING_TYPE,
                                 p_sys->b_garbage_pic );
@@ -514,7 +514,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
                     if ( p_sys->p_picture_to_destroy != p_pic )
                     {
-                        p_pic->date = vout_SynchroDate( p_sys->p_synchro );
+                        p_pic->date = decoder_SynchroDate( p_sys->p_synchro );
                     }
                     else
                     {
@@ -553,7 +553,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 ( ( p_sys->p_info->current_picture->flags &
                     PIC_MASK_CODING_TYPE) != B_CODING_TYPE ) )
                 {
-                    if( p_sys->p_synchro ) vout_SynchroReset( p_sys->p_synchro );
+                    if( p_sys->p_synchro ) decoder_SynchroReset( p_sys->p_synchro );
                 }
                 mpeg2_skip( p_sys->p_mpeg2dec, 1 );
                 p_sys->b_skip = 1;
@@ -588,11 +588,11 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
                 if( p_sys->b_slice_i )
                 {
-                    vout_SynchroNewPicture( p_sys->p_synchro,
+                    decoder_SynchroNewPicture( p_sys->p_synchro,
                         I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate,
                         p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY );
-                    vout_SynchroDecode( p_sys->p_synchro );
-                    vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
+                    decoder_SynchroDecode( p_sys->p_synchro );
+                    decoder_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
                 }
                 break;
             }
@@ -613,7 +613,7 @@ static void CloseDecoder( vlc_object_t *p_this )
     decoder_sys_t *p_sys = p_dec->p_sys;
     FILE *f_wd_dec;
 
-    if( p_sys->p_synchro ) vout_SynchroRelease( p_sys->p_synchro );
+    if( p_sys->p_synchro ) decoder_SynchroRelease( p_sys->p_synchro );
     if( p_sys->p_mpeg2dec ) mpeg2_close( p_sys->p_mpeg2dec );
 
     f_wd_dec = fopen("/vlc/dec_pid", "w");
index 4755adf4d7d878fd681c6ac95ea6555028444e76..e6b6b420db71a403253f59d6011a1f5637dcd71e 100644 (file)
@@ -39,6 +39,7 @@ HEADERS_include = \
        ../include/vlc_block_helper.h \
        ../include/vlc_charset.h \
        ../include/vlc_codec.h \
+       ../include/vlc_codec_synchro.h \
        ../include/vlc_codecs.h \
        ../include/vlc_common.h \
        ../include/vlc_config.h \
@@ -82,7 +83,6 @@ HEADERS_include = \
        ../include/vlc_vlm.h \
        ../include/vlc_vod.h \
        ../include/vlc_vout.h \
-       ../include/vlc_vout_synchro.h \
        ../include/vlc_xml.h \
        $(NULL)
 
@@ -223,6 +223,7 @@ SOURCES_libvlc_common = \
        input/clock.c \
        input/control.c \
        input/decoder.c \
+       input/decoder_synchro.c \
        input/demux.c \
        input/es_out.c \
        input/input.c \
@@ -239,7 +240,6 @@ SOURCES_libvlc_common = \
        video_output/video_text.c \
        video_output/video_widgets.c \
        video_output/vout_subpictures.c \
-       video_output/vout_synchro.c \
        video_output/vout_intf.c \
        audio_output/aout_internal.h \
        audio_output/common.c \
similarity index 91%
rename from src/video_output/vout_synchro.c
rename to src/input/decoder_synchro.c
index 024e323e18eadacb390561532ebcc3b441fdce7b..89ef646a2c3d2de8fd56e056623a9b6dc9a6b72c 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * vout_synchro.c : frame dropping routines
+ * decoder_synchro.c : frame dropping routines
  *****************************************************************************
  * Copyright (C) 1999-2005 the VideoLAN team
  * $Id$
@@ -95,9 +95,8 @@
  * Preamble
  *****************************************************************************/
 #include <vlc/vlc.h>
-#include <vlc_vout.h>
 #include <vlc_input.h>
-#include <vlc_vout_synchro.h>
+#include <vlc_codec_synchro.h>
 
 /*
  * Local prototypes
 
 #define MAX_PIC_AVERAGE         8
 
-struct vout_synchro_t
+struct decoder_synchro_t
 {
     VLC_COMMON_MEMBERS
 
@@ -152,22 +151,22 @@ struct vout_synchro_t
 #define DEFAULT_NB_B            1
 
 /*****************************************************************************
- * vout_SynchroInit : You know what ?
+ * decoder_SynchroInit : You know what ?
  *****************************************************************************/
-vout_synchro_t * __vout_SynchroInit( vlc_object_t * p_object,
+decoder_synchro_t * decoder_SynchroInit( decoder_t *p_dec,
                                      int i_frame_rate )
 {
-    vout_synchro_t * p_synchro = vlc_object_create( p_object,
-                                                  sizeof(vout_synchro_t) );
+    decoder_synchro_t * p_synchro = vlc_object_create( p_dec,
+                                                  sizeof(decoder_synchro_t) );
     if ( p_synchro == NULL )
     {
-        msg_Err( p_object, "out of memory" );
+        msg_Err( p_dec, "out of memory" );
         return NULL;
     }
-    vlc_object_attach( p_synchro, p_object );
+    vlc_object_attach( p_synchro, p_dec );
 
-    p_synchro->b_no_skip = !config_GetInt( p_object, "skip-frames" );
-    p_synchro->b_quiet = config_GetInt( p_object, "quiet-synchro" );
+    p_synchro->b_no_skip = !config_GetInt( p_dec, "skip-frames" );
+    p_synchro->b_quiet = config_GetInt( p_dec, "quiet-synchro" );
 
     /* We use a fake stream pattern, which is often right. */
     p_synchro->i_n_p = p_synchro->i_eta_p = DEFAULT_NB_P;
@@ -188,27 +187,27 @@ vout_synchro_t * __vout_SynchroInit( vlc_object_t * p_object,
 }
 
 /*****************************************************************************
- * vout_SynchroRelease : You know what ?
+ * decoder_SynchroRelease : You know what ?
  *****************************************************************************/
-void vout_SynchroRelease( vout_synchro_t * p_synchro )
+void decoder_SynchroRelease( decoder_synchro_t * p_synchro )
 {
     vlc_object_detach( p_synchro );
     vlc_object_destroy( p_synchro );
 }
 
 /*****************************************************************************
- * vout_SynchroReset : Reset the reference picture counter
+ * decoder_SynchroReset : Reset the reference picture counter
  *****************************************************************************/
-void vout_SynchroReset( vout_synchro_t * p_synchro )
+void decoder_SynchroReset( decoder_synchro_t * p_synchro )
 {
     p_synchro->i_nb_ref = 0;
     p_synchro->i_trash_nb_ref = p_synchro->i_dec_nb_ref = 0;
 }
 
 /*****************************************************************************
- * vout_SynchroChoose : Decide whether we will decode a picture or not
+ * decoder_SynchroChoose : Decide whether we will decode a picture or not
  *****************************************************************************/
-vlc_bool_t vout_SynchroChoose( vout_synchro_t * p_synchro, int i_coding_type,
+vlc_bool_t decoder_SynchroChoose( decoder_synchro_t * p_synchro, int i_coding_type,
                                int i_render_time, vlc_bool_t b_low_delay )
 {
 #define TAU_PRIME( coding_type )    (p_synchro->p_tau[(coding_type)] \
@@ -335,27 +334,27 @@ vlc_bool_t vout_SynchroChoose( vout_synchro_t * p_synchro, int i_coding_type,
 }
 
 /*****************************************************************************
- * vout_SynchroTrash : Update counters when we trash a picture
+ * decoder_SynchroTrash : Update counters when we trash a picture
  *****************************************************************************/
-void vout_SynchroTrash( vout_synchro_t * p_synchro )
+void decoder_SynchroTrash( decoder_synchro_t * p_synchro )
 {
     p_synchro->i_trashed_pic++;
     p_synchro->i_nb_ref = p_synchro->i_trash_nb_ref;
 }
 
 /*****************************************************************************
- * vout_SynchroDecode : Update timers when we decide to decode a picture
+ * decoder_SynchroDecode : Update timers when we decide to decode a picture
  *****************************************************************************/
-void vout_SynchroDecode( vout_synchro_t * p_synchro )
+void decoder_SynchroDecode( decoder_synchro_t * p_synchro )
 {
     p_synchro->decoding_start = mdate();
     p_synchro->i_nb_ref = p_synchro->i_dec_nb_ref;
 }
 
 /*****************************************************************************
- * vout_SynchroEnd : Called when the image is totally decoded
+ * decoder_SynchroEnd : Called when the image is totally decoded
  *****************************************************************************/
-void vout_SynchroEnd( vout_synchro_t * p_synchro, int i_coding_type,
+void decoder_SynchroEnd( decoder_synchro_t * p_synchro, int i_coding_type,
                       vlc_bool_t b_garbage )
 {
     mtime_t     tau;
@@ -384,18 +383,18 @@ void vout_SynchroEnd( vout_synchro_t * p_synchro, int i_coding_type,
 }
 
 /*****************************************************************************
- * vout_SynchroDate : When an image has been decoded, ask for its date
+ * decoder_SynchroDate : When an image has been decoded, ask for its date
  *****************************************************************************/
-mtime_t vout_SynchroDate( vout_synchro_t * p_synchro )
+mtime_t decoder_SynchroDate( decoder_synchro_t * p_synchro )
 {
     /* No need to lock, since PTS are only used by the video parser. */
     return p_synchro->current_pts;
 }
 
 /*****************************************************************************
- * vout_SynchroNewPicture: Update stream structure and PTS
+ * decoder_SynchroNewPicture: Update stream structure and PTS
  *****************************************************************************/
-void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type,
+void decoder_SynchroNewPicture( decoder_synchro_t * p_synchro, int i_coding_type,
                              int i_repeat_field, mtime_t next_pts,
                              mtime_t next_dts, int i_current_rate,
                              vlc_bool_t b_low_delay )
@@ -501,7 +500,7 @@ void vout_SynchroNewPicture( vout_synchro_t * p_synchro, int i_coding_type,
                   || p_synchro->current_pts - next_pts
                     > PTS_THRESHOLD) && !p_synchro->b_quiet )
             {
-                msg_Warn( p_synchro, "vout synchro warning: pts != "
+                msg_Warn( p_synchro, "decoder synchro warning: pts != "
                           "current_date ("I64Fd")",
                           p_synchro->current_pts
                               - next_pts );