/libavcodec_decode.c Secret
Created
December 7, 2017 12:09
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (config->methods & | |
AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX && | |
avctx->hw_frames_ctx) { | |
const AVHWFramesContext *frames_ctx = | |
(AVHWFramesContext*)avctx->hw_frames_ctx->data; | |
if (frames_ctx->format != user_choice) { | |
av_log(avctx, AV_LOG_ERROR, "Invalid setup for format %s: " | |
"does not match the format of the provided frames " | |
"context.\n", desc->name); | |
goto try_again; | |
} | |
} else if (config->methods & | |
AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX && | |
avctx->hw_device_ctx) { | |
const AVHWDeviceContext *device_ctx = | |
(AVHWDeviceContext*)avctx->hw_device_ctx->data; | |
if (device_ctx->type != config->device_type) { | |
av_log(avctx, AV_LOG_ERROR, "Invalid setup for format %s: " | |
"does not match the type of the provided device " | |
"context.\n", desc->name); | |
goto try_again; | |
} | |
} else if (config->methods & | |
AV_CODEC_HW_CONFIG_METHOD_INTERNAL) { | |
// Internal-only setup, no additional configuration. | |
} else if (config->methods & | |
AV_CODEC_HW_CONFIG_METHOD_AD_HOC) { | |
// Some ad-hoc configuration we can't see and can't check. | |
} else { | |
av_log(avctx, AV_LOG_ERROR, "Invalid setup for format %s: " | |
"missing configuration.\n", desc->name); | |
goto try_again; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment