"presence": "always"
},
"src": {
- "caps": "video/x-raw:\n format: { I420, YV12, Y42B, Y444, GBR, I420_10LE, I422_10LE }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n",
+ "caps": "video/x-raw:\n format: { I420, YV12, Y42B, Y444, GBR, I420_10LE, I420_12LE, I422_10LE, I422_12LE, Y444_10LE, Y444_12LE, GBR_10LE, GBR_12LE }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n",
"direction": "src",
"presence": "always"
}
"long-name": "On2 VP9 Encoder",
"pad-templates": {
"sink": {
- "caps": "video/x-raw:\n format: { I420, YV12, Y444, I420_10LE, I422_10LE }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n",
+ "caps": "video/x-raw:\n format: { I420, YV12, Y444, I420_10LE, I420_12LE, I422_10LE, I422_12LE, Y444_10LE, Y444_12LE }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n",
"direction": "sink",
"presence": "always"
},
);
#define GST_VP9_DEC_VIDEO_FORMATS_8BIT "I420, YV12, Y42B, Y444, GBR"
-#define GST_VP9_DEC_VIDEO_FORMATS_10BIT "I420_10LE, I422_10LE"
+#define GST_VP9_DEC_VIDEO_FORMATS_HIGHBIT \
+ "I420_10LE, I420_12LE, I422_10LE, I422_12LE, Y444_10LE, Y444_12LE, GBR_10LE, GBR_12LE"
#define parent_class gst_vp9_dec_parent_class
G_DEFINE_TYPE (GstVP9Dec, gst_vp9_dec, GST_TYPE_VPX_DEC);
gst_vp9_dec_get_src_caps (void)
{
#define CAPS_8BIT GST_VIDEO_CAPS_MAKE ("{ " GST_VP9_DEC_VIDEO_FORMATS_8BIT " }")
-#define CAPS_10BIT GST_VIDEO_CAPS_MAKE ( "{ " GST_VP9_DEC_VIDEO_FORMATS_8BIT ", " \
- GST_VP9_DEC_VIDEO_FORMATS_10BIT "}")
+#define CAPS_HIGHBIT GST_VIDEO_CAPS_MAKE ( "{ " GST_VP9_DEC_VIDEO_FORMATS_8BIT ", " \
+ GST_VP9_DEC_VIDEO_FORMATS_HIGHBIT "}")
return gst_caps_from_string ((vpx_codec_get_caps (&vpx_codec_vp9_dx_algo)
- & VPX_CODEC_CAP_HIGHBITDEPTH) ? CAPS_10BIT : CAPS_8BIT);
+ & VPX_CODEC_CAP_HIGHBITDEPTH) ? CAPS_HIGHBIT : CAPS_8BIT);
}
static void
gst_vp9_dec_get_valid_format (GstVPXDec * dec, vpx_image_t * img,
GstVideoFormat * fmt)
{
- switch (img->fmt) {
+ switch ((gst_vpx_img_fmt_t) img->fmt) {
case GST_VPX_IMG_FMT_I420:
*fmt = GST_VIDEO_FORMAT_I420;
return TRUE;
if (img->bit_depth == 10) {
*fmt = GST_VIDEO_FORMAT_I420_10LE;
return TRUE;
+ } else if (img->bit_depth == 12) {
+ *fmt = GST_VIDEO_FORMAT_I420_12LE;
+ return TRUE;
}
- GST_FIXME_OBJECT (dec, "Please add 16-bit I420 format");
GST_ELEMENT_WARNING (dec, STREAM, NOT_IMPLEMENTED,
- (NULL), ("Unsupported frame format - 16-bit 4:2:0 planar"));
+ (NULL), ("Unsupported frame format - %d-bit 4:2:0 planar",
+ img->bit_depth));
return FALSE;
case GST_VPX_IMG_FMT_I42216:
if (img->bit_depth == 10) {
*fmt = GST_VIDEO_FORMAT_I422_10LE;
return TRUE;
+ } else if (img->bit_depth == 12) {
+ *fmt = GST_VIDEO_FORMAT_I422_12LE;
+ return TRUE;
}
- GST_FIXME_OBJECT (dec, "Please add 16-bit Y42B format");
GST_ELEMENT_WARNING (dec, STREAM, NOT_IMPLEMENTED,
- (NULL), ("Unsupported frame format - 16-bit 4:2:2 planar"));
+ (NULL), ("Unsupported frame format - %d-bit 4:2:2 planar",
+ img->bit_depth));
return FALSE;
case GST_VPX_IMG_FMT_I44416:
- GST_FIXME_OBJECT (dec, "Please add 16-bit Y444 format");
+ if (img->cs == VPX_CS_SRGB) {
+ if (img->bit_depth == 10) {
+ *fmt = GST_VIDEO_FORMAT_GBR_10LE;
+ return TRUE;
+ } else if (img->bit_depth == 12) {
+ *fmt = GST_VIDEO_FORMAT_GBR_12LE;
+ return TRUE;
+ }
+ } else {
+ if (img->bit_depth == 10) {
+ *fmt = GST_VIDEO_FORMAT_Y444_10LE;
+ return TRUE;
+ } else if (img->bit_depth == 12) {
+ *fmt = GST_VIDEO_FORMAT_Y444_12LE;
+ return TRUE;
+ }
+ }
GST_ELEMENT_WARNING (dec, STREAM, NOT_IMPLEMENTED,
- (NULL), ("Unsupported frame format - 16-bit 4:4:4 planar"));
+ (NULL), ("Unsupported frame format - %d-bit 4:4:4 planar",
+ img->bit_depth));
return FALSE;
case GST_VPX_IMG_FMT_I44016:
GST_FIXME_OBJECT (dec, "Please add 16-bit 4:4:0 planar frame format");
};
#define GST_VP9_ENC_VIDEO_FORMATS_8BIT "I420, YV12, Y444"
-#define GST_VP9_ENC_VIDEO_FORMATS_10BIT "I420_10LE, I422_10LE"
+#define GST_VP9_ENC_VIDEO_FORMATS_HIGHBIT \
+ "I420_10LE, I420_12LE, I422_10LE, I422_12LE, Y444_10LE, Y444_12LE"
static GstStaticPadTemplate gst_vp9_enc_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
gst_vp9_enc_get_sink_caps (void)
{
#define CAPS_8BIT GST_VIDEO_CAPS_MAKE ("{ " GST_VP9_ENC_VIDEO_FORMATS_8BIT " }")
-#define CAPS_10BIT GST_VIDEO_CAPS_MAKE ( "{ " GST_VP9_ENC_VIDEO_FORMATS_8BIT ", " \
- GST_VP9_ENC_VIDEO_FORMATS_10BIT "}")
+#define CAPS_HIGHBIT GST_VIDEO_CAPS_MAKE ( "{ " GST_VP9_ENC_VIDEO_FORMATS_8BIT ", " \
+ GST_VP9_ENC_VIDEO_FORMATS_HIGHBIT "}")
return gst_caps_from_string ((vpx_codec_get_caps (gst_vp9_enc_get_algo (NULL))
- & VPX_CODEC_CAP_HIGHBITDEPTH) ? CAPS_10BIT : CAPS_8BIT);
+ & VPX_CODEC_CAP_HIGHBITDEPTH) ? CAPS_HIGHBIT : CAPS_8BIT);
}
static void
{
switch (enc->input_state->info.finfo->format) {
case GST_VIDEO_FORMAT_I420:
- image->fmt = GST_VPX_IMG_FMT_I420;
+ image->fmt = (vpx_img_fmt_t) GST_VPX_IMG_FMT_I420;
image->bps = 12;
+ image->bit_depth = 8;
image->x_chroma_shift = image->y_chroma_shift = 1;
break;
case GST_VIDEO_FORMAT_YV12:
- image->fmt = GST_VPX_IMG_FMT_YV12;
+ image->fmt = (vpx_img_fmt_t) GST_VPX_IMG_FMT_YV12;
image->bps = 12;
+ image->bit_depth = 8;
image->x_chroma_shift = image->y_chroma_shift = 1;
break;
case GST_VIDEO_FORMAT_Y42B:
- image->fmt = GST_VPX_IMG_FMT_I422;
+ image->fmt = (vpx_img_fmt_t) GST_VPX_IMG_FMT_I422;
image->bps = 16;
+ image->bit_depth = 8;
image->x_chroma_shift = 1;
image->y_chroma_shift = 0;
break;
case GST_VIDEO_FORMAT_Y444:
- image->fmt = GST_VPX_IMG_FMT_I444;
+ image->fmt = (vpx_img_fmt_t) GST_VPX_IMG_FMT_I444;
image->bps = 24;
+ image->bit_depth = 8;
image->x_chroma_shift = image->y_chroma_shift = 0;
break;
case GST_VIDEO_FORMAT_I420_10LE:
- image->fmt = GST_VPX_IMG_FMT_I42016;
+ image->fmt = (vpx_img_fmt_t) GST_VPX_IMG_FMT_I42016;
image->bps = 15;
+ image->bit_depth = 10;
+ image->x_chroma_shift = image->y_chroma_shift = 1;
+ break;
+ case GST_VIDEO_FORMAT_I420_12LE:
+ image->fmt = (vpx_img_fmt_t) GST_VPX_IMG_FMT_I42016;
+ image->bps = 18;
+ image->bit_depth = 12;
image->x_chroma_shift = image->y_chroma_shift = 1;
break;
case GST_VIDEO_FORMAT_I422_10LE:
- image->fmt = GST_VPX_IMG_FMT_I42216;
+ image->fmt = (vpx_img_fmt_t) GST_VPX_IMG_FMT_I42216;
image->bps = 20;
+ image->bit_depth = 10;
+ image->x_chroma_shift = 1;
+ image->y_chroma_shift = 0;
+ break;
+ case GST_VIDEO_FORMAT_I422_12LE:
+ image->fmt = (vpx_img_fmt_t) GST_VPX_IMG_FMT_I42216;
+ image->bps = 24;
+ image->bit_depth = 12;
image->x_chroma_shift = 1;
image->y_chroma_shift = 0;
break;
+ case GST_VIDEO_FORMAT_Y444_10LE:
+ image->fmt = (vpx_img_fmt_t) GST_VPX_IMG_FMT_I44416;
+ image->bps = 30;
+ image->bit_depth = 10;
+ image->x_chroma_shift = image->y_chroma_shift = 0;
+ break;
+ case GST_VIDEO_FORMAT_Y444_12LE:
+ image->fmt = (vpx_img_fmt_t) GST_VPX_IMG_FMT_I44416;
+ image->bps = 36;
+ image->bit_depth = 12;
+ image->x_chroma_shift = image->y_chroma_shift = 0;
+ break;
default:
g_assert_not_reached ();
break;
min_profile = 1;
break;
case GST_VIDEO_FORMAT_I420_10LE:
+ case GST_VIDEO_FORMAT_I420_12LE:
min_profile = 2;
break;
case GST_VIDEO_FORMAT_I422_10LE:
+ case GST_VIDEO_FORMAT_I422_12LE:
+ case GST_VIDEO_FORMAT_Y444_10LE:
+ case GST_VIDEO_FORMAT_Y444_12LE:
min_profile = 3;
break;
default: