History

Merge commit 'e3e158e81f0666b8fe66be9ce1cad63a535920e0'

* commit 'e3e158e81f0666b8fe66be9ce1cad63a535920e0': vdpau: add av_vdpau_bind_context() Conflicts: doc/APIchanges libavcodec/vdpau.h libavcodec/version.h

Michael Niedermayer committed 12 years ago

Commit a61899a2 parents 067d11b e3e158e5 files · +48 −3Browse files

Unified · Split

5 files
  1. doc/APIchanges +4 −0
  2. libavcodec/vdpau.c +21 −1
  3. libavcodec/vdpau.h +20 −0
  4. libavcodec/vdpau_internal.h +1 −0
  5. libavcodec/version.h +2 −2
doc/APIchanges+4−0
@@ -15,6 +15,10 @@ libavutil: 2014-08-09 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
18+2014-09-xx - xxxxxxx - lavc 56.2.0 - vdpau.h
19+ Add av_vdpau_bind_context(). This function should now be used for creating
20+ (or resetting) a AVVDPAUContext instead of av_vdpau_alloc_context().
21+
1822 2014-10-02 - xxxxxxx - lavc 56.2.100 - avcodec.h
1923 2014-10-02 - xxxxxxx - lavu 54.9.100 - frame.h
2024 Add AV_FRAME_DATA_SKIP_SAMPLES. Add lavc CODEC_FLAG2_SKIP_MANUAL and
libavcodec/vdpau.c+21−1
@@ -85,6 +85,7 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, · 84 unmodified lines
8585
8686 vdctx->width = UINT32_MAX;
8787 vdctx->height = UINT32_MAX;
88+ hwctx->reset = 0;
8889
8990 if (!hwctx) {
9091 vdctx->device = VDP_INVALID_HANDLE;
@@ -151,12 +152,13 @@ int ff_vdpau_common_uninit(AVCodecContext *avctx) · 60 unmodified lines
151152
152153 static int ff_vdpau_common_reinit(AVCodecContext *avctx)
153154 {
155+ VDPAUHWContext *hwctx = avctx->hwaccel_context;
154156 VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data;
155157
156158 if (vdctx->device == VDP_INVALID_HANDLE)
157159 return 0; /* Decoder created by user */
158160 if (avctx->coded_width == vdctx->width &&
159− avctx->coded_height == vdctx->height)
161+ avctx->coded_height == vdctx->height && !hwctx->reset)
160162 return 0;
161163
162164 avctx->hwaccel->uninit(avctx);
@@ -639,4 +641,22 @@ AVVDPAUContext *av_vdpau_alloc_context(void) · 476 unmodified lines
639641 return av_mallocz(sizeof(AVVDPAUContext));
640642 }
641643
644+int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
645+ VdpGetProcAddress *get_proc, unsigned flags)
646+{
647+ VDPAUHWContext *hwctx;
648+
649+ if (av_reallocp(&avctx->hwaccel_context, sizeof(*hwctx)))
650+ return AVERROR(ENOMEM);
651+
652+ hwctx = avctx->hwaccel_context;
653+
654+ memset(hwctx, 0, sizeof(*hwctx));
655+ hwctx->context.decoder = VDP_INVALID_HANDLE;
656+ hwctx->device = device;
657+ hwctx->get_proc_address = get_proc;
658+ hwctx->reset = 1;
659+ return 0;
660+}
661+
642662 /* @}*/
libavcodec/vdpau.h+20−0
@@ -149,6 +149,26 @@ AVVDPAUContext *av_alloc_vdpaucontext(void); · 148 unmodified lines
149149 AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *);
150150 void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2);
151151
152+/**
153+ * Associate a VDPAU device with a codec context for hardware acceleration.
154+ * This function is meant to be called from the get_format() codec callback,
155+ * or earlier. It can also be called after avcodec_flush_buffers() to change
156+ * the underlying VDPAU device mid-stream (e.g. to recover from non-transparent
157+ * display preemption).
158+ *
159+ * @note get_format() must return AV_PIX_FMT_VDPAU if this function completes
160+ * succesfully.
161+ *
162+ * @param avctx decoding context whose get_format() callback is invoked
163+ * @param device VDPAU device handle to use for hardware acceleration
164+ * @param get_proc_address VDPAU device driver
165+ * @param flags for future use, must be zero
166+ *
167+ * @return 0 on success, an AVERROR code on failure.
168+ */
169+int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
170+ VdpGetProcAddress *get_proc_address, unsigned flags);
171+
152172 /**
153173 * Allocate an AVVDPAUContext.
154174 *
libavcodec/vdpau_internal.h+1−0
@@ -59,6 +59,7 @@ typedef struct VDPAUHWContext { · 58 unmodified lines
5959 AVVDPAUContext context;
6060 VdpDevice device;
6161 VdpGetProcAddress *get_proc_address;
62+ char reset;
6263 } VDPAUHWContext;
6364
6465 typedef struct VDPAUContext {
libavcodec/version.h+2−2
@@ -29,8 +29,8 @@ · 28 unmodified lines
2929 #include "libavutil/version.h"
3030
3131 #define LIBAVCODEC_VERSION_MAJOR 56
32−#define LIBAVCODEC_VERSION_MINOR 2
33−#define LIBAVCODEC_VERSION_MICRO 101
32+#define LIBAVCODEC_VERSION_MINOR 3
33+#define LIBAVCODEC_VERSION_MICRO 100
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3636 LIBAVCODEC_VERSION_MINOR, \

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