From: rcombs <rcombs@rcombs.me>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 01/10] lavc/videotoolboxenc: use common routine for pixfmt conversion
Date: Thu, 16 Dec 2021 18:12:06 -0600
Message-ID: <20211217001215.75135-2-rcombs@rcombs.me> (raw)
In-Reply-To: <20211217001215.75135-1-rcombs@rcombs.me>
---
libavcodec/videotoolboxenc.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index ebaa3ebdc8..1e7c164a97 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -29,6 +29,7 @@
#include "libavutil/avstring.h"
#include "libavcodec/avcodec.h"
#include "libavutil/pixdesc.h"
+#include "libavutil/hwcontext_videotoolbox.h"
#include "internal.h"
#include <pthread.h>
#include "atsc_a53.h"
@@ -797,25 +798,9 @@ static int get_cv_pixel_format(AVCodecContext* avctx,
range != AVCOL_RANGE_JPEG;
//MPEG range is used when no range is set
- if (fmt == AV_PIX_FMT_NV12) {
- *av_pixel_format = range == AVCOL_RANGE_JPEG ?
- kCVPixelFormatType_420YpCbCr8BiPlanarFullRange :
- kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
- } else if (fmt == AV_PIX_FMT_YUV420P) {
- *av_pixel_format = range == AVCOL_RANGE_JPEG ?
- kCVPixelFormatType_420YpCbCr8PlanarFullRange :
- kCVPixelFormatType_420YpCbCr8Planar;
- } else if (fmt == AV_PIX_FMT_BGRA) {
- *av_pixel_format = kCVPixelFormatType_32BGRA;
- } else if (fmt == AV_PIX_FMT_P010LE) {
- *av_pixel_format = range == AVCOL_RANGE_JPEG ?
- kCVPixelFormatType_420YpCbCr10BiPlanarFullRange :
- kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange;
- } else {
- return AVERROR(EINVAL);
- }
+ *av_pixel_format = av_map_videotoolbox_format_from_pixfmt2(fmt, range == AVCOL_RANGE_JPEG);
- return 0;
+ return *av_pixel_format ? 0 : AVERROR(EINVAL);
}
static void add_color_attr(AVCodecContext *avctx, CFMutableDictionaryRef dict) {
--
2.33.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2021-12-17 0:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-17 0:12 [FFmpeg-devel] lavc/videotoolboxenc: add ProRes support rcombs
2021-12-17 0:12 ` rcombs [this message]
2021-12-17 0:12 ` [FFmpeg-devel] [PATCH 02/10] lavc/videotoolboxenc: don't access int64_t member as int rcombs
2021-12-17 0:12 ` [FFmpeg-devel] [PATCH 03/10] lavc/videotoolboxenc: detect alpha more generically rcombs
2021-12-17 0:12 ` [FFmpeg-devel] [PATCH 04/10] lavc/videotoolboxenc: fix RGB support rcombs
2021-12-19 16:18 ` Rick Kern
2021-12-17 0:12 ` [FFmpeg-devel] [PATCH 05/10] lavc/videotoolboxenc: config-gate ATSC CC support rcombs
2021-12-17 0:12 ` [FFmpeg-devel] [PATCH 06/10] lavc/videotoolboxenc: vastly simplify get_cv_pixel_info rcombs
2021-12-19 16:25 ` Rick Kern
2021-12-17 0:12 ` [FFmpeg-devel] [PATCH 07/10] lavc/videotoolboxenc: add handling for non-NAL-based codecs rcombs
2021-12-19 16:40 ` Rick Kern
2021-12-17 0:12 ` [FFmpeg-devel] [PATCH 08/10] lavc/Makefile: fix missing hevc_videotoolbox case rcombs
2021-12-17 0:12 ` [FFmpeg-devel] [PATCH 09/10] swscale: add P210/P410/P216/P416 output rcombs
2021-12-23 11:00 ` Michael Niedermayer
2021-12-17 0:12 ` [FFmpeg-devel] [PATCH 10/10] lavc/videotoolboxenc: add ProRes support rcombs
2021-12-19 17:30 ` [FFmpeg-devel] " Rick Kern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211217001215.75135-2-rcombs@rcombs.me \
--to=rcombs@rcombs.me \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git