| 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 19 matching lines...) Expand all Loading... |
| 30 class PPB_Graphics3D_Shared; | 30 class PPB_Graphics3D_Shared; |
| 31 class TrackedCallback; | 31 class TrackedCallback; |
| 32 | 32 |
| 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 ~VideoDecoderResource() override; |
| 41 | 41 |
| 42 // Resource overrides. | 42 // Resource overrides. |
| 43 virtual thunk::PPB_VideoDecoder_API* AsPPB_VideoDecoder_API() override; | 43 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 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 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 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 GetPicture0_1( | 59 int32_t GetPicture0_1( |
| 60 PP_VideoPicture_0_1* picture, | 60 PP_VideoPicture_0_1* picture, |
| 61 scoped_refptr<TrackedCallback> callback) override; | 61 scoped_refptr<TrackedCallback> callback) override; |
| 62 virtual int32_t GetPicture(PP_VideoPicture* picture, | 62 int32_t GetPicture(PP_VideoPicture* picture, |
| 63 scoped_refptr<TrackedCallback> callback) override; | 63 scoped_refptr<TrackedCallback> callback) override; |
| 64 virtual void RecyclePicture(const PP_VideoPicture* picture) override; | 64 void RecyclePicture(const PP_VideoPicture* picture) override; |
| 65 virtual int32_t Flush(scoped_refptr<TrackedCallback> callback) override; | 65 int32_t Flush(scoped_refptr<TrackedCallback> callback) override; |
| 66 virtual int32_t Reset(scoped_refptr<TrackedCallback> callback) override; | 66 int32_t Reset(scoped_refptr<TrackedCallback> callback) override; |
| 67 | 67 |
| 68 // PluginResource implementation. | 68 // PluginResource implementation. |
| 69 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, | 69 void OnReplyReceived(const ResourceMessageReplyParams& params, |
| 70 const IPC::Message& msg) override; | 70 const IPC::Message& msg) override; |
| 71 | 71 |
| 72 // Called only by unit tests. This bypasses Graphics3D setup, which doesn't | 72 // Called only by unit tests. This bypasses Graphics3D setup, which doesn't |
| 73 // work in ppapi::proxy::PluginProxyTest. | 73 // work in ppapi::proxy::PluginProxyTest. |
| 74 void SetForTest(); | 74 void SetForTest(); |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 // Struct to hold a shared memory buffer. | 77 // Struct to hold a shared memory buffer. |
| 78 struct ShmBuffer { | 78 struct ShmBuffer { |
| 79 ShmBuffer(scoped_ptr<base::SharedMemory> shm, | 79 ShmBuffer(scoped_ptr<base::SharedMemory> shm, |
| 80 uint32_t size, | 80 uint32_t size, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 bool testing_; | 179 bool testing_; |
| 180 int32_t decoder_last_error_; | 180 int32_t decoder_last_error_; |
| 181 | 181 |
| 182 DISALLOW_COPY_AND_ASSIGN(VideoDecoderResource); | 182 DISALLOW_COPY_AND_ASSIGN(VideoDecoderResource); |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 } // namespace proxy | 185 } // namespace proxy |
| 186 } // namespace ppapi | 186 } // namespace ppapi |
| 187 | 187 |
| 188 #endif // PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ | 188 #endif // PPAPI_PROXY_VIDEO_DECODER_RESOURCE_H_ |
| OLD | NEW |