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
1515
1616 API changes, most recent first:
1717
18+2017-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+
1822 2017-03-02 - xxxxxxx - lavu 55.47.101, lavc 57.81.102, lavf 57.66.103
1923 Remove requirement to use AVOption or accessors to access certain fields
2024 in AVFrame, AVCodecContext, and AVFormatContext that were previously
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929
3030 #define LIBAVCODEC_VERSION_MAJOR 57
3131 #define LIBAVCODEC_VERSION_MINOR 81
32−#define LIBAVCODEC_VERSION_MICRO 102
32+#define LIBAVCODEC_VERSION_MICRO 103
3333
3434 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3535 LIBAVCODEC_VERSION_MINOR, \
libavcodec/videotoolbox.c+2−1
@@ -472,7 +472,8 @@ static CFDictionaryRef videotoolbox_buffer_attributes_create(int width, · 471 unmodified lines
472472 &kCFTypeDictionaryKeyCallBacks,
473473 &kCFTypeDictionaryValueCallBacks);
474474
475− CFDictionarySetValue(buffer_attributes, kCVPixelBufferPixelFormatTypeKey, cv_pix_fmt);
475+ if (pix_fmt)
476+ CFDictionarySetValue(buffer_attributes, kCVPixelBufferPixelFormatTypeKey, cv_pix_fmt);
476477 CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfacePropertiesKey, io_surface_properties);
477478 CFDictionarySetValue(buffer_attributes, kCVPixelBufferWidthKey, w);
478479 CFDictionarySetValue(buffer_attributes, kCVPixelBufferHeightKey, h);
libavcodec/videotoolbox.h+2−1
@@ -58,7 +58,8 @@ typedef struct AVVideotoolboxContext { · 57 unmodified lines
5858
5959 /**
6060 * 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.
6263 */
6364 OSType cv_pix_fmt_type;
6465

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