| 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 14 matching lines...) Expand all Loading... |
| 25 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSourc
e.h" | 25 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSourc
e.h" |
| 26 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack
.h" | 26 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack
.h" |
| 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 28 | 28 |
| 29 #if defined(USE_OPENSSL) | 29 #if defined(USE_OPENSSL) |
| 30 #include "third_party/libjingle/source/talk/base/ssladapter.h" | 30 #include "third_party/libjingle/source/talk/base/ssladapter.h" |
| 31 #else | 31 #else |
| 32 #include "net/socket/nss_ssl_util.h" | 32 #include "net/socket/nss_ssl_util.h" |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 #if defined(GOOGLE_TV) |
| 36 #include "content/renderer/media/rtc_video_decoder_factory_tv.h" |
| 37 #endif |
| 38 |
| 35 namespace content { | 39 namespace content { |
| 36 | 40 |
| 37 // Constant constraint keys which disables all audio constraints. | 41 // Constant constraint keys which disables all audio constraints. |
| 38 // Only used in combination with WebAudio sources. | 42 // Only used in combination with WebAudio sources. |
| 39 struct { | 43 struct { |
| 40 const char* key; | 44 const char* key; |
| 41 const char* value; | 45 const char* value; |
| 42 } const kWebAudioConstraints[] = { | 46 } const kWebAudioConstraints[] = { |
| 43 {webrtc::MediaConstraintsInterface::kEchoCancellation, | 47 {webrtc::MediaConstraintsInterface::kEchoCancellation, |
| 44 webrtc::MediaConstraintsInterface::kValueFalse}, | 48 webrtc::MediaConstraintsInterface::kValueFalse}, |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 return type == WebKit::WebMediaStreamSource::TypeAudio ? | 420 return type == WebKit::WebMediaStreamSource::TypeAudio ? |
| 417 native_stream->RemoveTrack(native_stream->FindAudioTrack(track_id)) : | 421 native_stream->RemoveTrack(native_stream->FindAudioTrack(track_id)) : |
| 418 native_stream->RemoveTrack(native_stream->FindVideoTrack(track_id)); | 422 native_stream->RemoveTrack(native_stream->FindVideoTrack(track_id)); |
| 419 } | 423 } |
| 420 | 424 |
| 421 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { | 425 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { |
| 422 DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()"; | 426 DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()"; |
| 423 if (!pc_factory_.get()) { | 427 if (!pc_factory_.get()) { |
| 424 DCHECK(!audio_device_); | 428 DCHECK(!audio_device_); |
| 425 audio_device_ = new WebRtcAudioDeviceImpl(); | 429 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 430 |
| 431 cricket::WebRtcVideoDecoderFactory* decoder_factory = NULL; |
| 432 #if defined(GOOGLE_TV) |
| 433 decoder_factory = new RTCVideoDecoderFactoryTv(); |
| 434 #endif |
| 435 |
| 426 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( | 436 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( |
| 427 webrtc::CreatePeerConnectionFactory(worker_thread_, | 437 webrtc::CreatePeerConnectionFactory(worker_thread_, |
| 428 signaling_thread_, | 438 signaling_thread_, |
| 429 audio_device_)); | 439 audio_device_, |
| 440 decoder_factory)); |
| 430 if (factory.get()) | 441 if (factory.get()) |
| 431 pc_factory_ = factory; | 442 pc_factory_ = factory; |
| 432 else | 443 else |
| 433 audio_device_ = NULL; | 444 audio_device_ = NULL; |
| 434 } | 445 } |
| 435 return pc_factory_.get() != NULL; | 446 return pc_factory_.get() != NULL; |
| 436 } | 447 } |
| 437 | 448 |
| 438 bool MediaStreamDependencyFactory::PeerConnectionFactoryCreated() { | 449 bool MediaStreamDependencyFactory::PeerConnectionFactoryCreated() { |
| 439 return pc_factory_.get() != NULL; | 450 return pc_factory_.get() != NULL; |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 // processed before returning. We wait for the above task to finish before | 700 // processed before returning. We wait for the above task to finish before |
| 690 // letting the the function continue to avoid any potential race issues. | 701 // letting the the function continue to avoid any potential race issues. |
| 691 chrome_worker_thread_.Stop(); | 702 chrome_worker_thread_.Stop(); |
| 692 } else { | 703 } else { |
| 693 NOTREACHED() << "Worker thread not running."; | 704 NOTREACHED() << "Worker thread not running."; |
| 694 } | 705 } |
| 695 } | 706 } |
| 696 } | 707 } |
| 697 | 708 |
| 698 } // namespace content | 709 } // namespace content |
| OLD | NEW |