Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/videotoolbox.c10
-rw-r--r--libavcodec/vt_internal.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 51d4eacfd8..9f6176ea18 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -680,8 +680,7 @@ static void videotoolbox_decoder_callback(void *opaque,
CMTime pts,
CMTime duration)
{
- AVCodecContext *avctx = opaque;
- VTContext *vtctx = avctx->internal->hwaccel_priv_data;
+ VTContext *vtctx = opaque;
if (vtctx->frame) {
CVPixelBufferRelease(vtctx->frame);
@@ -689,7 +688,8 @@ static void videotoolbox_decoder_callback(void *opaque,
}
if (!image_buffer) {
- av_log(avctx, AV_LOG_DEBUG, "vt decoder cb: output image buffer is null\n");
+ av_log(vtctx->logctx, AV_LOG_DEBUG,
+ "vt decoder cb: output image buffer is null: %i\n", status);
return;
}
@@ -939,7 +939,7 @@ static int videotoolbox_start(AVCodecContext *avctx)
videotoolbox->cv_pix_fmt_type);
decoder_cb.decompressionOutputCallback = videotoolbox_decoder_callback;
- decoder_cb.decompressionOutputRefCon = avctx;
+ decoder_cb.decompressionOutputRefCon = avctx->internal->hwaccel_priv_data;
status = VTDecompressionSessionCreate(NULL, // allocator
videotoolbox->cm_fmt_desc, // videoFormatDescription
@@ -1169,6 +1169,8 @@ int ff_videotoolbox_common_init(AVCodecContext *avctx)
AVHWFramesContext *hw_frames;
int err;
+ vtctx->logctx = avctx;
+
// Old API - do nothing.
if (avctx->hwaccel_context)
return 0;
diff --git a/libavcodec/vt_internal.h b/libavcodec/vt_internal.h
index 54a11fd1b5..9502d7c7dc 100644
--- a/libavcodec/vt_internal.h
+++ b/libavcodec/vt_internal.h
@@ -45,6 +45,8 @@ typedef struct VTContext {
// Current H264 parameters (used to trigger decoder restart on SPS changes).
uint8_t sps[3];
bool reconfig_needed;
+
+ void *logctx;
} VTContext;
int ff_videotoolbox_alloc_frame(AVCodecContext *avctx, AVFrame *frame);