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 PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ | 5 #ifndef PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ |
6 #define PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ | 6 #define PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 namespace proxy { | 33 namespace proxy { |
34 | 34 |
35 class PPAPI_PROXY_EXPORT VideoDecoderResource | 35 class PPAPI_PROXY_EXPORT VideoDecoderResource |
36 : public PluginResource, | 36 : public PluginResource, |
37 public thunk::PPB_VideoDecoder_API { | 37 public thunk::PPB_VideoDecoder_API { |
38 public: | 38 public: |
39 VideoDecoderResource(Connection connection, PP_Instance instance); | 39 VideoDecoderResource(Connection connection, PP_Instance instance); |
40 virtual ~VideoDecoderResource(); | 40 virtual ~VideoDecoderResource(); |
41 | 41 |
42 // Resource overrides. | 42 // Resource overrides. |
43 virtual thunk::PPB_VideoDecoder_API* AsPPB_VideoDecoder_API() OVERRIDE; | 43 virtual thunk::PPB_VideoDecoder_API* AsPPB_VideoDecoder_API() override; |
44 | 44 |
45 // PPB_VideoDecoder_API implementation. | 45 // PPB_VideoDecoder_API implementation. |
46 virtual int32_t Initialize0_1( | 46 virtual int32_t Initialize0_1( |
47 PP_Resource graphics_context, | 47 PP_Resource graphics_context, |
48 PP_VideoProfile profile, | 48 PP_VideoProfile profile, |
49 PP_Bool allow_software_fallback, | 49 PP_Bool allow_software_fallback, |
50 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 50 scoped_refptr<TrackedCallback> callback) override; |
51 virtual int32_t Initialize(PP_Resource graphics_context, | 51 virtual int32_t Initialize(PP_Resource graphics_context, |
52 PP_VideoProfile profile, | 52 PP_VideoProfile profile, |
53 PP_HardwareAcceleration acceleration, | 53 PP_HardwareAcceleration acceleration, |
54 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 54 scoped_refptr<TrackedCallback> callback) override; |
55 virtual int32_t Decode(uint32_t decode_id, | 55 virtual int32_t Decode(uint32_t decode_id, |
56 uint32_t size, | 56 uint32_t size, |
57 const void* buffer, | 57 const void* buffer, |
58 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 58 scoped_refptr<TrackedCallback> callback) override; |
59 virtual int32_t GetPicture(PP_VideoPicture* picture, | 59 virtual int32_t GetPicture(PP_VideoPicture* picture, |
60 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 60 scoped_refptr<TrackedCallback> callback) override; |
61 virtual void RecyclePicture(const PP_VideoPicture* picture) OVERRIDE; | 61 virtual void RecyclePicture(const PP_VideoPicture* picture) override; |
62 virtual int32_t Flush(scoped_refptr<TrackedCallback> callback) OVERRIDE; | 62 virtual int32_t Flush(scoped_refptr<TrackedCallback> callback) override; |
63 virtual int32_t Reset(scoped_refptr<TrackedCallback> callback) OVERRIDE; | 63 virtual int32_t Reset(scoped_refptr<TrackedCallback> callback) override; |
64 | 64 |
65 // PluginResource implementation. | 65 // PluginResource implementation. |
66 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, | 66 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, |
67 const IPC::Message& msg) OVERRIDE; | 67 const IPC::Message& msg) override; |
68 | 68 |
69 // Called only by unit tests. This bypasses Graphics3D setup, which doesn't | 69 // Called only by unit tests. This bypasses Graphics3D setup, which doesn't |
70 // work in ppapi::proxy::PluginProxyTest. | 70 // work in ppapi::proxy::PluginProxyTest. |
71 void SetForTest(); | 71 void SetForTest(); |
72 | 72 |
73 private: | 73 private: |
74 // Struct to hold a shared memory buffer. | 74 // Struct to hold a shared memory buffer. |
75 struct ShmBuffer { | 75 struct ShmBuffer { |
76 ShmBuffer(scoped_ptr<base::SharedMemory> shm, | 76 ShmBuffer(scoped_ptr<base::SharedMemory> shm, |
77 uint32_t size, | 77 uint32_t size, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 bool testing_; | 177 bool testing_; |
178 int32_t decoder_last_error_; | 178 int32_t decoder_last_error_; |
179 | 179 |
180 DISALLOW_COPY_AND_ASSIGN(VideoDecoderResource); | 180 DISALLOW_COPY_AND_ASSIGN(VideoDecoderResource); |
181 }; | 181 }; |
182 | 182 |
183 } // namespace proxy | 183 } // namespace proxy |
184 } // namespace ppapi | 184 } // namespace ppapi |
185 | 185 |
186 #endif // PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ | 186 #endif // PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ |
OLD | NEW |