thiz->param.mfx.FrameInfo.BitDepthChroma = 10;
break;
#endif
+ case GST_VIDEO_FORMAT_BGRA:
+ thiz->param.mfx.FrameInfo.FourCC = MFX_FOURCC_RGB4;
+ thiz->param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV444;
+ thiz->param.mfx.FrameInfo.BitDepthLuma = 8;
+ thiz->param.mfx.FrameInfo.BitDepthChroma = 8;
+ break;
+ case GST_VIDEO_FORMAT_YUY2:
+ thiz->param.mfx.FrameInfo.FourCC = MFX_FOURCC_YUY2;
+ thiz->param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
+ thiz->param.mfx.FrameInfo.BitDepthLuma = 8;
+ thiz->param.mfx.FrameInfo.BitDepthChroma = 8;
+ break;
default:
thiz->param.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;
thiz->param.mfx.FrameInfo.BitDepthLuma = 8;
GST_OBJECT_UNLOCK (thiz);
}
+static gboolean
+gst_msdkmjpegenc_need_conversion (GstMsdkEnc * encoder, GstVideoInfo * info,
+ GstVideoFormat * out_format)
+{
+ switch (GST_VIDEO_INFO_FORMAT (info)) {
+ case GST_VIDEO_FORMAT_NV12:
+ case GST_VIDEO_FORMAT_YUY2:
+ case GST_VIDEO_FORMAT_BGRA:
+ return FALSE;
+
+ default:
+ *out_format = GST_VIDEO_FORMAT_NV12;
+ return TRUE;
+ }
+}
+
static void
gst_msdkmjpegenc_class_init (GstMsdkMJPEGEncClass * klass)
{
encoder_class->set_format = gst_msdkmjpegenc_set_format;
encoder_class->configure = gst_msdkmjpegenc_configure;
encoder_class->set_src_caps = gst_msdkmjpegenc_set_src_caps;
+ encoder_class->need_conversion = gst_msdkmjpegenc_need_conversion;
gobject_class->get_property = gst_msdkmjpegenc_get_property;
gobject_class->set_property = gst_msdkmjpegenc_set_property;