aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-15 12:30:07 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-15 12:30:07 +0200
commit51c810e62b63a1451b337b1cba0141b386066668 (patch)
tree1b5d4697495201e68400608a0bb9fc1ba738ebb8
parentfd937866f7b7ae3303e8a78b1e9a48d853360d62 (diff)
parentd565fef1b83b6c5f8afb32229260b79f67c68109 (diff)
downloadffmpeg-51c810e62b63a1451b337b1cba0141b386066668.tar.gz
Merge commit 'd565fef1b83b6c5f8afb32229260b79f67c68109'
* commit 'd565fef1b83b6c5f8afb32229260b79f67c68109': vdpau: add AV_HWACCEL_FLAG_IGNORE_LEVEL to skip the codec level check Conflicts: libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--doc/APIchanges3
-rw-r--r--libavcodec/avcodec.h14
-rw-r--r--libavcodec/vdpau.c7
-rw-r--r--libavcodec/vdpau.h2
-rw-r--r--libavcodec/vdpau_internal.h1
-rw-r--r--libavcodec/version.h2
6 files changed, 24 insertions, 5 deletions
diff --git a/doc/APIchanges b/doc/APIchanges
index 8e6d5e1888..13f762d764 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2014-08-09
API changes, most recent first:
+2014-10-xx - xxxxxxx - lavc 56.4.0 - avcodec.h
+ Add AV_HWACCEL_FLAG_IGNORE_LEVEL flag to av_vdpau_bind_context().
+
2014-10-13 - xxxxxxx - lavc 56.03.0 - avcodec.h
Add AVCodecContext.initial_padding. Deprecate the use of AVCodecContext.delay
for audio encoding.
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index f9ab7c2da9..27d6e55d61 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3229,7 +3229,8 @@ int av_codec_get_max_lowres(const AVCodec *codec);
struct MpegEncContext;
/**
- * AVHWAccel.
+ * @defgroup lavc_hwaccel AVHWAccel
+ * @{
*/
typedef struct AVHWAccel {
/**
@@ -3366,6 +3367,17 @@ typedef struct AVHWAccel {
} AVHWAccel;
/**
+ * Hardware acceleration should be used for decoding even if the codec level
+ * used is unknown or higher than the maximum supported level reported by the
+ * hardware driver.
+ */
+#define AV_HWACCEL_FLAG_IGNORE_LEVEL (1 << 0)
+
+/**
+ * @}
+ */
+
+/**
* @defgroup lavc_picture AVPicture
*
* Functions for working with AVPicture
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index c3a5ca00fd..41aea1c215 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -107,7 +107,9 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
vdctx->device = hwctx->device;
vdctx->get_proc_address = hwctx->get_proc_address;
- if (level < 0)
+ if (hwctx->flags & AV_HWACCEL_FLAG_IGNORE_LEVEL)
+ level = 0;
+ else if (level < 0)
return AVERROR(ENOTSUP);
status = vdctx->get_proc_address(vdctx->device,
@@ -686,7 +688,7 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
{
VDPAUHWContext *hwctx;
- if (flags != 0)
+ if (flags & ~AV_HWACCEL_FLAG_IGNORE_LEVEL)
return AVERROR(EINVAL);
if (av_reallocp(&avctx->hwaccel_context, sizeof(*hwctx)))
@@ -698,6 +700,7 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
hwctx->context.decoder = VDP_INVALID_HANDLE;
hwctx->device = device;
hwctx->get_proc_address = get_proc;
+ hwctx->flags = flags;
hwctx->reset = 1;
return 0;
}
diff --git a/libavcodec/vdpau.h b/libavcodec/vdpau.h
index a8483d77f3..d686ef45da 100644
--- a/libavcodec/vdpau.h
+++ b/libavcodec/vdpau.h
@@ -162,7 +162,7 @@ void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2);
* @param avctx decoding context whose get_format() callback is invoked
* @param device VDPAU device handle to use for hardware acceleration
* @param get_proc_address VDPAU device driver
- * @param flags for future use, must be zero
+ * @param flags zero of more OR'd AV_HWACCEL_FLAG_* flags
*
* @return 0 on success, an AVERROR code on failure.
*/
diff --git a/libavcodec/vdpau_internal.h b/libavcodec/vdpau_internal.h
index 825da7dcd3..e1ea4306f2 100644
--- a/libavcodec/vdpau_internal.h
+++ b/libavcodec/vdpau_internal.h
@@ -60,6 +60,7 @@ typedef struct VDPAUHWContext {
VdpDevice device;
VdpGetProcAddress *get_proc_address;
char reset;
+ unsigned char flags;
} VDPAUHWContext;
typedef struct VDPAUContext {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 30ce7947fc..5532a57f4d 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 56
-#define LIBAVCODEC_VERSION_MINOR 5
+#define LIBAVCODEC_VERSION_MINOR 6
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \