History

Merge commit 'e7c5e17d4fbd7c83fb331bf327e25ebd8e6a8623'

* commit 'e7c5e17d4fbd7c83fb331bf327e25ebd8e6a8623': vda: Make output CVPixelBuffer format configurable Conflicts: doc/APIchanges libavcodec/version.h

Michael Niedermayer committed 11 years ago

Commit cc484092 parents a3adba3 e7c5e175 files · +31 −4Browse files

Unified · Split

5 files
  1. doc/APIchanges +3 −0
  2. libavcodec/vda.c +9 −2
  3. libavcodec/vda.h +17 −0
  4. libavcodec/vda_h264.c +1 −1
  5. libavcodec/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2014-08-09 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182015-05-13 - xxxxxxx - lavc 56.39.100 / 56.23.0
19 Add av_vda_default_init2.
20
182015-05-11 - XXXXXXX - lavf 56.33.100 - avformat.h212015-05-11 - XXXXXXX - lavf 56.33.100 - avformat.h
19 Add AVOpenCallback AVFormatContext.open_cb22 Add AVOpenCallback AVFormatContext.open_cb
20 23
libavcodec/vda.c+9−2
@@ -28,15 +28,22 @@ AVVDAContext *av_vda_alloc_context(void) · 27 unmodified lines
28{28{
29 AVVDAContext *ret = av_mallocz(sizeof(*ret));29 AVVDAContext *ret = av_mallocz(sizeof(*ret));
30 30
31 if (ret)31 if (ret) {
32 ret->output_callback = ff_vda_output_callback;32 ret->output_callback = ff_vda_output_callback;
33 ret->cv_pix_fmt_type = kCVPixelFormatType_422YpCbCr8;
34 }
33 35
34 return ret;36 return ret;
35}37}
36 38
37int av_vda_default_init(AVCodecContext *avctx)39int av_vda_default_init(AVCodecContext *avctx)
38{40{
39 avctx->hwaccel_context = av_vda_alloc_context();41 return av_vda_default_init2(avctx, NULL);
42}
43
44int av_vda_default_init2(AVCodecContext *avctx, AVVDAContext *vdactx)
45{
46 avctx->hwaccel_context = vdactx ?: av_vda_alloc_context();
40 if (!avctx->hwaccel_context)47 if (!avctx->hwaccel_context)
41 return AVERROR(ENOMEM);48 return AVERROR(ENOMEM);
42 return ff_vda_default_init(avctx);49 return ff_vda_default_init(avctx);
libavcodec/vda.h+17−0
@@ -171,6 +171,12 @@ typedef struct AVVDAContext { · 170 unmodified lines
171 * Set by av_vda_alloc_context().171 * Set by av_vda_alloc_context().
172 */172 */
173 VDADecoderOutputCallback output_callback;173 VDADecoderOutputCallback output_callback;
174
175 /**
176 * CVPixelBuffer Format Type that VDA will use for decoded frames; set by
177 * the caller.
178 */
179 OSType cv_pix_fmt_type;
174} AVVDAContext;180} AVVDAContext;
175 181
176/**182/**
@@ -198,6 +204,17 @@ AVVDAContext *av_vda_alloc_context(void); · 21 unmodified lines
198 */204 */
199int av_vda_default_init(AVCodecContext *avctx);205int av_vda_default_init(AVCodecContext *avctx);
200 206
207/**
208 * This is a convenience function that creates and sets up the VDA context using
209 * an internal implementation.
210 *
211 * @param avctx the corresponding codec context
212 * @param vdactx the VDA context to use
213 *
214 * @return >= 0 on success, a negative AVERROR code on failure
215 */
216int av_vda_default_init2(AVCodecContext *avctx, AVVDAContext *vdactx);
217
201/**218/**
202 * This function must be called to free the VDA context initialized with219 * This function must be called to free the VDA context initialized with
203 * av_vda_default_init().220 * av_vda_default_init().
libavcodec/vda_h264.c+1−1
@@ -430,7 +430,7 @@ int ff_vda_default_init(AVCodecContext *avctx) · 429 unmodified lines
430 CFMutableDictionaryRef buffer_attributes;430 CFMutableDictionaryRef buffer_attributes;
431 CFMutableDictionaryRef io_surface_properties;431 CFMutableDictionaryRef io_surface_properties;
432 CFNumberRef cv_pix_fmt;432 CFNumberRef cv_pix_fmt;
433 int32_t fmt = 'avc1', pix_fmt = kCVPixelFormatType_422YpCbCr8;433 int32_t fmt = 'avc1', pix_fmt = vda_ctx->cv_pix_fmt_type;
434 434
435 // kCVPixelFormatType_420YpCbCr8Planar;435 // kCVPixelFormatType_420YpCbCr8Planar;
436 436
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29#include "libavutil/version.h"29#include "libavutil/version.h"
30 30
31#define LIBAVCODEC_VERSION_MAJOR 5631#define LIBAVCODEC_VERSION_MAJOR 56
32#define LIBAVCODEC_VERSION_MINOR 3832#define LIBAVCODEC_VERSION_MINOR 39
33#define LIBAVCODEC_VERSION_MICRO 10033#define LIBAVCODEC_VERSION_MICRO 100
34 34
35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

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