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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 void NotifyFlushDone() override; | 51 void NotifyFlushDone() override; |
52 void NotifyEndOfBitstreamBuffer(int32 buffer_id) override; | 52 void NotifyEndOfBitstreamBuffer(int32 buffer_id) override; |
53 void NotifyResetDone() override; | 53 void NotifyResetDone() override; |
54 | 54 |
55 private: | 55 private: |
56 ~PPB_VideoDecoder_Impl() override; | 56 ~PPB_VideoDecoder_Impl() override; |
57 | 57 |
58 explicit PPB_VideoDecoder_Impl(PP_Instance instance); | 58 explicit PPB_VideoDecoder_Impl(PP_Instance instance); |
59 bool Init(PP_Resource graphics_context, | 59 bool Init(PP_Resource graphics_context, |
60 PP_VideoDecoder_Profile profile); | 60 PP_VideoDecoder_Profile profile); |
| 61 // Returns the associated PPP_VideoDecoder_Dev interface to use when |
| 62 // making calls on the plugin. This fetches the interface lazily. For |
| 63 // 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 |
| 65 // plugin->renderer message (such as the Create message). |
| 66 const PPP_VideoDecoder_Dev* GetPPP(); |
61 | 67 |
62 // This is NULL before initialization, and after destruction. | 68 // This is NULL before initialization, and after destruction. |
63 // Holds a GpuVideoDecodeAcceleratorHost. | 69 // Holds a GpuVideoDecodeAcceleratorHost. |
64 scoped_ptr<media::VideoDecodeAccelerator> decoder_; | 70 scoped_ptr<media::VideoDecodeAccelerator> decoder_; |
65 | 71 |
66 // Reference to the plugin requesting this interface. | 72 // 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. |
67 const PPP_VideoDecoder_Dev* ppp_videodecoder_; | 74 const PPP_VideoDecoder_Dev* ppp_videodecoder_; |
68 | 75 |
69 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); | 76 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); |
70 }; | 77 }; |
71 | 78 |
72 } // namespace content | 79 } // namespace content |
73 | 80 |
74 #endif // CONTENT_RENDERER_PEPPER_PPB_VIDEO_DECODER_IMPL_H_ | 81 #endif // CONTENT_RENDERER_PEPPER_PPB_VIDEO_DECODER_IMPL_H_ |
OLD | NEW |