remove spurious gst_video_info_init()
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Fri, 20 May 2016 17:33:39 +0000 (19:33 +0200)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Fri, 20 May 2016 17:33:39 +0000 (19:33 +0200)
gst_video_info_set_format() and gst_video_info_from_caps() call, internally,
gst_video_info_init(), hence it is not required to call it before them. This
patch removes these spurious calls.

gst-libs/gst/vaapi/gstvaapisurface_drm.c
gst/vaapi/gstvaapipluginbase.c
gst/vaapi/gstvaapipostproc.c
tests/simple-encoder.c

index 426019a..371f05d 100644 (file)
@@ -114,7 +114,6 @@ fill_video_info (GstVideoInfo * vip, GstVideoFormat format, guint width,
 {
   guint i;
 
-  gst_video_info_init (vip);
   gst_video_info_set_format (vip, format, width, height);
   for (i = 0; i < GST_VIDEO_INFO_N_PLANES (vip); i++) {
     GST_VIDEO_INFO_PLANE_OFFSET (vip, i) = offset[i];
index 45e9a3d..8ef550c 100644 (file)
@@ -500,7 +500,6 @@ ensure_sinkpad_buffer_pool (GstVaapiPluginBase * plugin, GstCaps * caps)
   if (!pool)
     goto error_create_pool;
 
-  gst_video_info_init (&vi);
   gst_video_info_from_caps (&vi, caps);
   if (GST_VIDEO_INFO_FORMAT (&vi) == GST_VIDEO_FORMAT_ENCODED) {
     GST_DEBUG ("assume video buffer pool format is NV12");
@@ -694,7 +693,6 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
   if (!gst_vaapi_plugin_base_ensure_display (plugin))
     goto error_ensure_display;
 
-  gst_video_info_init (&vi);
   gst_video_info_from_caps (&vi, caps);
   if (GST_VIDEO_INFO_FORMAT (&vi) == GST_VIDEO_FORMAT_ENCODED)
     gst_video_info_set_format (&vi, GST_VIDEO_FORMAT_NV12,
index a29b2a6..85270c6 100644 (file)
@@ -1140,7 +1140,6 @@ ensure_srcpad_buffer_pool (GstVaapiPostproc * postproc, GstCaps * caps)
   GstVideoInfo vi;
   GstVaapiVideoPool *pool;
 
-  gst_video_info_init (&vi);
   gst_video_info_from_caps (&vi, caps);
   gst_video_info_change_format (&vi, postproc->format,
       GST_VIDEO_INFO_WIDTH (&vi), GST_VIDEO_INFO_HEIGHT (&vi));
index b827604..58b0e8c 100644 (file)
@@ -157,7 +157,6 @@ new_codec_state (gint width, gint height, gint fps_n, gint fps_d)
 
   state = g_slice_new0 (GstVideoCodecState);
   state->ref_count = 1;
-  gst_video_info_init (&state->info);
   gst_video_info_set_format (&state->info, GST_VIDEO_FORMAT_ENCODED, width,
       height);