[email protected] | c80a0ba | 2012-01-13 00:02:29 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 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_PPP_VIDEO_DECODER_PROXY_H_ | ||||
6 | #define PPAPI_PROXY_PPP_VIDEO_DECODER_PROXY_H_ | ||||
7 | |||||
avi | e029c413 | 2015-12-23 06:45:22 | [diff] [blame] | 8 | #include <stdint.h> |
9 | |||||
10 | #include "base/macros.h" | ||||
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 11 | #include "ppapi/c/dev/ppp_video_decoder_dev.h" |
12 | #include "ppapi/c/pp_instance.h" | ||||
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 13 | #include "ppapi/proxy/interface_proxy.h" |
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 14 | #include "ppapi/shared_impl/host_resource.h" |
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 15 | |
16 | struct PP_Picture_Dev; | ||||
17 | struct PP_Size; | ||||
18 | |||||
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame] | 19 | namespace ppapi { |
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 20 | namespace proxy { |
21 | |||||
22 | class PPP_VideoDecoder_Proxy : public InterfaceProxy { | ||||
23 | public: | ||||
[email protected] | 5c96602 | 2011-09-13 18:09:37 | [diff] [blame] | 24 | PPP_VideoDecoder_Proxy(Dispatcher* dispatcher); |
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 25 | virtual ~PPP_VideoDecoder_Proxy(); |
26 | |||||
[email protected] | 6642ebf | 2013-12-17 20:49:30 | [diff] [blame] | 27 | static const PPP_VideoDecoder_Dev* GetProxyInterface(); |
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 28 | |
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 29 | // InterfaceProxy implementation. |
30 | virtual bool OnMessageReceived(const IPC::Message& msg); | ||||
31 | |||||
32 | private: | ||||
33 | // Message handlers. | ||||
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 34 | void OnMsgProvidePictureBuffers(const ppapi::HostResource& decoder, |
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 35 | uint32_t req_num_of_buffers, |
[email protected] | 08bab53 | 2012-06-08 19:39:45 | [diff] [blame] | 36 | const PP_Size& dimensions, |
37 | uint32_t texture_target); | ||||
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 38 | void OnMsgDismissPictureBuffer(const ppapi::HostResource& decoder, |
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 39 | int32_t picture_id); |
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 40 | void OnMsgPictureReady(const ppapi::HostResource& decoder, |
41 | const PP_Picture_Dev& picture_buffer); | ||||
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 42 | void OnMsgNotifyError(const ppapi::HostResource& decoder, |
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 43 | PP_VideoDecodeError_Dev error); |
44 | |||||
[email protected] | 5c96602 | 2011-09-13 18:09:37 | [diff] [blame] | 45 | // When this proxy is in the plugin side, this value caches the interface |
46 | // pointer so we don't have to retrieve it from the dispatcher each time. | ||||
47 | // In the host, this value is always NULL. | ||||
48 | const PPP_VideoDecoder_Dev* ppp_video_decoder_impl_; | ||||
49 | |||||
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 50 | DISALLOW_COPY_AND_ASSIGN(PPP_VideoDecoder_Proxy); |
51 | }; | ||||
52 | |||||
53 | } // namespace proxy | ||||
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame] | 54 | } // namespace ppapi |
[email protected] | 7ace8ad | 2011-08-06 03:23:58 | [diff] [blame] | 55 | |
56 | #endif // PPAPI_PROXY_PPP_VIDEO_DECODER_PROXY_H_ |