OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/api/videotrack.h" | 11 #include "webrtc/api/videotrack.h" |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 namespace webrtc { | 15 namespace webrtc { |
16 | 16 |
17 const char MediaStreamTrackInterface::kVideoKind[] = "video"; | 17 const char MediaStreamTrackInterface::kVideoKind[] = "video"; |
18 | 18 |
19 VideoTrack::VideoTrack(const std::string& label, | 19 VideoTrack::VideoTrack(const std::string& label, |
20 VideoTrackSourceInterface* video_source) | 20 VideoTrackSourceInterface* video_source) |
21 : MediaStreamTrack<VideoTrackInterface>(label), | 21 : MediaStreamTrack<VideoTrackInterface>(label), |
22 video_source_(video_source) { | 22 video_source_(video_source) { |
| 23 RTC_CHECK(video_source); |
23 } | 24 } |
24 | 25 |
25 VideoTrack::~VideoTrack() { | 26 VideoTrack::~VideoTrack() { |
26 } | 27 } |
27 | 28 |
28 std::string VideoTrack::kind() const { | 29 std::string VideoTrack::kind() const { |
29 return kVideoKind; | 30 return kVideoKind; |
30 } | 31 } |
31 | 32 |
32 void VideoTrack::AddOrUpdateSink( | 33 void VideoTrack::AddOrUpdateSink( |
(...skipping 25 matching lines...) Expand all Loading... |
58 | 59 |
59 rtc::scoped_refptr<VideoTrack> VideoTrack::Create( | 60 rtc::scoped_refptr<VideoTrack> VideoTrack::Create( |
60 const std::string& id, | 61 const std::string& id, |
61 VideoTrackSourceInterface* source) { | 62 VideoTrackSourceInterface* source) { |
62 rtc::RefCountedObject<VideoTrack>* track = | 63 rtc::RefCountedObject<VideoTrack>* track = |
63 new rtc::RefCountedObject<VideoTrack>(id, source); | 64 new rtc::RefCountedObject<VideoTrack>(id, source); |
64 return track; | 65 return track; |
65 } | 66 } |
66 | 67 |
67 } // namespace webrtc | 68 } // namespace webrtc |
OLD | NEW |