| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 receiver->SetReader(NULL); | 96 receiver->SetReader(NULL); |
| 97 source->RemoveSink(receiver); | 97 source->RemoveSink(receiver); |
| 98 reader_to_receiver_.erase(reader); | 98 reader_to_receiver_.erase(reader); |
| 99 delete receiver; | 99 delete receiver; |
| 100 return true; | 100 return true; |
| 101 } | 101 } |
| 102 | 102 |
| 103 scoped_refptr<VideoSourceInterface> VideoSourceHandler::GetFirstVideoSource( | 103 scoped_refptr<VideoSourceInterface> VideoSourceHandler::GetFirstVideoSource( |
| 104 const std::string& url) { | 104 const std::string& url) { |
| 105 scoped_refptr<webrtc::VideoSourceInterface> source; | 105 scoped_refptr<webrtc::VideoSourceInterface> source; |
| 106 WebKit::WebMediaStream stream; | 106 blink::WebMediaStream stream; |
| 107 if (registry_) { | 107 if (registry_) { |
| 108 stream = registry_->GetMediaStream(url); | 108 stream = registry_->GetMediaStream(url); |
| 109 } else { | 109 } else { |
| 110 stream = | 110 stream = |
| 111 WebKit::WebMediaStreamRegistry::lookupMediaStreamDescriptor(GURL(url)); | 111 blink::WebMediaStreamRegistry::lookupMediaStreamDescriptor(GURL(url)); |
| 112 } | 112 } |
| 113 if (stream.isNull() || !stream.extraData()) { | 113 if (stream.isNull() || !stream.extraData()) { |
| 114 LOG(ERROR) << "GetFirstVideoSource - invalid url: " << url; | 114 LOG(ERROR) << "GetFirstVideoSource - invalid url: " << url; |
| 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) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 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 |