]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
Build: move subtitles codecs to m/codec/ instead of m/codec/subtitles
[vlc] / modules / video_filter / dynamicoverlay / dynamicoverlay_commands.c
index cee57f154e6a959e579c04f154fe9b24f932dbb7..d119ed3290b221758e8dd12ab447eaf3c44c8a4a 100644 (file)
@@ -56,7 +56,7 @@ overlay_t *OverlayCreate( void )
     p_ovl->i_alpha = 0xFF;
     p_ovl->b_active = false;
     video_format_Setup( &p_ovl->format, VLC_FOURCC( '\0','\0','\0','\0') , 0, 0,
-                        VOUT_ASPECT_FACTOR );
+                        1, 1 );
     p_ovl->p_fontstyle = text_style_New();
     p_ovl->data.p_text = NULL;
 
@@ -464,7 +464,7 @@ static int exec_DataSharedMem( filter_t *p_filter,
         }
 
         video_format_Setup( &p_ovl->format, VLC_CODEC_TEXT,
-                            0, 0, 0 );
+                            0, 0, 0, 1 );
 
         p_data = shmat( p_params->i_shmid, NULL, SHM_RDONLY );
         if( p_data == NULL )
@@ -483,22 +483,13 @@ static int exec_DataSharedMem( filter_t *p_filter,
         uint8_t *p_data, *p_in;
         size_t i_neededsize = 0;
 
-        p_ovl->data.p_pic = malloc( sizeof( picture_t ) );
+        p_ovl->data.p_pic = picture_New( p_params->fourcc,
+                                         p_params->i_width, p_params->i_height,
+                                         1, 1 );
         if( p_ovl->data.p_pic == NULL )
             return VLC_ENOMEM;
 
-        video_format_Setup( &p_ovl->format, p_params->fourcc,
-                            p_params->i_width, p_params->i_height,
-                            VOUT_ASPECT_FACTOR );
-        if( vout_AllocatePicture( p_filter, p_ovl->data.p_pic,
-                                  p_ovl->format.i_chroma, p_params->i_width,
-                                  p_params->i_height, p_ovl->format.i_aspect ) )
-        {
-            msg_Err( p_filter, "Unable to allocate picture" );
-            free( p_ovl->data.p_pic );
-            p_ovl->data.p_pic = NULL;
-            return VLC_ENOMEM;
-        }
+        p_ovl->format = p_ovl->data.p_pic->format;
 
         for( size_t i_plane = 0; i_plane < (size_t)p_ovl->data.p_pic->i_planes;
              ++i_plane )
@@ -513,7 +504,6 @@ static int exec_DataSharedMem( filter_t *p_filter,
                      "Insufficient data in shared memory. need %zu, got %zu",
                      i_neededsize, i_size );
             picture_Release( p_ovl->data.p_pic );
-            free( p_ovl->data.p_pic );
             p_ovl->data.p_pic = NULL;
             return VLC_EGENERIC;
         }
@@ -523,7 +513,6 @@ static int exec_DataSharedMem( filter_t *p_filter,
         {
             msg_Err( p_filter, "Unable to attach to shared memory" );
             picture_Release( p_ovl->data.p_pic );
-            free( p_ovl->data.p_pic );
             p_ovl->data.p_pic = NULL;
             return VLC_ENOMEM;
         }
@@ -792,7 +781,7 @@ static int exec_StartAtomic( filter_t *p_filter,
 /*****************************************************************************
  * Command functions
  *****************************************************************************/
-static const commanddesc_t p_commands[] =
+static const commanddesc_static_t p_commands[] =
 {
     {   .psz_command = "DataSharedMem",
         .b_atomic = true,