pluginutil: add gst_caps_is_video_raw()

This commit is contained in:
Víctor Manuel Jáquez Leal 2016-10-21 11:21:04 +02:00
parent e0d73d613e
commit 1605a2646a
2 changed files with 19 additions and 0 deletions

View file

@ -661,6 +661,21 @@ gst_caps_has_vaapi_surface (GstCaps * caps)
return _gst_caps_has_feature (caps, GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE); return _gst_caps_has_feature (caps, GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE);
} }
gboolean
gst_caps_is_video_raw (GstCaps * caps)
{
GstStructure *structure;
g_return_val_if_fail (caps != NULL, FALSE);
if (!gst_caps_is_fixed (caps))
return FALSE;
if (!_gst_caps_has_feature (caps, GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY))
return FALSE;
structure = gst_caps_get_structure (caps, 0);
return gst_structure_has_name (structure, "video/x-raw");
}
void void
gst_video_info_change_format (GstVideoInfo * vip, GstVideoFormat format, gst_video_info_change_format (GstVideoInfo * vip, GstVideoFormat format,
guint width, guint height) guint width, guint height)

View file

@ -118,6 +118,10 @@ G_GNUC_INTERNAL
gboolean gboolean
gst_caps_has_vaapi_surface (GstCaps * caps); gst_caps_has_vaapi_surface (GstCaps * caps);
G_GNUC_INTERNAL
gboolean
gst_caps_is_video_raw (GstCaps * caps);
G_GNUC_INTERNAL G_GNUC_INTERNAL
void void
gst_video_info_change_format (GstVideoInfo * vip, GstVideoFormat format, gst_video_info_change_format (GstVideoInfo * vip, GstVideoFormat format,