blob: b2f76e32d932a514d277a25baf797fa53be9d4a5 [file] [log] [blame]
Avi Drissmandb497b32022-09-15 19:47:281// Copyright 2011 The Chromium Authors
[email protected]7ace8ad2011-08-06 03:23:582// 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
[email protected]7ace8ad2011-08-06 03:23:5810#include "ppapi/c/pp_instance.h"
[email protected]7ace8ad2011-08-06 03:23:5811#include "ppapi/proxy/interface_proxy.h"
[email protected]47a961c2012-07-13 19:18:5212#include "ppapi/proxy/proxy_completion_callback_factory.h"
[email protected]9a578392011-12-07 18:59:2713#include "ppapi/shared_impl/ppb_video_decoder_shared.h"
[email protected]4ba60db2014-05-06 07:08:1914#include "ppapi/thunk/ppb_video_decoder_dev_api.h"
[email protected]ae5ff9ae2012-01-06 22:50:3315#include "ppapi/utility/completion_callback_factory.h"
[email protected]7ace8ad2011-08-06 03:23:5816
[email protected]4d2efd22011-08-18 21:58:0217namespace ppapi {
[email protected]7ace8ad2011-08-06 03:23:5818namespace proxy {
19
20class PPB_VideoDecoder_Proxy : public InterfaceProxy {
21 public:
Lei Zhang94f57fe32017-08-30 23:58:2422 explicit PPB_VideoDecoder_Proxy(Dispatcher* dispatcher);
Peter Boström3d5b3cb2021-09-23 21:35:4523
24 PPB_VideoDecoder_Proxy(const PPB_VideoDecoder_Proxy&) = delete;
25 PPB_VideoDecoder_Proxy& operator=(const PPB_VideoDecoder_Proxy&) = delete;
26
Lei Zhang94f57fe32017-08-30 23:58:2427 ~PPB_VideoDecoder_Proxy() override;
[email protected]7ace8ad2011-08-06 03:23:5828
[email protected]7ace8ad2011-08-06 03:23:5829 // Creates a VideoDecoder object in the plugin process.
[email protected]2ffc31a2011-09-01 03:18:2830 static PP_Resource CreateProxyResource(
31 PP_Instance instance,
32 PP_Resource graphics_context,
33 PP_VideoDecoder_Profile profile);
[email protected]7ace8ad2011-08-06 03:23:5834
35 // InterfaceProxy implementation.
Lei Zhang94f57fe32017-08-30 23:58:2436 bool OnMessageReceived(const IPC::Message& msg) override;
[email protected]7ace8ad2011-08-06 03:23:5837
[email protected]ac4b54d2011-10-20 23:09:2838 static const ApiID kApiID = API_ID_PPB_VIDEO_DECODER_DEV;
[email protected]7ace8ad2011-08-06 03:23:5839
40 private:
41 // Message handlers in the renderer process to receive messages from the
42 // plugin process.
[email protected]be0a84b2011-08-13 04:18:4443 void OnMsgCreate(PP_Instance instance,
[email protected]1b2ec22e2011-08-30 00:48:3344 const ppapi::HostResource& graphics_context,
[email protected]2ffc31a2011-09-01 03:18:2845 PP_VideoDecoder_Profile profile,
[email protected]be0a84b2011-08-13 04:18:4446 ppapi::HostResource* result);
avie029c4132015-12-23 06:45:2247 void OnMsgDecode(const ppapi::HostResource& decoder,
48 const ppapi::HostResource& buffer,
49 int32_t id,
50 uint32_t size);
[email protected]7ace8ad2011-08-06 03:23:5851 void OnMsgAssignPictureBuffers(
[email protected]be0a84b2011-08-13 04:18:4452 const ppapi::HostResource& decoder,
[email protected]7ace8ad2011-08-06 03:23:5853 const std::vector<PP_PictureBuffer_Dev>& buffers);
avie029c4132015-12-23 06:45:2254 void OnMsgReusePictureBuffer(const ppapi::HostResource& decoder,
55 int32_t picture_buffer_id);
[email protected]be0a84b2011-08-13 04:18:4456 void OnMsgFlush(const ppapi::HostResource& decoder);
57 void OnMsgReset(const ppapi::HostResource& decoder);
58 void OnMsgDestroy(const ppapi::HostResource& decoder);
[email protected]7ace8ad2011-08-06 03:23:5859
60 // Send a message from the renderer process to the plugin process to tell it
61 // to run its callback.
avie029c4132015-12-23 06:45:2262 void SendMsgEndOfBitstreamACKToPlugin(int32_t result,
63 const ppapi::HostResource& decoder,
64 int32_t id);
[email protected]7ace8ad2011-08-06 03:23:5865 void SendMsgFlushACKToPlugin(
[email protected]be0a84b2011-08-13 04:18:4466 int32_t result, const ppapi::HostResource& decoder);
[email protected]7ace8ad2011-08-06 03:23:5867 void SendMsgResetACKToPlugin(
[email protected]be0a84b2011-08-13 04:18:4468 int32_t result, const ppapi::HostResource& decoder);
[email protected]7ace8ad2011-08-06 03:23:5869
70 // Message handlers in the plugin process to receive messages from the
71 // renderer process.
[email protected]be0a84b2011-08-13 04:18:4472 void OnMsgEndOfBitstreamACK(const ppapi::HostResource& decoder,
[email protected]7ace8ad2011-08-06 03:23:5873 int32_t id, int32_t result);
[email protected]be0a84b2011-08-13 04:18:4474 void OnMsgFlushACK(const ppapi::HostResource& decoder, int32_t result);
75 void OnMsgResetACK(const ppapi::HostResource& decoder, int32_t result);
[email protected]7ace8ad2011-08-06 03:23:5876
[email protected]47a961c2012-07-13 19:18:5277 ProxyCompletionCallbackFactory<PPB_VideoDecoder_Proxy> callback_factory_;
[email protected]7ace8ad2011-08-06 03:23:5878};
79
80} // namespace proxy
[email protected]4d2efd22011-08-18 21:58:0281} // namespace ppapi
[email protected]7ace8ad2011-08-06 03:23:5882
83#endif // PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_