Commit 01602303 authored by wm4's avatar wm4

videotoolbox: log errors

With the new decode API, you can't handle errors directly in the API
user - you only know that the hwaccel did not initialize at all.

Add some approximate logging.
parent edf686f0
...@@ -648,15 +648,21 @@ static int videotoolbox_default_init(AVCodecContext *avctx) ...@@ -648,15 +648,21 @@ static int videotoolbox_default_init(AVCodecContext *avctx)
switch (status) { switch (status) {
case kVTVideoDecoderNotAvailableNowErr: case kVTVideoDecoderNotAvailableNowErr:
av_log(avctx, AV_LOG_VERBOSE, "VideoToolbox session not available.\n");
return AVERROR(ENOSYS);
case kVTVideoDecoderUnsupportedDataFormatErr: case kVTVideoDecoderUnsupportedDataFormatErr:
av_log(avctx, AV_LOG_VERBOSE, "VideoToolbox does not support this format.\n");
return AVERROR(ENOSYS); return AVERROR(ENOSYS);
case kVTVideoDecoderMalfunctionErr: case kVTVideoDecoderMalfunctionErr:
av_log(avctx, AV_LOG_VERBOSE, "VideoToolbox malfunction.\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
case kVTVideoDecoderBadDataErr : case kVTVideoDecoderBadDataErr :
av_log(avctx, AV_LOG_VERBOSE, "VideoToolbox reported invalid data.\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
case 0: case 0:
return 0; return 0;
default: default:
av_log(avctx, AV_LOG_VERBOSE, "Unknown VideoToolbox session creation error %u\n", (unsigned)status);
return AVERROR_UNKNOWN; return AVERROR_UNKNOWN;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment