Exemplo n.º 1
0
static bool check_ffmpeg_hevc_dxva2()
{
    avcodec_register_all();
    AVHWAccel *hwa = av_hwaccel_next(0);
    while (hwa) {
        if (strncmp("hevc_dxva2", hwa->name, 10) == 0)
            return true;
        hwa = av_hwaccel_next(hwa);
    }
    return false;
}
Exemplo n.º 2
0
bool FFDecHWAccel::hasHWAccel(const char *hwaccelName)
{
	AVHWAccel *avHWAccel = NULL;
	while ((avHWAccel = av_hwaccel_next(avHWAccel)))
		if (avHWAccel->id == codec_ctx->codec_id && strstr(avHWAccel->name, hwaccelName))
			break;
	return avHWAccel;
}
Exemplo n.º 3
0
static AVHWAccel *find_hwaccel(enum AVCodecID codec_id,
                               enum AVPixelFormat pix_fmt)
{
    AVHWAccel *hwaccel = NULL;

    while ((hwaccel = av_hwaccel_next(hwaccel)))
        if (hwaccel->id == codec_id
            && hwaccel->pix_fmt == pix_fmt)
            return hwaccel;
    return NULL;
}
Exemplo n.º 4
0
static AVCodec *find_hardware_decoder(enum AVCodecID id)
{
	AVHWAccel *hwa = av_hwaccel_next(NULL);
	AVCodec *c = NULL;

	while (hwa) {
		if (hwa->id == id) {
			if (hwa->pix_fmt == AV_PIX_FMT_VDA_VLD ||
			    hwa->pix_fmt == AV_PIX_FMT_DXVA2_VLD ||
			    hwa->pix_fmt == AV_PIX_FMT_VAAPI_VLD) {
				c = avcodec_find_decoder_by_name(hwa->name);
				if (c)
					break;
			}
		}

		hwa = av_hwaccel_next(hwa);
	}

	return c;
}
Exemplo n.º 5
0
AVHWAccel *find_hwaccel_codec(AVCodecContext *codec_context)
{
	AVHWAccel *hwaccel = NULL;

	while ((hwaccel = av_hwaccel_next(hwaccel)) != NULL) {
		if (hwaccel->id == codec_context->codec_id &&
		    (hwaccel->pix_fmt == AV_PIX_FMT_VDA_VLD   ||
		     hwaccel->pix_fmt == AV_PIX_FMT_DXVA2_VLD ||
		     hwaccel->pix_fmt == AV_PIX_FMT_VAAPI_VLD)) {
			return hwaccel;
		}

	}

	return NULL;
}