[FFmpeg-devel] [PATCH] lavc/webp: Select vp8 decoder when compiling webp

James Almer jamrial at gmail.com
Sat Mar 30 08:23:43 CET 2013


Fixes compilation with --disable-everything --enable-decoder=webp

Signed-off-by: James Almer <jamrial at gmail.com>
---
 configure           |  1 +
 libavcodec/Makefile |  1 -
 libavcodec/vp8.c    | 22 ++++++++++++----------
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index 8dc2500..ccf8a79 100755
--- a/configure
+++ b/configure
@@ -1833,6 +1833,7 @@ vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp"
 vp6a_decoder_select="vp6_decoder"
 vp6f_decoder_select="vp6_decoder"
 vp8_decoder_select="h264pred videodsp"
+webp_decoder_select="vp8_decoder"
 wmapro_decoder_select="mdct sinewin"
 wmav1_decoder_select="mdct sinewin"
 wmav1_encoder_select="mdct sinewin"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index fcb006a..094598d 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -460,7 +460,6 @@ OBJS-$(CONFIG_VP8_DECODER)             += vp8.o vp8dsp.o vp56rac.o
 OBJS-$(CONFIG_VPLAYER_DECODER)         += textdec.o ass.o
 OBJS-$(CONFIG_VQA_DECODER)             += vqavideo.o
 OBJS-$(CONFIG_WAVPACK_DECODER)         += wavpack.o
-OBJS-$(CONFIG_WEBP_DECODER)            += vp8.o vp8dsp.o vp56rac.o
 OBJS-$(CONFIG_WEBVTT_DECODER)          += webvttdec.o
 OBJS-$(CONFIG_WMALOSSLESS_DECODER)     += wmalosslessdec.o wma_common.o
 OBJS-$(CONFIG_WMAPRO_DECODER)          += wmaprodec.o wma.o wma_common.o
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 553e5c8..44a54d1 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2100,6 +2100,7 @@ static int vp8_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo
 
 static unsigned apply_padding(unsigned size) { return size + (size & 1); }
 
+#if CONFIG_WEBP_DECODER
 static int webp_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
                              AVPacket *avpkt)
 {
@@ -2144,32 +2145,33 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     return vp8_decode_frame(avctx, data, data_size, &pkt);
 }
 
-AVCodec ff_vp8_decoder = {
-    .name                  = "vp8",
+AVCodec ff_webp_decoder = {
+    .name                  = "webp",
     .type                  = AVMEDIA_TYPE_VIDEO,
-    .id                    = AV_CODEC_ID_VP8,
+    .id                    = AV_CODEC_ID_WEBP,
     .priv_data_size        = sizeof(VP8Context),
     .init                  = vp8_decode_init,
     .close                 = vp8_decode_free,
-    .decode                = vp8_decode_frame,
+    .decode                = webp_decode_frame,
     .capabilities          = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
     .flush                 = vp8_decode_flush,
-    .long_name             = NULL_IF_CONFIG_SMALL("On2 VP8"),
+    .long_name             = NULL_IF_CONFIG_SMALL("WebP"),
     .init_thread_copy      = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy),
     .update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context),
 };
+#endif
 
-AVCodec ff_webp_decoder = {
-    .name                  = "webp",
+AVCodec ff_vp8_decoder = {
+    .name                  = "vp8",
     .type                  = AVMEDIA_TYPE_VIDEO,
-    .id                    = AV_CODEC_ID_WEBP,
+    .id                    = AV_CODEC_ID_VP8,
     .priv_data_size        = sizeof(VP8Context),
     .init                  = vp8_decode_init,
     .close                 = vp8_decode_free,
-    .decode                = webp_decode_frame,
+    .decode                = vp8_decode_frame,
     .capabilities          = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS,
     .flush                 = vp8_decode_flush,
-    .long_name             = NULL_IF_CONFIG_SMALL("WebP"),
+    .long_name             = NULL_IF_CONFIG_SMALL("On2 VP8"),
     .init_thread_copy      = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy),
     .update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_context),
 };
-- 
1.8.1.5



More information about the ffmpeg-devel mailing list