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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 return type == WebKit::WebMediaStreamSource::TypeAudio ? | 422 return type == WebKit::WebMediaStreamSource::TypeAudio ? |
419 native_stream->RemoveTrack(native_stream->FindAudioTrack(track_id)) : | 423 native_stream->RemoveTrack(native_stream->FindAudioTrack(track_id)) : |
420 native_stream->RemoveTrack(native_stream->FindVideoTrack(track_id)); | 424 native_stream->RemoveTrack(native_stream->FindVideoTrack(track_id)); |
421 } | 425 } |
422 | 426 |
423 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { | 427 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { |
424 DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()"; | 428 DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()"; |
425 if (!pc_factory_) { | 429 if (!pc_factory_) { |
426 DCHECK(!audio_device_); | 430 DCHECK(!audio_device_); |
427 audio_device_ = new WebRtcAudioDeviceImpl(); | 431 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 432 |
| 433 cricket::WebRtcVideoDecoderFactory* decoder_factory = NULL; |
| 434 #if defined(GOOGLE_TV) |
| 435 // PeerConnectionFactory will hold the ownership of this |
| 436 // VideoDecoderFactory. |
| 437 decoder_factory = new RTCVideoDecoderFactoryTv(); |
| 438 #endif |
| 439 |
428 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( | 440 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( |
429 webrtc::CreatePeerConnectionFactory(worker_thread_, | 441 webrtc::CreatePeerConnectionFactory(worker_thread_, |
430 signaling_thread_, | 442 signaling_thread_, |
431 audio_device_)); | 443 audio_device_, |
| 444 decoder_factory)); |
432 if (factory) | 445 if (factory) |
433 pc_factory_ = factory; | 446 pc_factory_ = factory; |
434 else | 447 else |
435 audio_device_ = NULL; | 448 audio_device_ = NULL; |
436 } | 449 } |
437 return pc_factory_.get() != NULL; | 450 return pc_factory_.get() != NULL; |
438 } | 451 } |
439 | 452 |
440 bool MediaStreamDependencyFactory::PeerConnectionFactoryCreated() { | 453 bool MediaStreamDependencyFactory::PeerConnectionFactoryCreated() { |
441 return pc_factory_.get() != NULL; | 454 return pc_factory_.get() != NULL; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 // processed before returning. We wait for the above task to finish before | 710 // processed before returning. We wait for the above task to finish before |
698 // letting the the function continue to avoid any potential race issues. | 711 // letting the the function continue to avoid any potential race issues. |
699 chrome_worker_thread_.Stop(); | 712 chrome_worker_thread_.Stop(); |
700 } else { | 713 } else { |
701 NOTREACHED() << "Worker thread not running."; | 714 NOTREACHED() << "Worker thread not running."; |
702 } | 715 } |
703 } | 716 } |
704 } | 717 } |
705 | 718 |
706 } // namespace content | 719 } // namespace content |
OLD | NEW |