From 6724cf8183f30408a483639db4c622456b94f656 Mon Sep 17 00:00:00 2001 From: "mikhal@webrtc.org" Date: Wed, 24 Aug 2011 00:51:36 +0000 Subject: [PATCH] VP8: Adding a flag to indicate the libvpx version. When in Cayuga, additional API's will be used. Review URL: http://webrtc-codereview.appspot.com/120006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@433 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/video_coding/codecs/vp8/main/source/vp8.cc | 9 +++++++-- src/modules/video_coding/codecs/vp8/main/source/vp8.gyp | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/modules/video_coding/codecs/vp8/main/source/vp8.cc b/src/modules/video_coding/codecs/vp8/main/source/vp8.cc index d9ad5c1e9..92e5c7285 100644 --- a/src/modules/video_coding/codecs/vp8/main/source/vp8.cc +++ b/src/modules/video_coding/codecs/vp8/main/source/vp8.cc @@ -67,7 +67,7 @@ VP8Encoder::~VP8Encoder() WebRtc_Word32 VP8Encoder::VersionStatic(WebRtc_Word8* version, WebRtc_Word32 length) { - const WebRtc_Word8* str = "WebM/VP8 version 1.0.0\n"; // Bali + const WebRtc_Word8* str = "WebM/VP8 version 1.0.0\n"; WebRtc_Word32 verLen = (WebRtc_Word32)strlen(str); if (verLen > length) { @@ -345,8 +345,10 @@ VP8Encoder::InitAndSetControlSettings() } vpx_codec_control(_encoder, VP8E_SET_STATIC_THRESHOLD, 800); vpx_codec_control(_encoder, VP8E_SET_CPUUSED, _cpuSpeed); +#if WEBRTC_LIBVPX_VERSION >= 971 vpx_codec_control(_encoder, VP8E_SET_MAX_INTRA_BITRATE_PCT, _rcMaxIntraTarget); +#endif *_cfg = cfg_copy; _inited = true; @@ -656,7 +658,10 @@ VP8Decoder::InitDecode(const VideoCodec* inst, cfg.threads = numberOfCores; cfg.h = cfg.w = 0; // set after decode - vpx_codec_flags_t flags = VPX_CODEC_USE_ERROR_CONCEALMENT; + vpx_codec_flags_t flags = 0; +#if WEBRTC_LIBVPX_VERSION >= 971 + flags = VPX_CODEC_USE_ERROR_CONCEALMENT; +#endif if (vpx_codec_dec_init(_decoder, vpx_codec_vp8_dx(), NULL, flags)) { diff --git a/src/modules/video_coding/codecs/vp8/main/source/vp8.gyp b/src/modules/video_coding/codecs/vp8/main/source/vp8.gyp index 4f7aeb8f4..083845e02 100644 --- a/src/modules/video_coding/codecs/vp8/main/source/vp8.gyp +++ b/src/modules/video_coding/codecs/vp8/main/source/vp8.gyp @@ -47,6 +47,9 @@ ], }], ], + 'defines': [ + 'WEBRTC_LIBVPX_VERSION=960' # Bali + ], },{ 'dependencies': [ '../../../../../../../third_party/libvpx/libvpx.gyp:libvpx', @@ -54,6 +57,9 @@ 'include_dirs': [ '../../../../../../../third_party/libvpx/source/libvpx', ], + 'defines': [ + 'WEBRTC_LIBVPX_VERSION=971' # Cayuga + ], }], ], 'direct_dependent_settings': {