Commit 82630b11 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Onion soup content/renderer/media/webrtc/rtc_video_decoder_factory.cc|h

This is phase 2.2 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: I643f8ca0d6b81d3c26c9f7973b4d6b0a15dfde71
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1778665Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#692352}
parent 5e296e11
...@@ -218,8 +218,6 @@ target(link_target_type, "renderer") { ...@@ -218,8 +218,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_decoder_factory.cc",
"media/webrtc/rtc_video_decoder_factory.h",
"media/webrtc/rtc_video_encoder_factory.cc", "media/webrtc/rtc_video_encoder_factory.cc",
"media/webrtc/rtc_video_encoder_factory.h", "media/webrtc/rtc_video_encoder_factory.h",
"media/webrtc/stun_field_trial.cc", "media/webrtc/stun_field_trial.cc",
...@@ -501,7 +499,6 @@ target(link_target_type, "renderer") { ...@@ -501,7 +499,6 @@ target(link_target_type, "renderer") {
"//third_party/webrtc/modules/audio_processing:api", "//third_party/webrtc/modules/audio_processing:api",
"//third_party/webrtc/modules/audio_processing:audio_processing_statistics", "//third_party/webrtc/modules/audio_processing:audio_processing_statistics",
"//third_party/webrtc/modules/audio_processing/aec_dump", "//third_party/webrtc/modules/audio_processing/aec_dump",
"//third_party/webrtc/modules/video_coding:video_codec_interface",
"//third_party/webrtc/modules/video_coding:webrtc_h264", "//third_party/webrtc/modules/video_coding:webrtc_h264",
"//third_party/webrtc/p2p:libstunprober", "//third_party/webrtc/p2p:libstunprober",
"//third_party/webrtc/p2p:rtc_p2p", "//third_party/webrtc/p2p:rtc_p2p",
......
...@@ -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_decoder_factory.h"
#include "content/renderer/media/webrtc/rtc_video_encoder_factory.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/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"
...@@ -199,7 +199,7 @@ std::unique_ptr<webrtc::VideoDecoderFactory> CreateWebrtcVideoDecoderFactory( ...@@ -199,7 +199,7 @@ std::unique_ptr<webrtc::VideoDecoderFactory> CreateWebrtcVideoDecoderFactory(
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::kDisableWebRtcHWDecoding)) { !cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) {
decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); decoder_factory.reset(new blink::RTCVideoDecoderFactory(gpu_factories));
} }
return std::make_unique<DecoderAdapter>(std::move(decoder_factory)); return std::make_unique<DecoderAdapter>(std::move(decoder_factory));
......
...@@ -158,6 +158,7 @@ source_set("blink_headers") { ...@@ -158,6 +158,7 @@ source_set("blink_headers") {
"platform/modules/mediastream/webrtc_uma_histograms.h", "platform/modules/mediastream/webrtc_uma_histograms.h",
"platform/modules/peerconnection/audio_codec_factory.h", "platform/modules/peerconnection/audio_codec_factory.h",
"platform/modules/peerconnection/rtc_event_log_output_sink.h", "platform/modules/peerconnection/rtc_event_log_output_sink.h",
"platform/modules/peerconnection/rtc_video_decoder_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/web_rtc_video_frame_adapter_factory.h", "platform/modules/peerconnection/web_rtc_video_frame_adapter_factory.h",
...@@ -562,6 +563,7 @@ source_set("blink_headers") { ...@@ -562,6 +563,7 @@ source_set("blink_headers") {
"//third_party/webrtc/media:rtc_media_base", "//third_party/webrtc/media:rtc_media_base",
"//third_party/webrtc/modules/audio_device:audio_device_api", "//third_party/webrtc/modules/audio_device:audio_device_api",
"//third_party/webrtc/modules/audio_processing:api", "//third_party/webrtc/modules/audio_processing:api",
"//third_party/webrtc/modules/video_coding:video_codec_interface",
"//third_party/webrtc/pc:peerconnection", "//third_party/webrtc/pc:peerconnection",
"//third_party/webrtc/rtc_base:rtc_base", "//third_party/webrtc/rtc_base:rtc_base",
"//third_party/webrtc/rtc_base:rtc_task_queue", "//third_party/webrtc/rtc_base:rtc_task_queue",
......
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
// 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_DECODER_FACTORY_H_ #ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_PEERCONNECTION_RTC_VIDEO_DECODER_FACTORY_H_
#define CONTENT_RENDERER_MEDIA_WEBRTC_RTC_VIDEO_DECODER_FACTORY_H_ #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_PEERCONNECTION_RTC_VIDEO_DECODER_FACTORY_H_
#include "base/macros.h" #include "base/macros.h"
#include "base/threading/thread.h" #include "third_party/blink/public/platform/web_common.h"
#include "content/common/content_export.h"
#include "third_party/webrtc/api/video_codecs/video_decoder_factory.h" #include "third_party/webrtc/api/video_codecs/video_decoder_factory.h"
#include "third_party/webrtc/modules/video_coding/include/video_codec_interface.h" #include "third_party/webrtc/modules/video_coding/include/video_codec_interface.h"
...@@ -19,10 +18,13 @@ namespace media { ...@@ -19,10 +18,13 @@ namespace media {
class GpuVideoAcceleratorFactories; class GpuVideoAcceleratorFactories;
} // namespace media } // namespace media
namespace content { namespace blink {
// TODO(wuchengli): add unittest. // TODO(wuchengli): add unittest.
class CONTENT_EXPORT RTCVideoDecoderFactory //
// TODO(crbug.com/787254): Move this class out of the Blink exposed API when its
// clients get Onion soup'ed. Also, switch away from using std::vector.
class BLINK_PLATFORM_EXPORT RTCVideoDecoderFactory
: public webrtc::VideoDecoderFactory { : public webrtc::VideoDecoderFactory {
public: public:
explicit RTCVideoDecoderFactory( explicit RTCVideoDecoderFactory(
...@@ -42,6 +44,6 @@ class CONTENT_EXPORT RTCVideoDecoderFactory ...@@ -42,6 +44,6 @@ class CONTENT_EXPORT RTCVideoDecoderFactory
DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoderFactory); DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoderFactory);
}; };
} // namespace content } // namespace blink
#endif // CONTENT_RENDERER_MEDIA_WEBRTC_RTC_VIDEO_DECODER_FACTORY_H_ #endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_PEERCONNECTION_RTC_VIDEO_DECODER_FACTORY_H_
...@@ -1240,6 +1240,7 @@ jumbo_component("platform") { ...@@ -1240,6 +1240,7 @@ jumbo_component("platform") {
"peerconnection/rtc_stats_response_base.h", "peerconnection/rtc_stats_response_base.h",
"peerconnection/rtc_video_decoder_adapter.cc", "peerconnection/rtc_video_decoder_adapter.cc",
"peerconnection/rtc_video_decoder_adapter.h", "peerconnection/rtc_video_decoder_adapter.h",
"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_void_request.h", "peerconnection/rtc_void_request.h",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// 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_decoder_factory.h" #include "third_party/blink/public/platform/modules/peerconnection/rtc_video_decoder_factory.h"
#include <memory> #include <memory>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "media/video/gpu_video_accelerator_factories.h" #include "media/video/gpu_video_accelerator_factories.h"
#include "third_party/blink/public/platform/modules/peerconnection/web_rtc_video_frame_adapter_factory.h" #include "third_party/blink/public/platform/modules/peerconnection/web_rtc_video_frame_adapter_factory.h"
namespace content { namespace blink {
namespace { namespace {
// This extra indirection is needed so that we can delete the decoder on the // This extra indirection is needed so that we can delete the decoder on the
...@@ -87,4 +87,4 @@ RTCVideoDecoderFactory::CreateVideoDecoder( ...@@ -87,4 +87,4 @@ RTCVideoDecoderFactory::CreateVideoDecoder(
: nullptr; : nullptr;
} }
} // 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