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/common/gpu/media/gpu_video_encode_accelerator.h" | 5 #include "content/common/gpu/media/gpu_video_encode_accelerator.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 DCHECK(stub_); | 158 DCHECK(stub_); |
159 stub_->channel()->RemoveRoute(host_route_id_); | 159 stub_->channel()->RemoveRoute(host_route_id_); |
160 stub_->RemoveDestructionObserver(this); | 160 stub_->RemoveDestructionObserver(this); |
161 encoder_.reset(); | 161 encoder_.reset(); |
162 delete this; | 162 delete this; |
163 } | 163 } |
164 | 164 |
165 // static | 165 // static |
166 std::vector<media::VideoEncodeAccelerator::SupportedProfile> | 166 std::vector<media::VideoEncodeAccelerator::SupportedProfile> |
167 GpuVideoEncodeAccelerator::GetSupportedProfiles() { | 167 GpuVideoEncodeAccelerator::GetSupportedProfiles() { |
168 #if defined(OS_CHROMEOS) && defined(USE_X11) && defined(ARCH_CPU_ARMEL) | |
169 // This is a work-around for M39 because the video device is not ready at | |
170 // boot. | |
171 // TODO(wuchengli): remove this after http://crbug.com/418762 is fixed. | |
172 return V4L2VideoEncodeAccelerator::GetSupportedProfilesStatic(); | |
173 #endif | |
174 scoped_ptr<media::VideoEncodeAccelerator> encoder = CreateEncoder(); | 168 scoped_ptr<media::VideoEncodeAccelerator> encoder = CreateEncoder(); |
175 if (!encoder) | 169 if (!encoder) |
176 return std::vector<media::VideoEncodeAccelerator::SupportedProfile>(); | 170 return std::vector<media::VideoEncodeAccelerator::SupportedProfile>(); |
177 return encoder->GetSupportedProfiles(); | 171 return encoder->GetSupportedProfiles(); |
178 } | 172 } |
179 | 173 |
180 scoped_ptr<media::VideoEncodeAccelerator> | 174 scoped_ptr<media::VideoEncodeAccelerator> |
181 GpuVideoEncodeAccelerator::CreateEncoder() { | 175 GpuVideoEncodeAccelerator::CreateEncoder() { |
182 scoped_ptr<media::VideoEncodeAccelerator> encoder; | 176 scoped_ptr<media::VideoEncodeAccelerator> encoder; |
183 #if defined(OS_CHROMEOS) && defined(USE_X11) | 177 #if defined(OS_CHROMEOS) && defined(USE_X11) |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 stub_->channel()->Send(message); | 298 stub_->channel()->Send(message); |
305 } | 299 } |
306 | 300 |
307 void GpuVideoEncodeAccelerator::SendCreateEncoderReply(IPC::Message* message, | 301 void GpuVideoEncodeAccelerator::SendCreateEncoderReply(IPC::Message* message, |
308 bool succeeded) { | 302 bool succeeded) { |
309 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(message, succeeded); | 303 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(message, succeeded); |
310 Send(message); | 304 Send(message); |
311 } | 305 } |
312 | 306 |
313 } // namespace content | 307 } // namespace content |
OLD | NEW |