mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #1685: Cross build RTC with FFmpeg
This commit is contained in:
parent
1c75a270b3
commit
1e9de0e191
267 changed files with 12603 additions and 1451 deletions
|
@ -389,7 +389,7 @@ static mfxStatus frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req,
|
|||
!(req->Type & (MFX_MEMTYPE_FROM_VPPIN | MFX_MEMTYPE_FROM_VPPOUT)) ||
|
||||
!(req->Type & MFX_MEMTYPE_EXTERNAL_FRAME))
|
||||
return MFX_ERR_UNSUPPORTED;
|
||||
if (i->Width > i1->Width || i->Height > i1->Height ||
|
||||
if (i->Width != i1->Width || i->Height != i1->Height ||
|
||||
i->FourCC != i1->FourCC || i->ChromaFormat != i1->ChromaFormat) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Mismatching surface properties in an "
|
||||
"allocation request: %dx%d %d %d vs %dx%d %d %d\n",
|
||||
|
@ -863,8 +863,7 @@ static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
|
|||
mfxStatus err;
|
||||
int ret = 0;
|
||||
/* make a copy if the input is not padded as libmfx requires */
|
||||
AVFrame tmp_frame;
|
||||
const AVFrame *src_frame;
|
||||
AVFrame tmp_frame, *src_frame;
|
||||
int realigned = 0;
|
||||
|
||||
|
||||
|
@ -892,7 +891,8 @@ static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (src->height & 15 || src->linesize[0] & 15) {
|
||||
|
||||
if (src->height & 16 || src->linesize[0] & 16) {
|
||||
realigned = 1;
|
||||
memset(&tmp_frame, 0, sizeof(tmp_frame));
|
||||
tmp_frame.format = src->format;
|
||||
|
@ -1206,7 +1206,6 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device,
|
|||
QSVDevicePriv *priv;
|
||||
enum AVHWDeviceType child_device_type;
|
||||
AVHWDeviceContext *child_device;
|
||||
AVDictionary *child_device_opts;
|
||||
AVDictionaryEntry *e;
|
||||
|
||||
mfxIMPL impl;
|
||||
|
@ -1221,17 +1220,9 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device,
|
|||
|
||||
e = av_dict_get(opts, "child_device", NULL, 0);
|
||||
|
||||
child_device_opts = NULL;
|
||||
if (CONFIG_VAAPI) {
|
||||
if (CONFIG_VAAPI)
|
||||
child_device_type = AV_HWDEVICE_TYPE_VAAPI;
|
||||
// libmfx does not actually implement VAAPI properly, rather it
|
||||
// depends on the specific behaviour of a matching iHD driver when
|
||||
// used on recent Intel hardware. Set options to the VAAPI device
|
||||
// creation so that we should pick a usable setup by default if
|
||||
// possible, even when multiple devices and drivers are available.
|
||||
av_dict_set(&child_device_opts, "kernel_driver", "i915", 0);
|
||||
av_dict_set(&child_device_opts, "driver", "iHD", 0);
|
||||
} else if (CONFIG_DXVA2)
|
||||
else if (CONFIG_DXVA2)
|
||||
child_device_type = AV_HWDEVICE_TYPE_DXVA2;
|
||||
else {
|
||||
av_log(ctx, AV_LOG_ERROR, "No supported child device type is enabled\n");
|
||||
|
@ -1239,7 +1230,7 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device,
|
|||
}
|
||||
|
||||
ret = av_hwdevice_ctx_create(&priv->child_device_ctx, child_device_type,
|
||||
e ? e->value : NULL, child_device_opts, 0);
|
||||
e ? e->value : NULL, NULL, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue