mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
Add P010 video format support
The P010 video format is the native format used by the vaapi intel driver for HEVCMain10 decode . Add support for planes and images of this video format. https://bugzilla.gnome.org/show_bug.cgi?id=759181
This commit is contained in:
parent
b64eaaad4d
commit
eea3f0cdb2
5 changed files with 12 additions and 4 deletions
|
@ -94,6 +94,9 @@ vaapi_image_is_linear (const VAImage * va_image)
|
|||
case VA_FOURCC ('B', 'G', 'R', 'X'):
|
||||
data_size = 4 * width * height;
|
||||
break;
|
||||
case VA_FOURCC ('P', '0', '1', '0'):
|
||||
data_size = 2 * (width * height + 2 * width2 * height2);
|
||||
break;
|
||||
default:
|
||||
g_error ("FIXME: incomplete formats %" GST_FOURCC_FORMAT,
|
||||
GST_FOURCC_ARGS (va_image->format.fourcc));
|
||||
|
|
|
@ -50,7 +50,9 @@ typedef struct
|
|||
{ VA_FOURCC FOURCC, VA_##ENDIAN##_FIRST, BPP, DEPTH, R,G,B,A }, }
|
||||
|
||||
/* Image formats, listed in HW order preference */
|
||||
/* *INDENT-OFF* */
|
||||
static const GstVideoFormatMap gst_vaapi_video_formats[] = {
|
||||
DEF_YUV (P010_10LE, ('P', '0', '1', '0'), LSB, 24, 420_10BPP),
|
||||
DEF_YUV (NV12, ('N', 'V', '1', '2'), LSB, 12, 420),
|
||||
DEF_YUV (YV12, ('Y', 'V', '1', '2'), LSB, 12, 420),
|
||||
DEF_YUV (I420, ('I', '4', '2', '0'), LSB, 12, 420),
|
||||
|
@ -79,6 +81,7 @@ static const GstVideoFormatMap gst_vaapi_video_formats[] = {
|
|||
DEF_YUV (GRAY8, ('Y', '8', '0', '0'), LSB, 8, 400),
|
||||
{0,}
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#undef DEF_RGB
|
||||
#undef DEF_YUV
|
||||
|
@ -298,6 +301,8 @@ gst_vaapi_video_format_get_best_native (GstVideoFormat format)
|
|||
case GST_VAAPI_CHROMA_TYPE_YUV420:
|
||||
case GST_VAAPI_CHROMA_TYPE_RGB32: /* GstVideoGLTextureUploadMeta */
|
||||
return GST_VIDEO_FORMAT_NV12;
|
||||
case GST_VAAPI_CHROMA_TYPE_YUV420_10BPP:
|
||||
return GST_VIDEO_FORMAT_P010_10LE;
|
||||
default:
|
||||
return GST_VIDEO_FORMAT_UNKNOWN;
|
||||
};
|
||||
|
|
|
@ -105,7 +105,7 @@ static const char gst_vaapidecode_sink_caps_str[] =
|
|||
static const char gst_vaapidecode_src_caps_str[] =
|
||||
GST_VAAPI_MAKE_SURFACE_CAPS ";"
|
||||
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS ";"
|
||||
GST_VIDEO_CAPS_MAKE("{ I420, YV12, NV12 }");
|
||||
GST_VIDEO_CAPS_MAKE("{ I420, YV12, NV12, P010_10LE }");
|
||||
|
||||
static GstStaticPadTemplate gst_vaapidecode_src_factory =
|
||||
GST_STATIC_PAD_TEMPLATE(
|
||||
|
|
|
@ -104,11 +104,11 @@ gst_vaapi_caps_feature_contains (const GstCaps * caps,
|
|||
|
||||
#define GST_VAAPI_MAKE_SURFACE_CAPS \
|
||||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \
|
||||
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, I420, YV12, NV12 }")
|
||||
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, I420, YV12, NV12, P010_10LE }")
|
||||
|
||||
#define GST_VAAPI_MAKE_ENC_SURFACE_CAPS \
|
||||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \
|
||||
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, NV12, I420, YV12 }")
|
||||
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, NV12, I420, YV12, P010_10LE }")
|
||||
|
||||
#define GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS \
|
||||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \
|
||||
|
|
|
@ -68,7 +68,7 @@ static const char gst_vaapisink_sink_caps_str[] =
|
|||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES (
|
||||
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE ","
|
||||
GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION,
|
||||
"{ ENCODED, NV12, I420, YV12 }") ";"
|
||||
"{ ENCODED, NV12, I420, YV12, P010_10LE }") ";"
|
||||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES (
|
||||
GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION,
|
||||
GST_VIDEO_FORMATS_ALL) ";"
|
||||
|
|
Loading…
Reference in a new issue