OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/pepper/pepper_video_decoder_host.h" | 5 #include "content/renderer/pepper/pepper_video_decoder_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "content/common/gpu/client/gpu_channel_host.h" | 9 #include "content/common/gpu/client/gpu_channel_host.h" |
10 #include "content/public/renderer/render_thread.h" | 10 #include "content/public/renderer/render_thread.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // it is okay to immediately send IPC messages through the returned channel. | 132 // it is okay to immediately send IPC messages through the returned channel. |
133 GpuChannelHost* channel = graphics3d->channel(); | 133 GpuChannelHost* channel = graphics3d->channel(); |
134 DCHECK(channel); | 134 DCHECK(channel); |
135 decoder_ = channel->CreateVideoDecoder(command_buffer_route_id); | 135 decoder_ = channel->CreateVideoDecoder(command_buffer_route_id); |
136 if (decoder_ && decoder_->Initialize(media_profile, this)) { | 136 if (decoder_ && decoder_->Initialize(media_profile, this)) { |
137 initialized_ = true; | 137 initialized_ = true; |
138 return PP_OK; | 138 return PP_OK; |
139 } | 139 } |
140 decoder_.reset(); | 140 decoder_.reset(); |
141 | 141 |
| 142 #if defined(OS_ANDROID) |
| 143 return PP_ERROR_NOTSUPPORTED; |
| 144 #else |
142 if (!allow_software_fallback) | 145 if (!allow_software_fallback) |
143 return PP_ERROR_NOTSUPPORTED; | 146 return PP_ERROR_NOTSUPPORTED; |
144 | 147 |
145 decoder_.reset(new VideoDecoderShim(this)); | 148 decoder_.reset(new VideoDecoderShim(this)); |
146 initialize_reply_context_ = context->MakeReplyMessageContext(); | 149 initialize_reply_context_ = context->MakeReplyMessageContext(); |
147 decoder_->Initialize(media_profile, this); | 150 decoder_->Initialize(media_profile, this); |
148 | 151 |
149 return PP_OK_COMPLETIONPENDING; | 152 return PP_OK_COMPLETIONPENDING; |
| 153 #endif |
150 } | 154 } |
151 | 155 |
152 int32_t PepperVideoDecoderHost::OnHostMsgGetShm( | 156 int32_t PepperVideoDecoderHost::OnHostMsgGetShm( |
153 ppapi::host::HostMessageContext* context, | 157 ppapi::host::HostMessageContext* context, |
154 uint32_t shm_id, | 158 uint32_t shm_id, |
155 uint32_t shm_size) { | 159 uint32_t shm_size) { |
156 if (!initialized_) | 160 if (!initialized_) |
157 return PP_ERROR_FAILED; | 161 return PP_ERROR_FAILED; |
158 | 162 |
159 // Make the buffers larger since we hope to reuse them. | 163 // Make the buffers larger since we hope to reuse them. |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 host()->SendUnsolicitedReply( | 400 host()->SendUnsolicitedReply( |
397 pp_resource(), | 401 pp_resource(), |
398 PpapiPluginMsg_VideoDecoder_RequestTextures( | 402 PpapiPluginMsg_VideoDecoder_RequestTextures( |
399 requested_num_of_buffers, | 403 requested_num_of_buffers, |
400 PP_MakeSize(dimensions.width(), dimensions.height()), | 404 PP_MakeSize(dimensions.width(), dimensions.height()), |
401 texture_target, | 405 texture_target, |
402 mailboxes)); | 406 mailboxes)); |
403 } | 407 } |
404 | 408 |
405 } // namespace content | 409 } // namespace content |
OLD | NEW |