Chromium Code Reviews| Index: content/public/renderer/media/video_track_sink.cc |
| diff --git a/content/public/renderer/media/video_track_sink.cc b/content/public/renderer/media/video_track_sink.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..46e9f616760385b82b5f0497e567575242328885 |
| --- /dev/null |
| +++ b/content/public/renderer/media/video_track_sink.cc |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/public/renderer/media/video_track_sink.h" |
| + |
| +#include "base/logging.h" |
| +#include "content/renderer/media/video_track.h" |
|
Alpha Left Google
2013/11/26 04:59:32
content/public cannot include content/renderer so
perkj_chrome
2013/11/26 09:16:38
is that true? See content/public/renderer/render_v
Alpha Left Google
2013/11/26 10:00:47
I cannot locate the file you mentioned.
Jói
2013/11/26 10:18:15
A .cc file in content/public/renderer can include
|
| +#include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| +#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| + |
| +namespace media { |
| +class VideoFrame; |
| +} |
| + |
| +namespace content { |
| + |
| +void VideoTrackSink::Register(const blink::WebMediaStreamTrack& track) { |
| + DCHECK(track.source().type() == blink::WebMediaStreamSource::TypeVideo); |
| + VideoTrack* video_track = static_cast <VideoTrack*>(track.extraData()); |
| + video_track->RegisterSink(this); |
| +} |
| + |
| +void VideoTrackSink::UnRegister(const blink::WebMediaStreamTrack& track) { |
| + VideoTrack* video_track = static_cast <VideoTrack*>(track.extraData()); |
| + video_track->UnRegisterSink(this); |
| +} |
| + |
| +MediaTrackSink::ReadyState MediaTrackSink::GetSourceState( |
| + const blink::WebMediaStreamTrack& track) const{ |
| + switch (track.source().readyState()) { |
| + case blink::WebMediaStreamSource::ReadyStateLive: |
| + return MediaTrackSink::kLive; |
| + case blink::WebMediaStreamSource::ReadyStateMuted: |
| + return MediaTrackSink::kMuted; |
| + case blink::WebMediaStreamSource::ReadyStateEnded: |
| + return MediaTrackSink::kEnded; |
| + default: |
|
no longer working on chromium
2013/11/25 13:55:07
nit, you don't need default case if you have alrea
perkj_chrome
2013/11/26 09:16:38
These are removed.
|
| + NOTREACHED(); |
| + } |
| + return MediaTrackSink::kEnded; |
| +} |
| + |
| +} // namespace content |