Make sure WebRTC works without libvpx VP9 support.

Wires up existing libvpx_build_vp9==0 GYP flag into WebRTC and makes VP9
optional. Change is GYP only for now since libvpx's GN files build VP9
unconditionally.

BUG=webrtc:5884
R=kjellander@webrtc.org

Review URL: https://codereview.webrtc.org/1970343002 .

Cr-Commit-Position: refs/heads/master@{#12741}
This commit is contained in:
Peter Boström
2016-05-14 02:03:18 +02:00
parent dae07bae82
commit 1299615838
14 changed files with 110 additions and 9 deletions

View File

@ -626,6 +626,7 @@ TEST_F(VideoProcessorIntegrationTest, Process0PercentPacketLossH264) {
// Fails on iOS. See webrtc:4755.
#if !defined(WEBRTC_IOS)
#if !defined(RTC_DISABLE_VP9)
// VP9: Run with no packet loss and fixed bitrate. Quality should be very high.
// One key frame (first frame only) in sequence. Setting |key_frame_interval|
// to -1 below means no periodic key frames in test.
@ -780,6 +781,8 @@ TEST_F(VideoProcessorIntegrationTest, ProcessNoLossSpatialResizeFrameDropVP9) {
// TODO(marpan): Add temporal layer test for VP9, once changes are in
// vp9 wrapper for this.
#endif // !defined(RTC_DISABLE_VP9)
// VP8: Run with no packet loss and fixed bitrate. Quality should be very high.
// One key frame (first frame only) in sequence. Setting |key_frame_interval|
// to -1 below means no periodic key frames in test.

View File

@ -18,6 +18,7 @@ namespace webrtc {
class VP9Encoder : public VideoEncoder {
public:
static bool IsSupported();
static VP9Encoder* Create();
virtual ~VP9Encoder() {}
@ -25,6 +26,7 @@ class VP9Encoder : public VideoEncoder {
class VP9Decoder : public VideoDecoder {
public:
static bool IsSupported();
static VP9Decoder* Create();
virtual ~VP9Decoder() {}

View File

@ -20,6 +20,21 @@
'<(libvpx_dir)/libvpx.gyp:libvpx',
],
}],
['libvpx_build_vp9==1', {
'sources': [
'screenshare_layers.cc',
'screenshare_layers.h',
'vp9_frame_buffer_pool.cc',
'vp9_frame_buffer_pool.h',
'vp9_impl.cc',
'vp9_impl.h',
],
}, {
'sources': [
'vp9_noop.cc',
],
}
],
],
'dependencies': [
'<(webrtc_root)/common_video/common_video.gyp:common_video',
@ -28,12 +43,6 @@
],
'sources': [
'include/vp9.h',
'screenshare_layers.cc',
'screenshare_layers.h',
'vp9_frame_buffer_pool.cc',
'vp9_frame_buffer_pool.h',
'vp9_impl.cc',
'vp9_impl.h',
],
},
],

View File

@ -47,6 +47,10 @@ int GetCpuSpeed(int width, int height) {
#endif
}
bool VP9Encoder::IsSupported() {
return true;
}
VP9Encoder* VP9Encoder::Create() {
return new VP9EncoderImpl();
}
@ -823,6 +827,10 @@ const char* VP9EncoderImpl::ImplementationName() const {
return "libvpx";
}
bool VP9Decoder::IsSupported() {
return true;
}
VP9Decoder* VP9Decoder::Create() {
return new VP9DecoderImpl();
}

View File

@ -0,0 +1,39 @@
/*
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*
*/
#if !defined(RTC_DISABLE_VP9)
#error
#endif // !defined(RTC_DISABLE_VP9)
#include "webrtc/base/checks.h"
#include "webrtc/modules/video_coding/codecs/vp9/include/vp9.h"
namespace webrtc {
bool VP9Encoder::IsSupported() {
return false;
}
VP9Encoder* VP9Encoder::Create() {
RTC_NOTREACHED();
return nullptr;
}
bool VP9Decoder::IsSupported() {
return false;
}
VP9Decoder* VP9Decoder::Create() {
RTC_NOTREACHED();
return nullptr;
}
} // namespace webrtc