#include <mfxjpeg.h>
#include "gstmsdkmjpegdec.h"
+#include "gstmsdkvideomemory.h"
#include <gst/pbutils/pbutils.h>
"width = (int) [ 1, MAX ], height = (int) [ 1, MAX ], parsed = true ")
);
+static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("video/x-raw, "
+ "format = (string) { NV12, YUY2 }, "
+ "framerate = (fraction) [0, MAX], "
+ "width = (int) [ 1, MAX ], height = (int) [ 1, MAX ],"
+ "interlace-mode = (string) progressive;"
+ GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_DMABUF,
+ "{ NV12, YUY2 }") ";")
+ );
+
#define gst_msdkmjpegdec_parent_class parent_class
G_DEFINE_TYPE (GstMsdkMJPEGDec, gst_msdkmjpegdec, GST_TYPE_MSDKDEC);
the InterleaveDec to MFX_SCANTYPE_NONINTERLEAVED, msdk seems to be taking care
of Interleaved samples, so let's hardcode it for now */
decoder->param.mfx.InterleavedDec = MFX_SCANTYPE_NONINTERLEAVED;
+
+ return TRUE;
+}
+
+static gboolean
+gst_msdkmjpegdec_post_configure (GstMsdkDec * decoder)
+{
+ /* Set the output color format based on the input color format */
+ switch (decoder->param.mfx.JPEGChromaFormat) {
+ case MFX_CHROMAFORMAT_YUV422:
+ decoder->param.mfx.FrameInfo.FourCC = MFX_FOURCC_YUY2;
+ decoder->param.mfx.FrameInfo.ChromaFormat =
+ decoder->param.mfx.JPEGChromaFormat;
+ break;
+ default:
+ break;
+ }
+
return TRUE;
}
decoder_class = GST_MSDKDEC_CLASS (klass);
decoder_class->configure = GST_DEBUG_FUNCPTR (gst_msdkmjpegdec_configure);
+ decoder_class->post_configure =
+ GST_DEBUG_FUNCPTR (gst_msdkmjpegdec_post_configure);
gst_element_class_set_static_metadata (element_class,
"Intel MSDK MJPEG decoder",
"Scott D Phillips <scott.d.phillips@intel.com>");
gst_element_class_add_static_pad_template (element_class, &sink_factory);
+ gst_element_class_add_static_pad_template (element_class, &src_factory);
}
static void