mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 02:15:31 +00:00
Avoid use of GstStaticCaps since older gstreamer versions (0.10.22) write to it.
This commit is contained in:
parent
a0255faa07
commit
8e72746f35
1 changed files with 3 additions and 8 deletions
|
@ -35,14 +35,14 @@ enum _GstVaapiImageFormatType {
|
||||||
struct _GstVaapiImageFormatMap {
|
struct _GstVaapiImageFormatMap {
|
||||||
GstVaapiImageFormatType type;
|
GstVaapiImageFormatType type;
|
||||||
GstVaapiImageFormat format;
|
GstVaapiImageFormat format;
|
||||||
GstStaticCaps caps;
|
const char *caps_str;
|
||||||
VAImageFormat va_format;
|
VAImageFormat va_format;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DEF(TYPE, FORMAT, CAPS_STR) \
|
#define DEF(TYPE, FORMAT, CAPS_STR) \
|
||||||
GST_VAAPI_IMAGE_FORMAT_TYPE_##TYPE, \
|
GST_VAAPI_IMAGE_FORMAT_TYPE_##TYPE, \
|
||||||
GST_VAAPI_IMAGE_##FORMAT, \
|
GST_VAAPI_IMAGE_##FORMAT, \
|
||||||
GST_STATIC_CAPS(CAPS_STR)
|
CAPS_STR
|
||||||
#define DEF_YUV(FORMAT, FOURCC, ENDIAN, BPP) \
|
#define DEF_YUV(FORMAT, FOURCC, ENDIAN, BPP) \
|
||||||
{ DEF(YCBCR, FORMAT, GST_VIDEO_CAPS_YUV(#FORMAT)), \
|
{ DEF(YCBCR, FORMAT, GST_VIDEO_CAPS_YUV(#FORMAT)), \
|
||||||
{ VA_FOURCC FOURCC, VA_##ENDIAN##_FIRST, BPP, }, }
|
{ VA_FOURCC FOURCC, VA_##ENDIAN##_FIRST, BPP, }, }
|
||||||
|
@ -157,18 +157,13 @@ gst_vaapi_image_format_get_va_format(GstVaapiImageFormat format)
|
||||||
GstCaps *
|
GstCaps *
|
||||||
gst_vaapi_image_format_get_caps(GstVaapiImageFormat format)
|
gst_vaapi_image_format_get_caps(GstVaapiImageFormat format)
|
||||||
{
|
{
|
||||||
GstCaps *caps;
|
|
||||||
const GstVaapiImageFormatMap *m;
|
const GstVaapiImageFormatMap *m;
|
||||||
|
|
||||||
m = get_map_from_gst_vaapi_image_format(format);
|
m = get_map_from_gst_vaapi_image_format(format);
|
||||||
if (!m)
|
if (!m)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
caps = gst_static_caps_get(&m->caps);
|
return gst_caps_from_string(m->caps_str);
|
||||||
if (!caps)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return gst_caps_make_writable(caps);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
guint
|
guint
|
||||||
|
|
Loading…
Reference in a new issue