History

avcodec/videotoolbox: allow not setting the kCVPixelBufferPixelFormatTypeKey

If AVVideotoolboxContext.cv_pix_fmt_type is set to 0, don't set the kCVPixelBufferPixelFormatTypeKey value on the VT decoder. This makes VT output its native format, which can be much faster on some hardware iterations (if the native format does not match with the requested format, it will be converted, which is slow). The default is still forcing nv12.

wm4 committed 9 years ago

Commit ade7c1a1 parent 227f6e14 files · +9 −3Browse files

Unified · Split

4 files
  1. doc/APIchanges +4 −0
  2. libavcodec/version.h +1 −1
  3. libavcodec/videotoolbox.c +2 −1
  4. libavcodec/videotoolbox.h +2 −1
doc/APIchanges+4−0
@@ -15,6 +15,10 @@ libavutil: 2015-08-28 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182017-03-02 - xxxxxxx - lavc 57.81.104 - videotoolbox.h
19 AVVideotoolboxContext.cv_pix_fmt_type can now be set to 0 to output the
20 native decoder format. (The default value is not changed.)
21
182017-03-02 - xxxxxxx - lavu 55.47.101, lavc 57.81.102, lavf 57.66.103222017-03-02 - xxxxxxx - lavu 55.47.101, lavc 57.81.102, lavf 57.66.103
19 Remove requirement to use AVOption or accessors to access certain fields23 Remove requirement to use AVOption or accessors to access certain fields
20 in AVFrame, AVCodecContext, and AVFormatContext that were previously24 in AVFrame, AVCodecContext, and AVFormatContext that were previously
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29 29
30#define LIBAVCODEC_VERSION_MAJOR 5730#define LIBAVCODEC_VERSION_MAJOR 57
31#define LIBAVCODEC_VERSION_MINOR 8131#define LIBAVCODEC_VERSION_MINOR 81
32#define LIBAVCODEC_VERSION_MICRO 10232#define LIBAVCODEC_VERSION_MICRO 103
33 33
34#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \34#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
35 LIBAVCODEC_VERSION_MINOR, \35 LIBAVCODEC_VERSION_MINOR, \
libavcodec/videotoolbox.c+2−1
@@ -472,7 +472,8 @@ static CFDictionaryRef videotoolbox_buffer_attributes_create(int width, · 471 unmodified lines
472 &kCFTypeDictionaryKeyCallBacks,472 &kCFTypeDictionaryKeyCallBacks,
473 &kCFTypeDictionaryValueCallBacks);473 &kCFTypeDictionaryValueCallBacks);
474 474
475 CFDictionarySetValue(buffer_attributes, kCVPixelBufferPixelFormatTypeKey, cv_pix_fmt);475 if (pix_fmt)
476 CFDictionarySetValue(buffer_attributes, kCVPixelBufferPixelFormatTypeKey, cv_pix_fmt);
476 CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfacePropertiesKey, io_surface_properties);477 CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfacePropertiesKey, io_surface_properties);
477 CFDictionarySetValue(buffer_attributes, kCVPixelBufferWidthKey, w);478 CFDictionarySetValue(buffer_attributes, kCVPixelBufferWidthKey, w);
478 CFDictionarySetValue(buffer_attributes, kCVPixelBufferHeightKey, h);479 CFDictionarySetValue(buffer_attributes, kCVPixelBufferHeightKey, h);
libavcodec/videotoolbox.h+2−1
@@ -58,7 +58,8 @@ typedef struct AVVideotoolboxContext { · 57 unmodified lines
58 58
59 /**59 /**
60 * CVPixelBuffer Format Type that Videotoolbox will use for decoded frames.60 * CVPixelBuffer Format Type that Videotoolbox will use for decoded frames.
61 * set by the caller.61 * set by the caller. If this is set to 0, then no specific format is
62 * requested from the decoder, and its native format is output.
62 */63 */
63 OSType cv_pix_fmt_type;64 OSType cv_pix_fmt_type;
64 65

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t