Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: content/public/renderer/media/video_track_sink.cc

Issue 83023005: Add VideoTrackSink interface to content/public (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698