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 26 matching lines...) Expand all Loading... |
37 webrtc::kVideoCodecH264, "H264", width, height, fps)); | 37 webrtc::kVideoCodecH264, "H264", width, height, fps)); |
38 } | 38 } |
39 } | 39 } |
40 } | 40 } |
41 | 41 |
42 } // anonymous namespace | 42 } // anonymous namespace |
43 | 43 |
44 RTCVideoEncoderFactory::RTCVideoEncoderFactory( | 44 RTCVideoEncoderFactory::RTCVideoEncoderFactory( |
45 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories) | 45 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories) |
46 : gpu_factories_(gpu_factories) { | 46 : gpu_factories_(gpu_factories) { |
47 std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles = | 47 std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles; |
48 gpu_factories_->GetVideoEncodeAcceleratorSupportedProfiles(); | 48 gpu_factories_->GetVideoEncodeAcceleratorSupportedProfiles(&profiles); |
49 for (size_t i = 0; i < profiles.size(); ++i) | 49 for (size_t i = 0; i < profiles.size(); ++i) |
50 VEAToWebRTCCodecs(&codecs_, profiles[i]); | 50 VEAToWebRTCCodecs(&codecs_, profiles[i]); |
51 } | 51 } |
52 | 52 |
53 RTCVideoEncoderFactory::~RTCVideoEncoderFactory() {} | 53 RTCVideoEncoderFactory::~RTCVideoEncoderFactory() {} |
54 | 54 |
55 webrtc::VideoEncoder* RTCVideoEncoderFactory::CreateVideoEncoder( | 55 webrtc::VideoEncoder* RTCVideoEncoderFactory::CreateVideoEncoder( |
56 webrtc::VideoCodecType type) { | 56 webrtc::VideoCodecType type) { |
57 bool found = false; | 57 bool found = false; |
58 for (size_t i = 0; i < codecs_.size(); ++i) { | 58 for (size_t i = 0; i < codecs_.size(); ++i) { |
(...skipping 11 matching lines...) Expand all Loading... |
70 RTCVideoEncoderFactory::codecs() const { | 70 RTCVideoEncoderFactory::codecs() const { |
71 return codecs_; | 71 return codecs_; |
72 } | 72 } |
73 | 73 |
74 void RTCVideoEncoderFactory::DestroyVideoEncoder( | 74 void RTCVideoEncoderFactory::DestroyVideoEncoder( |
75 webrtc::VideoEncoder* encoder) { | 75 webrtc::VideoEncoder* encoder) { |
76 delete encoder; | 76 delete encoder; |
77 } | 77 } |
78 | 78 |
79 } // namespace content | 79 } // namespace content |
OLD | NEW |