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

Unified Diff: ppapi/proxy/ppb_video_decoder_proxy.h

Issue 7545014: Implement PPAPI VideoDecode out-of-process support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: responses to ddorwin and piman Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/proxy/ppb_video_decoder_proxy.h
diff --git a/ppapi/proxy/ppb_video_decoder_proxy.h b/ppapi/proxy/ppb_video_decoder_proxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..e15c5f59709df8e3f9e3c280cd5553b297417594
--- /dev/null
+++ b/ppapi/proxy/ppb_video_decoder_proxy.h
@@ -0,0 +1,107 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_
+#define PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_
+
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/cpp/completion_callback.h"
+#include "ppapi/proxy/interface_proxy.h"
+#include "ppapi/proxy/plugin_resource.h"
+#include "ppapi/proxy/proxy_non_thread_safe_ref_count.h"
+#include "ppapi/shared_impl/video_decoder_impl.h"
+#include "ppapi/thunk/ppb_video_decoder_api.h"
+
+namespace pp {
+namespace proxy {
+
+class VideoDecoder : public PluginResource,
+ public ::ppapi::VideoDecoderImpl {
+ public:
+ virtual ~VideoDecoder();
+
+ static VideoDecoder* Create(const HostResource& resource,
+ PP_Resource context3d_id,
+ const PP_VideoConfigElement* config);
+
+ // ResourceObjectBase overrides.
+ virtual PPB_VideoDecoder_API* AsPPB_VideoDecoder_API() OVERRIDE;
+
+ // PPB_VideoDecoder_API implementation.
+ virtual int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer,
+ PP_CompletionCallback callback) OVERRIDE;
+ virtual void AssignPictureBuffers(
+ uint32_t no_of_buffers, const PP_PictureBuffer_Dev* buffers) OVERRIDE;
+ virtual void ReusePictureBuffer(int32_t picture_buffer_id) OVERRIDE;
+ virtual int32_t Flush(PP_CompletionCallback callback) OVERRIDE;
+ virtual int32_t Reset(PP_CompletionCallback callback) OVERRIDE;
+ virtual void Destroy() OVERRIDE;
+
+ 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.
+ void ResetACK();
+ void EndOfBitstreamACK(int32_t buffer_id);
+
+ 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.
+ PP_Resource context_id, const PP_VideoConfigElement* decoder_config);
+
+ private:
+ explicit VideoDecoder(const HostResource& resource);
+ DISALLOW_COPY_AND_ASSIGN(VideoDecoder);
+};
+
+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
+ public:
+ PPB_VideoDecoder_Proxy(Dispatcher* dispatcher, const void* target_interface);
+ virtual ~PPB_VideoDecoder_Proxy();
+
+ static const Info* GetInfo();
+
+ // Creates a VideoDecoder object in the plugin process.
+ static PP_Resource CreateProxyResource(PP_Instance instance,
+ PP_Resource context3d_id, const PP_VideoConfigElement* config);
+
+ // InterfaceProxy implementation.
+ virtual bool OnMessageReceived(const IPC::Message& msg);
+
+ private:
+ // Message handlers in the renderer process to receive messages from the
+ // plugin process.
+ void OnMsgCreate(PP_Instance instance, const HostResource& context3d_id,
+ const std::vector<int32_t>& config, HostResource* result);
+ void OnMsgDecode(
+ const HostResource& decoder,
+ const HostResource& buffer, int32 id, int32 size);
+ void OnMsgAssignPictureBuffers(
+ const HostResource& decoder,
+ const std::vector<PP_PictureBuffer_Dev>& buffers);
+ void OnMsgReusePictureBuffer(
+ const HostResource& decoder,
+ int32 picture_buffer_id);
+ void OnMsgFlush(const HostResource& decoder);
+ void OnMsgReset(const HostResource& decoder);
+ void OnMsgDestroy(const HostResource& decoder);
+
+ void SendMsgEndOfBitstreamACKToPlugin(
+ int32_t result, const HostResource& decoder, int32 id);
+ void SendMsgFlushACKToPlugin(
+ int32_t result, const HostResource& decoder);
+ void SendMsgResetACKToPlugin(
+ int32_t result, const HostResource& decoder);
+
+ // Message handlers in the plugin process to receive messages from the
+ // renderer process.
+ void OnMsgEndOfBitstreamACK(const HostResource& decoder, int32_t pp_error);
+ void OnMsgFlushACK(const HostResource& decoder, int32_t pp_error);
+ void OnMsgResetACK(const HostResource& decoder, int32_t pp_error);
+
+ CompletionCallbackFactory<PPB_VideoDecoder_Proxy,
+ ProxyNonThreadSafeRefCount> callback_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Proxy);
+};
+
+} // namespace proxy
+} // namespace pp
+
+#endif // PPAPI_PROXY_PPB_VIDEO_DECODER_PROXY_H_

Powered by Google App Engine
This is Rietveld 408576698