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

Side by Side Diff: content/renderer/media/media_stream_impl.cc

Issue 11066101: Tentatively turn on WebMediaPlayerMS by default. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: use static function to check if url is media stream Created 8 years, 2 months 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
« no previous file with comments | « content/renderer/media/media_stream_impl.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/media_stream_impl.h" 5 #include "content/renderer/media/media_stream_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 user_media_requests_.erase(it); 139 user_media_requests_.erase(it);
140 } 140 }
141 } 141 }
142 142
143 WebKit::WebMediaStreamDescriptor MediaStreamImpl::GetMediaStream( 143 WebKit::WebMediaStreamDescriptor MediaStreamImpl::GetMediaStream(
144 const GURL& url) { 144 const GURL& url) {
145 return WebKit::WebMediaStreamRegistry::lookupMediaStreamDescriptor(url); 145 return WebKit::WebMediaStreamRegistry::lookupMediaStreamDescriptor(url);
146 } 146 }
147 147
148 bool MediaStreamImpl::IsMediaStream(const GURL& url) { 148 bool MediaStreamImpl::IsMediaStream(const GURL& url) {
149 DCHECK(CalledOnValidThread()); 149 return CheckMediaStream(url);
150 WebKit::WebMediaStreamDescriptor descriptor(GetMediaStream(url)); 150 }
151
152 // static
153 bool MediaStreamImpl::CheckMediaStream(const GURL& url) {
154 WebKit::WebMediaStreamDescriptor descriptor(
155 WebKit::WebMediaStreamRegistry::lookupMediaStreamDescriptor(url));
151 156
152 if (descriptor.isNull() || !descriptor.extraData()) 157 if (descriptor.isNull() || !descriptor.extraData())
153 return false; // This is not a valid stream. 158 return false; // This is not a valid stream.
154 159
155 MediaStreamExtraData* extra_data = 160 MediaStreamExtraData* extra_data =
156 static_cast<MediaStreamExtraData*>(descriptor.extraData()); 161 static_cast<MediaStreamExtraData*>(descriptor.extraData());
157 webrtc::MediaStreamInterface* stream = extra_data->local_stream(); 162 webrtc::MediaStreamInterface* stream = extra_data->local_stream();
158 if (stream && stream->video_tracks() && stream->video_tracks()->count() > 0) 163 if (stream && stream->video_tracks() && stream->video_tracks()->count() > 0)
159 return true; 164 return true;
160 stream = extra_data->remote_stream(); 165 stream = extra_data->remote_stream();
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 461
457 void MediaStreamExtraData::SetLocalStreamStopCallback( 462 void MediaStreamExtraData::SetLocalStreamStopCallback(
458 const StreamStopCallback& stop_callback) { 463 const StreamStopCallback& stop_callback) {
459 stream_stop_callback_ = stop_callback; 464 stream_stop_callback_ = stop_callback;
460 } 465 }
461 466
462 void MediaStreamExtraData::OnLocalStreamStop() { 467 void MediaStreamExtraData::OnLocalStreamStop() {
463 if (!stream_stop_callback_.is_null()) 468 if (!stream_stop_callback_.is_null())
464 stream_stop_callback_.Run(local_stream_->label()); 469 stream_stop_callback_.Run(local_stream_->label());
465 } 470 }
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_impl.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698