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

Onion soup content/renderer/media/web_media_element_source_utils.cc|h

This CL is a prepraration step to Onion souping webmediaplayer_ms.cc|h,
webmediaplayer_ms_compositor.cc|h.

It is part of phase 4.4, described in the design doc [1].

[1] https://docs.google.com/document/d/1rHJGi1U72qZsOGIctIf7GKRaY8d7BgtVW8MaMYumzYY/

BUG=704136
R=haraken@chromium.org, hiroshige@chromium.org

Change-Id: Ifa20c5e06feae9433a6c8438f845546088b025f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1692389
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Auto-Submit: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676305}
parent bb709ee6
...@@ -232,8 +232,6 @@ target(link_target_type, "renderer") { ...@@ -232,8 +232,6 @@ target(link_target_type, "renderer") {
"media/video_capture/video_capture_impl.h", "media/video_capture/video_capture_impl.h",
"media/video_capture/video_capture_impl_manager.cc", "media/video_capture/video_capture_impl_manager.cc",
"media/video_capture/video_capture_impl_manager.h", "media/video_capture/video_capture_impl_manager.h",
"media/web_media_element_source_utils.cc",
"media/web_media_element_source_utils.h",
"media/webrtc/audio_codec_factory.cc", "media/webrtc/audio_codec_factory.cc",
"media/webrtc/audio_codec_factory.h", "media/webrtc/audio_codec_factory.h",
"media/webrtc/media_stream_track_metrics.cc", "media/webrtc/media_stream_track_metrics.cc",
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "content/renderer/media/renderer_webmediaplayer_delegate.h" #include "content/renderer/media/renderer_webmediaplayer_delegate.h"
#include "content/renderer/media/stream/media_stream_renderer_factory_impl.h" #include "content/renderer/media/stream/media_stream_renderer_factory_impl.h"
#include "content/renderer/media/stream/webmediaplayer_ms.h" #include "content/renderer/media/stream/webmediaplayer_ms.h"
#include "content/renderer/media/web_media_element_source_utils.h"
#include "content/renderer/render_frame_impl.h" #include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_thread_impl.h" #include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_view_impl.h" #include "content/renderer/render_view_impl.h"
...@@ -45,6 +44,7 @@ ...@@ -45,6 +44,7 @@
#include "services/service_manager/public/cpp/connect.h" #include "services/service_manager/public/cpp/connect.h"
#include "services/service_manager/public/cpp/interface_provider.h" #include "services/service_manager/public/cpp/interface_provider.h"
#include "services/viz/public/cpp/gpu/context_provider_command_buffer.h" #include "services/viz/public/cpp/gpu/context_provider_command_buffer.h"
#include "third_party/blink/public/platform/modules/mediastream/web_media_element_source_utils.h"
#include "third_party/blink/public/platform/web_surface_layer_bridge.h" #include "third_party/blink/public/platform/web_surface_layer_bridge.h"
#include "third_party/blink/public/platform/web_video_frame_submitter.h" #include "third_party/blink/public/platform/web_video_frame_submitter.h"
#include "third_party/blink/public/web/blink.h" #include "third_party/blink/public/web/blink.h"
...@@ -270,7 +270,7 @@ blink::WebMediaPlayer* MediaFactory::CreateMediaPlayer( ...@@ -270,7 +270,7 @@ blink::WebMediaPlayer* MediaFactory::CreateMediaPlayer(
blink::WebSecurityOrigin security_origin = blink::WebSecurityOrigin security_origin =
render_frame_->GetWebFrame()->GetSecurityOrigin(); render_frame_->GetWebFrame()->GetSecurityOrigin();
blink::WebMediaStream web_stream = blink::WebMediaStream web_stream =
GetWebMediaStreamFromWebMediaPlayerSource(source); blink::GetWebMediaStreamFromWebMediaPlayerSource(source);
if (!web_stream.IsNull()) if (!web_stream.IsNull())
return CreateWebMediaPlayerForMediaStream( return CreateWebMediaPlayerForMediaStream(
client, sink_id, security_origin, web_frame, layer_tree_view, settings); client, sink_id, security_origin, web_frame, layer_tree_view, settings);
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "cc/layers/video_layer.h" #include "cc/layers/video_layer.h"
#include "content/child/child_process.h" #include "content/child/child_process.h"
#include "content/renderer/media/stream/webmediaplayer_ms_compositor.h" #include "content/renderer/media/stream/webmediaplayer_ms_compositor.h"
#include "content/renderer/media/web_media_element_source_utils.h"
#include "content/renderer/render_frame_impl.h" #include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_thread_impl.h" #include "content/renderer/render_thread_impl.h"
#include "media/base/bind_to_current_loop.h" #include "media/base/bind_to_current_loop.h"
...@@ -29,6 +28,7 @@ ...@@ -29,6 +28,7 @@
#include "media/video/gpu_memory_buffer_video_frame_pool.h" #include "media/video/gpu_memory_buffer_video_frame_pool.h"
#include "services/viz/public/cpp/gpu/context_provider_command_buffer.h" #include "services/viz/public/cpp/gpu/context_provider_command_buffer.h"
#include "third_party/blink/public/platform/modules/mediastream/media_stream_audio_track.h" #include "third_party/blink/public/platform/modules/mediastream/media_stream_audio_track.h"
#include "third_party/blink/public/platform/modules/mediastream/web_media_element_source_utils.h"
#include "third_party/blink/public/platform/modules/mediastream/web_media_stream_audio_renderer.h" #include "third_party/blink/public/platform/modules/mediastream/web_media_stream_audio_renderer.h"
#include "third_party/blink/public/platform/modules/mediastream/web_media_stream_renderer_factory.h" #include "third_party/blink/public/platform/modules/mediastream/web_media_stream_renderer_factory.h"
#include "third_party/blink/public/platform/modules/mediastream/web_media_stream_video_renderer.h" #include "third_party/blink/public/platform/modules/mediastream/web_media_stream_video_renderer.h"
...@@ -318,7 +318,7 @@ blink::WebMediaPlayer::LoadTiming WebMediaPlayerMS::Load( ...@@ -318,7 +318,7 @@ blink::WebMediaPlayer::LoadTiming WebMediaPlayerMS::Load(
// TODO(acolwell): Change this to DCHECK_EQ(load_type, LoadTypeMediaStream) // TODO(acolwell): Change this to DCHECK_EQ(load_type, LoadTypeMediaStream)
// once Blink-side changes land. // once Blink-side changes land.
DCHECK_NE(load_type, kLoadTypeMediaSource); DCHECK_NE(load_type, kLoadTypeMediaSource);
web_stream_ = GetWebMediaStreamFromWebMediaPlayerSource(source); web_stream_ = blink::GetWebMediaStreamFromWebMediaPlayerSource(source);
if (!web_stream_.IsNull()) if (!web_stream_.IsNull())
web_stream_.AddObserver(this); web_stream_.AddObserver(this);
......
...@@ -147,6 +147,7 @@ source_set("blink_headers") { ...@@ -147,6 +147,7 @@ source_set("blink_headers") {
"platform/modules/mediastream/media_stream_dispatcher_eventhandler.h", "platform/modules/mediastream/media_stream_dispatcher_eventhandler.h",
"platform/modules/mediastream/media_stream_types.h", "platform/modules/mediastream/media_stream_types.h",
"platform/modules/mediastream/secure_display_link_tracker.h", "platform/modules/mediastream/secure_display_link_tracker.h",
"platform/modules/mediastream/web_media_element_source_utils.h",
"platform/modules/mediastream/web_media_stream_audio_renderer.h", "platform/modules/mediastream/web_media_stream_audio_renderer.h",
"platform/modules/mediastream/web_media_stream_audio_sink.h", "platform/modules/mediastream/web_media_stream_audio_sink.h",
"platform/modules/mediastream/web_media_stream_renderer_factory.h", "platform/modules/mediastream/web_media_stream_renderer_factory.h",
......
...@@ -2,22 +2,22 @@ ...@@ -2,22 +2,22 @@
// 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_WEB_MEDIA_ELEMENT_SOURCE_UTILS_H_ #ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_MEDIASTREAM_WEB_MEDIA_ELEMENT_SOURCE_UTILS_H_
#define CONTENT_RENDERER_MEDIA_WEB_MEDIA_ELEMENT_SOURCE_UTILS_H_ #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_MEDIASTREAM_WEB_MEDIA_ELEMENT_SOURCE_UTILS_H_
#include "third_party/blink/public/platform/web_common.h"
namespace blink { namespace blink {
class WebMediaPlayerSource; class WebMediaPlayerSource;
class WebMediaStream; class WebMediaStream;
}
namespace content {
// Obtains a WebMediaStream from a WebMediaPlayerSource. If the // Obtains a WebMediaStream from a WebMediaPlayerSource. If the
// WebMediaPlayerSource does not contain a WebMediaStream, a null // WebMediaPlayerSource does not contain a WebMediaStream, a null
// WebMediaStream is returned. // WebMediaStream is returned.
blink::WebMediaStream GetWebMediaStreamFromWebMediaPlayerSource( BLINK_PLATFORM_EXPORT WebMediaStream
const blink::WebMediaPlayerSource& source); GetWebMediaStreamFromWebMediaPlayerSource(const WebMediaPlayerSource& source);
} // namespace content } // namespace blink
#endif // CONTENT_RENDERER_MEDIA_WEB_MEDIA_ELEMENT_SOURCE_UTILS_H_ #endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MODULES_MEDIASTREAM_WEB_MEDIA_ELEMENT_SOURCE_UTILS_H_
...@@ -471,6 +471,7 @@ jumbo_component("platform") { ...@@ -471,6 +471,7 @@ jumbo_component("platform") {
"exported/mediastream/media_stream_audio_processor_options.cc", "exported/mediastream/media_stream_audio_processor_options.cc",
"exported/mediastream/media_stream_audio_source.cc", "exported/mediastream/media_stream_audio_source.cc",
"exported/mediastream/media_stream_audio_track.cc", "exported/mediastream/media_stream_audio_track.cc",
"exported/mediastream/web_media_element_source_utils.cc",
"exported/mediastream/web_platform_media_stream_source.cc", "exported/mediastream/web_platform_media_stream_source.cc",
"exported/mediastream/web_platform_media_stream_track.cc", "exported/mediastream/web_platform_media_stream_track.cc",
"exported/mediastream/webaudio_media_stream_source.cc", "exported/mediastream/webaudio_media_stream_source.cc",
......
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
// 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/web_media_element_source_utils.h" #include "third_party/blink/public/platform/modules/mediastream/web_media_element_source_utils.h"
#include "third_party/blink/public/platform/web_media_player_source.h" #include "third_party/blink/public/platform/web_media_player_source.h"
#include "third_party/blink/public/platform/web_media_stream.h" #include "third_party/blink/public/platform/web_media_stream.h"
namespace content { namespace blink {
blink::WebMediaStream GetWebMediaStreamFromWebMediaPlayerSource( WebMediaStream GetWebMediaStreamFromWebMediaPlayerSource(
const blink::WebMediaPlayerSource& source) { const WebMediaPlayerSource& source) {
if (source.IsMediaStream()) if (source.IsMediaStream())
return source.GetAsMediaStream(); return source.GetAsMediaStream();
return blink::WebMediaStream(); return WebMediaStream();
} }
} // 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