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

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

Issue 14247018: Implement WebRTC in Chrome for TV (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WebRTC impl on Chrome for TV Created 7 years, 7 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
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_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
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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 return type == WebKit::WebMediaStreamSource::TypeAudio ? 421 return type == WebKit::WebMediaStreamSource::TypeAudio ?
418 native_stream->RemoveTrack(native_stream->FindAudioTrack(track_id)) : 422 native_stream->RemoveTrack(native_stream->FindAudioTrack(track_id)) :
419 native_stream->RemoveTrack(native_stream->FindVideoTrack(track_id)); 423 native_stream->RemoveTrack(native_stream->FindVideoTrack(track_id));
420 } 424 }
421 425
422 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() { 426 bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() {
423 DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()"; 427 DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()";
424 if (!pc_factory_) { 428 if (!pc_factory_) {
425 DCHECK(!audio_device_); 429 DCHECK(!audio_device_);
426 audio_device_ = new WebRtcAudioDeviceImpl(); 430 audio_device_ = new WebRtcAudioDeviceImpl();
431
432 cricket::WebRtcVideoDecoderFactory* decoder_factory = NULL;
433 #if defined(GOOGLE_TV)
434 decoder_factory = new RTCVideoDecoderFactoryTv();
435 #endif
436
427 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( 437 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory(
428 webrtc::CreatePeerConnectionFactory(worker_thread_, 438 webrtc::CreatePeerConnectionFactory(worker_thread_,
429 signaling_thread_, 439 signaling_thread_,
430 audio_device_)); 440 audio_device_,
441 decoder_factory));
431 if (factory) 442 if (factory)
432 pc_factory_ = factory; 443 pc_factory_ = factory;
433 else 444 else
434 audio_device_ = NULL; 445 audio_device_ = NULL;
435 } 446 }
436 return pc_factory_.get() != NULL; 447 return pc_factory_.get() != NULL;
437 } 448 }
438 449
439 bool MediaStreamDependencyFactory::PeerConnectionFactoryCreated() { 450 bool MediaStreamDependencyFactory::PeerConnectionFactoryCreated() {
440 return pc_factory_.get() != NULL; 451 return pc_factory_.get() != NULL;
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 // processed before returning. We wait for the above task to finish before 703 // processed before returning. We wait for the above task to finish before
693 // letting the the function continue to avoid any potential race issues. 704 // letting the the function continue to avoid any potential race issues.
694 chrome_worker_thread_.Stop(); 705 chrome_worker_thread_.Stop();
695 } else { 706 } else {
696 NOTREACHED() << "Worker thread not running."; 707 NOTREACHED() << "Worker thread not running.";
697 } 708 }
698 } 709 }
699 } 710 }
700 711
701 } // namespace content 712 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698