OLD | NEW |
---|---|
(Empty) | |
1 // 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 | |
8 #include "ppapi/c/pp_instance.h" | |
9 #include "ppapi/cpp/completion_callback.h" | |
10 #include "ppapi/proxy/interface_proxy.h" | |
11 #include "ppapi/proxy/plugin_resource.h" | |
12 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" | |
13 #include "ppapi/shared_impl/video_decoder_impl.h" | |
14 #include "ppapi/thunk/ppb_video_decoder_api.h" | |
15 | |
16 namespace pp { | |
17 namespace proxy { | |
18 | |
19 class VideoDecoder : public PluginResource, | |
20 public ::ppapi::VideoDecoderImpl { | |
21 public: | |
22 virtual ~VideoDecoder(); | |
23 | |
24 static VideoDecoder* Create(const HostResource& resource, | |
25 PP_Resource context3d_id, | |
26 const PP_VideoConfigElement* config); | |
27 | |
28 // ResourceObjectBase overrides. | |
29 virtual PPB_VideoDecoder_API* AsPPB_VideoDecoder_API() OVERRIDE; | |
30 | |
31 // PPB_VideoDecoder_API implementation. | |
32 virtual int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | |
33 PP_CompletionCallback callback) OVERRIDE; | |
34 virtual void AssignPictureBuffers( | |
35 uint32_t no_of_buffers, const PP_PictureBuffer_Dev* buffers) OVERRIDE; | |
36 virtual void ReusePictureBuffer(int32_t picture_buffer_id) OVERRIDE; | |
37 virtual int32_t Flush(PP_CompletionCallback callback) OVERRIDE; | |
38 virtual int32_t Reset(PP_CompletionCallback callback) OVERRIDE; | |
39 virtual void Destroy() OVERRIDE; | |
40 | |
41 void FlushACK(); | |
Ami GONE FROM CHROMIUM
2011/08/02 00:49:08
Does proxy stuff not believe in "friend"ship?
(i.e
vrk (LEFT CHROMIUM)
2011/08/03 19:04:30
Yes.
| |
42 void ResetACK(); | |
43 void EndOfBitstreamACK(int32_t buffer_id); | |
44 | |
45 virtual bool Init( | |
Ami GONE FROM CHROMIUM
2011/08/02 00:49:08
s/public/protected/
vrk (LEFT CHROMIUM)
2011/08/03 19:04:30
n/a removed the overrided method.
| |
46 PP_Resource context_id, const PP_VideoConfigElement* decoder_config); | |
47 | |
48 private: | |
49 explicit VideoDecoder(const HostResource& resource); | |
50 DISALLOW_COPY_AND_ASSIGN(VideoDecoder); | |
51 }; | |
52 | |
53 class PPB_VideoDecoder_Proxy : public InterfaceProxy { | |
Ami GONE FROM CHROMIUM
2011/08/02 00:49:08
None of the other .h files in this dir declare two
vrk (LEFT CHROMIUM)
2011/08/03 19:04:30
Talked in person. Not unified but class def moved
| |
54 public: | |
55 PPB_VideoDecoder_Proxy(Dispatcher* dispatcher, const void* target_interface); | |
56 virtual ~PPB_VideoDecoder_Proxy(); | |
57 | |
58 static const Info* GetInfo(); | |
59 | |
60 // Creates a VideoDecoder object in the plugin process. | |
61 static PP_Resource CreateProxyResource(PP_Instance instance, | |
62 PP_Resource context3d_id, const PP_VideoConfigElement* config); | |
63 | |
64 // InterfaceProxy implementation. | |
65 virtual bool OnMessageReceived(const IPC::Message& msg); | |
66 | |
67 private: | |
68 // Message handlers in the renderer process to receive messages from the | |
69 // plugin process. | |
70 void OnMsgCreate(PP_Instance instance, const HostResource& context3d_id, | |
71 const std::vector<int32_t>& config, HostResource* result); | |
72 void OnMsgDecode( | |
73 const HostResource& decoder, | |
74 const HostResource& buffer, int32 id, int32 size); | |
75 void OnMsgAssignPictureBuffers( | |
76 const HostResource& decoder, | |
77 const std::vector<PP_PictureBuffer_Dev>& buffers); | |
78 void OnMsgReusePictureBuffer( | |
79 const HostResource& decoder, | |
80 int32 picture_buffer_id); | |
81 void OnMsgFlush(const HostResource& decoder); | |
82 void OnMsgReset(const HostResource& decoder); | |
83 void OnMsgDestroy(const HostResource& decoder); | |
84 | |
85 void SendMsgEndOfBitstreamACKToPlugin( | |
86 int32_t result, const HostResource& decoder, int32 id); | |
87 void SendMsgFlushACKToPlugin( | |
88 int32_t result, const HostResource& decoder); | |
89 void SendMsgResetACKToPlugin( | |
90 int32_t result, const HostResource& decoder); | |
91 | |
92 // Message handlers in the plugin process to receive messages from the | |
93 // renderer process. | |
94 void OnMsgEndOfBitstreamACK(const HostResource& decoder, int32_t pp_error); | |
95 void OnMsgFlushACK(const HostResource& decoder, int32_t pp_error); | |
96 void OnMsgResetACK(const HostResource& decoder, int32_t pp_error); | |
97 | |
98 CompletionCallbackFactory<PPB_VideoDecoder_Proxy, | |
99 ProxyNonThreadSafeRefCount> callback_factory_; | |
100 | |
101 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Proxy); | |
102 }; | |
103 | |
104 } // namespace proxy | |
105 } // namespace pp | |
106 | |
107 #endif // PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_ | |
OLD | NEW |