Chromium Code Reviews| 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 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 | 189 |
| 190 // Set an optional callback that will be invoked when the context is lost | 190 // Set an optional callback that will be invoked when the context is lost |
| 191 // (e.g. gpu process crash). Takes ownership of the callback. | 191 // (e.g. gpu process crash). Takes ownership of the callback. |
| 192 virtual void SetContextLostCallback( | 192 virtual void SetContextLostCallback( |
| 193 const base::Callback<void()>& callback) = 0; | 193 const base::Callback<void()>& callback) = 0; |
| 194 | 194 |
| 195 // Run the callback once the channel has been flushed. | 195 // Run the callback once the channel has been flushed. |
| 196 virtual bool Echo(const base::Callback<void()>& callback) = 0; | 196 virtual bool Echo(const base::Callback<void()>& callback) = 0; |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 // The (interface for the) client used by |PlatformAudio| and | 199 // The (interface for the) client used by |PlatformAudio| and |
|
viettrungluu
2012/03/16 22:29:09
Probably this comment needs to be updated. Maybe i
yzshen1
2012/03/19 21:47:54
Done.
| |
| 200 // |PlatformAudioInput|. | 200 // |PlatformAudioInput|. |
| 201 class PlatformAudioCommonClient { | 201 class PlatformAudioCommonClient { |
| 202 protected: | 202 protected: |
| 203 virtual ~PlatformAudioCommonClient() {} | 203 virtual ~PlatformAudioCommonClient() {} |
| 204 | 204 |
| 205 public: | 205 public: |
| 206 // Called when the stream is created. | 206 // Called when the stream is created. |
| 207 virtual void StreamCreated(base::SharedMemoryHandle shared_memory_handle, | 207 virtual void StreamCreated(base::SharedMemoryHandle shared_memory_handle, |
| 208 size_t shared_memory_size, | 208 size_t shared_memory_size, |
| 209 base::SyncSocket::Handle socket) = 0; | 209 base::SyncSocket::Handle socket) = 0; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 220 virtual bool StopPlayback() = 0; | 220 virtual bool StopPlayback() = 0; |
| 221 | 221 |
| 222 // Closes the stream. Make sure to call this before the object is | 222 // Closes the stream. Make sure to call this before the object is |
| 223 // destructed. | 223 // destructed. |
| 224 virtual void ShutDown() = 0; | 224 virtual void ShutDown() = 0; |
| 225 | 225 |
| 226 protected: | 226 protected: |
| 227 virtual ~PlatformAudioOutput() {} | 227 virtual ~PlatformAudioOutput() {} |
| 228 }; | 228 }; |
| 229 | 229 |
| 230 class PlatformAudioInputClient : public PlatformAudioCommonClient { | |
| 231 public: | |
| 232 virtual void StreamCreationFailed() = 0; | |
| 233 | |
| 234 protected: | |
| 235 virtual ~PlatformAudioInputClient() {} | |
| 236 }; | |
| 237 | |
| 230 class PlatformAudioInput { | 238 class PlatformAudioInput { |
| 231 public: | 239 public: |
| 232 // Starts the capture. Returns false on error or if called before the | 240 // Starts the capture. Returns false on error or if called before the |
| 233 // stream is created or after the stream is closed. | 241 // stream is created or after the stream is closed. |
| 234 virtual bool StartCapture() = 0; | 242 virtual bool StartCapture() = 0; |
| 235 | 243 |
| 236 // Stops the capture. Returns false on error or if called before the stream | 244 // Stops the capture. Returns false on error or if called before the stream |
| 237 // is created or after the stream is closed. | 245 // is created or after the stream is closed. |
| 238 virtual bool StopCapture() = 0; | 246 virtual bool StopCapture() = 0; |
| 239 | 247 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 341 // Get audio hardware output buffer size. | 349 // Get audio hardware output buffer size. |
| 342 virtual uint32_t GetAudioHardwareOutputBufferSize() = 0; | 350 virtual uint32_t GetAudioHardwareOutputBufferSize() = 0; |
| 343 | 351 |
| 344 // The caller is responsible for calling Shutdown() on the returned pointer | 352 // The caller is responsible for calling Shutdown() on the returned pointer |
| 345 // to clean up the corresponding resources allocated during this call. | 353 // to clean up the corresponding resources allocated during this call. |
| 346 virtual PlatformAudioOutput* CreateAudioOutput( | 354 virtual PlatformAudioOutput* CreateAudioOutput( |
| 347 uint32_t sample_rate, | 355 uint32_t sample_rate, |
| 348 uint32_t sample_count, | 356 uint32_t sample_count, |
| 349 PlatformAudioCommonClient* client) = 0; | 357 PlatformAudioCommonClient* client) = 0; |
| 350 | 358 |
| 359 // If |device_id| is empty, the default audio input device will be used. | |
| 351 // The caller is responsible for calling Shutdown() on the returned pointer | 360 // The caller is responsible for calling Shutdown() on the returned pointer |
| 352 // to clean up the corresponding resources allocated during this call. | 361 // to clean up the corresponding resources allocated during this call. |
| 353 virtual PlatformAudioInput* CreateAudioInput( | 362 virtual PlatformAudioInput* CreateAudioInput( |
| 363 const std::string& device_id, | |
| 354 uint32_t sample_rate, | 364 uint32_t sample_rate, |
| 355 uint32_t sample_count, | 365 uint32_t sample_count, |
| 356 PlatformAudioCommonClient* client) = 0; | 366 PlatformAudioInputClient* client) = 0; |
| 357 | 367 |
| 358 // A pointer is returned immediately, but it is not ready to be used until | 368 // A pointer is returned immediately, but it is not ready to be used until |
| 359 // BrokerConnected has been called. | 369 // BrokerConnected has been called. |
| 360 // The caller is responsible for calling Release() on the returned pointer | 370 // The caller is responsible for calling Release() on the returned pointer |
| 361 // to clean up the corresponding resources allocated during this call. | 371 // to clean up the corresponding resources allocated during this call. |
| 362 virtual Broker* ConnectToBroker(webkit::ppapi::PPB_Broker_Impl* client) = 0; | 372 virtual Broker* ConnectToBroker(webkit::ppapi::PPB_Broker_Impl* client) = 0; |
| 363 | 373 |
| 364 // Notifies that the number of find results has changed. | 374 // Notifies that the number of find results has changed. |
| 365 virtual void NumberOfFindResultsChanged(int identifier, | 375 virtual void NumberOfFindResultsChanged(int identifier, |
| 366 int total, | 376 int total, |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 602 const EnumerateDevicesCallback& callback) = 0; | 612 const EnumerateDevicesCallback& callback) = 0; |
| 603 // Create a ClipboardClient for writing to the clipboard. The caller will own | 613 // Create a ClipboardClient for writing to the clipboard. The caller will own |
| 604 // the pointer to this. | 614 // the pointer to this. |
| 605 virtual webkit_glue::ClipboardClient* CreateClipboardClient() const = 0; | 615 virtual webkit_glue::ClipboardClient* CreateClipboardClient() const = 0; |
| 606 }; | 616 }; |
| 607 | 617 |
| 608 } // namespace ppapi | 618 } // namespace ppapi |
| 609 } // namespace webkit | 619 } // namespace webkit |
| 610 | 620 |
| 611 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 621 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
| OLD | NEW |