blob: 0b2a6f69054d49746abd37a85029accbc921e337 [file] [log] [blame]
[email protected]7ace8ad2011-08-06 03:23:581// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_
6#define PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_
7
avie029c4132015-12-23 06:45:228#include <stdint.h>
9
10#include "base/macros.h"
[email protected]7ace8ad2011-08-06 03:23:5811#include "ppapi/c/pp_instance.h"
[email protected]7ace8ad2011-08-06 03:23:5812#include "ppapi/proxy/interface_proxy.h"
[email protected]47a961c2012-07-13 19:18:5213#include "ppapi/proxy/proxy_completion_callback_factory.h"
[email protected]9a578392011-12-07 18:59:2714#include "ppapi/shared_impl/ppb_video_decoder_shared.h"
[email protected]4ba60db2014-05-06 07:08:1915#include "ppapi/thunk/ppb_video_decoder_dev_api.h"
[email protected]ae5ff9ae2012-01-06 22:50:3316#include "ppapi/utility/completion_callback_factory.h"
[email protected]7ace8ad2011-08-06 03:23:5817
[email protected]4d2efd22011-08-18 21:58:0218namespace ppapi {
[email protected]7ace8ad2011-08-06 03:23:5819namespace proxy {
20
21class PPB_VideoDecoder_Proxy : public InterfaceProxy {
22 public:
[email protected]5c966022011-09-13 18:09:3723 PPB_VideoDecoder_Proxy(Dispatcher* dispatcher);
[email protected]7ace8ad2011-08-06 03:23:5824 virtual ~PPB_VideoDecoder_Proxy();
25
[email protected]7ace8ad2011-08-06 03:23:5826 // Creates a VideoDecoder object in the plugin process.
[email protected]2ffc31a2011-09-01 03:18:2827 static PP_Resource CreateProxyResource(
28 PP_Instance instance,
29 PP_Resource graphics_context,
30 PP_VideoDecoder_Profile profile);
[email protected]7ace8ad2011-08-06 03:23:5831
32 // InterfaceProxy implementation.
33 virtual bool OnMessageReceived(const IPC::Message& msg);
34
[email protected]ac4b54d2011-10-20 23:09:2835 static const ApiID kApiID = API_ID_PPB_VIDEO_DECODER_DEV;
[email protected]7ace8ad2011-08-06 03:23:5836
37 private:
38 // Message handlers in the renderer process to receive messages from the
39 // plugin process.
[email protected]be0a84b2011-08-13 04:18:4440 void OnMsgCreate(PP_Instance instance,
[email protected]1b2ec22e2011-08-30 00:48:3341 const ppapi::HostResource& graphics_context,
[email protected]2ffc31a2011-09-01 03:18:2842 PP_VideoDecoder_Profile profile,
[email protected]be0a84b2011-08-13 04:18:4443 ppapi::HostResource* result);
avie029c4132015-12-23 06:45:2244 void OnMsgDecode(const ppapi::HostResource& decoder,
45 const ppapi::HostResource& buffer,
46 int32_t id,
47 uint32_t size);
[email protected]7ace8ad2011-08-06 03:23:5848 void OnMsgAssignPictureBuffers(
[email protected]be0a84b2011-08-13 04:18:4449 const ppapi::HostResource& decoder,
[email protected]7ace8ad2011-08-06 03:23:5850 const std::vector<PP_PictureBuffer_Dev>& buffers);
avie029c4132015-12-23 06:45:2251 void OnMsgReusePictureBuffer(const ppapi::HostResource& decoder,
52 int32_t picture_buffer_id);
[email protected]be0a84b2011-08-13 04:18:4453 void OnMsgFlush(const ppapi::HostResource& decoder);
54 void OnMsgReset(const ppapi::HostResource& decoder);
55 void OnMsgDestroy(const ppapi::HostResource& decoder);
[email protected]7ace8ad2011-08-06 03:23:5856
57 // Send a message from the renderer process to the plugin process to tell it
58 // to run its callback.
avie029c4132015-12-23 06:45:2259 void SendMsgEndOfBitstreamACKToPlugin(int32_t result,
60 const ppapi::HostResource& decoder,
61 int32_t id);
[email protected]7ace8ad2011-08-06 03:23:5862 void SendMsgFlushACKToPlugin(
[email protected]be0a84b2011-08-13 04:18:4463 int32_t result, const ppapi::HostResource& decoder);
[email protected]7ace8ad2011-08-06 03:23:5864 void SendMsgResetACKToPlugin(
[email protected]be0a84b2011-08-13 04:18:4465 int32_t result, const ppapi::HostResource& decoder);
[email protected]7ace8ad2011-08-06 03:23:5866
67 // Message handlers in the plugin process to receive messages from the
68 // renderer process.
[email protected]be0a84b2011-08-13 04:18:4469 void OnMsgEndOfBitstreamACK(const ppapi::HostResource& decoder,
[email protected]7ace8ad2011-08-06 03:23:5870 int32_t id, int32_t result);
[email protected]be0a84b2011-08-13 04:18:4471 void OnMsgFlushACK(const ppapi::HostResource& decoder, int32_t result);
72 void OnMsgResetACK(const ppapi::HostResource& decoder, int32_t result);
[email protected]7ace8ad2011-08-06 03:23:5873
[email protected]47a961c2012-07-13 19:18:5274 ProxyCompletionCallbackFactory<PPB_VideoDecoder_Proxy> callback_factory_;
[email protected]7ace8ad2011-08-06 03:23:5875
76 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Proxy);
77};
78
79} // namespace proxy
[email protected]4d2efd22011-08-18 21:58:0280} // namespace ppapi
[email protected]7ace8ad2011-08-06 03:23:5881
82#endif // PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_