[FFmpeg-devel] [PATCH]Remove xvmc_acceleration if favor of hw_acceleration
Carl Eugen Hoyos
cehoyos
Wed Jan 7 18:49:15 CET 2009
Hi!
Attached patch tries to solve the discussions around how to detect if HW
acceleration is currently used.
Please comment, Carl Eugen
-------------- next part --------------
Index: libavcodec/avcodec.h
===================================================================
--- libavcodec/avcodec.h (revision 16452)
+++ libavcodec/avcodec.h (working copy)
@@ -350,6 +350,15 @@
SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if dynamically linking to libavcodec
};
+/**
+ * Hardware accelerated decoding
+ */
+enum HW_ACCELERATION {
+ HW_ACCELERATION_NONE,
+ HW_ACCELERATION_XVMC,
+ HW_ACCELERATION_VDPAU
+};
+
/* Audio channel masks */
#define CH_FRONT_LEFT 0x00000001
#define CH_FRONT_RIGHT 0x00000002
@@ -518,8 +527,10 @@
/* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */
#define CODEC_CAP_PARSE_ONLY 0x0004
#define CODEC_CAP_TRUNCATED 0x0008
+#if LIBAVCODEC_VERSION_MAJOR < 53
/* Codec can export data for HW decoding (XvMC). */
#define CODEC_CAP_HWACCEL 0x0010
+#endif
/**
* Codec has a nonzero delay and needs to be fed with NULL at the end to get the delayed data.
* If this is not set, the codec is guaranteed to never be fed with NULL data.
@@ -530,10 +541,12 @@
* This can be used to prevent truncation of the last audio samples.
*/
#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
+#if LIBAVCODEC_VERSION_MAJOR < 53
/**
* Codec can export data for HW decoding (VDPAU).
*/
#define CODEC_CAP_HWACCEL_VDPAU 0x0080
+#endif
//The following defines may change, don't expect compatibility if you use them.
#define MB_TYPE_INTRA4x4 0x0001
@@ -1737,12 +1750,14 @@
#define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
#define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
+#if LIBAVCODEC_VERSION_MAJOR < 53
/**
* XVideo Motion Acceleration
* - encoding: forbidden
* - decoding: set by decoder
*/
int xvmc_acceleration;
+#endif
/**
* macroblock decision mode
@@ -2306,6 +2321,13 @@
* - decoding: unused.
*/
float rc_min_vbv_overflow_use;
+
+ /**
+ * Set on the used HW acceleration
+ * - encoding: unused.
+ * - decoding: Set by libavcodec
+ */
+ enum HW_Acceleration hw_acceleration;
} AVCodecContext;
/**
More information about the ffmpeg-devel
mailing list