Commit a14f0154 authored by hclam's avatar hclam Committed by Commit bot

Don't use libvpx if it is disabled in GN build

This change excludes libvpx from linking if it is disabled. This is
needed to enable linking Chrome with GN, since libvpx is not building
with GN yet.

Review URL: https://codereview.chromium.org/501153003

Cr-Commit-Position: refs/heads/master@{#292457}
parent 7ddf94b2
......@@ -108,8 +108,7 @@ source_set("net") {
source_set("sender") {
sources = [
"cast_sender.h",
# TODO(hclam): libvpx support.
# "cast_sender_impl.cc",
"cast_sender_impl.cc",
"cast_sender_impl.h",
"sender/audio_encoder.h",
"sender/audio_encoder.cc",
......@@ -126,12 +125,11 @@ source_set("sender") {
"sender/rtp_timestamp_helper.cc",
"sender/rtp_timestamp_helper.h",
"sender/software_video_encoder.h",
# TODO(hclam): libvpx support.
# "sender/video_encoder.h",
# "sender/video_encoder_impl.h",
# "sender/video_encoder_impl.cc",
# "sender/video_sender.h",
# "sender/video_sender.cc",
"sender/video_encoder.h",
"sender/video_encoder_impl.h",
"sender/video_encoder_impl.cc",
"sender/video_sender.h",
"sender/video_sender.cc",
# "sender/vp8_encoder.cc",
# "sender/vp8_encoder.h",
]
......
......@@ -12,13 +12,16 @@
#include "media/base/video_frame.h"
#include "media/cast/cast_defines.h"
#include "media/cast/sender/fake_software_video_encoder.h"
#if !defined(MEDIA_DISABLE_LIBVPX)
#include "media/cast/sender/vp8_encoder.h"
#endif // !defined(MEDIA_DISABLE_LIBVPX)
namespace media {
namespace cast {
namespace {
#if !defined(MEDIA_DISABLE_LIBVPX)
typedef base::Callback<void(Vp8Encoder*)> PassEncoderCallback;
void InitializeEncoderOnEncoderThread(
......@@ -27,6 +30,7 @@ void InitializeEncoderOnEncoderThread(
DCHECK(environment->CurrentlyOn(CastEnvironment::VIDEO));
encoder->Initialize();
}
#endif // !defined(MEDIA_DISABLE_LIBVPX)
void EncodeVideoFrameOnEncoderThread(
scoped_refptr<CastEnvironment> environment,
......@@ -70,12 +74,14 @@ VideoEncoderImpl::VideoEncoderImpl(
int max_unacked_frames)
: cast_environment_(cast_environment) {
if (video_config.codec == CODEC_VIDEO_VP8) {
#if !defined(MEDIA_DISABLE_LIBVPX)
encoder_.reset(new Vp8Encoder(video_config, max_unacked_frames));
cast_environment_->PostTask(CastEnvironment::VIDEO,
FROM_HERE,
base::Bind(&InitializeEncoderOnEncoderThread,
cast_environment,
encoder_.get()));
#endif // !defined(MEDIA_DISABLE_LIBVPX)
#ifndef OFFICIAL_BUILD
} else if (video_config.codec == CODEC_VIDEO_FAKE) {
encoder_.reset(new FakeSoftwareVideoEncoder(video_config));
......
......@@ -16,7 +16,9 @@
#include "remoting/client/frame_consumer.h"
#include "remoting/codec/video_decoder.h"
#include "remoting/codec/video_decoder_verbatim.h"
#if !defined(MEDIA_DISABLE_LIBVPX)
#include "remoting/codec/video_decoder_vpx.h"
#endif // !defined(MEDIA_DISABLE_LIBVPX)
#include "remoting/protocol/session_config.h"
#include "third_party/libyuv/include/libyuv/convert_argb.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
......@@ -147,11 +149,13 @@ void SoftwareVideoRenderer::Core::Initialize(const SessionConfig& config) {
ChannelConfig::Codec codec = config.video_config().codec;
if (codec == ChannelConfig::CODEC_VERBATIM) {
decoder_.reset(new VideoDecoderVerbatim());
#if !defined(MEDIA_DISABLE_LIBVPX)
} else if (codec == ChannelConfig::CODEC_VP8) {
decoder_ = VideoDecoderVpx::CreateForVP8();
} else if (codec == ChannelConfig::CODEC_VP9) {
decoder_ = VideoDecoderVpx::CreateForVP9();
} else {
#endif // !defined(MEDIA_DISABLE_LIBVPX)
NOTREACHED() << "Invalid Encoding found: " << codec;
}
......
......@@ -192,10 +192,12 @@ scoped_ptr<CandidateSessionConfig> CandidateSessionConfig::CreateDefault() {
ChannelConfig::CODEC_UNDEFINED));
// Video channel.
#if !defined(MEDIA_DISABLE_LIBVPX)
result->mutable_video_configs()->push_back(
ChannelConfig(ChannelConfig::TRANSPORT_STREAM,
kDefaultStreamVersion,
ChannelConfig::CODEC_VP8));
#endif // !defined(MEDIA_DISABLE_LIBVPX)
// Audio channel.
result->mutable_audio_configs()->push_back(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment