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

Unified Diff: content/renderer/pepper/pepper_video_decoder_host.h

Issue 270213004: Implement Pepper PPB_VideoDecoder interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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: content/renderer/pepper/pepper_video_decoder_host.h
diff --git a/content/renderer/pepper/pepper_video_decoder_host.h b/content/renderer/pepper/pepper_video_decoder_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..c895f9e6b2292681c8521d9007e3f674e13f8755
--- /dev/null
+++ b/content/renderer/pepper/pepper_video_decoder_host.h
@@ -0,0 +1,118 @@
+// Copyright (c) 2014 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 CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_
+#define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_
+
+#include <list>
+#include <map>
+#include <queue>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
+#include "base/memory/weak_ptr.h"
+#include "content/common/content_export.h"
+#include "gpu/command_buffer/common/mailbox.h"
+#include "media/video/video_decode_accelerator.h"
+#include "ppapi/c/pp_codecs.h"
+#include "ppapi/host/host_message_context.h"
+#include "ppapi/host/resource_host.h"
+#include "ppapi/proxy/resource_message_params.h"
+
+namespace base {
+class SharedMemory;
+}
+
+namespace gpu {
+namespace gles2 {
+class GLES2Interface;
+}
+}
+
+namespace webkit {
+namespace gpu {
+class ContextProviderWebContext;
+}
+}
+
+namespace content {
+
+class PPB_Graphics3D_Impl;
+class RendererPpapiHost;
+class RenderViewImpl;
+
+class CONTENT_EXPORT PepperVideoDecoderHost
+ : public ppapi::host::ResourceHost,
+ public media::VideoDecodeAccelerator::Client,
+ public base::SupportsWeakPtr<PepperVideoDecoderHost> {
dmichael (off chromium) 2014/05/08 20:27:00 You don't seem to use this base class?
bbudge 2014/05/14 16:40:41 I removed all vestiges of the software decoder stu
+ public:
+ PepperVideoDecoderHost(RendererPpapiHost* host,
+ PP_Instance instance,
+ PP_Resource resource);
+ virtual ~PepperVideoDecoderHost();
+
+ virtual int32_t OnResourceMessageReceived(
dmichael (off chromium) 2014/05/08 20:27:00 I think this and everything below should be privat
bbudge 2014/05/14 16:40:41 Done.
+ const IPC::Message& msg,
+ ppapi::host::HostMessageContext* context) OVERRIDE;
+
+ // media::VideoDecodeAccelerator::Client implementation.
+ virtual void ProvidePictureBuffers(uint32 requested_num_of_buffers,
+ const gfx::Size& dimensions,
+ uint32 texture_target) OVERRIDE;
+ virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE;
+ virtual void PictureReady(const media::Picture& picture) OVERRIDE;
+ virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE;
+ virtual void NotifyFlushDone() OVERRIDE;
+ virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) OVERRIDE;
+ virtual void NotifyResetDone() OVERRIDE;
+
+ private:
+ int32_t OnHostMsgInitialize(ppapi::host::HostMessageContext* context,
+ ppapi::HostResource graphics_context,
+ PP_VideoProfile profile,
+ bool allow_software_fallback);
+ int32_t OnHostMsgGetShm(ppapi::host::HostMessageContext* context,
+ uint32_t size);
+ int32_t OnHostMsgAssignTextures(ppapi::host::HostMessageContext* context,
+ PP_Size size,
+ const std::vector<uint32_t>& texture_ids);
+ int32_t OnHostMsgDecode(ppapi::host::HostMessageContext* context,
+ uint32_t shm_id,
+ uint32_t size);
+ int32_t OnHostMsgRecyclePicture(ppapi::host::HostMessageContext* context,
+ uint32_t picture_id);
+ int32_t OnHostMsgFlush(ppapi::host::HostMessageContext* context);
+ int32_t OnHostMsgReset(ppapi::host::HostMessageContext* context);
+
+ void RequestTextures(uint32 num_textures,
+ const gfx::Size& dimensions,
+ uint32 texture_target,
+ const std::vector<gpu::Mailbox>& mailboxes);
+
+ // Non-owning pointer.
+ RendererPpapiHost* renderer_ppapi_host_;
+
+ scoped_ptr<media::VideoDecodeAccelerator> decoder_;
+
+ ScopedVector<base::SharedMemory> shm_buffers_;
+
+ typedef std::map<uint32_t, ppapi::host::ReplyMessageContext> ReplyMap;
dmichael (off chromium) 2014/05/08 20:27:00 Some indication of what the uint32_t is would be n
bbudge 2014/05/14 16:40:41 Definitely, done.
+ ReplyMap pending_decodes_;
+
+ ppapi::host::ReplyMessageContext flush_reply_context_;
+ ppapi::host::ReplyMessageContext reset_reply_context_;
+
+ bool initialized_;
+
+ base::WeakPtrFactory<PepperVideoDecoderHost> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperVideoDecoderHost);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698