Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/public/renderer/media/video_track_sink.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #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
| |
| 9 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | |
| 10 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | |
| 11 | |
| 12 namespace media { | |
| 13 class VideoFrame; | |
| 14 } | |
| 15 | |
| 16 namespace content { | |
| 17 | |
| 18 void VideoTrackSink::Register(const blink::WebMediaStreamTrack& track) { | |
| 19 DCHECK(track.source().type() == blink::WebMediaStreamSource::TypeVideo); | |
| 20 VideoTrack* video_track = static_cast <VideoTrack*>(track.extraData()); | |
| 21 video_track->RegisterSink(this); | |
| 22 } | |
| 23 | |
| 24 void VideoTrackSink::UnRegister(const blink::WebMediaStreamTrack& track) { | |
| 25 VideoTrack* video_track = static_cast <VideoTrack*>(track.extraData()); | |
| 26 video_track->UnRegisterSink(this); | |
| 27 } | |
| 28 | |
| 29 MediaTrackSink::ReadyState MediaTrackSink::GetSourceState( | |
| 30 const blink::WebMediaStreamTrack& track) const{ | |
| 31 switch (track.source().readyState()) { | |
| 32 case blink::WebMediaStreamSource::ReadyStateLive: | |
| 33 return MediaTrackSink::kLive; | |
| 34 case blink::WebMediaStreamSource::ReadyStateMuted: | |
| 35 return MediaTrackSink::kMuted; | |
| 36 case blink::WebMediaStreamSource::ReadyStateEnded: | |
| 37 return MediaTrackSink::kEnded; | |
| 38 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.
| |
| 39 NOTREACHED(); | |
| 40 } | |
| 41 return MediaTrackSink::kEnded; | |
| 42 } | |
| 43 | |
| 44 } // namespace content | |
| OLD | NEW |