OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ppapi/proxy/ppb_video_decoder_proxy.h" | 5 #include "ppapi/proxy/ppb_video_decoder_proxy.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
9 #include "gpu/command_buffer/client/gles2_implementation.h" | 9 #include "gpu/command_buffer/client/gles2_implementation.h" |
10 #include "ppapi/proxy/enter_proxy.h" | 10 #include "ppapi/proxy/enter_proxy.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 using ppapi::thunk::PPB_Graphics3D_API; | 21 using ppapi::thunk::PPB_Graphics3D_API; |
22 using ppapi::thunk::PPB_VideoDecoder_Dev_API; | 22 using ppapi::thunk::PPB_VideoDecoder_Dev_API; |
23 | 23 |
24 namespace ppapi { | 24 namespace ppapi { |
25 namespace proxy { | 25 namespace proxy { |
26 | 26 |
27 class VideoDecoder : public PPB_VideoDecoder_Shared { | 27 class VideoDecoder : public PPB_VideoDecoder_Shared { |
28 public: | 28 public: |
29 // You must call Init() before using this class. | 29 // You must call Init() before using this class. |
30 explicit VideoDecoder(const HostResource& resource); | 30 explicit VideoDecoder(const HostResource& resource); |
31 virtual ~VideoDecoder(); | 31 ~VideoDecoder() override; |
32 | 32 |
33 static VideoDecoder* Create(const HostResource& resource, | 33 static VideoDecoder* Create(const HostResource& resource, |
34 PP_Resource graphics_context, | 34 PP_Resource graphics_context, |
35 PP_VideoDecoder_Profile profile); | 35 PP_VideoDecoder_Profile profile); |
36 | 36 |
37 // PPB_VideoDecoder_Dev_API implementation. | 37 // PPB_VideoDecoder_Dev_API implementation. |
38 virtual int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 38 int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
39 scoped_refptr<TrackedCallback> callback) override; | 39 scoped_refptr<TrackedCallback> callback) override; |
40 virtual void AssignPictureBuffers( | 40 void AssignPictureBuffers(uint32_t no_of_buffers, |
41 uint32_t no_of_buffers, const PP_PictureBuffer_Dev* buffers) override; | 41 const PP_PictureBuffer_Dev* buffers) override; |
42 virtual void ReusePictureBuffer(int32_t picture_buffer_id) override; | 42 void ReusePictureBuffer(int32_t picture_buffer_id) override; |
43 virtual int32_t Flush(scoped_refptr<TrackedCallback> callback) override; | 43 int32_t Flush(scoped_refptr<TrackedCallback> callback) override; |
44 virtual int32_t Reset(scoped_refptr<TrackedCallback> callback) override; | 44 int32_t Reset(scoped_refptr<TrackedCallback> callback) override; |
45 virtual void Destroy() override; | 45 void Destroy() override; |
46 | 46 |
47 private: | 47 private: |
48 friend class PPB_VideoDecoder_Proxy; | 48 friend class PPB_VideoDecoder_Proxy; |
49 | 49 |
50 PluginDispatcher* GetDispatcher() const; | 50 PluginDispatcher* GetDispatcher() const; |
51 | 51 |
52 // Run the callbacks that were passed into the plugin interface. | 52 // Run the callbacks that were passed into the plugin interface. |
53 void FlushACK(int32_t result); | 53 void FlushACK(int32_t result); |
54 void ResetACK(int32_t result); | 54 void ResetACK(int32_t result); |
55 void EndOfBitstreamACK(int32_t buffer_id, int32_t result); | 55 void EndOfBitstreamACK(int32_t buffer_id, int32_t result); |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 316 |
317 void PPB_VideoDecoder_Proxy::OnMsgResetACK( | 317 void PPB_VideoDecoder_Proxy::OnMsgResetACK( |
318 const HostResource& decoder, int32_t result) { | 318 const HostResource& decoder, int32_t result) { |
319 EnterPluginFromHostResource<PPB_VideoDecoder_Dev_API> enter(decoder); | 319 EnterPluginFromHostResource<PPB_VideoDecoder_Dev_API> enter(decoder); |
320 if (enter.succeeded()) | 320 if (enter.succeeded()) |
321 static_cast<VideoDecoder*>(enter.object())->ResetACK(result); | 321 static_cast<VideoDecoder*>(enter.object())->ResetACK(result); |
322 } | 322 } |
323 | 323 |
324 } // namespace proxy | 324 } // namespace proxy |
325 } // namespace ppapi | 325 } // namespace ppapi |
OLD | NEW |