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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 // PeerConnectionFactory will hold the ownership of this | 541 // PeerConnectionFactory will hold the ownership of this |
538 // VideoDecoderFactory. | 542 // VideoDecoderFactory. |
539 decoder_factory.reset(decoder_factory_tv_ = new RTCVideoDecoderFactoryTv()); | 543 decoder_factory.reset(decoder_factory_tv_ = new RTCVideoDecoderFactoryTv()); |
540 #endif | 544 #endif |
541 | 545 |
542 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { | 546 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { |
543 if (gpu_factories) | 547 if (gpu_factories) |
544 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); | 548 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); |
545 } | 549 } |
546 | 550 |
| 551 #if defined(OS_ANDROID) |
| 552 if (!media::MediaCodecBridge::IsAvailable() || |
| 553 !media::MediaCodecBridge::SupportsSetParameters()) { |
| 554 encoder_factory.reset(); |
| 555 } |
| 556 #endif |
| 557 |
547 scoped_refptr<WebRtcAudioDeviceImpl> audio_device( | 558 scoped_refptr<WebRtcAudioDeviceImpl> audio_device( |
548 new WebRtcAudioDeviceImpl()); | 559 new WebRtcAudioDeviceImpl()); |
549 | 560 |
550 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( | 561 scoped_refptr<webrtc::PeerConnectionFactoryInterface> factory( |
551 webrtc::CreatePeerConnectionFactory(worker_thread_, | 562 webrtc::CreatePeerConnectionFactory(worker_thread_, |
552 signaling_thread_, | 563 signaling_thread_, |
553 audio_device.get(), | 564 audio_device.get(), |
554 encoder_factory.release(), | 565 encoder_factory.release(), |
555 decoder_factory.release())); | 566 decoder_factory.release())); |
556 if (!factory.get()) { | 567 if (!factory.get()) { |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 MediaStreamDependencyFactory::GetNativeMediaStreamTrack( | 892 MediaStreamDependencyFactory::GetNativeMediaStreamTrack( |
882 const blink::WebMediaStreamTrack& track) { | 893 const blink::WebMediaStreamTrack& track) { |
883 if (track.isNull()) | 894 if (track.isNull()) |
884 return NULL; | 895 return NULL; |
885 MediaStreamTrackExtraData* extra_data = | 896 MediaStreamTrackExtraData* extra_data = |
886 static_cast<MediaStreamTrackExtraData*>(track.extraData()); | 897 static_cast<MediaStreamTrackExtraData*>(track.extraData()); |
887 return extra_data ? extra_data->track().get() : NULL; | 898 return extra_data ? extra_data->track().get() : NULL; |
888 } | 899 } |
889 | 900 |
890 } // namespace content | 901 } // namespace content |
OLD | NEW |