Chromium Code Reviews| 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.h" | 10 #include "base/callback.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 virtual bool StopPlayback() = 0; | 209 virtual bool StopPlayback() = 0; |
| 210 | 210 |
| 211 // Closes the stream. Make sure to call this before the object is | 211 // Closes the stream. Make sure to call this before the object is |
| 212 // destructed. | 212 // destructed. |
| 213 virtual void ShutDown() = 0; | 213 virtual void ShutDown() = 0; |
| 214 | 214 |
| 215 protected: | 215 protected: |
| 216 virtual ~PlatformAudio() {} | 216 virtual ~PlatformAudio() {} |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 class PlatformAudioInput { | |
| 220 public: | |
| 221 class Client { | |
| 222 protected: | |
| 223 virtual ~Client() {} | |
| 224 | |
| 225 public: | |
| 226 // Called when the stream is created. | |
| 227 virtual void StreamCreated(base::SharedMemoryHandle shared_memory_handle, | |
|
viettrungluu
2011/11/16 01:08:34
I'm going to refactor this to get rid of the Strea
| |
| 228 size_t shared_memory_size, | |
| 229 base::SyncSocket::Handle socket) = 0; | |
| 230 }; | |
| 231 | |
| 232 // Starts the playback. Returns false on error or if called before the | |
| 233 // stream is created or after the stream is closed. | |
| 234 virtual bool StartCapture() = 0; | |
| 235 | |
| 236 // Stops the capture. Returns false on error or if called before the stream | |
| 237 // is created or after the stream is closed. | |
| 238 virtual bool StopCapture() = 0; | |
| 239 | |
| 240 // Closes the stream. Make sure to call this before the object is | |
| 241 // destructed. | |
| 242 virtual void ShutDown() = 0; | |
| 243 | |
| 244 protected: | |
| 245 virtual ~PlatformAudioInput() {} | |
| 246 }; | |
| 247 | |
| 219 // Interface for PlatformVideoDecoder is directly inherited from general media | 248 // Interface for PlatformVideoDecoder is directly inherited from general media |
| 220 // VideoDecodeAccelerator interface. | 249 // VideoDecodeAccelerator interface. |
| 221 class PlatformVideoDecoder : public media::VideoDecodeAccelerator { | 250 class PlatformVideoDecoder : public media::VideoDecodeAccelerator { |
| 222 protected: | 251 protected: |
| 223 virtual ~PlatformVideoDecoder() {} | 252 virtual ~PlatformVideoDecoder() {} |
| 224 }; | 253 }; |
| 225 | 254 |
| 226 class PlatformVideoCapture : public media::VideoCapture { | 255 class PlatformVideoCapture : public media::VideoCapture { |
| 227 public: | 256 public: |
| 228 virtual ~PlatformVideoCapture() {} | 257 virtual ~PlatformVideoCapture() {} |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 virtual PlatformVideoDecoder* CreateVideoDecoder( | 316 virtual PlatformVideoDecoder* CreateVideoDecoder( |
| 288 media::VideoDecodeAccelerator::Client* client, | 317 media::VideoDecodeAccelerator::Client* client, |
| 289 int32 command_buffer_route_id) = 0; | 318 int32 command_buffer_route_id) = 0; |
| 290 | 319 |
| 291 // The caller is responsible for calling Shutdown() on the returned pointer | 320 // The caller is responsible for calling Shutdown() on the returned pointer |
| 292 // to clean up the corresponding resources allocated during this call. | 321 // to clean up the corresponding resources allocated during this call. |
| 293 virtual PlatformAudio* CreateAudio(uint32_t sample_rate, | 322 virtual PlatformAudio* CreateAudio(uint32_t sample_rate, |
| 294 uint32_t sample_count, | 323 uint32_t sample_count, |
| 295 PlatformAudio::Client* client) = 0; | 324 PlatformAudio::Client* client) = 0; |
| 296 | 325 |
| 326 // The caller is responsible for calling Shutdown() on the returned pointer | |
| 327 // to clean up the corresponding resources allocated during this call. | |
| 328 virtual PlatformAudioInput* CreateAudioInput(uint32_t sample_rate, | |
| 329 uint32_t sample_count, | |
| 330 PlatformAudioInput::Client* client) = 0; | |
| 331 | |
| 297 // A pointer is returned immediately, but it is not ready to be used until | 332 // A pointer is returned immediately, but it is not ready to be used until |
| 298 // BrokerConnected has been called. | 333 // BrokerConnected has been called. |
| 299 // The caller is responsible for calling Release() on the returned pointer | 334 // The caller is responsible for calling Release() on the returned pointer |
| 300 // to clean up the corresponding resources allocated during this call. | 335 // to clean up the corresponding resources allocated during this call. |
| 301 virtual PpapiBroker* ConnectToPpapiBroker( | 336 virtual PpapiBroker* ConnectToPpapiBroker( |
| 302 webkit::ppapi::PPB_Broker_Impl* client) = 0; | 337 webkit::ppapi::PPB_Broker_Impl* client) = 0; |
| 303 | 338 |
| 304 // Notifies that the number of find results has changed. | 339 // Notifies that the number of find results has changed. |
| 305 virtual void NumberOfFindResultsChanged(int identifier, | 340 virtual void NumberOfFindResultsChanged(int identifier, |
| 306 int total, | 341 int total, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 464 virtual void DidReceiveMouseEvent(PluginInstance* instance) = 0; | 499 virtual void DidReceiveMouseEvent(PluginInstance* instance) = 0; |
| 465 | 500 |
| 466 // Determines if the browser entered fullscreen mode. | 501 // Determines if the browser entered fullscreen mode. |
| 467 virtual bool IsInFullscreenMode() = 0; | 502 virtual bool IsInFullscreenMode() = 0; |
| 468 }; | 503 }; |
| 469 | 504 |
| 470 } // namespace ppapi | 505 } // namespace ppapi |
| 471 } // namespace webkit | 506 } // namespace webkit |
| 472 | 507 |
| 473 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 508 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
| OLD | NEW |