| 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_dependency_factory.h" | 5 #include "content/renderer/media/media_stream_dependency_factory.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSourc
e.h" | 26 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSourc
e.h" |
| 27 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack
.h" | 27 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack
.h" |
| 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 29 | 29 |
| 30 #if defined(USE_OPENSSL) | 30 #if defined(USE_OPENSSL) |
| 31 #include "third_party/libjingle/source/talk/base/ssladapter.h" | 31 #include "third_party/libjingle/source/talk/base/ssladapter.h" |
| 32 #else | 32 #else |
| 33 #include "net/socket/nss_ssl_util.h" | 33 #include "net/socket/nss_ssl_util.h" |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 #if defined(GOOGLE_TV) |
| 37 #include "content/renderer/media/rtc_video_decoder_factory_tv.h" |
| 38 #endif |
| 39 |
| 36 namespace content { | 40 namespace content { |
| 37 | 41 |
| 38 // Constant constraint keys which disables all audio constraints. | 42 // Constant constraint keys which disables all audio constraints. |
| 39 // Only used in combination with WebAudio sources. | 43 // Only used in combination with WebAudio sources. |
| 40 struct { | 44 struct { |
| 41 const char* key; | 45 const char* key; |
| 42 const char* value; | 46 const char* value; |
| 43 } const kWebAudioConstraints[] = { | 47 } const kWebAudioConstraints[] = { |
| 44 {webrtc::MediaConstraintsInterface::kEchoCancellation, | 48 {webrtc::MediaConstraintsInterface::kEchoCancellation, |
| 45 webrtc::MediaConstraintsInterface::kValueFalse}, | 49 webrtc::MediaConstraintsInterface::kValueFalse}, |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 return type == WebKit::WebMediaStreamSource::TypeAudio ? | 456 return type == WebKit::WebMediaStreamSource::TypeAudio ? |
| 453 native_stream->RemoveTrack(native_stream->FindAudioTrack(track_id)) : | 457 native_stream->RemoveTrack(native_stream->FindAudioTrack(track_id)) : |
| 454 native_stream->RemoveTrack(native_stream->FindVideoTrack(track_id)); | 458 native_stream->RemoveTrack(native_stream->FindVideoTrack(track_id)); |
| 455 } | 459 } |
| 456 | 460 |
| 457 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { | 461 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { |
| 458 DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()"; | 462 DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()"; |
| 459 if (!pc_factory_) { | 463 if (!pc_factory_) { |
| 460 DCHECK(!audio_device_); | 464 DCHECK(!audio_device_); |
| 461 audio_device_ = new WebRtcAudioDeviceImpl(); | 465 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 466 |
| 467 cricket::WebRtcVideoDecoderFactory* decoder_factory = NULL; |
| 468 #if defined(GOOGLE_TV) |
| 469 // PeerConnectionFactory will hold the ownership of this |
| 470 // VideoDecoderFactory. |
| 471 decoder_factory = new RTCVideoDecoderFactoryTv(this); |
| 472 #endif |
| 473 |
| 462 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( | 474 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( |
| 463 webrtc::CreatePeerConnectionFactory(worker_thread_, | 475 webrtc::CreatePeerConnectionFactory(worker_thread_, |
| 464 signaling_thread_, | 476 signaling_thread_, |
| 465 audio_device_)); | 477 audio_device_, |
| 478 decoder_factory)); |
| 466 if (factory) | 479 if (factory) |
| 467 pc_factory_ = factory; | 480 pc_factory_ = factory; |
| 468 else | 481 else |
| 469 audio_device_ = NULL; | 482 audio_device_ = NULL; |
| 470 } | 483 } |
| 471 return pc_factory_.get() != NULL; | 484 return pc_factory_.get() != NULL; |
| 472 } | 485 } |
| 473 | 486 |
| 474 bool MediaStreamDependencyFactory::PeerConnectionFactoryCreated() { | 487 bool MediaStreamDependencyFactory::PeerConnectionFactoryCreated() { |
| 475 return pc_factory_.get() != NULL; | 488 return pc_factory_.get() != NULL; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 // processed before returning. We wait for the above task to finish before | 760 // processed before returning. We wait for the above task to finish before |
| 748 // letting the the function continue to avoid any potential race issues. | 761 // letting the the function continue to avoid any potential race issues. |
| 749 chrome_worker_thread_.Stop(); | 762 chrome_worker_thread_.Stop(); |
| 750 } else { | 763 } else { |
| 751 NOTREACHED() << "Worker thread not running."; | 764 NOTREACHED() << "Worker thread not running."; |
| 752 } | 765 } |
| 753 } | 766 } |
| 754 } | 767 } |
| 755 | 768 |
| 756 } // namespace content | 769 } // namespace content |
| OLD | NEW |