OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_old.h" | 10 #include "base/callback_old.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 virtual bool StopPlayback() = 0; | 210 virtual bool StopPlayback() = 0; |
211 | 211 |
212 // Closes the stream. Make sure to call this before the object is | 212 // Closes the stream. Make sure to call this before the object is |
213 // destructed. | 213 // destructed. |
214 virtual void ShutDown() = 0; | 214 virtual void ShutDown() = 0; |
215 | 215 |
216 protected: | 216 protected: |
217 virtual ~PlatformAudio() {} | 217 virtual ~PlatformAudio() {} |
218 }; | 218 }; |
219 | 219 |
| 220 class PlatformAudioInput { |
| 221 public: |
| 222 class Client { |
| 223 protected: |
| 224 virtual ~Client() {} |
| 225 |
| 226 public: |
| 227 // Called when the stream is created. |
| 228 virtual void StreamCreated(base::SharedMemoryHandle shared_memory_handle, |
| 229 size_t shared_memory_size, |
| 230 base::SyncSocket::Handle socket) = 0; |
| 231 }; |
| 232 |
| 233 // Starts the playback. Returns false on error or if called before the |
| 234 // stream is created or after the stream is closed. |
| 235 virtual bool StartCapture() = 0; |
| 236 |
| 237 // Stops the capture. Returns false on error or if called before the stream |
| 238 // is created or after the stream is closed. |
| 239 virtual bool StopCapture() = 0; |
| 240 |
| 241 // Closes the stream. Make sure to call this before the object is |
| 242 // destructed. |
| 243 virtual void ShutDown() = 0; |
| 244 |
| 245 protected: |
| 246 virtual ~PlatformAudioInput() {} |
| 247 }; |
| 248 |
220 // Interface for PlatformVideoDecoder is directly inherited from general media | 249 // Interface for PlatformVideoDecoder is directly inherited from general media |
221 // VideoDecodeAccelerator interface. | 250 // VideoDecodeAccelerator interface. |
222 class PlatformVideoDecoder : public media::VideoDecodeAccelerator { | 251 class PlatformVideoDecoder : public media::VideoDecodeAccelerator { |
223 protected: | 252 protected: |
224 virtual ~PlatformVideoDecoder() {} | 253 virtual ~PlatformVideoDecoder() {} |
225 }; | 254 }; |
226 | 255 |
227 class PlatformVideoCapture : public media::VideoCapture { | 256 class PlatformVideoCapture : public media::VideoCapture { |
228 public: | 257 public: |
229 virtual ~PlatformVideoCapture() {} | 258 virtual ~PlatformVideoCapture() {} |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 virtual PlatformVideoDecoder* CreateVideoDecoder( | 307 virtual PlatformVideoDecoder* CreateVideoDecoder( |
279 media::VideoDecodeAccelerator::Client* client, | 308 media::VideoDecodeAccelerator::Client* client, |
280 int32 command_buffer_route_id) = 0; | 309 int32 command_buffer_route_id) = 0; |
281 | 310 |
282 // The caller is responsible for calling Shutdown() on the returned pointer | 311 // The caller is responsible for calling Shutdown() on the returned pointer |
283 // to clean up the corresponding resources allocated during this call. | 312 // to clean up the corresponding resources allocated during this call. |
284 virtual PlatformAudio* CreateAudio(uint32_t sample_rate, | 313 virtual PlatformAudio* CreateAudio(uint32_t sample_rate, |
285 uint32_t sample_count, | 314 uint32_t sample_count, |
286 PlatformAudio::Client* client) = 0; | 315 PlatformAudio::Client* client) = 0; |
287 | 316 |
| 317 // The caller is responsible for calling Shutdown() on the returned pointer |
| 318 // to clean up the corresponding resources allocated during this call. |
| 319 virtual PlatformAudioInput* CreateAudioInput(uint32_t sample_rate, |
| 320 uint32_t sample_count, |
| 321 PlatformAudioInput::Client* client) = 0; |
| 322 |
288 // A pointer is returned immediately, but it is not ready to be used until | 323 // A pointer is returned immediately, but it is not ready to be used until |
289 // BrokerConnected has been called. | 324 // BrokerConnected has been called. |
290 // The caller is responsible for calling Release() on the returned pointer | 325 // The caller is responsible for calling Release() on the returned pointer |
291 // to clean up the corresponding resources allocated during this call. | 326 // to clean up the corresponding resources allocated during this call. |
292 virtual PpapiBroker* ConnectToPpapiBroker( | 327 virtual PpapiBroker* ConnectToPpapiBroker( |
293 webkit::ppapi::PPB_Broker_Impl* client) = 0; | 328 webkit::ppapi::PPB_Broker_Impl* client) = 0; |
294 | 329 |
295 // Notifies that the number of find results has changed. | 330 // Notifies that the number of find results has changed. |
296 virtual void NumberOfFindResultsChanged(int identifier, | 331 virtual void NumberOfFindResultsChanged(int identifier, |
297 int total, | 332 int total, |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 // the only cause of losing mouse lock. For example, a user may press the Esc | 487 // the only cause of losing mouse lock. For example, a user may press the Esc |
453 // key to quit the mouse lock mode, which also results in an OnMouseLockLost() | 488 // key to quit the mouse lock mode, which also results in an OnMouseLockLost() |
454 // call to the current mouse lock owner. | 489 // call to the current mouse lock owner. |
455 virtual void UnlockMouse(PluginInstance* instance) = 0; | 490 virtual void UnlockMouse(PluginInstance* instance) = 0; |
456 }; | 491 }; |
457 | 492 |
458 } // namespace ppapi | 493 } // namespace ppapi |
459 } // namespace webkit | 494 } // namespace webkit |
460 | 495 |
461 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 496 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
OLD | NEW |