Skip to content

Commit

Permalink
lavc/videotoolboxenc: always set pixel buffer info
Browse files Browse the repository at this point in the history
  • Loading branch information
gnattu committed Oct 12, 2024
1 parent 4a02f81 commit 1dd26f0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Index: FFmpeg/libavcodec/videotoolboxenc.c
===================================================================
--- FFmpeg.orig/libavcodec/videotoolboxenc.c
+++ FFmpeg/libavcodec/videotoolboxenc.c
@@ -1034,9 +1034,10 @@ static int create_cv_pixel_buffer_info(A
CFNumberRef width_num = NULL;
CFNumberRef height_num = NULL;
CFMutableDictionaryRef pixel_buffer_info = NULL;
+ enum AVPixelFormat pix_fmt = avctx->pix_fmt == AV_PIX_FMT_VIDEOTOOLBOX ? avctx->sw_pix_fmt : avctx->pix_fmt;
int cv_color_format;
int status = get_cv_pixel_format(avctx,
- avctx->pix_fmt,
+ pix_fmt,
avctx->color_range,
&cv_color_format,
NULL);
@@ -1687,11 +1688,9 @@ static int vtenc_configure_encoder(AVCod
kCFBooleanTrue);
}

- if (avctx->pix_fmt != AV_PIX_FMT_VIDEOTOOLBOX) {
- status = create_cv_pixel_buffer_info(avctx, &pixel_buffer_info);
- if (status)
- goto init_cleanup;
- }
+ status = create_cv_pixel_buffer_info(avctx, &pixel_buffer_info);
+ if (status)
+ goto init_cleanup;

vtctx->dts_delta = vtctx->has_b_frames ? -1 : 0;

1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@
0073-add-12bit-decoding-on-videotoolbox.patch
0074-fix-the-sub2video-perf-regressions.patch
0075-allow-vpl-qsv-to-init-with-the-legacy-msdk-path.patch
0076-alway-set-videotoolboxenc-pixel-buffer-info.patch

0 comments on commit 1dd26f0

Please sign in to comment.