Commit de4d8e57 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Reland "Onion soup content/renderer/media/webrtc/rtc_video_encoder_factory.cc|h"

This is a reland of 19c2d0e4

This CL has no changes compared to the original one. The error was on CL
https://crrev.com/c/1778671 (already relanded in https://crrev.com/c/1782514).

Original change's description:
> Onion soup content/renderer/media/webrtc/rtc_video_encoder_factory.cc|h
>
> This is phase 2.3 on the design document [1].
>
> [1] https://docs.google.com/document/d/1AJKVA5U4nDkyDB9p4ROrggWXadCxyy-grKaE9KS5vOU/
>
> BUG=787254
> R=guidou@chromium.org, haraken@chromium.org
>
> Change-Id: I32628d84aaba9eba9bde7c9484f8984517b9abf4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1778673
> Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Guido Urdaneta <guidou@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#692762}

TBR=guidou@chromium.org

Bug: 787254
Change-Id: Ia59c58a57dc84322408f64181057819adf4bdad6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1783208Reviewed-by: default avatarAntonio Gomes <tonikitoo@igalia.com>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#692963}
parent 375896a8
...@@ -216,8 +216,6 @@ target(link_target_type, "renderer") { ...@@ -216,8 +216,6 @@ target(link_target_type, "renderer") {
"media/webrtc/rtc_rtp_sender.h", "media/webrtc/rtc_rtp_sender.h",
"media/webrtc/rtc_rtp_transceiver.cc", "media/webrtc/rtc_rtp_transceiver.cc",
"media/webrtc/rtc_rtp_transceiver.h", "media/webrtc/rtc_rtp_transceiver.h",
"media/webrtc/rtc_video_encoder_factory.cc",
"media/webrtc/rtc_video_encoder_factory.h",
"media/webrtc/stun_field_trial.cc", "media/webrtc/stun_field_trial.cc",
"media/webrtc/stun_field_trial.h", "media/webrtc/stun_field_trial.h",
"media/webrtc/transceiver_state_surfacer.cc", "media/webrtc/transceiver_state_surfacer.cc",
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/renderer/media/webrtc/rtc_video_encoder_factory.h"
#include "media/base/media_switches.h" #include "media/base/media_switches.h"
#include "third_party/blink/public/platform/modules/peerconnection/rtc_video_decoder_factory.h" #include "third_party/blink/public/platform/modules/peerconnection/rtc_video_decoder_factory.h"
#include "third_party/blink/public/platform/modules/peerconnection/rtc_video_encoder_factory.h"
#include "third_party/webrtc/api/video_codecs/video_decoder_software_fallback_wrapper.h" #include "third_party/webrtc/api/video_codecs/video_decoder_software_fallback_wrapper.h"
#include "third_party/webrtc/api/video_codecs/video_encoder_software_fallback_wrapper.h" #include "third_party/webrtc/api/video_codecs/video_encoder_software_fallback_wrapper.h"
#include "third_party/webrtc/media/base/codec.h" #include "third_party/webrtc/media/base/codec.h"
...@@ -181,7 +181,7 @@ std::unique_ptr<webrtc::VideoEncoderFactory> CreateWebrtcVideoEncoderFactory( ...@@ -181,7 +181,7 @@ std::unique_ptr<webrtc::VideoEncoderFactory> CreateWebrtcVideoEncoderFactory(
const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled() && if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled() &&
!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { !cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) {
encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); encoder_factory.reset(new blink::RTCVideoEncoderFactory(gpu_factories));
} }
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
......
...@@ -160,6 +160,7 @@ source_set("blink_headers") { ...@@ -160,6 +160,7 @@ source_set("blink_headers") {
"platform/modules/peerconnection/rtc_event_log_output_sink.h", "platform/modules/peerconnection/rtc_event_log_output_sink.h",
"platform/modules/peerconnection/rtc_event_log_output_sink_proxy_util.h", "platform/modules/peerconnection/rtc_event_log_output_sink_proxy_util.h",
"platform/modules/peerconnection/rtc_video_decoder_factory.h", "platform/modules/peerconnection/rtc_video_decoder_factory.h",
"platform/modules/peerconnection/rtc_video_encoder_factory.h",
"platform/modules/peerconnection/two_keys_adapter_map.h", "platform/modules/peerconnection/two_keys_adapter_map.h",
"platform/modules/peerconnection/web_rtc_video_encoder_factory.h", "platform/modules/peerconnection/web_rtc_video_encoder_factory.h",
"platform/modules/peerconnection/webrtc_audio_sink.h", "platform/modules/peerconnection/webrtc_audio_sink.h",
......
...@@ -2,27 +2,29 @@ ...@@ -2,27 +2,29 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_RENDERER_MEDIA_WEBRTC_RTC_VIDEO_ENCODER_FACTORY_H_ #ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_PEERCONNECTION_RTC_VIDEO_ENCODER_FACTORY_H_
#define CONTENT_RENDERER_MEDIA_WEBRTC_RTC_VIDEO_ENCODER_FACTORY_H_ #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_PEERCONNECTION_RTC_VIDEO_ENCODER_FACTORY_H_
#include <vector> #include <vector>
#include "base/compiler_specific.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "content/common/content_export.h"
#include "media/base/video_codecs.h" #include "media/base/video_codecs.h"
#include "third_party/blink/public/platform/web_common.h"
#include "third_party/webrtc/api/video_codecs/video_encoder_factory.h" #include "third_party/webrtc/api/video_codecs/video_encoder_factory.h"
namespace media { namespace media {
class GpuVideoAcceleratorFactories; class GpuVideoAcceleratorFactories;
} // namespace media } // namespace media
namespace content { namespace blink {
// This class creates RTCVideoEncoder instances (each wrapping a // This class creates RTCVideoEncoder instances (each wrapping a
// media::VideoEncodeAccelerator) on behalf of the WebRTC stack. // media::VideoEncodeAccelerator) on behalf of the WebRTC stack.
class CONTENT_EXPORT RTCVideoEncoderFactory //
// TODO(crbug.com/787254): Move this class out of the Blink exposed API
// when all users of it have been Onion souped.
class BLINK_PLATFORM_EXPORT RTCVideoEncoderFactory
: public webrtc::VideoEncoderFactory { : public webrtc::VideoEncoderFactory {
public: public:
explicit RTCVideoEncoderFactory( explicit RTCVideoEncoderFactory(
...@@ -48,6 +50,6 @@ class CONTENT_EXPORT RTCVideoEncoderFactory ...@@ -48,6 +50,6 @@ class CONTENT_EXPORT RTCVideoEncoderFactory
DISALLOW_COPY_AND_ASSIGN(RTCVideoEncoderFactory); DISALLOW_COPY_AND_ASSIGN(RTCVideoEncoderFactory);
}; };
} // namespace content } // namespace blink
#endif // CONTENT_RENDERER_MEDIA_WEBRTC_RTC_VIDEO_ENCODER_FACTORY_H_ #endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_PEERCONNECTION_RTC_VIDEO_ENCODER_FACTORY_H_
...@@ -1241,6 +1241,7 @@ jumbo_component("platform") { ...@@ -1241,6 +1241,7 @@ jumbo_component("platform") {
"peerconnection/rtc_video_decoder_factory.cc", "peerconnection/rtc_video_decoder_factory.cc",
"peerconnection/rtc_video_encoder.cc", "peerconnection/rtc_video_encoder.cc",
"peerconnection/rtc_video_encoder.h", "peerconnection/rtc_video_encoder.h",
"peerconnection/rtc_video_encoder_factory.cc",
"peerconnection/rtc_void_request.h", "peerconnection/rtc_void_request.h",
"peerconnection/webrtc_audio_sink.cc", "peerconnection/webrtc_audio_sink.cc",
"peerconnection/webrtc_video_track_source.cc", "peerconnection/webrtc_video_track_source.cc",
......
...@@ -9,6 +9,7 @@ include_rules = [ ...@@ -9,6 +9,7 @@ include_rules = [
# Dependencies. # Dependencies.
"+base/threading/thread_restrictions.h", "+base/threading/thread_restrictions.h",
"+media/base", "+media/base",
"+media/media_buildflags.h",
"+media/video/gpu_video_accelerator_factories.h", "+media/video/gpu_video_accelerator_factories.h",
"+media/video/video_decode_accelerator.h", "+media/video/video_decode_accelerator.h",
"+media/video/h264_parser.h", "+media/video/h264_parser.h",
......
...@@ -2,14 +2,12 @@ ...@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "content/renderer/media/webrtc/rtc_video_encoder_factory.h" #include "third_party/blink/public/platform/modules/peerconnection/rtc_video_encoder_factory.h"
#include <memory> #include <memory>
#include "base/command_line.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "content/public/common/content_switches.h"
#include "media/media_buildflags.h" #include "media/media_buildflags.h"
#include "media/video/gpu_video_accelerator_factories.h" #include "media/video/gpu_video_accelerator_factories.h"
#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/features.h"
...@@ -19,7 +17,7 @@ ...@@ -19,7 +17,7 @@
#include "third_party/webrtc/common_video/h264/profile_level_id.h" #include "third_party/webrtc/common_video/h264/profile_level_id.h"
#include "third_party/webrtc/media/base/codec.h" #include "third_party/webrtc/media/base/codec.h"
namespace content { namespace blink {
namespace { namespace {
...@@ -146,4 +144,4 @@ RTCVideoEncoderFactory::QueryVideoEncoder( ...@@ -146,4 +144,4 @@ RTCVideoEncoderFactory::QueryVideoEncoder(
return info; return info;
} }
} // namespace content } // namespace blink
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