OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 class RenderViewImpl; | 30 class RenderViewImpl; |
31 class VideoDecoderShim; | 31 class VideoDecoderShim; |
32 | 32 |
33 class CONTENT_EXPORT PepperVideoDecoderHost | 33 class CONTENT_EXPORT PepperVideoDecoderHost |
34 : public ppapi::host::ResourceHost, | 34 : public ppapi::host::ResourceHost, |
35 public media::VideoDecodeAccelerator::Client { | 35 public media::VideoDecodeAccelerator::Client { |
36 public: | 36 public: |
37 PepperVideoDecoderHost(RendererPpapiHost* host, | 37 PepperVideoDecoderHost(RendererPpapiHost* host, |
38 PP_Instance instance, | 38 PP_Instance instance, |
39 PP_Resource resource); | 39 PP_Resource resource); |
40 virtual ~PepperVideoDecoderHost(); | 40 ~PepperVideoDecoderHost() override; |
41 | 41 |
42 private: | 42 private: |
43 struct PendingDecode { | 43 struct PendingDecode { |
44 PendingDecode(uint32_t shm_id, | 44 PendingDecode(uint32_t shm_id, |
45 const ppapi::host::ReplyMessageContext& reply_context); | 45 const ppapi::host::ReplyMessageContext& reply_context); |
46 ~PendingDecode(); | 46 ~PendingDecode(); |
47 | 47 |
48 const uint32_t shm_id; | 48 const uint32_t shm_id; |
49 const ppapi::host::ReplyMessageContext reply_context; | 49 const ppapi::host::ReplyMessageContext reply_context; |
50 }; | 50 }; |
51 | 51 |
52 friend class VideoDecoderShim; | 52 friend class VideoDecoderShim; |
53 | 53 |
54 // ResourceHost implementation. | 54 // ResourceHost implementation. |
55 virtual int32_t OnResourceMessageReceived( | 55 int32_t OnResourceMessageReceived( |
56 const IPC::Message& msg, | 56 const IPC::Message& msg, |
57 ppapi::host::HostMessageContext* context) override; | 57 ppapi::host::HostMessageContext* context) override; |
58 | 58 |
59 // media::VideoDecodeAccelerator::Client implementation. | 59 // media::VideoDecodeAccelerator::Client implementation. |
60 virtual void ProvidePictureBuffers(uint32 requested_num_of_buffers, | 60 void ProvidePictureBuffers(uint32 requested_num_of_buffers, |
61 const gfx::Size& dimensions, | 61 const gfx::Size& dimensions, |
62 uint32 texture_target) override; | 62 uint32 texture_target) override; |
63 virtual void DismissPictureBuffer(int32 picture_buffer_id) override; | 63 void DismissPictureBuffer(int32 picture_buffer_id) override; |
64 virtual void PictureReady(const media::Picture& picture) override; | 64 void PictureReady(const media::Picture& picture) override; |
65 virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) override; | 65 void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) override; |
66 virtual void NotifyFlushDone() override; | 66 void NotifyFlushDone() override; |
67 virtual void NotifyResetDone() override; | 67 void NotifyResetDone() override; |
68 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) override; | 68 void NotifyError(media::VideoDecodeAccelerator::Error error) override; |
69 | 69 |
70 int32_t OnHostMsgInitialize(ppapi::host::HostMessageContext* context, | 70 int32_t OnHostMsgInitialize(ppapi::host::HostMessageContext* context, |
71 const ppapi::HostResource& graphics_context, | 71 const ppapi::HostResource& graphics_context, |
72 PP_VideoProfile profile, | 72 PP_VideoProfile profile, |
73 PP_HardwareAcceleration acceleration); | 73 PP_HardwareAcceleration acceleration); |
74 int32_t OnHostMsgGetShm(ppapi::host::HostMessageContext* context, | 74 int32_t OnHostMsgGetShm(ppapi::host::HostMessageContext* context, |
75 uint32_t shm_id, | 75 uint32_t shm_id, |
76 uint32_t shm_size); | 76 uint32_t shm_size); |
77 int32_t OnHostMsgDecode(ppapi::host::HostMessageContext* context, | 77 int32_t OnHostMsgDecode(ppapi::host::HostMessageContext* context, |
78 uint32_t shm_id, | 78 uint32_t shm_id, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 ppapi::host::ReplyMessageContext initialize_reply_context_; | 119 ppapi::host::ReplyMessageContext initialize_reply_context_; |
120 | 120 |
121 bool initialized_; | 121 bool initialized_; |
122 | 122 |
123 DISALLOW_COPY_AND_ASSIGN(PepperVideoDecoderHost); | 123 DISALLOW_COPY_AND_ASSIGN(PepperVideoDecoderHost); |
124 }; | 124 }; |
125 | 125 |
126 } // namespace content | 126 } // namespace content |
127 | 127 |
128 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ | 128 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ |
OLD | NEW |