summaryrefslogtreecommitdiff
path: root/libavcodec/libvpxdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-15 14:57:57 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-15 14:57:57 +0100
commit353dbaa29714c9fb7d4b3ccc7e1b50569b0ea257 (patch)
treee0e67a898b5e6ce2ba9d641473960beb109995ff /libavcodec/libvpxdec.c
parent8686b6c68bacfdd9ffa89736756192188973ad5d (diff)
parent3f111804eb5c603a344706b84b7164cbf7b4e0df (diff)
Merge commit '3f111804eb5c603a344706b84b7164cbf7b4e0df'
* commit '3f111804eb5c603a344706b84b7164cbf7b4e0df': libvpx: make vp8 and vp9 selectable libvpx: support vp9 nut: support vp9 tag mkv: support vp9 tag rtpdec: Make variables that should wrap unsigned Conflicts: configure libavcodec/Makefile libavcodec/allcodecs.c libavcodec/avcodec.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libvpxdec.c')
-rw-r--r--libavcodec/libvpxdec.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 809266a982..7e41e80646 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -35,10 +35,10 @@ typedef struct VP8DecoderContext {
struct vpx_codec_ctx decoder;
} VP8Context;
-static av_cold int vp8_init(AVCodecContext *avctx)
+static av_cold int vpx_init(AVCodecContext *avctx,
+ const struct vpx_codec_iface *iface)
{
VP8Context *ctx = avctx->priv_data;
- const struct vpx_codec_iface *iface = &vpx_codec_vp8_dx_algo;
struct vpx_codec_dec_cfg deccfg = {
/* token partitions+1 would be a decent choice */
.threads = FFMIN(avctx->thread_count, 16)
@@ -112,7 +112,13 @@ static av_cold int vp8_free(AVCodecContext *avctx)
return 0;
}
-AVCodec ff_libvpx_decoder = {
+#if CONFIG_LIBVPX_VP8_DECODER
+static av_cold int vp8_init(AVCodecContext *avctx)
+{
+ return vpx_init(avctx, &vpx_codec_vp8_dx_algo);
+}
+
+AVCodec ff_libvpx_vp8_decoder = {
.name = "libvpx",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VP8,
@@ -123,3 +129,23 @@ AVCodec ff_libvpx_decoder = {
.capabilities = CODEC_CAP_AUTO_THREADS,
.long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),
};
+#endif /* CONFIG_LIBVPX_VP8_DECODER */
+
+#if CONFIG_LIBVPX_VP9_DECODER
+static av_cold int vp9_init(AVCodecContext *avctx)
+{
+ return vpx_init(avctx, &vpx_codec_vp9_dx_algo);
+}
+
+AVCodec ff_libvpx_vp9_decoder = {
+ .name = "libvpx-vp9",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_VP9,
+ .priv_data_size = sizeof(VP8Context),
+ .init = vp9_init,
+ .close = vp8_free,
+ .decode = vp8_decode,
+ .capabilities = CODEC_CAP_AUTO_THREADS | CODEC_CAP_EXPERIMENTAL,
+ .long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"),
+};
+#endif /* CONFIG_LIBVPX_VP9_DECODER */