[MPlayer-dev-eng] [PATCH] add VP8/WebM support
James Zern
jzern at google.com
Tue May 25 19:15:15 CEST 2010
On Wed, May 19, 2010 at 16:46, Reimar Döffinger
<Reimar.Doeffinger at gmx.de> wrote:
> I am not the maintainer but the mkv change looks ok to me.
> The configure change should probably away review of the FFmpeg patch and
> then be modeled based on what came out of that discussion.
>
Updated to match vpx decoder name and libvpx include file location.
The demux_mkv changes are provided separately as well.
-------------- next part --------------
Index: libmpdemux/matroska.h
===================================================================
--- libmpdemux/matroska.h (revision 31217)
+++ libmpdemux/matroska.h (working copy)
@@ -69,6 +69,7 @@
#define MKV_V_MPEG4_AP "V_MPEG4/ISO/AP"
#define MKV_V_MPEG4_AVC "V_MPEG4/ISO/AVC"
#define MKV_V_THEORA "V_THEORA"
+#define MKV_V_VP8 "V_VP8"
#define MKV_S_TEXTASCII "S_TEXT/ASCII"
#define MKV_S_TEXTUTF8 "S_TEXT/UTF8"
Index: libmpdemux/demux_mkv.c
===================================================================
--- libmpdemux/demux_mkv.c (revision 31217)
+++ libmpdemux/demux_mkv.c (working copy)
@@ -1519,6 +1519,7 @@ static const videocodec_info_t vinfo[] =
{ MKV_V_MPEG4_AP, mmioFOURCC('m', 'p', '4', 'v'), 1 },
{ MKV_V_MPEG4_AVC, mmioFOURCC('a', 'v', 'c', '1'), 1 },
{ MKV_V_THEORA, mmioFOURCC('t', 'h', 'e', 'o'), 1 },
+ { MKV_V_VP8, mmioFOURCC('V', 'P', '8', '0'), 0 },
{ NULL, 0, 0 }
};
@@ -2053,7 +2054,7 @@ demux_mkv_open (demuxer_t *demuxer)
stream_seek(s, s->start_pos);
str = ebml_read_header (s, &version);
- if (str == NULL || strcmp (str, "matroska") || version > 2)
+ if (str == NULL || (strcmp (str, "matroska") && strcmp (str, "webm")) || version > 2)
{
mp_msg (MSGT_DEMUX, MSGL_DBG2, "[mkv] no head found\n");
return 0;
-------------- next part --------------
Index: etc/codecs.conf
===================================================================
--- etc/codecs.conf (revision 31217)
+++ etc/codecs.conf (working copy)
@@ -2173,6 +2173,14 @@ videocodec vp7
out YUY2
out BGR32,BGR24
+videocodec fflibvpx
+ info "FFmpeg wrapper for libvpx/VP8"
+ status working
+ fourcc VP80
+ driver ffmpeg
+ dll "libvpx"
+ out YV12
+
videocodec mwv1
info "Motion Wavelets"
status working
Index: configure
===================================================================
--- configure (revision 31217)
+++ configure (working copy)
@@ -299,6 +299,7 @@ Codecs:
--disable-libdirac-lavc disable Dirac in libavcodec [autodetect]
--disable-libschroedinger-lavc disable Dirac in libavcodec (Schroedinger
decoder) [autodetect]
+ --disable-libvpx-lavc disable libvpx in libavcodec [autodetect]
--disable-libnut disable libnut [autodetect]
--disable-libavutil_a disable static libavutil [autodetect]
--disable-libavcodec_a disable static libavcodec [autodetect]
@@ -693,6 +694,7 @@ _x264=auto
_x264_lavc=auto
_libdirac_lavc=auto
_libschroedinger_lavc=auto
+_libvpx_lavc=auto
_libnut=auto
_lirc=auto
_lircc=auto
@@ -1137,6 +1139,8 @@ for ac_option do
--disable-libdirac-lavc) _libdirac_lavc=no ;;
--enable-libschroedinger-lavc) _libschroedinger_lavc=yes ;;
--disable-libschroedinger-lavc) _libschroedinger_lavc=no ;;
+ --enable-libvpx-lavc) _libvpx_lavc=yes ;;
+ --disable-libvpx-lavc) _libvpx_lavc=no ;;
--enable-libnut) _libnut=yes ;;
--disable-libnut) _libnut=no ;;
--enable-libavutil_a) _libavutil_a=yes ;;
@@ -7596,6 +7600,39 @@ else
fi
echores "$_libschroedinger_lavc"
+echocheck "libvpx"
+if test "$_libvpx_lavc" = auto; then
+ _libvpx_lavc=no
+ if test "$_libavcodec_a" != yes; then
+ res_comment="libavcodec (static) is required by libvpx, sorry"
+ else
+ cat > $TMPC << EOF
+#include <vpx/vpx_decoder.h>
+#include <vpx/vp8dx.h>
+int main(void)
+{
+ vpx_codec_dec_init(NULL,&vpx_codec_vp8_dx_algo,NULL,0);
+ return 0;
+}
+EOF
+ _inc_vpx=
+ _ld_vpx=-lvpx
+ cc_check $_inc_vpx $_ld_vpx &&
+ _libvpx_lavc=yes &&
+ extra_cflags="$extra_cflags $_inc_vpx" &&
+ extra_ldflags="$extra_ldflags $_ld_vpx"
+ fi
+fi
+if test "$_libvpx_lavc" = yes ; then
+ def_libvpx_lavc='#define CONFIG_LIBVPX 1'
+ _libavdecoders="$_libavdecoders LIBVPX_DECODER"
+ codecmodules="libvpx $codecmodules"
+else
+ def_libvpx_lavc='#define CONFIG_LIBVPX 0'
+ nocodecmodules="libvpx $nocodecmodules"
+fi
+echores "$_libvpx_lavc"
+
echocheck "libnut"
if test "$_libnut" = auto ; then
cat > $TMPC << EOF
More information about the MPlayer-dev-eng
mailing list