Commit 1990f896 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Change MediaStreamAudioTrack to operate over MediaStreamComponent

.... instead of WebMediaStreamTrack.

This is part of the effort to reduce the needless use of
public Blink APIs (wrappers) within renderer/modules.

BUG=704136
R=guidou@chromium.org

Change-Id: I5a6e683283b9a57f642a09d0f06410d2fde95690
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2239973
Auto-Submit: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#777989}
parent 13678012
......@@ -12,6 +12,8 @@
#include "third_party/blink/public/platform/modules/mediastream/web_media_stream_audio_sink.h"
#include "third_party/blink/public/platform/modules/webrtc/webrtc_logging.h"
#include "third_party/blink/public/platform/web_media_stream_source.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_component.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_source.h"
namespace blink {
......@@ -38,12 +40,12 @@ MediaStreamAudioTrack::~MediaStreamAudioTrack() {
// static
MediaStreamAudioTrack* MediaStreamAudioTrack::From(
const WebMediaStreamTrack& track) {
if (track.IsNull() ||
track.Source().GetType() != WebMediaStreamSource::kTypeAudio) {
const MediaStreamComponent* component) {
if (!component ||
component->Source()->GetType() != MediaStreamSource::kTypeAudio) {
return nullptr;
}
return static_cast<MediaStreamAudioTrack*>(track.GetPlatformTrack());
return static_cast<MediaStreamAudioTrack*>(component->GetPlatformTrack());
}
void MediaStreamAudioTrack::AddSink(WebMediaStreamAudioSink* sink) {
......
......@@ -21,11 +21,12 @@ namespace blink {
class WebMediaStreamAudioSink;
class MediaStreamAudioSource;
class MediaStreamComponent;
// Provides the part of the audio pipeline delivering audio from a
// MediaStreamAudioSource to one or more WebMediaStreamAudioSinks. An instance
// of this class is owned by WebMediaStreamTrack, and clients should use
// From() to gain access to a MediaStreamAudioTrack.
// of this class is owned by MediaStreamComponent/WebMediaStreamTrack, and
// clients should use From() to gain access to a MediaStreamAudioTrack.
class PLATFORM_EXPORT MediaStreamAudioTrack
: public WebPlatformMediaStreamTrack {
public:
......@@ -35,7 +36,7 @@ class PLATFORM_EXPORT MediaStreamAudioTrack
// Returns the MediaStreamAudioTrack instance owned by the given blink |track|
// or null.
static MediaStreamAudioTrack* From(const WebMediaStreamTrack& track);
static MediaStreamAudioTrack* From(const MediaStreamComponent* component);
// Provides a weak reference to this MediaStreamAudioTrack which is
// invalidated when Stop() is called. The weak pointer may only be
......
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