OLD | NEW |
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/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 // MediaStreamDispatcher know that the stream is no longer wanted. | 491 // MediaStreamDispatcher know that the stream is no longer wanted. |
492 // If not, we cancel the request and delete the request object. | 492 // If not, we cancel the request and delete the request object. |
493 if ((*request_it)->generated) { | 493 if ((*request_it)->generated) { |
494 // Stop the local audio track before closing the device in the browser. | 494 // Stop the local audio track before closing the device in the browser. |
495 dependency_factory_->StopLocalAudioSource((*request_it)->descriptor); | 495 dependency_factory_->StopLocalAudioSource((*request_it)->descriptor); |
496 | 496 |
497 media_stream_dispatcher_->StopStream( | 497 media_stream_dispatcher_->StopStream( |
498 UTF16ToUTF8((*request_it)->descriptor.label())); | 498 UTF16ToUTF8((*request_it)->descriptor.label())); |
499 } else { | 499 } else { |
500 media_stream_dispatcher_->CancelGenerateStream( | 500 media_stream_dispatcher_->CancelGenerateStream( |
501 (*request_it)->request_id); | 501 (*request_it)->request_id, AsWeakPtr()); |
502 } | 502 } |
503 request_it = user_media_requests_.erase(request_it); | 503 request_it = user_media_requests_.erase(request_it); |
504 } else { | 504 } else { |
505 ++request_it; | 505 ++request_it; |
506 } | 506 } |
507 } | 507 } |
508 } | 508 } |
509 | 509 |
510 scoped_refptr<webkit_media::VideoFrameProvider> | 510 scoped_refptr<webkit_media::VideoFrameProvider> |
511 MediaStreamImpl::CreateVideoFrameProvider( | 511 MediaStreamImpl::CreateVideoFrameProvider( |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 } | 622 } |
623 | 623 |
624 for (size_t i = 0; i < video_sources.size(); ++i) { | 624 for (size_t i = 0; i < video_sources.size(); ++i) { |
625 video_sources[i].setReadyState( | 625 video_sources[i].setReadyState( |
626 WebKit::WebMediaStreamSource::ReadyStateEnded); | 626 WebKit::WebMediaStreamSource::ReadyStateEnded); |
627 video_sources[i].setExtraData(NULL); | 627 video_sources[i].setExtraData(NULL); |
628 } | 628 } |
629 } | 629 } |
630 | 630 |
631 } // namespace content | 631 } // namespace content |
OLD | NEW |