| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #if defined(USE_OPENSSL) | 41 #if defined(USE_OPENSSL) |
| 42 #include "third_party/libjingle/source/talk/base/ssladapter.h" | 42 #include "third_party/libjingle/source/talk/base/ssladapter.h" |
| 43 #else | 43 #else |
| 44 #include "net/socket/nss_ssl_util.h" | 44 #include "net/socket/nss_ssl_util.h" |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 #if defined(GOOGLE_TV) | 47 #if defined(GOOGLE_TV) |
| 48 #include "content/renderer/media/rtc_video_decoder_factory_tv.h" | 48 #include "content/renderer/media/rtc_video_decoder_factory_tv.h" |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 #if defined(OS_ANDROID) |
| 52 #include "media/base/android/media_codec_bridge.h" |
| 53 #endif |
| 54 |
| 51 namespace content { | 55 namespace content { |
| 52 | 56 |
| 53 // Constant constraint keys which enables default audio constraints on | 57 // Constant constraint keys which enables default audio constraints on |
| 54 // mediastreams with audio. | 58 // mediastreams with audio. |
| 55 struct { | 59 struct { |
| 56 const char* key; | 60 const char* key; |
| 57 const char* value; | 61 const char* value; |
| 58 } const kDefaultAudioConstraints[] = { | 62 } const kDefaultAudioConstraints[] = { |
| 59 { webrtc::MediaConstraintsInterface::kEchoCancellation, | 63 { webrtc::MediaConstraintsInterface::kEchoCancellation, |
| 60 webrtc::MediaConstraintsInterface::kValueTrue }, | 64 webrtc::MediaConstraintsInterface::kValueTrue }, |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 // PeerConnectionFactory will hold the ownership of this | 591 // PeerConnectionFactory will hold the ownership of this |
| 588 // VideoDecoderFactory. | 592 // VideoDecoderFactory. |
| 589 decoder_factory.reset(decoder_factory_tv_ = new RTCVideoDecoderFactoryTv()); | 593 decoder_factory.reset(decoder_factory_tv_ = new RTCVideoDecoderFactoryTv()); |
| 590 #endif | 594 #endif |
| 591 | 595 |
| 592 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { | 596 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { |
| 593 if (gpu_factories) | 597 if (gpu_factories) |
| 594 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); | 598 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); |
| 595 } | 599 } |
| 596 | 600 |
| 601 #if defined(OS_ANDROID) |
| 602 if (!media::MediaCodecBridge::IsAvailable() || |
| 603 !media::MediaCodecBridge::SupportsSetParameters()) { |
| 604 encoder_factory.reset(); |
| 605 } |
| 606 #endif |
| 607 |
| 597 scoped_refptr<WebRtcAudioDeviceImpl> audio_device( | 608 scoped_refptr<WebRtcAudioDeviceImpl> audio_device( |
| 598 new WebRtcAudioDeviceImpl()); | 609 new WebRtcAudioDeviceImpl()); |
| 599 | 610 |
| 600 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( | 611 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( |
| 601 webrtc::CreatePeerConnectionFactory(worker_thread_, | 612 webrtc::CreatePeerConnectionFactory(worker_thread_, |
| 602 signaling_thread_, | 613 signaling_thread_, |
| 603 audio_device.get(), | 614 audio_device.get(), |
| 604 encoder_factory.release(), | 615 encoder_factory.release(), |
| 605 decoder_factory.release())); | 616 decoder_factory.release())); |
| 606 if (!factory.get()) { | 617 if (!factory.get()) { |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 MediaStreamDependencyFactory::GetNativeMediaStreamTrack( | 942 MediaStreamDependencyFactory::GetNativeMediaStreamTrack( |
| 932 const blink::WebMediaStreamTrack& track) { | 943 const blink::WebMediaStreamTrack& track) { |
| 933 if (track.isNull()) | 944 if (track.isNull()) |
| 934 return NULL; | 945 return NULL; |
| 935 MediaStreamTrackExtraData* extra_data = | 946 MediaStreamTrackExtraData* extra_data = |
| 936 static_cast<MediaStreamTrackExtraData*>(track.extraData()); | 947 static_cast<MediaStreamTrackExtraData*>(track.extraData()); |
| 937 return extra_data ? extra_data->track().get() : NULL; | 948 return extra_data ? extra_data->track().get() : NULL; |
| 938 } | 949 } |
| 939 | 950 |
| 940 } // namespace content | 951 } // namespace content |
| OLD | NEW |