diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2014-11-18 14:57:02 +0100 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2014-11-18 18:39:32 +0100 |
commit | a4d88db0fdf208bb5c999cf2cca2742993b17cd8 (patch) | |
tree | d36cf1a8cc7caac1c12c4839b50ef178590bb596 /gst/vaapi/gstvaapipluginutil.c | |
parent | 0ddf6b21b960c43e11e196322ae709ad84ea8124 (diff) |
plugins: preserve framerate when updating src caps video format.
In the current implementation, gst_video_info_set_format() would reset
the whole GstVideoInfo structure first, prior to setting video format
and size. So, coleteral information like framerate or pixel-aspect-
ratio are lost.
Provide and use a unique gst_video_info_change_format() for overcome
this issue, i.e. only have it change the format and video size, and
copy over the rest of the fields.
https://bugzilla.gnome.org/show_bug.cgi?id=734665
Diffstat (limited to 'gst/vaapi/gstvaapipluginutil.c')
-rw-r--r-- | gst/vaapi/gstvaapipluginutil.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c index 40f55886..7b0ced4c 100644 --- a/gst/vaapi/gstvaapipluginutil.c +++ b/gst/vaapi/gstvaapipluginutil.c @@ -681,3 +681,20 @@ gst_caps_has_vaapi_surface (GstCaps * caps) #endif return found_caps; } + +void +gst_video_info_change_format (GstVideoInfo * vip, GstVideoFormat format, + guint width, guint height) +{ + GstVideoInfo vi = *vip; + + gst_video_info_set_format (vip, format, width, height); + + vip->interlace_mode = vi.interlace_mode; + vip->flags = vi.flags; + vip->views = vi.views; + vip->par_n = vi.par_n; + vip->par_d = vi.par_d; + vip->fps_n = vi.fps_n; + vip->fps_d = vi.fps_d; +} |