OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/rtc_video_encoder_factory.h" | 5 #include "content/renderer/media/rtc_video_encoder_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/common/gpu/client/gpu_video_encode_accelerator_host.h" | 8 #include "content/common/gpu/client/gpu_video_encode_accelerator_host.h" |
9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
10 #include "content/renderer/media/rtc_video_encoder.h" | 10 #include "content/renderer/media/rtc_video_encoder.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 if (cmd_line->HasSwitch(switches::kEnableWebRtcHWVp8Encoding)) { | 31 if (cmd_line->HasSwitch(switches::kEnableWebRtcHWVp8Encoding)) { |
32 codecs->push_back(cricket::WebRtcVideoEncoderFactory::VideoCodec( | 32 codecs->push_back(cricket::WebRtcVideoEncoderFactory::VideoCodec( |
33 webrtc::kVideoCodecVP8, "VP8", width, height, fps)); | 33 webrtc::kVideoCodecVP8, "VP8", width, height, fps)); |
34 } | 34 } |
35 } else if (profile.profile >= media::H264PROFILE_MIN && | 35 } else if (profile.profile >= media::H264PROFILE_MIN && |
36 profile.profile <= media::H264PROFILE_MAX) { | 36 profile.profile <= media::H264PROFILE_MAX) { |
37 if (cmd_line->HasSwitch(switches::kEnableWebRtcHWH264Encoding)) { | 37 if (cmd_line->HasSwitch(switches::kEnableWebRtcHWH264Encoding)) { |
38 codecs->push_back(cricket::WebRtcVideoEncoderFactory::VideoCodec( | 38 codecs->push_back(cricket::WebRtcVideoEncoderFactory::VideoCodec( |
39 webrtc::kVideoCodecH264, "H264", width, height, fps)); | 39 webrtc::kVideoCodecH264, "H264", width, height, fps)); |
40 } | 40 } |
41 // TODO(hshi): remove the generic codec type after CASTv1 deprecation. | |
42 codecs->push_back(cricket::WebRtcVideoEncoderFactory::VideoCodec( | |
43 webrtc::kVideoCodecGeneric, "CAST1", width, height, fps)); | |
44 } | 41 } |
45 } | 42 } |
46 | 43 |
47 } // anonymous namespace | 44 } // anonymous namespace |
48 | 45 |
49 RTCVideoEncoderFactory::RTCVideoEncoderFactory( | 46 RTCVideoEncoderFactory::RTCVideoEncoderFactory( |
50 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories) | 47 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories) |
51 : gpu_factories_(gpu_factories) { | 48 : gpu_factories_(gpu_factories) { |
52 std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles = | 49 std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles = |
53 gpu_factories_->GetVideoEncodeAcceleratorSupportedProfiles(); | 50 gpu_factories_->GetVideoEncodeAcceleratorSupportedProfiles(); |
(...skipping 21 matching lines...) Expand all Loading... |
75 RTCVideoEncoderFactory::codecs() const { | 72 RTCVideoEncoderFactory::codecs() const { |
76 return codecs_; | 73 return codecs_; |
77 } | 74 } |
78 | 75 |
79 void RTCVideoEncoderFactory::DestroyVideoEncoder( | 76 void RTCVideoEncoderFactory::DestroyVideoEncoder( |
80 webrtc::VideoEncoder* encoder) { | 77 webrtc::VideoEncoder* encoder) { |
81 delete encoder; | 78 delete encoder; |
82 } | 79 } |
83 | 80 |
84 } // namespace content | 81 } // namespace content |
OLD | NEW |