Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Side by Side Diff: webkit/plugins/ppapi/plugin_delegate.h

Issue 8138008: Implementation of ppapi audio. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
viettrungluu 2011/11/08 00:41:54 nit: remove extra blank line
221 class PlatformAudioInput {
222 public:
223 class Client {
224 protected:
225 virtual ~Client() {}
226
227 public:
228 // Called when the stream is created.
229 virtual void StreamCreated(base::SharedMemoryHandle shared_memory_handle,
230 size_t shared_memory_size,
231 base::SyncSocket::Handle socket) = 0;
232 };
233
234 // Starts the playback. Returns false on error or if called before the
235 // stream is created or after the stream is closed.
236 virtual bool StartCapture() = 0;
237
238 // Stops the capture. Returns false on error or if called before the stream
239 // is created or after the stream is closed.
240 virtual bool StopCapture() = 0;
241
242 // Closes the stream. Make sure to call this before the object is
243 // destructed.
244 virtual void ShutDown() = 0;
245
246 protected:
247 virtual ~PlatformAudioInput() {}
248 };
249
viettrungluu 2011/11/08 00:41:54 nit: remove extra blank lines
250
251
252
220 // Interface for PlatformVideoDecoder is directly inherited from general media 253 // Interface for PlatformVideoDecoder is directly inherited from general media
221 // VideoDecodeAccelerator interface. 254 // VideoDecodeAccelerator interface.
222 class PlatformVideoDecoder : public media::VideoDecodeAccelerator { 255 class PlatformVideoDecoder : public media::VideoDecodeAccelerator {
223 protected: 256 protected:
224 virtual ~PlatformVideoDecoder() {} 257 virtual ~PlatformVideoDecoder() {}
225 }; 258 };
226 259
227 class PlatformVideoCapture : public media::VideoCapture { 260 class PlatformVideoCapture : public media::VideoCapture {
228 public: 261 public:
229 virtual ~PlatformVideoCapture() {} 262 virtual ~PlatformVideoCapture() {}
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 virtual PlatformVideoDecoder* CreateVideoDecoder( 311 virtual PlatformVideoDecoder* CreateVideoDecoder(
279 media::VideoDecodeAccelerator::Client* client, 312 media::VideoDecodeAccelerator::Client* client,
280 int32 command_buffer_route_id) = 0; 313 int32 command_buffer_route_id) = 0;
281 314
282 // The caller is responsible for calling Shutdown() on the returned pointer 315 // The caller is responsible for calling Shutdown() on the returned pointer
283 // to clean up the corresponding resources allocated during this call. 316 // to clean up the corresponding resources allocated during this call.
284 virtual PlatformAudio* CreateAudio(uint32_t sample_rate, 317 virtual PlatformAudio* CreateAudio(uint32_t sample_rate,
285 uint32_t sample_count, 318 uint32_t sample_count,
286 PlatformAudio::Client* client) = 0; 319 PlatformAudio::Client* client) = 0;
287 320
321 // The caller is responsible for calling Shutdown() on the returned pointer
322 // to clean up the corresponding resources allocated during this call.
323 virtual PlatformAudioInput* CreateAudioInput(uint32_t sample_rate,
324 uint32_t sample_count,
viettrungluu 2011/11/08 00:41:54 nit: indentation
325 PlatformAudioInput::Client* client) = 0;
326
288 // A pointer is returned immediately, but it is not ready to be used until 327 // A pointer is returned immediately, but it is not ready to be used until
289 // BrokerConnected has been called. 328 // BrokerConnected has been called.
290 // The caller is responsible for calling Release() on the returned pointer 329 // The caller is responsible for calling Release() on the returned pointer
291 // to clean up the corresponding resources allocated during this call. 330 // to clean up the corresponding resources allocated during this call.
292 virtual PpapiBroker* ConnectToPpapiBroker( 331 virtual PpapiBroker* ConnectToPpapiBroker(
293 webkit::ppapi::PPB_Broker_Impl* client) = 0; 332 webkit::ppapi::PPB_Broker_Impl* client) = 0;
294 333
295 // Notifies that the number of find results has changed. 334 // Notifies that the number of find results has changed.
296 virtual void NumberOfFindResultsChanged(int identifier, 335 virtual void NumberOfFindResultsChanged(int identifier,
297 int total, 336 int total,
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 // the only cause of losing mouse lock. For example, a user may press the Esc 491 // 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() 492 // key to quit the mouse lock mode, which also results in an OnMouseLockLost()
454 // call to the current mouse lock owner. 493 // call to the current mouse lock owner.
455 virtual void UnlockMouse(PluginInstance* instance) = 0; 494 virtual void UnlockMouse(PluginInstance* instance) = 0;
456 }; 495 };
457 496
458 } // namespace ppapi 497 } // namespace ppapi
459 } // namespace webkit 498 } // namespace webkit
460 499
461 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ 500 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698