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 <stdint.h> |
| 9 |
9 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
11 #include "media/video/video_decode_accelerator.h" | 13 #include "media/video/video_decode_accelerator.h" |
12 #include "ppapi/c/dev/pp_video_dev.h" | 14 #include "ppapi/c/dev/pp_video_dev.h" |
13 #include "ppapi/c/dev/ppp_video_decoder_dev.h" | 15 #include "ppapi/c/dev/ppp_video_decoder_dev.h" |
14 #include "ppapi/c/pp_var.h" | 16 #include "ppapi/c/pp_var.h" |
15 #include "ppapi/shared_impl/ppb_video_decoder_shared.h" | 17 #include "ppapi/shared_impl/ppb_video_decoder_shared.h" |
16 #include "ppapi/shared_impl/resource.h" | 18 #include "ppapi/shared_impl/resource.h" |
17 #include "ppapi/thunk/ppb_video_decoder_dev_api.h" | 19 #include "ppapi/thunk/ppb_video_decoder_dev_api.h" |
18 | 20 |
19 struct PP_PictureBuffer_Dev; | 21 struct PP_PictureBuffer_Dev; |
(...skipping 15 matching lines...) Expand all Loading... |
35 int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 37 int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
36 scoped_refptr<ppapi::TrackedCallback> callback) override; | 38 scoped_refptr<ppapi::TrackedCallback> callback) override; |
37 void AssignPictureBuffers(uint32_t no_of_buffers, | 39 void AssignPictureBuffers(uint32_t no_of_buffers, |
38 const PP_PictureBuffer_Dev* buffers) override; | 40 const PP_PictureBuffer_Dev* buffers) override; |
39 void ReusePictureBuffer(int32_t picture_buffer_id) override; | 41 void ReusePictureBuffer(int32_t picture_buffer_id) override; |
40 int32_t Flush(scoped_refptr<ppapi::TrackedCallback> callback) override; | 42 int32_t Flush(scoped_refptr<ppapi::TrackedCallback> callback) override; |
41 int32_t Reset(scoped_refptr<ppapi::TrackedCallback> callback) override; | 43 int32_t Reset(scoped_refptr<ppapi::TrackedCallback> callback) override; |
42 void Destroy() override; | 44 void Destroy() override; |
43 | 45 |
44 // media::VideoDecodeAccelerator::Client implementation. | 46 // media::VideoDecodeAccelerator::Client implementation. |
45 void ProvidePictureBuffers(uint32 requested_num_of_buffers, | 47 void ProvidePictureBuffers(uint32_t requested_num_of_buffers, |
46 const gfx::Size& dimensions, | 48 const gfx::Size& dimensions, |
47 uint32 texture_target) override; | 49 uint32_t texture_target) override; |
48 void DismissPictureBuffer(int32 picture_buffer_id) override; | 50 void DismissPictureBuffer(int32_t picture_buffer_id) override; |
49 void PictureReady(const media::Picture& picture) override; | 51 void PictureReady(const media::Picture& picture) override; |
50 void NotifyError(media::VideoDecodeAccelerator::Error error) override; | 52 void NotifyError(media::VideoDecodeAccelerator::Error error) override; |
51 void NotifyFlushDone() override; | 53 void NotifyFlushDone() override; |
52 void NotifyEndOfBitstreamBuffer(int32 buffer_id) override; | 54 void NotifyEndOfBitstreamBuffer(int32_t buffer_id) override; |
53 void NotifyResetDone() override; | 55 void NotifyResetDone() override; |
54 | 56 |
55 private: | 57 private: |
56 ~PPB_VideoDecoder_Impl() override; | 58 ~PPB_VideoDecoder_Impl() override; |
57 | 59 |
58 explicit PPB_VideoDecoder_Impl(PP_Instance instance); | 60 explicit PPB_VideoDecoder_Impl(PP_Instance instance); |
59 bool Init(PP_Resource graphics_context, | 61 bool Init(PP_Resource graphics_context, |
60 PP_VideoDecoder_Profile profile); | 62 PP_VideoDecoder_Profile profile); |
61 // Returns the associated PPP_VideoDecoder_Dev interface to use when | 63 // Returns the associated PPP_VideoDecoder_Dev interface to use when |
62 // making calls on the plugin. This fetches the interface lazily. For | 64 // making calls on the plugin. This fetches the interface lazily. For |
63 // out-of-process plugins, this means a synchronous message to the plugin, | 65 // out-of-process plugins, this means a synchronous message to the plugin, |
64 // so it's important to never call this in response to a synchronous | 66 // so it's important to never call this in response to a synchronous |
65 // plugin->renderer message (such as the Create message). | 67 // plugin->renderer message (such as the Create message). |
66 const PPP_VideoDecoder_Dev* GetPPP(); | 68 const PPP_VideoDecoder_Dev* GetPPP(); |
67 | 69 |
68 // This is NULL before initialization, and after destruction. | 70 // This is NULL before initialization, and after destruction. |
69 // Holds a GpuVideoDecodeAcceleratorHost. | 71 // Holds a GpuVideoDecodeAcceleratorHost. |
70 scoped_ptr<media::VideoDecodeAccelerator> decoder_; | 72 scoped_ptr<media::VideoDecodeAccelerator> decoder_; |
71 | 73 |
72 // The interface to use when making calls on the plugin. For the most part, | 74 // The interface to use when making calls on the plugin. For the most part, |
73 // methods should not use this directly but should call GetPPP() instead. | 75 // methods should not use this directly but should call GetPPP() instead. |
74 const PPP_VideoDecoder_Dev* ppp_videodecoder_; | 76 const PPP_VideoDecoder_Dev* ppp_videodecoder_; |
75 | 77 |
76 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); | 78 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); |
77 }; | 79 }; |
78 | 80 |
79 } // namespace content | 81 } // namespace content |
80 | 82 |
81 #endif // CONTENT_RENDERER_PEPPER_PPB_VIDEO_DECODER_IMPL_H_ | 83 #endif // CONTENT_RENDERER_PEPPER_PPB_VIDEO_DECODER_IMPL_H_ |
OLD | NEW |