OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/video_source_handler.h" | 5 #include "content/renderer/media/video_source_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/renderer/media/media_stream_dependency_factory.h" | 10 #include "content/renderer/media/media_stream_dependency_factory.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 return source; | 115 return source; |
116 } | 116 } |
117 | 117 |
118 // Get the first video track from the stream. | 118 // Get the first video track from the stream. |
119 MediaStreamExtraData* extra_data = | 119 MediaStreamExtraData* extra_data = |
120 static_cast<MediaStreamExtraData*>(stream.extraData()); | 120 static_cast<MediaStreamExtraData*>(stream.extraData()); |
121 if (!extra_data) { | 121 if (!extra_data) { |
122 LOG(ERROR) << "GetFirstVideoSource - MediaStreamExtraData is NULL."; | 122 LOG(ERROR) << "GetFirstVideoSource - MediaStreamExtraData is NULL."; |
123 return source; | 123 return source; |
124 } | 124 } |
125 webrtc::MediaStreamInterface* native_stream = extra_data->stream(); | 125 webrtc::MediaStreamInterface* native_stream = extra_data->stream().get(); |
126 if (!native_stream) { | 126 if (!native_stream) { |
127 LOG(ERROR) << "GetFirstVideoSource - native stream is NULL."; | 127 LOG(ERROR) << "GetFirstVideoSource - native stream is NULL."; |
128 return source; | 128 return source; |
129 } | 129 } |
130 webrtc::VideoTrackVector native_video_tracks = | 130 webrtc::VideoTrackVector native_video_tracks = |
131 native_stream->GetVideoTracks(); | 131 native_stream->GetVideoTracks(); |
132 if (native_video_tracks.empty()) { | 132 if (native_video_tracks.empty()) { |
133 LOG(ERROR) << "GetFirstVideoSource - stream has no video track."; | 133 LOG(ERROR) << "GetFirstVideoSource - stream has no video track."; |
134 return source; | 134 return source; |
135 } | 135 } |
136 source = native_video_tracks[0]->GetSource(); | 136 source = native_video_tracks[0]->GetSource(); |
137 return source; | 137 return source; |
138 } | 138 } |
139 | 139 |
140 VideoRenderer* VideoSourceHandler::GetReceiver( | 140 VideoRenderer* VideoSourceHandler::GetReceiver( |
141 FrameReaderInterface* reader) { | 141 FrameReaderInterface* reader) { |
142 std::map<FrameReaderInterface*, VideoRenderer*>::iterator it; | 142 std::map<FrameReaderInterface*, VideoRenderer*>::iterator it; |
143 it = reader_to_receiver_.find(reader); | 143 it = reader_to_receiver_.find(reader); |
144 if (it == reader_to_receiver_.end()) { | 144 if (it == reader_to_receiver_.end()) { |
145 return NULL; | 145 return NULL; |
146 } | 146 } |
147 return it->second; | 147 return it->second; |
148 } | 148 } |
149 | 149 |
150 } // namespace content | 150 } // namespace content |
151 | 151 |
OLD | NEW |