]> git.sesse.net Git - vlc/blobdiff - modules/codec/fake.c
qt4: Hopefully blindely fix the qt4 build, by defining the std p_playlist.
[vlc] / modules / codec / fake.c
index 3aa7a6255204461ccda1267dd0636566f7060926..6c47a525b16ead386c3496f0e11fbaa9a95dfe2a 100644 (file)
@@ -29,7 +29,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_codec.h>
 
 #include <vlc_image.h>
@@ -77,7 +78,7 @@ static int FakeCallback( vlc_object_t *, char const *,
 #define CHROMA_LONGTEXT N_( \
     "Force use of a specific chroma for output. Default is I420." )
 
-static const char *ppsz_deinterlace_type[] =
+static const char *const ppsz_deinterlace_type[] =
 {
     "deinterlace", "ffmpeg-deinterlace"
 };
@@ -85,32 +86,32 @@ static const char *ppsz_deinterlace_type[] =
 vlc_module_begin();
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_VCODEC );
-    set_shortname( _("Fake") );
-    set_description( _("Fake video decoder") );
+    set_shortname( N_("Fake") );
+    set_description( N_("Fake video decoder") );
     set_capability( "decoder", 1000 );
     set_callbacks( OpenDecoder, CloseDecoder );
     add_shortcut( "fake" );
 
     add_file( "fake-file", "", NULL, FILE_TEXT,
-                FILE_LONGTEXT, VLC_FALSE );
+                FILE_LONGTEXT, false );
     add_integer( "fake-file-reload", 0, NULL, RELOAD_TEXT,
-                RELOAD_LONGTEXT, VLC_FALSE );
+                RELOAD_LONGTEXT, false );
     add_integer( "fake-width", 0, NULL, WIDTH_TEXT,
-                 WIDTH_LONGTEXT, VLC_TRUE );
+                 WIDTH_LONGTEXT, true );
     add_integer( "fake-height", 0, NULL, HEIGHT_TEXT,
-                 HEIGHT_LONGTEXT, VLC_TRUE );
+                 HEIGHT_LONGTEXT, true );
     add_bool( "fake-keep-ar", 0, NULL, KEEP_AR_TEXT, KEEP_AR_LONGTEXT,
-              VLC_TRUE );
+              true );
     add_string( "fake-aspect-ratio", "", NULL,
-                ASPECT_RATIO_TEXT, ASPECT_RATIO_LONGTEXT, VLC_TRUE );
+                ASPECT_RATIO_TEXT, ASPECT_RATIO_LONGTEXT, true );
     add_bool( "fake-deinterlace", 0, NULL, DEINTERLACE_TEXT,
-              DEINTERLACE_LONGTEXT, VLC_FALSE );
+              DEINTERLACE_LONGTEXT, false );
     add_string( "fake-deinterlace-module", "deinterlace", NULL,
                 DEINTERLACE_MODULE_TEXT, DEINTERLACE_MODULE_LONGTEXT,
-                VLC_FALSE );
+                false );
         change_string_list( ppsz_deinterlace_type, 0, 0 );
     add_string( "fake-chroma", "I420", NULL, CHROMA_TEXT, CHROMA_LONGTEXT,
-                VLC_TRUE );
+                true );
 vlc_module_end();
 
 struct decoder_sys_t
@@ -118,7 +119,7 @@ struct decoder_sys_t
     picture_t *p_image;
     vlc_mutex_t lock;
 
-    vlc_bool_t  b_reload;
+    bool  b_reload;
     mtime_t     i_reload;
     mtime_t     i_next;
 };
@@ -134,7 +135,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     video_format_t fmt_in, fmt_out;
     picture_t *p_image;
     char *psz_file, *psz_chroma;
-    vlc_bool_t b_keep_ar;
+    bool b_keep_ar;
     int i_aspect = 0;
 
     if( p_dec->fmt_in.i_codec != VLC_FOURCC('f','a','k','e') )
@@ -163,7 +164,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     val.i_int = var_CreateGetIntegerCommand( p_dec, "fake-file-reload" );
     if( val.i_int > 0)
     {
-        p_dec->p_sys->b_reload = VLC_TRUE;
+        p_dec->p_sys->b_reload = true;
         p_dec->p_sys->i_reload = (mtime_t)(val.i_int * 1000000);
         p_dec->p_sys->i_next   = (mtime_t)(p_dec->p_sys->i_reload + mdate());
     }
@@ -225,7 +226,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     }
     msg_Dbg( p_dec, "file %s loaded successfully", psz_file );
 
-    if ( psz_file ) free( psz_file );
+    free( psz_file );
 
     if ( b_keep_ar )
     {
@@ -304,7 +305,7 @@ static int OpenDecoder( vlc_object_t *p_this )
         p_handler = image_HandlerCreate( p_dec );
         p_image = image_Filter( p_handler, p_old, &fmt_out, val.psz_string );
         image_HandlerDelete( p_handler );
-        if ( val.psz_string != NULL ) free( val.psz_string );
+        free( val.psz_string );
 
         if ( p_image == NULL )
         {
@@ -326,7 +327,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     p_dec->pf_decode_video = DecodeBlock;
 
     p_dec->p_sys->p_image = p_image;
-    vlc_mutex_init( p_dec, &p_dec->p_sys->lock );
+    vlc_mutex_init( &p_dec->p_sys->lock );
 
     return VLC_SUCCESS;
 }
@@ -431,13 +432,13 @@ static int FakeCallback( vlc_object_t *p_this, char const *psz_var,
     {
         if( newval.i_int > 0)
         {
-            p_dec->p_sys->b_reload = VLC_TRUE;
+            p_dec->p_sys->b_reload = true;
             p_dec->p_sys->i_reload = (mtime_t)(newval.i_int * 1000000);
             p_dec->p_sys->i_next   = (mtime_t)(p_dec->p_sys->i_reload + mdate());
         }
         else
         {
-            p_dec->p_sys->b_reload = VLC_FALSE;
+            p_dec->p_sys->b_reload = false;
         }
     }