Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: ppapi/proxy/ppb_video_decoder_proxy.cc

Issue 1548813002: Switch to standard integer types in ppapi/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/proxy/ppb_video_decoder_proxy.h ('k') | ppapi/proxy/ppb_x509_certificate_private_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ppapi/proxy/ppb_video_decoder_proxy.h" 5 #include "ppapi/proxy/ppb_video_decoder_proxy.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h"
8 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
9 #include "gpu/command_buffer/client/gles2_implementation.h" 10 #include "gpu/command_buffer/client/gles2_implementation.h"
10 #include "ppapi/proxy/enter_proxy.h" 11 #include "ppapi/proxy/enter_proxy.h"
11 #include "ppapi/proxy/plugin_dispatcher.h" 12 #include "ppapi/proxy/plugin_dispatcher.h"
12 #include "ppapi/proxy/ppapi_messages.h" 13 #include "ppapi/proxy/ppapi_messages.h"
13 #include "ppapi/proxy/ppb_buffer_proxy.h" 14 #include "ppapi/proxy/ppb_buffer_proxy.h"
14 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" 15 #include "ppapi/proxy/ppb_graphics_3d_proxy.h"
15 #include "ppapi/thunk/enter.h" 16 #include "ppapi/thunk/enter.h"
16 #include "ppapi/thunk/resource_creation_api.h" 17 #include "ppapi/thunk/resource_creation_api.h"
17 #include "ppapi/thunk/thunk.h" 18 #include "ppapi/thunk/thunk.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 thunk::EnterResourceCreation resource_creation(instance); 224 thunk::EnterResourceCreation resource_creation(instance);
224 if (resource_creation.failed()) 225 if (resource_creation.failed())
225 return; 226 return;
226 227
227 // Make the resource and get the API pointer to its interface. 228 // Make the resource and get the API pointer to its interface.
228 result->SetHostResource( 229 result->SetHostResource(
229 instance, resource_creation.functions()->CreateVideoDecoderDev( 230 instance, resource_creation.functions()->CreateVideoDecoderDev(
230 instance, graphics_context.host_resource(), profile)); 231 instance, graphics_context.host_resource(), profile));
231 } 232 }
232 233
233 void PPB_VideoDecoder_Proxy::OnMsgDecode( 234 void PPB_VideoDecoder_Proxy::OnMsgDecode(const HostResource& decoder,
234 const HostResource& decoder, 235 const HostResource& buffer,
235 const HostResource& buffer, int32 id, uint32 size) { 236 int32_t id,
237 uint32_t size) {
236 EnterHostFromHostResourceForceCallback<PPB_VideoDecoder_Dev_API> enter( 238 EnterHostFromHostResourceForceCallback<PPB_VideoDecoder_Dev_API> enter(
237 decoder, callback_factory_, 239 decoder, callback_factory_,
238 &PPB_VideoDecoder_Proxy::SendMsgEndOfBitstreamACKToPlugin, decoder, id); 240 &PPB_VideoDecoder_Proxy::SendMsgEndOfBitstreamACKToPlugin, decoder, id);
239 if (enter.failed()) 241 if (enter.failed())
240 return; 242 return;
241 PP_VideoBitstreamBuffer_Dev bitstream = { id, buffer.host_resource(), size }; 243 PP_VideoBitstreamBuffer_Dev bitstream = { id, buffer.host_resource(), size };
242 enter.SetResult(enter.object()->Decode(&bitstream, enter.callback())); 244 enter.SetResult(enter.object()->Decode(&bitstream, enter.callback()));
243 } 245 }
244 246
245 void PPB_VideoDecoder_Proxy::OnMsgAssignPictureBuffers( 247 void PPB_VideoDecoder_Proxy::OnMsgAssignPictureBuffers(
246 const HostResource& decoder, 248 const HostResource& decoder,
247 const std::vector<PP_PictureBuffer_Dev>& buffers) { 249 const std::vector<PP_PictureBuffer_Dev>& buffers) {
248 EnterHostFromHostResource<PPB_VideoDecoder_Dev_API> enter(decoder); 250 EnterHostFromHostResource<PPB_VideoDecoder_Dev_API> enter(decoder);
249 if (enter.succeeded() && !buffers.empty()) { 251 if (enter.succeeded() && !buffers.empty()) {
250 const PP_PictureBuffer_Dev* buffer_array = &buffers.front(); 252 const PP_PictureBuffer_Dev* buffer_array = &buffers.front();
251 enter.object()->AssignPictureBuffers( 253 enter.object()->AssignPictureBuffers(
252 base::checked_cast<uint32_t>(buffers.size()), buffer_array); 254 base::checked_cast<uint32_t>(buffers.size()), buffer_array);
253 } 255 }
254 } 256 }
255 257
256 void PPB_VideoDecoder_Proxy::OnMsgReusePictureBuffer( 258 void PPB_VideoDecoder_Proxy::OnMsgReusePictureBuffer(
257 const HostResource& decoder, int32 picture_buffer_id) { 259 const HostResource& decoder,
260 int32_t picture_buffer_id) {
258 EnterHostFromHostResource<PPB_VideoDecoder_Dev_API> enter(decoder); 261 EnterHostFromHostResource<PPB_VideoDecoder_Dev_API> enter(decoder);
259 if (enter.succeeded()) 262 if (enter.succeeded())
260 enter.object()->ReusePictureBuffer(picture_buffer_id); 263 enter.object()->ReusePictureBuffer(picture_buffer_id);
261 } 264 }
262 265
263 void PPB_VideoDecoder_Proxy::OnMsgFlush(const HostResource& decoder) { 266 void PPB_VideoDecoder_Proxy::OnMsgFlush(const HostResource& decoder) {
264 EnterHostFromHostResourceForceCallback<PPB_VideoDecoder_Dev_API> enter( 267 EnterHostFromHostResourceForceCallback<PPB_VideoDecoder_Dev_API> enter(
265 decoder, callback_factory_, 268 decoder, callback_factory_,
266 &PPB_VideoDecoder_Proxy::SendMsgFlushACKToPlugin, decoder); 269 &PPB_VideoDecoder_Proxy::SendMsgFlushACKToPlugin, decoder);
267 if (enter.succeeded()) 270 if (enter.succeeded())
268 enter.SetResult(enter.object()->Flush(enter.callback())); 271 enter.SetResult(enter.object()->Flush(enter.callback()));
269 } 272 }
270 273
271 void PPB_VideoDecoder_Proxy::OnMsgReset(const HostResource& decoder) { 274 void PPB_VideoDecoder_Proxy::OnMsgReset(const HostResource& decoder) {
272 EnterHostFromHostResourceForceCallback<PPB_VideoDecoder_Dev_API> enter( 275 EnterHostFromHostResourceForceCallback<PPB_VideoDecoder_Dev_API> enter(
273 decoder, callback_factory_, 276 decoder, callback_factory_,
274 &PPB_VideoDecoder_Proxy::SendMsgResetACKToPlugin, decoder); 277 &PPB_VideoDecoder_Proxy::SendMsgResetACKToPlugin, decoder);
275 if (enter.succeeded()) 278 if (enter.succeeded())
276 enter.SetResult(enter.object()->Reset(enter.callback())); 279 enter.SetResult(enter.object()->Reset(enter.callback()));
277 } 280 }
278 281
279 void PPB_VideoDecoder_Proxy::OnMsgDestroy(const HostResource& decoder) { 282 void PPB_VideoDecoder_Proxy::OnMsgDestroy(const HostResource& decoder) {
280 EnterHostFromHostResource<PPB_VideoDecoder_Dev_API> enter(decoder); 283 EnterHostFromHostResource<PPB_VideoDecoder_Dev_API> enter(decoder);
281 if (enter.succeeded()) 284 if (enter.succeeded())
282 enter.object()->Destroy(); 285 enter.object()->Destroy();
283 } 286 }
284 287
285 void PPB_VideoDecoder_Proxy::SendMsgEndOfBitstreamACKToPlugin( 288 void PPB_VideoDecoder_Proxy::SendMsgEndOfBitstreamACKToPlugin(
286 int32_t result, const HostResource& decoder, int32 id) { 289 int32_t result,
290 const HostResource& decoder,
291 int32_t id) {
287 dispatcher()->Send(new PpapiMsg_PPBVideoDecoder_EndOfBitstreamACK( 292 dispatcher()->Send(new PpapiMsg_PPBVideoDecoder_EndOfBitstreamACK(
288 API_ID_PPB_VIDEO_DECODER_DEV, decoder, id, result)); 293 API_ID_PPB_VIDEO_DECODER_DEV, decoder, id, result));
289 } 294 }
290 295
291 void PPB_VideoDecoder_Proxy::SendMsgFlushACKToPlugin( 296 void PPB_VideoDecoder_Proxy::SendMsgFlushACKToPlugin(
292 int32_t result, const HostResource& decoder) { 297 int32_t result, const HostResource& decoder) {
293 dispatcher()->Send(new PpapiMsg_PPBVideoDecoder_FlushACK( 298 dispatcher()->Send(new PpapiMsg_PPBVideoDecoder_FlushACK(
294 API_ID_PPB_VIDEO_DECODER_DEV, decoder, result)); 299 API_ID_PPB_VIDEO_DECODER_DEV, decoder, result));
295 } 300 }
296 301
(...skipping 19 matching lines...) Expand all
316 321
317 void PPB_VideoDecoder_Proxy::OnMsgResetACK( 322 void PPB_VideoDecoder_Proxy::OnMsgResetACK(
318 const HostResource& decoder, int32_t result) { 323 const HostResource& decoder, int32_t result) {
319 EnterPluginFromHostResource<PPB_VideoDecoder_Dev_API> enter(decoder); 324 EnterPluginFromHostResource<PPB_VideoDecoder_Dev_API> enter(decoder);
320 if (enter.succeeded()) 325 if (enter.succeeded())
321 static_cast<VideoDecoder*>(enter.object())->ResetACK(result); 326 static_cast<VideoDecoder*>(enter.object())->ResetACK(result);
322 } 327 }
323 328
324 } // namespace proxy 329 } // namespace proxy
325 } // namespace ppapi 330 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_video_decoder_proxy.h ('k') | ppapi/proxy/ppb_x509_certificate_private_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698