diff options
author | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2016-05-23 15:38:07 +0200 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2016-06-08 10:19:01 +0200 |
commit | 3d9f8dd41fe53996c8b9ea6dc5ed2aab5e0a3db0 (patch) | |
tree | 29bf2072752ad026b735d3c7283ad61804134447 /gst/vaapi/gstvaapipluginutil.c | |
parent | 2562cd51beb9b105d2809988651b45a173f88072 (diff) |
pluginutil: add gst_video_info_force_nv12_if_encoded()
This lines repeat a couple times in the code, so it would be better to put it
a helper function.
https://bugzilla.gnome.org/show_bug.cgi?id=765435
Diffstat (limited to 'gst/vaapi/gstvaapipluginutil.c')
-rw-r--r-- | gst/vaapi/gstvaapipluginutil.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c index 28761210..a88aeba9 100644 --- a/gst/vaapi/gstvaapipluginutil.c +++ b/gst/vaapi/gstvaapipluginutil.c @@ -693,6 +693,22 @@ gst_video_info_changed (GstVideoInfo * old, GstVideoInfo * new) } /** + * gst_video_info_force_nv12_if_encoded: + * @vinfo: a #GstVideoInfo + * + * If the format of @vinfo is %GST_VIDEO_FORMAT_ENCODED it is changed + * to %GST_VIDEO_FORMAT_NV12. + **/ +void +gst_video_info_force_nv12_if_encoded (GstVideoInfo * vinfo) +{ + if (GST_VIDEO_INFO_FORMAT (vinfo) != GST_VIDEO_FORMAT_ENCODED) + return; + gst_video_info_set_format (vinfo, GST_VIDEO_FORMAT_NV12, + GST_VIDEO_INFO_WIDTH (vinfo), GST_VIDEO_INFO_HEIGHT (vinfo)); +} + +/** * gst_vaapi_create_test_display: * * Creates a temporal #GstVaapiDisplay instance, just for testing the |