"klass": "Codec/Decoder/Video/Hardware",
"pad-templates": {
"sink": {
- "caps": "video/x-h264:\n width: [ 16, 4096 ]\n height: [ 16, 4096 ]\n stream-format: { (string)byte-stream, (string)avc, (string)avc3 }\n alignment: au\n profile: { (string)high, (string)progressive-high, (string)constrained-high, (string)main, (string)constrained-baseline, (string)baseline }\n",
+ "caps": "video/x-h264:\n width: [ 1, 4096 ]\n height: [ 1, 4096 ]\n stream-format: { (string)byte-stream, (string)avc, (string)avc3 }\n alignment: au\n profile: { (string)high, (string)progressive-high, (string)constrained-high, (string)main, (string)constrained-baseline, (string)baseline }\n",
"direction": "sink",
"presence": "always"
},
"src": {
- "caps": "video/x-raw(memory:D3D11Memory):\n format: NV12\n width: [ 16, 4096 ]\n height: [ 16, 4096 ]\nvideo/x-raw:\n format: NV12\n width: [ 16, 4096 ]\n height: [ 16, 4096 ]\n",
+ "caps": "video/x-raw(memory:D3D11Memory):\n format: NV12\n width: [ 1, 4096 ]\n height: [ 1, 4096 ]\nvideo/x-raw:\n format: NV12\n width: [ 1, 4096 ]\n height: [ 1, 4096 ]\n",
"direction": "src",
"presence": "always"
}
"klass": "Codec/Decoder/Video/Hardware",
"pad-templates": {
"sink": {
- "caps": "video/x-h265:\n width: [ 16, 8192 ]\n height: [ 16, 8192 ]\n stream-format: { (string)byte-stream, (string)hev1, (string)hvc1 }\n alignment: au\n profile: { (string)main, (string)main-10 }\n",
+ "caps": "video/x-h265:\n width: [ 1, 16384 ]\n height: [ 1, 16384 ]\n stream-format: { (string)byte-stream, (string)hev1, (string)hvc1 }\n alignment: au\n profile: { (string)main, (string)main-10 }\n",
"direction": "sink",
"presence": "always"
},
"src": {
- "caps": "video/x-raw(memory:D3D11Memory):\n format: NV12\n width: [ 16, 8192 ]\n height: [ 16, 8192 ]\nvideo/x-raw:\n format: NV12\n width: [ 16, 8192 ]\n height: [ 16, 8192 ]\n",
+ "caps": "video/x-raw(memory:D3D11Memory):\n format: NV12\n width: [ 1, 16384 ]\n height: [ 1, 16384 ]\nvideo/x-raw:\n format: NV12\n width: [ 1, 16384 ]\n height: [ 1, 16384 ]\n",
"direction": "src",
"presence": "always"
}
"klass": "Codec/Encoder/Video/Hardware",
"pad-templates": {
"sink": {
- "caps": "video/x-raw(memory:D3D11Memory):\n format: { NV12, BGRA }\n width: [ 16, 8192 ]\n height: [ 16, 8192 ]\n\nvideo/x-raw(memory:VAMemory):\n format: { NV12, BGRA }\n width: [ 16, 8192 ]\n height: [ 16, 8192 ]\nvideo/x-raw:\n format: { NV12, BGRA }\n width: [ 16, 8192 ]\n height: [ 16, 8192 ]\n",
+ "caps": "video/x-raw(memory:D3D11Memory):\n format: { NV12, BGRA }\n width: [ 16, 16384 ]\n height: [ 16, 16384 ]\n\nvideo/x-raw(memory:VAMemory):\n format: { NV12, BGRA }\n width: [ 16, 16384 ]\n height: [ 16, 16384 ]\nvideo/x-raw:\n format: { NV12, BGRA }\n width: [ 16, 16384 ]\n height: [ 16, 16384 ]\n",
"direction": "sink",
"presence": "always"
},
"src": {
- "caps": "image/jpeg:\n width: [ 16, 8192 ]\n height: [ 16, 8192 ]\n",
+ "caps": "image/jpeg:\n width: [ 16, 16384 ]\n height: [ 16, 16384 ]\n",
"direction": "src",
"presence": "always"
}
return ret;
}
-typedef struct
-{
- guint width;
- guint height;
-} Resolution;
-
void
gst_qsv_av1_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
GstObject * device, mfxSession session)
{
mfxVideoParam param;
mfxInfoMFX *mfx;
- static const Resolution resolutions_to_check[] = {
- {1280, 720}, {1920, 1088}, {2560, 1440}, {3840, 2160}, {4096, 2160},
- {7680, 4320}, {8192, 4320}
- };
std::vector < std::string > supported_formats;
- Resolution max_resolution;
+ GstQsvResolution max_resolution;
mfxExtAV1ResolutionParam resolution_param;
mfxExtAV1BitstreamParam bitstream_param;
mfxExtBuffer *ext_bufs[2];
GST_DEBUG_CATEGORY_INIT (gst_qsv_av1_enc_debug, "qsvav1enc", 0, "qsvav1enc");
memset (¶m, 0, sizeof (mfxVideoParam));
- memset (&max_resolution, 0, sizeof (Resolution));
+ memset (&max_resolution, 0, sizeof (GstQsvResolution));
memset (&resolution_param, 0, sizeof (mfxExtAV1ResolutionParam));
memset (&bitstream_param, 0, sizeof (mfxExtAV1BitstreamParam));
mfx->FrameInfo.Shift = 0;
/* Check max-resolution */
- for (guint i = 0; i < G_N_ELEMENTS (resolutions_to_check); i++) {
+ for (guint i = 0; i < G_N_ELEMENTS (gst_qsv_resolutions); i++) {
mfx->FrameInfo.Width = mfx->FrameInfo.CropW =
- GST_ROUND_UP_16 (resolutions_to_check[i].width);
+ GST_ROUND_UP_16 (gst_qsv_resolutions[i].width);
mfx->FrameInfo.Height = mfx->FrameInfo.CropH =
- GST_ROUND_UP_16 (resolutions_to_check[i].height);
+ GST_ROUND_UP_16 (gst_qsv_resolutions[i].height);
- resolution_param.FrameWidth = resolutions_to_check[i].width;
- resolution_param.FrameHeight = resolutions_to_check[i].height;
+ resolution_param.FrameWidth = gst_qsv_resolutions[i].width;
+ resolution_param.FrameHeight = gst_qsv_resolutions[i].height;
bitstream_param.WriteIVFHeaders = MFX_CODINGOPTION_OFF;
if (MFXVideoENCODE_Query (session, ¶m, ¶m) != MFX_ERR_NONE)
break;
- max_resolution.width = resolutions_to_check[i].width;
- max_resolution.height = resolutions_to_check[i].height;
+ max_resolution.width = gst_qsv_resolutions[i].width;
+ max_resolution.height = gst_qsv_resolutions[i].height;
}
GST_INFO ("Maximum supported resolution: %dx%d",
#define GST_CAT_DEFAULT gst_qsv_h264_dec_debug
#define DOC_SINK_CAPS \
- "video/x-h264, width = (int) [ 16, 4096 ], height = (int) [ 16, 4096 ], " \
+ "video/x-h264, width = (int) [ 1, 4096 ], height = (int) [ 1, 4096 ], " \
"stream-format = (string) { byte-stream, avc, avc3 }, " \
"alignment = (string) au, " \
"profile = (string) { high, progressive-high, constrained-high, main, " \
#define DOC_SRC_CAPS_COMM \
"format = (string) NV12, " \
- "width = (int) [ 16, 4096 ], height = (int) [ 16, 4096 ]"
+ "width = (int) [ 1, 4096 ], height = (int) [ 1, 4096 ]"
#define DOC_SRC_CAPS \
"video/x-raw(memory:D3D11Memory), " DOC_SRC_CAPS_COMM "; " \
return new_buf;
}
-typedef struct
-{
- guint width;
- guint height;
-} Resolution;
-
void
gst_qsv_h264_dec_register (GstPlugin * plugin, guint rank, guint impl_index,
GstObject * device, mfxSession session)
{
mfxVideoParam param;
mfxInfoMFX *mfx;
- static const Resolution resolutions_to_check[] = {
- {1280, 720}, {1920, 1088}, {2560, 1440}, {3840, 2160}, {4096, 2160},
- {7680, 4320}, {8192, 4320}
- };
- Resolution max_resolution;
+ GstQsvResolution max_resolution;
GST_DEBUG_CATEGORY_INIT (gst_qsv_h264_dec_debug,
"qsvh264dec", 0, "qsvh264dec");
memset (¶m, 0, sizeof (mfxVideoParam));
- memset (&max_resolution, 0, sizeof (Resolution));
+ memset (&max_resolution, 0, sizeof (GstQsvResolution));
param.AsyncDepth = 4;
param.IOPattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
mfx->CodecProfile = MFX_PROFILE_AVC_MAIN;
/* Check max-resolution */
- for (guint i = 0; i < G_N_ELEMENTS (resolutions_to_check); i++) {
- mfx->FrameInfo.Width = GST_ROUND_UP_16 (resolutions_to_check[i].width);
- mfx->FrameInfo.Height = GST_ROUND_UP_16 (resolutions_to_check[i].height);
- mfx->FrameInfo.CropW = resolutions_to_check[i].width;
- mfx->FrameInfo.CropH = resolutions_to_check[i].height;
+ for (guint i = 0; i < G_N_ELEMENTS (gst_qsv_resolutions); i++) {
+ mfx->FrameInfo.Width = GST_ROUND_UP_16 (gst_qsv_resolutions[i].width);
+ mfx->FrameInfo.Height = GST_ROUND_UP_16 (gst_qsv_resolutions[i].height);
+ mfx->FrameInfo.CropW = gst_qsv_resolutions[i].width;
+ mfx->FrameInfo.CropH = gst_qsv_resolutions[i].height;
if (MFXVideoDECODE_Query (session, ¶m, ¶m) != MFX_ERR_NONE)
break;
- max_resolution.width = resolutions_to_check[i].width;
- max_resolution.height = resolutions_to_check[i].height;
+ max_resolution.width = gst_qsv_resolutions[i].width;
+ max_resolution.height = gst_qsv_resolutions[i].height;
}
if (max_resolution.width == 0 || max_resolution.height == 0)
guint resolution = MAX (max_resolution.width, max_resolution.height);
std::string src_caps_str = "video/x-raw, format=(string) NV12";
- src_caps_str += ", width=(int) [ 16, " + std::to_string (resolution) + " ]";
- src_caps_str += ", height=(int) [ 16, " + std::to_string (resolution) + " ]";
+ src_caps_str += ", width=(int) [ 1, " + std::to_string (resolution) + " ]";
+ src_caps_str += ", height=(int) [ 1, " + std::to_string (resolution) + " ]";
GstCaps *src_caps = gst_caps_from_string (src_caps_str.c_str ());
#endif
std::string sink_caps_str = "video/x-h264";
- sink_caps_str += ", width=(int) [ 16, " + std::to_string (resolution) + " ]";
- sink_caps_str += ", height=(int) [ 16, " + std::to_string (resolution) + " ]";
+ sink_caps_str += ", width=(int) [ 1, " + std::to_string (resolution) + " ]";
+ sink_caps_str += ", height=(int) [ 1, " + std::to_string (resolution) + " ]";
sink_caps_str += ", stream-format=(string) { byte-stream, avc, avc3 }";
sink_caps_str += ", alignment=(string) au";
return ret;
}
-typedef struct
-{
- guint width;
- guint height;
-} Resolution;
-
void
gst_qsv_h264_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
GstObject * device, mfxSession session)
mfxStatus status;
mfxVideoParam param;
mfxInfoMFX *mfx;
- static const Resolution resolutions_to_check[] = {
- {1280, 720}, {1920, 1088}, {2560, 1440}, {3840, 2160}, {4096, 2160},
- {7680, 4320}, {8192, 4320}
- };
std::vector < mfxU16 > supported_profiles;
- Resolution max_resolution;
+ GstQsvResolution max_resolution;
bool supports_interlaced = false;
GST_DEBUG_CATEGORY_INIT (gst_qsv_h264_enc_debug,
"qsvh264enc", 0, "qsvh264enc");
memset (¶m, 0, sizeof (mfxVideoParam));
- memset (&max_resolution, 0, sizeof (Resolution));
+ memset (&max_resolution, 0, sizeof (GstQsvResolution));
param.AsyncDepth = 4;
param.IOPattern = MFX_IOPATTERN_IN_VIDEO_MEMORY;
mfx->CodecProfile = supported_profiles[0];
/* Check max-resolution */
- for (guint i = 0; i < G_N_ELEMENTS (resolutions_to_check); i++) {
- mfx->FrameInfo.Width = GST_ROUND_UP_16 (resolutions_to_check[i].width);
- mfx->FrameInfo.Height = GST_ROUND_UP_16 (resolutions_to_check[i].height);
- mfx->FrameInfo.CropW = resolutions_to_check[i].width;
- mfx->FrameInfo.CropH = resolutions_to_check[i].height;
+ for (guint i = 0; i < G_N_ELEMENTS (gst_qsv_resolutions); i++) {
+ mfx->FrameInfo.Width = GST_ROUND_UP_16 (gst_qsv_resolutions[i].width);
+ mfx->FrameInfo.Height = GST_ROUND_UP_16 (gst_qsv_resolutions[i].height);
+ mfx->FrameInfo.CropW = gst_qsv_resolutions[i].width;
+ mfx->FrameInfo.CropH = gst_qsv_resolutions[i].height;
if (MFXVideoENCODE_Query (session, ¶m, ¶m) != MFX_ERR_NONE)
break;
- max_resolution.width = resolutions_to_check[i].width;
- max_resolution.height = resolutions_to_check[i].height;
+ max_resolution.width = gst_qsv_resolutions[i].width;
+ max_resolution.height = gst_qsv_resolutions[i].height;
}
GST_INFO ("Maximum supported resolution: %dx%d",
#define GST_CAT_DEFAULT gst_qsv_h265_dec_debug
#define DOC_SINK_CAPS \
- "video/x-h265, width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ], " \
+ "video/x-h265, width = (int) [ 1, 16384 ], height = (int) [ 1, 16384 ], " \
"stream-format = (string) { byte-stream, hev1, hvc1 }, " \
"alignment = (string) au, profile = (string) { main, main-10 }"
#define DOC_SRC_CAPS_COMM \
"format = (string) NV12, " \
- "width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ]"
+ "width = (int) [ 1, 16384 ], height = (int) [ 1, 16384 ]"
#define DOC_SRC_CAPS \
"video/x-raw(memory:D3D11Memory), " DOC_SRC_CAPS_COMM "; " \
return new_buf;
}
-typedef struct
-{
- guint width;
- guint height;
-} Resolution;
-
void
gst_qsv_h265_dec_register (GstPlugin * plugin, guint rank, guint impl_index,
GstObject * device, mfxSession session)
{
mfxVideoParam param;
mfxInfoMFX *mfx;
- static const Resolution resolutions_to_check[] = {
- {1280, 720}, {1920, 1088}, {2560, 1440}, {3840, 2160}, {4096, 2160},
- {7680, 4320}, {8192, 4320}
- };
- Resolution max_resolution;
+ GstQsvResolution max_resolution;
std::vector < std::string > supported_profiles;
std::vector < std::string > supported_formats;
"qsvh265dec", 0, "qsvh265dec");
memset (¶m, 0, sizeof (mfxVideoParam));
- memset (&max_resolution, 0, sizeof (Resolution));
+ memset (&max_resolution, 0, sizeof (GstQsvResolution));
param.AsyncDepth = 4;
param.IOPattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
mfx->CodecProfile = MFX_PROFILE_HEVC_MAIN;
/* Check max-resolution */
- for (guint i = 0; i < G_N_ELEMENTS (resolutions_to_check); i++) {
- mfx->FrameInfo.Width = GST_ROUND_UP_16 (resolutions_to_check[i].width);
- mfx->FrameInfo.Height = GST_ROUND_UP_16 (resolutions_to_check[i].height);
- mfx->FrameInfo.CropW = resolutions_to_check[i].width;
- mfx->FrameInfo.CropH = resolutions_to_check[i].height;
+ for (guint i = 0; i < G_N_ELEMENTS (gst_qsv_resolutions); i++) {
+ mfx->FrameInfo.Width = GST_ROUND_UP_16 (gst_qsv_resolutions[i].width);
+ mfx->FrameInfo.Height = GST_ROUND_UP_16 (gst_qsv_resolutions[i].height);
+ mfx->FrameInfo.CropW = gst_qsv_resolutions[i].width;
+ mfx->FrameInfo.CropH = gst_qsv_resolutions[i].height;
if (MFXVideoDECODE_Query (session, ¶m, ¶m) != MFX_ERR_NONE)
break;
- max_resolution.width = resolutions_to_check[i].width;
- max_resolution.height = resolutions_to_check[i].height;
+ max_resolution.width = gst_qsv_resolutions[i].width;
+ max_resolution.height = gst_qsv_resolutions[i].height;
}
if (max_resolution.width == 0 || max_resolution.height == 0)
mfx->FrameInfo.Shift = 1;
mfx->FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
mfx->CodecProfile = MFX_PROFILE_HEVC_MAIN10;
- mfx->FrameInfo.Width = GST_ROUND_UP_16 (resolutions_to_check[0].width);
- mfx->FrameInfo.Height = GST_ROUND_UP_16 (resolutions_to_check[0].height);
- mfx->FrameInfo.CropW = resolutions_to_check[0].width;
- mfx->FrameInfo.CropH = resolutions_to_check[0].height;
+ mfx->FrameInfo.Width = GST_ROUND_UP_16 (gst_qsv_resolutions[0].width);
+ mfx->FrameInfo.Height = GST_ROUND_UP_16 (gst_qsv_resolutions[0].height);
+ mfx->FrameInfo.CropW = gst_qsv_resolutions[0].width;
+ mfx->FrameInfo.CropH = gst_qsv_resolutions[0].height;
if (MFXVideoDECODE_Query (session, ¶m, ¶m) == MFX_ERR_NONE) {
supported_profiles.push_back ("main-10");
supported_formats.push_back ("P010_10LE");
guint resolution = MAX (max_resolution.width, max_resolution.height);
std::string src_caps_str = "video/x-raw";
- src_caps_str += ", width=(int) [ 16, " + std::to_string (resolution) + " ]";
- src_caps_str += ", height=(int) [ 16, " + std::to_string (resolution) + " ]";
+ src_caps_str += ", width=(int) [ 1, " + std::to_string (resolution) + " ]";
+ src_caps_str += ", height=(int) [ 1, " + std::to_string (resolution) + " ]";
/* *INDENT-OFF* */
if (supported_formats.size () > 1) {
#endif
std::string sink_caps_str = "video/x-h265";
- sink_caps_str += ", width=(int) [ 16, " + std::to_string (resolution) + " ]";
- sink_caps_str += ", height=(int) [ 16, " + std::to_string (resolution) + " ]";
+ sink_caps_str += ", width=(int) [ 1, " + std::to_string (resolution) + " ]";
+ sink_caps_str += ", height=(int) [ 1, " + std::to_string (resolution) + " ]";
sink_caps_str += ", stream-format=(string) { byte-stream, hev1, hvc1 }";
sink_caps_str += ", alignment=(string) au";
return ret;
}
-typedef struct
-{
- guint width;
- guint height;
-} Resolution;
-
void
gst_qsv_h265_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
GstObject * device, mfxSession session)
{
mfxVideoParam param;
mfxInfoMFX *mfx;
- static const Resolution resolutions_to_check[] = {
- {1280, 720}, {1920, 1088}, {2560, 1440}, {3840, 2160}, {4096, 2160},
- {7680, 4320}, {8192, 4320}
- };
std::vector < mfxU16 > supported_profiles;
std::vector < std::string > supported_formats;
- Resolution max_resolution;
+ GstQsvResolution max_resolution;
mfxExtContentLightLevelInfo cll;
mfxExtMasteringDisplayColourVolume mdcv;
mfxExtBuffer *ext_buffers[2];
"qsvh265enc", 0, "qsvh265enc");
memset (¶m, 0, sizeof (mfxVideoParam));
- memset (&max_resolution, 0, sizeof (Resolution));
+ memset (&max_resolution, 0, sizeof (GstQsvResolution));
memset (&cll, 0, sizeof (mfxExtContentLightLevelInfo));
memset (&mdcv, 0, sizeof (mfxExtMasteringDisplayColourVolume));
param.ExtParam = nullptr;
/* Check max-resolution */
- for (guint i = 0; i < G_N_ELEMENTS (resolutions_to_check); i++) {
- mfx->FrameInfo.Width = GST_ROUND_UP_16 (resolutions_to_check[i].width);
- mfx->FrameInfo.Height = GST_ROUND_UP_16 (resolutions_to_check[i].height);
- mfx->FrameInfo.CropW = resolutions_to_check[i].width;
- mfx->FrameInfo.CropH = resolutions_to_check[i].height;
+ for (guint i = 0; i < G_N_ELEMENTS (gst_qsv_resolutions); i++) {
+ mfx->FrameInfo.Width = GST_ROUND_UP_16 (gst_qsv_resolutions[i].width);
+ mfx->FrameInfo.Height = GST_ROUND_UP_16 (gst_qsv_resolutions[i].height);
+ mfx->FrameInfo.CropW = gst_qsv_resolutions[i].width;
+ mfx->FrameInfo.CropH = gst_qsv_resolutions[i].height;
if (MFXVideoENCODE_Query (session, ¶m, ¶m) != MFX_ERR_NONE)
break;
- max_resolution.width = resolutions_to_check[i].width;
- max_resolution.height = resolutions_to_check[i].height;
+ max_resolution.width = gst_qsv_resolutions[i].width;
+ max_resolution.height = gst_qsv_resolutions[i].height;
}
GST_INFO ("Maximum supported resolution: %dx%d",
#define DOC_SINK_CAPS_COMM \
"format = (string) { NV12, BGRA }, " \
- "width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ]"
+ "width = (int) [ 16, 16384 ], height = (int) [ 16, 16384 ]"
#define DOC_SINK_CAPS \
"video/x-raw(memory:D3D11Memory), " DOC_SINK_CAPS_COMM "; " \
"video/x-raw, " DOC_SINK_CAPS_COMM
#define DOC_SRC_CAPS \
- "image/jpeg, width = (int) [ 16, 8192 ], height = (int) [ 16, 8192 ]"
+ "image/jpeg, width = (int) [ 16, 16384 ], height = (int) [ 16, 16384 ]"
typedef struct _GstQsvJpegEncClassData
{
return ret;
}
-typedef struct
-{
- guint width;
- guint height;
-} Resolution;
-
void
gst_qsv_jpeg_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
GstObject * device, mfxSession session)
{
mfxVideoParam param;
mfxInfoMFX *mfx;
- static const Resolution resolutions_to_check[] = {
- {1280, 720}, {1920, 1088}, {2560, 1440}, {3840, 2160}, {4096, 2160},
- {7680, 4320}, {8192, 4320}
- };
std::vector < std::string > supported_formats;
- Resolution max_resolution;
+ GstQsvResolution max_resolution;
mfxStatus status;
gboolean interlaved = TRUE;
"qsvjpegenc", 0, "qsvjpegenc");
memset (¶m, 0, sizeof (mfxVideoParam));
- memset (&max_resolution, 0, sizeof (Resolution));
+ memset (&max_resolution, 0, sizeof (GstQsvResolution));
param.AsyncDepth = 4;
param.IOPattern = MFX_IOPATTERN_IN_VIDEO_MEMORY;
mfx->FrameInfo.FourCC = MFX_FOURCC_NV12;
/* Check max-resolution */
- for (guint i = 0; i < G_N_ELEMENTS (resolutions_to_check); i++) {
- mfx->FrameInfo.Width = mfx->FrameInfo.CropW = resolutions_to_check[i].width;
+ for (guint i = 0; i < G_N_ELEMENTS (gst_qsv_resolutions); i++) {
+ mfx->FrameInfo.Width = mfx->FrameInfo.CropW = gst_qsv_resolutions[i].width;
mfx->FrameInfo.Height = mfx->FrameInfo.CropH =
- resolutions_to_check[i].height;
+ gst_qsv_resolutions[i].height;
if (MFXVideoENCODE_Query (session, ¶m, ¶m) != MFX_ERR_NONE)
break;
- max_resolution.width = resolutions_to_check[i].width;
- max_resolution.height = resolutions_to_check[i].height;
+ max_resolution.width = gst_qsv_resolutions[i].width;
+ max_resolution.height = gst_qsv_resolutions[i].height;
}
GST_INFO ("Maximum supported resolution: %dx%d",
return gst_util_uint64_scale (timestamp, 90000, GST_SECOND);
}
+typedef struct _GstQsvResolution
+{
+ guint width;
+ guint height;
+} GstQsvResolution;
+
+static const GstQsvResolution gst_qsv_resolutions[] = {
+ {1920, 1088}, {2560, 1440}, {3840, 2160}, {4096, 2160},
+ {7680, 4320}, {8192, 4320}, {15360, 8640}, {16384, 8640}
+};
+
G_END_DECLS
{
}
-typedef struct
-{
- guint width;
- guint height;
-} Resolution;
-
void
gst_qsv_vp9_dec_register (GstPlugin * plugin, guint rank, guint impl_index,
GstObject * device, mfxSession session)
{
mfxVideoParam param;
mfxInfoMFX *mfx;
- static const Resolution resolutions_to_check[] = {
- {1280, 720}, {1920, 1088}, {2560, 1440}, {3840, 2160}, {4096, 2160},
- {7680, 4320}, {8192, 4320}, {15360, 8640}, {16384, 8640}
- };
- Resolution max_resolution;
+ GstQsvResolution max_resolution;
std::vector < std::string > supported_formats;
gboolean have_profile_2 = FALSE;
gboolean have_profile_2_12bits = FALSE;
GST_DEBUG_CATEGORY_INIT (gst_qsv_vp9_dec_debug, "qsvvp9dec", 0, "qsvvp9dec");
memset (¶m, 0, sizeof (mfxVideoParam));
- memset (&max_resolution, 0, sizeof (Resolution));
+ memset (&max_resolution, 0, sizeof (GstQsvResolution));
param.AsyncDepth = 4;
param.IOPattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
mfx->CodecProfile = MFX_PROFILE_VP9_0;
/* Check max-resolution */
- for (guint i = 0; i < G_N_ELEMENTS (resolutions_to_check); i++) {
- mfx->FrameInfo.Width = GST_ROUND_UP_16 (resolutions_to_check[i].width);
- mfx->FrameInfo.Height = GST_ROUND_UP_16 (resolutions_to_check[i].height);
- mfx->FrameInfo.CropW = resolutions_to_check[i].width;
- mfx->FrameInfo.CropH = resolutions_to_check[i].height;
+ for (guint i = 0; i < G_N_ELEMENTS (gst_qsv_resolutions); i++) {
+ mfx->FrameInfo.Width = GST_ROUND_UP_16 (gst_qsv_resolutions[i].width);
+ mfx->FrameInfo.Height = GST_ROUND_UP_16 (gst_qsv_resolutions[i].height);
+ mfx->FrameInfo.CropW = gst_qsv_resolutions[i].width;
+ mfx->FrameInfo.CropH = gst_qsv_resolutions[i].height;
if (MFXVideoDECODE_Query (session, ¶m, ¶m) != MFX_ERR_NONE)
break;
- max_resolution.width = resolutions_to_check[i].width;
- max_resolution.height = resolutions_to_check[i].height;
+ max_resolution.width = gst_qsv_resolutions[i].width;
+ max_resolution.height = gst_qsv_resolutions[i].height;
}
if (max_resolution.width == 0 || max_resolution.height == 0)
return ret;
}
-typedef struct
-{
- guint width;
- guint height;
-} Resolution;
-
void
gst_qsv_vp9_enc_register (GstPlugin * plugin, guint rank, guint impl_index,
GstObject * device, mfxSession session)
{
mfxVideoParam param;
mfxInfoMFX *mfx;
- static const Resolution resolutions_to_check[] = {
- {1280, 720}, {1920, 1088}, {2560, 1440}, {3840, 2160}, {4096, 2160},
- {7680, 4320}, {8192, 4320}
- };
std::vector < mfxU16 > supported_profiles;
std::vector < std::string > supported_formats;
- Resolution max_resolution;
+ GstQsvResolution max_resolution;
mfxExtVP9Param vp9_param;
mfxExtBuffer *ext_bufs[1];
GST_DEBUG_CATEGORY_INIT (gst_qsv_vp9_enc_debug, "qsvvp9enc", 0, "qsvvp9enc");
memset (¶m, 0, sizeof (mfxVideoParam));
- memset (&max_resolution, 0, sizeof (Resolution));
+ memset (&max_resolution, 0, sizeof (GstQsvResolution));
ext_bufs[0] = (mfxExtBuffer *) & vp9_param;
mfx->FrameInfo.Shift = 0;
/* Check max-resolution */
- for (guint i = 0; i < G_N_ELEMENTS (resolutions_to_check); i++) {
+ for (guint i = 0; i < G_N_ELEMENTS (gst_qsv_resolutions); i++) {
mfx->FrameInfo.Width = mfx->FrameInfo.CropW =
- GST_ROUND_UP_16 (resolutions_to_check[i].width);
+ GST_ROUND_UP_16 (gst_qsv_resolutions[i].width);
mfx->FrameInfo.Height = mfx->FrameInfo.CropH =
- GST_ROUND_UP_16 (resolutions_to_check[i].height);
+ GST_ROUND_UP_16 (gst_qsv_resolutions[i].height);
gst_qsv_vp9_enc_init_vp9_param (&vp9_param);
- vp9_param.FrameWidth = resolutions_to_check[i].width;
- vp9_param.FrameHeight = resolutions_to_check[i].height;
+ vp9_param.FrameWidth = gst_qsv_resolutions[i].width;
+ vp9_param.FrameHeight = gst_qsv_resolutions[i].height;
vp9_param.WriteIVFHeaders = MFX_CODINGOPTION_OFF;
if (MFXVideoENCODE_Query (session, ¶m, ¶m) != MFX_ERR_NONE)
break;
- max_resolution.width = resolutions_to_check[i].width;
- max_resolution.height = resolutions_to_check[i].height;
+ max_resolution.width = gst_qsv_resolutions[i].width;
+ max_resolution.height = gst_qsv_resolutions[i].height;
}
GST_INFO ("Maximum supported resolution: %dx%d",