| 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 #ifndef CONTENT_RENDERER_PEPPER_PPB_VIDEO_DECODER_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PPB_VIDEO_DECODER_IMPL_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PPB_VIDEO_DECODER_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PPB_VIDEO_DECODER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 class PPB_VideoDecoder_Impl : public ppapi::PPB_VideoDecoder_Shared, | 25 class PPB_VideoDecoder_Impl : public ppapi::PPB_VideoDecoder_Shared, |
| 26 public media::VideoDecodeAccelerator::Client { | 26 public media::VideoDecodeAccelerator::Client { |
| 27 public: | 27 public: |
| 28 // See PPB_VideoDecoder_Dev::Create. Returns 0 on failure to create & | 28 // See PPB_VideoDecoder_Dev::Create. Returns 0 on failure to create & |
| 29 // initialize. | 29 // initialize. |
| 30 static PP_Resource Create(PP_Instance instance, | 30 static PP_Resource Create(PP_Instance instance, |
| 31 PP_Resource graphics_context, | 31 PP_Resource graphics_context, |
| 32 PP_VideoDecoder_Profile profile); | 32 PP_VideoDecoder_Profile profile); |
| 33 | 33 |
| 34 // PPB_VideoDecoder_Dev_API implementation. | 34 // PPB_VideoDecoder_Dev_API implementation. |
| 35 virtual int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 35 int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
| 36 scoped_refptr<ppapi::TrackedCallback> callback) | 36 scoped_refptr<ppapi::TrackedCallback> callback) override; |
| 37 override; | 37 void AssignPictureBuffers(uint32_t no_of_buffers, |
| 38 virtual void AssignPictureBuffers(uint32_t no_of_buffers, | 38 const PP_PictureBuffer_Dev* buffers) override; |
| 39 const PP_PictureBuffer_Dev* buffers) | 39 void ReusePictureBuffer(int32_t picture_buffer_id) override; |
| 40 override; | 40 int32_t Flush(scoped_refptr<ppapi::TrackedCallback> callback) override; |
| 41 virtual void ReusePictureBuffer(int32_t picture_buffer_id) override; | 41 int32_t Reset(scoped_refptr<ppapi::TrackedCallback> callback) override; |
| 42 virtual int32_t Flush(scoped_refptr<ppapi::TrackedCallback> callback) | 42 void Destroy() override; |
| 43 override; | |
| 44 virtual int32_t Reset(scoped_refptr<ppapi::TrackedCallback> callback) | |
| 45 override; | |
| 46 virtual void Destroy() override; | |
| 47 | 43 |
| 48 // media::VideoDecodeAccelerator::Client implementation. | 44 // media::VideoDecodeAccelerator::Client implementation. |
| 49 virtual void ProvidePictureBuffers(uint32 requested_num_of_buffers, | 45 void ProvidePictureBuffers(uint32 requested_num_of_buffers, |
| 50 const gfx::Size& dimensions, | 46 const gfx::Size& dimensions, |
| 51 uint32 texture_target) override; | 47 uint32 texture_target) override; |
| 52 virtual void DismissPictureBuffer(int32 picture_buffer_id) override; | 48 void DismissPictureBuffer(int32 picture_buffer_id) override; |
| 53 virtual void PictureReady(const media::Picture& picture) override; | 49 void PictureReady(const media::Picture& picture) override; |
| 54 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) override; | 50 void NotifyError(media::VideoDecodeAccelerator::Error error) override; |
| 55 virtual void NotifyFlushDone() override; | 51 void NotifyFlushDone() override; |
| 56 virtual void NotifyEndOfBitstreamBuffer(int32 buffer_id) override; | 52 void NotifyEndOfBitstreamBuffer(int32 buffer_id) override; |
| 57 virtual void NotifyResetDone() override; | 53 void NotifyResetDone() override; |
| 58 | 54 |
| 59 private: | 55 private: |
| 60 virtual ~PPB_VideoDecoder_Impl(); | 56 ~PPB_VideoDecoder_Impl() override; |
| 61 | 57 |
| 62 explicit PPB_VideoDecoder_Impl(PP_Instance instance); | 58 explicit PPB_VideoDecoder_Impl(PP_Instance instance); |
| 63 bool Init(PP_Resource graphics_context, | 59 bool Init(PP_Resource graphics_context, |
| 64 PP_VideoDecoder_Profile profile); | 60 PP_VideoDecoder_Profile profile); |
| 65 | 61 |
| 66 // This is NULL before initialization, and after destruction. | 62 // This is NULL before initialization, and after destruction. |
| 67 // Holds a GpuVideoDecodeAcceleratorHost. | 63 // Holds a GpuVideoDecodeAcceleratorHost. |
| 68 scoped_ptr<media::VideoDecodeAccelerator> decoder_; | 64 scoped_ptr<media::VideoDecodeAccelerator> decoder_; |
| 69 | 65 |
| 70 // Reference to the plugin requesting this interface. | 66 // Reference to the plugin requesting this interface. |
| 71 const PPP_VideoDecoder_Dev* ppp_videodecoder_; | 67 const PPP_VideoDecoder_Dev* ppp_videodecoder_; |
| 72 | 68 |
| 73 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); | 69 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); |
| 74 }; | 70 }; |
| 75 | 71 |
| 76 } // namespace content | 72 } // namespace content |
| 77 | 73 |
| 78 #endif // CONTENT_RENDERER_PEPPER_PPB_VIDEO_DECODER_IMPL_H_ | 74 #endif // CONTENT_RENDERER_PEPPER_PPB_VIDEO_DECODER_IMPL_H_ |
| OLD | NEW |