Home | History | Annotate | Download | only in renderer
      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_stream_video_sink.h"
      6 
      7 #include "base/logging.h"
      8 #include "content/renderer/media/media_stream_video_track.h"
      9 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
     10 
     11 namespace content {
     12 
     13 void MediaStreamVideoSink::AddToVideoTrack(
     14     MediaStreamVideoSink* sink,
     15     const blink::WebMediaStreamTrack& track) {
     16   DCHECK_EQ(blink::WebMediaStreamSource::TypeVideo, track.source().type());
     17   MediaStreamVideoTrack* video_track =
     18       static_cast<MediaStreamVideoTrack*>(track.extraData());
     19   video_track->AddSink(sink);
     20 }
     21 
     22 void MediaStreamVideoSink::RemoveFromVideoTrack(
     23     MediaStreamVideoSink* sink,
     24     const blink::WebMediaStreamTrack& track) {
     25   DCHECK_EQ(blink::WebMediaStreamSource::TypeVideo, track.source().type());
     26   MediaStreamVideoTrack* video_track =
     27       static_cast<MediaStreamVideoTrack*>(track.extraData());
     28   video_track->RemoveSink(sink);
     29 }
     30 
     31 }  // namespace content
     32