OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2014 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 CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ | |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ | |
7 | |
8 #include <list> | |
9 #include <map> | |
10 #include <queue> | |
11 #include <vector> | |
12 | |
13 #include "base/basictypes.h" | |
14 #include "base/memory/ref_counted.h" | |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "base/memory/scoped_vector.h" | |
17 #include "base/memory/weak_ptr.h" | |
18 #include "content/common/content_export.h" | |
19 #include "gpu/command_buffer/common/mailbox.h" | |
20 #include "media/video/video_decode_accelerator.h" | |
21 #include "ppapi/c/pp_codecs.h" | |
22 #include "ppapi/host/host_message_context.h" | |
23 #include "ppapi/host/resource_host.h" | |
24 #include "ppapi/proxy/resource_message_params.h" | |
25 | |
26 namespace base { | |
27 class SharedMemory; | |
28 } | |
29 | |
30 namespace gpu { | |
31 namespace gles2 { | |
32 class GLES2Interface; | |
33 } | |
34 } | |
35 | |
36 namespace webkit { | |
37 namespace gpu { | |
38 class ContextProviderWebContext; | |
39 } | |
40 } | |
41 | |
42 namespace content { | |
43 | |
44 class PPB_Graphics3D_Impl; | |
45 class RendererPpapiHost; | |
46 class RenderViewImpl; | |
47 | |
48 class CONTENT_EXPORT PepperVideoDecoderHost | |
49 : public ppapi::host::ResourceHost, | |
50 public media::VideoDecodeAccelerator::Client, | |
51 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
| |
52 public: | |
53 PepperVideoDecoderHost(RendererPpapiHost* host, | |
54 PP_Instance instance, | |
55 PP_Resource resource); | |
56 virtual ~PepperVideoDecoderHost(); | |
57 | |
58 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.
| |
59 const IPC::Message& msg, | |
60 ppapi::host::HostMessageContext* context) OVERRIDE; | |
61 | |
62 // media::VideoDecodeAccelerator::Client implementation. | |
63 virtual void ProvidePictureBuffers(uint32 requested_num_of_buffers, | |
64 const gfx::Size& dimensions, | |
65 uint32 texture_target) OVERRIDE; | |
66 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; | |
67 virtual void PictureReady(const media::Picture& picture) OVERRIDE; | |
68 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE; | |
69 virtual void NotifyFlushDone() OVERRIDE; | |
70 virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) OVERRIDE; | |
71 virtual void NotifyResetDone() OVERRIDE; | |
72 | |
73 private: | |
74 int32_t OnHostMsgInitialize(ppapi::host::HostMessageContext* context, | |
75 ppapi::HostResource graphics_context, | |
76 PP_VideoProfile profile, | |
77 bool allow_software_fallback); | |
78 int32_t OnHostMsgGetShm(ppapi::host::HostMessageContext* context, | |
79 uint32_t size); | |
80 int32_t OnHostMsgAssignTextures(ppapi::host::HostMessageContext* context, | |
81 PP_Size size, | |
82 const std::vector<uint32_t>& texture_ids); | |
83 int32_t OnHostMsgDecode(ppapi::host::HostMessageContext* context, | |
84 uint32_t shm_id, | |
85 uint32_t size); | |
86 int32_t OnHostMsgRecyclePicture(ppapi::host::HostMessageContext* context, | |
87 uint32_t picture_id); | |
88 int32_t OnHostMsgFlush(ppapi::host::HostMessageContext* context); | |
89 int32_t OnHostMsgReset(ppapi::host::HostMessageContext* context); | |
90 | |
91 void RequestTextures(uint32 num_textures, | |
92 const gfx::Size& dimensions, | |
93 uint32 texture_target, | |
94 const std::vector<gpu::Mailbox>& mailboxes); | |
95 | |
96 // Non-owning pointer. | |
97 RendererPpapiHost* renderer_ppapi_host_; | |
98 | |
99 scoped_ptr<media::VideoDecodeAccelerator> decoder_; | |
100 | |
101 ScopedVector<base::SharedMemory> shm_buffers_; | |
102 | |
103 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.
| |
104 ReplyMap pending_decodes_; | |
105 | |
106 ppapi::host::ReplyMessageContext flush_reply_context_; | |
107 ppapi::host::ReplyMessageContext reset_reply_context_; | |
108 | |
109 bool initialized_; | |
110 | |
111 base::WeakPtrFactory<PepperVideoDecoderHost> weak_factory_; | |
112 | |
113 DISALLOW_COPY_AND_ASSIGN(PepperVideoDecoderHost); | |
114 }; | |
115 | |
116 } // namespace content | |
117 | |
118 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ | |
OLD | NEW |