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_AUDIO_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PPB_AUDIO_IMPL_H_ |
6 #define CONTENT_RENDERER_PEPPER_PPB_AUDIO_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PPB_AUDIO_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // Trusted initialization. You must call Init after this. | 30 // Trusted initialization. You must call Init after this. |
31 // | 31 // |
32 // Untrusted initialization should just call the static Create() function | 32 // Untrusted initialization should just call the static Create() function |
33 // to properly create & initialize this class. | 33 // to properly create & initialize this class. |
34 explicit PPB_Audio_Impl(PP_Instance instance); | 34 explicit PPB_Audio_Impl(PP_Instance instance); |
35 | 35 |
36 // Creation function for untrusted plugins. This handles all initialization | 36 // Creation function for untrusted plugins. This handles all initialization |
37 // and will return 0 on failure. | 37 // and will return 0 on failure. |
38 static PP_Resource Create(PP_Instance instance, | 38 static PP_Resource Create(PP_Instance instance, |
39 PP_Resource config_id, | 39 PP_Resource config_id, |
40 PPB_Audio_Callback audio_callback, | 40 const ppapi::AudioCallbackCombined& audio_callback, |
41 void* user_data); | 41 void* user_data); |
42 | 42 |
43 // Initialization function for trusted init. | 43 // Initialization function for trusted init. |
44 bool Init(PP_Resource config_id, | 44 bool Init(PP_Resource config_id, |
45 PPB_Audio_Callback user_callback, | 45 const ppapi::AudioCallbackCombined& user_callback, |
46 void* user_data); | 46 void* user_data); |
47 | 47 |
48 // Resource overrides. | 48 // Resource overrides. |
49 virtual ppapi::thunk::PPB_Audio_API* AsPPB_Audio_API() OVERRIDE; | 49 virtual ppapi::thunk::PPB_Audio_API* AsPPB_Audio_API() OVERRIDE; |
50 | 50 |
51 // PPB_Audio_API implementation. | 51 // PPB_Audio_API implementation. |
52 virtual PP_Resource GetCurrentConfig() OVERRIDE; | 52 virtual PP_Resource GetCurrentConfig() OVERRIDE; |
53 virtual PP_Bool StartPlayback() OVERRIDE; | 53 virtual PP_Bool StartPlayback() OVERRIDE; |
54 virtual PP_Bool StopPlayback() OVERRIDE; | 54 virtual PP_Bool StopPlayback() OVERRIDE; |
55 virtual int32_t Open( | 55 virtual int32_t Open( |
(...skipping 10 matching lines...) Expand all Loading... |
66 size_t shared_memory_size_, | 66 size_t shared_memory_size_, |
67 base::SyncSocket::Handle socket) OVERRIDE; | 67 base::SyncSocket::Handle socket) OVERRIDE; |
68 | 68 |
69 // AudioConfig used for creating this Audio object. We own a ref. | 69 // AudioConfig used for creating this Audio object. We own a ref. |
70 ppapi::ScopedPPResource config_; | 70 ppapi::ScopedPPResource config_; |
71 | 71 |
72 // PluginDelegate audio object that we delegate audio IPC through. We don't | 72 // PluginDelegate audio object that we delegate audio IPC through. We don't |
73 // own this pointer but are responsible for calling Shutdown on it. | 73 // own this pointer but are responsible for calling Shutdown on it. |
74 PepperPlatformAudioOutput* audio_; | 74 PepperPlatformAudioOutput* audio_; |
75 | 75 |
76 // Track frame count for passing on to PPB_Audio_Shared::SetStreamInfo(). | |
77 int sample_frame_count_; | |
78 | |
79 DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl); | 76 DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl); |
80 }; | 77 }; |
81 | 78 |
82 } // namespace content | 79 } // namespace content |
83 | 80 |
84 #endif // CONTENT_RENDERER_PEPPER_PPB_AUDIO_IMPL_H_ | 81 #endif // CONTENT_RENDERER_PEPPER_PPB_AUDIO_IMPL_H_ |
OLD | NEW |