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
1515
1616 API changes, most recent first:
1717
18+2015-05-13 - xxxxxxx - lavc 56.39.100 / 56.23.0
19+ Add av_vda_default_init2.
20+
1821 2015-05-11 - XXXXXXX - lavf 56.33.100 - avformat.h
1922 Add AVOpenCallback AVFormatContext.open_cb
2023
libavcodec/vda.c+9−2
@@ -28,15 +28,22 @@ AVVDAContext *av_vda_alloc_context(void) · 27 unmodified lines
2828 {
2929 AVVDAContext *ret = av_mallocz(sizeof(*ret));
3030
31− if (ret)
31+ if (ret) {
3232 ret->output_callback = ff_vda_output_callback;
33+ ret->cv_pix_fmt_type = kCVPixelFormatType_422YpCbCr8;
34+ }
3335
3436 return ret;
3537 }
3638
3739 int av_vda_default_init(AVCodecContext *avctx)
3840 {
39− avctx->hwaccel_context = av_vda_alloc_context();
41+ return av_vda_default_init2(avctx, NULL);
42+}
43+
44+int av_vda_default_init2(AVCodecContext *avctx, AVVDAContext *vdactx)
45+{
46+ avctx->hwaccel_context = vdactx ?: av_vda_alloc_context();
4047 if (!avctx->hwaccel_context)
4148 return AVERROR(ENOMEM);
4249 return ff_vda_default_init(avctx);
libavcodec/vda.h+17−0
@@ -171,6 +171,12 @@ typedef struct AVVDAContext { · 170 unmodified lines
171171 * Set by av_vda_alloc_context().
172172 */
173173 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;
174180 } AVVDAContext;
175181
176182 /**
@@ -198,6 +204,17 @@ AVVDAContext *av_vda_alloc_context(void); · 21 unmodified lines
198204 */
199205 int av_vda_default_init(AVCodecContext *avctx);
200206
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+ */
216+int av_vda_default_init2(AVCodecContext *avctx, AVVDAContext *vdactx);
217+
201218 /**
202219 * This function must be called to free the VDA context initialized with
203220 * av_vda_default_init().
libavcodec/vda_h264.c+1−1
@@ -430,7 +430,7 @@ int ff_vda_default_init(AVCodecContext *avctx) · 429 unmodified lines
430430 CFMutableDictionaryRef buffer_attributes;
431431 CFMutableDictionaryRef io_surface_properties;
432432 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;
434434
435435 // kCVPixelFormatType_420YpCbCr8Planar;
436436
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include "libavutil/version.h"
3030
3131 #define LIBAVCODEC_VERSION_MAJOR 56
32−#define LIBAVCODEC_VERSION_MINOR 38
32+#define LIBAVCODEC_VERSION_MINOR 39
3333 #define LIBAVCODEC_VERSION_MICRO 100
3434
3535 #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