]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/extract.c
Sync PO files
[vlc] / modules / video_filter / extract.c
index e848b5a0ce0639e9b2f26737bec639a318621372..23716f018307be673ef1697208fab86675144001 100644 (file)
@@ -29,7 +29,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_vout.h>
 
@@ -64,8 +64,9 @@ static void get_custom_from_packedyuv422( picture_t *, picture_t *, int * );
 #define COMPONENT_LONGTEXT N_("RGB component to extract. 0 for Red, 1 for Green and 2 for Blue.")
 #define FILTER_PREFIX "extract-"
 
-static int pi_component_values[] = { 0xFF0000, 0x00FF00, 0x0000FF };
-static const char *ppsz_component_descriptions[] = { "Red", "Green", "Blue" };
+static const int pi_component_values[] = { 0xFF0000, 0x00FF00, 0x0000FF };
+static const char *const ppsz_component_descriptions[] = {
+    "Red", "Green", "Blue" };
 
 /*****************************************************************************
  * Module descriptor
@@ -85,7 +86,7 @@ vlc_module_begin();
     set_callbacks( Create, Destroy );
 vlc_module_end();
 
-static const char *ppsz_filter_options[] = {
+static const char *const ppsz_filter_options[] = {
     "component", NULL
 };
 
@@ -126,15 +127,11 @@ static int Create( vlc_object_t *p_this )
     /* Allocate structure */
     p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
     if( p_filter->p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
     p_filter->p_sys->projection_matrix = malloc( 9 * sizeof( int ) );
     if( !p_filter->p_sys->projection_matrix )
     {
         free( p_filter->p_sys );
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
     }
 
@@ -175,12 +172,10 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
 
     if( !p_pic ) return NULL;
 
-    p_outpic = p_filter->pf_vout_buffer_new( p_filter );
+    p_outpic = filter_NewPicture( p_filter );
     if( !p_outpic )
     {
-        msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
@@ -244,21 +239,11 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
         default:
             msg_Warn( p_filter, "Unsupported input chroma (%4s)",
                       (char*)&(p_pic->format.i_chroma) );
-            if( p_pic->pf_release )
-                p_pic->pf_release( p_pic );
+            picture_Release( p_pic );
             return NULL;
     }
 
-    p_outpic->date = p_pic->date;
-    p_outpic->b_force = p_pic->b_force;
-    p_outpic->i_nb_fields = p_pic->i_nb_fields;
-    p_outpic->b_progressive = p_pic->b_progressive;
-    p_outpic->b_top_field_first = p_pic->b_top_field_first;
-
-    if( p_pic->pf_release )
-        p_pic->pf_release( p_pic );
-
-    return p_outpic;
+    return CopyInfoAndRelease( p_outpic, p_pic );
 }
 
 static inline uint8_t crop( int a )