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" |
11 #include "base/message_loop_proxy.h" | 11 #include "base/message_loop_proxy.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
14 #include "base/shared_memory.h" | 14 #include "base/shared_memory.h" |
15 #include "base/sync_socket.h" | 15 #include "base/sync_socket.h" |
16 #include "base/time.h" | 16 #include "base/time.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 #include "media/video/capture/video_capture.h" |
18 #include "media/video/video_decode_accelerator.h" | 19 #include "media/video/video_decode_accelerator.h" |
19 #include "ppapi/c/dev/pp_video_dev.h" | 20 #include "ppapi/c/dev/pp_video_dev.h" |
20 #include "ppapi/c/pp_completion_callback.h" | 21 #include "ppapi/c/pp_completion_callback.h" |
21 #include "ppapi/c/pp_errors.h" | 22 #include "ppapi/c/pp_errors.h" |
22 #include "ppapi/c/pp_instance.h" | 23 #include "ppapi/c/pp_instance.h" |
23 #include "ppapi/c/pp_stdint.h" | 24 #include "ppapi/c/pp_stdint.h" |
24 #include "ui/gfx/size.h" | 25 #include "ui/gfx/size.h" |
25 #include "webkit/fileapi/file_system_types.h" | 26 #include "webkit/fileapi/file_system_types.h" |
26 #include "webkit/plugins/ppapi/dir_contents.h" | 27 #include "webkit/plugins/ppapi/dir_contents.h" |
27 #include "webkit/quota/quota_types.h" | 28 #include "webkit/quota/quota_types.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 virtual ~PlatformAudio() {} | 214 virtual ~PlatformAudio() {} |
214 }; | 215 }; |
215 | 216 |
216 // Interface for PlatformVideoDecoder is directly inherited from general media | 217 // Interface for PlatformVideoDecoder is directly inherited from general media |
217 // VideoDecodeAccelerator interface. | 218 // VideoDecodeAccelerator interface. |
218 class PlatformVideoDecoder : public media::VideoDecodeAccelerator { | 219 class PlatformVideoDecoder : public media::VideoDecodeAccelerator { |
219 protected: | 220 protected: |
220 virtual ~PlatformVideoDecoder() {} | 221 virtual ~PlatformVideoDecoder() {} |
221 }; | 222 }; |
222 | 223 |
| 224 class PlatformVideoCapture : public media::VideoCapture { |
| 225 public: |
| 226 virtual ~PlatformVideoCapture() {} |
| 227 }; |
| 228 |
223 // Provides access to the ppapi broker. | 229 // Provides access to the ppapi broker. |
224 class PpapiBroker { | 230 class PpapiBroker { |
225 public: | 231 public: |
226 virtual void Connect(webkit::ppapi::PPB_Broker_Impl* client) = 0; | 232 virtual void Connect(webkit::ppapi::PPB_Broker_Impl* client) = 0; |
227 | 233 |
228 // Decrements the references to the broker. | 234 // Decrements the references to the broker. |
229 // When there are no more references, this renderer's dispatcher is | 235 // When there are no more references, this renderer's dispatcher is |
230 // destroyed, allowing the broker to shutdown if appropriate. | 236 // destroyed, allowing the broker to shutdown if appropriate. |
231 // Callers should not reference this object after calling Disconnect. | 237 // Callers should not reference this object after calling Disconnect. |
232 virtual void Disconnect(webkit::ppapi::PPB_Broker_Impl* client) = 0; | 238 virtual void Disconnect(webkit::ppapi::PPB_Broker_Impl* client) = 0; |
(...skipping 22 matching lines...) Expand all Loading... |
255 // sad plugin screen with. Returns NULL on failure. | 261 // sad plugin screen with. Returns NULL on failure. |
256 virtual SkBitmap* GetSadPluginBitmap() = 0; | 262 virtual SkBitmap* GetSadPluginBitmap() = 0; |
257 | 263 |
258 // The caller will own the pointer returned from this. | 264 // The caller will own the pointer returned from this. |
259 virtual PlatformImage2D* CreateImage2D(int width, int height) = 0; | 265 virtual PlatformImage2D* CreateImage2D(int width, int height) = 0; |
260 | 266 |
261 // The caller will own the pointer returned from this. | 267 // The caller will own the pointer returned from this. |
262 virtual PlatformContext3D* CreateContext3D() = 0; | 268 virtual PlatformContext3D* CreateContext3D() = 0; |
263 | 269 |
264 // The caller will own the pointer returned from this. | 270 // The caller will own the pointer returned from this. |
| 271 virtual PlatformVideoCapture* CreateVideoCapture( |
| 272 media::VideoCapture::EventHandler* handler) = 0; |
| 273 |
| 274 // The caller will own the pointer returned from this. |
265 virtual PlatformVideoDecoder* CreateVideoDecoder( | 275 virtual PlatformVideoDecoder* CreateVideoDecoder( |
266 media::VideoDecodeAccelerator::Client* client, | 276 media::VideoDecodeAccelerator::Client* client, |
267 int32 command_buffer_route_id) = 0; | 277 int32 command_buffer_route_id) = 0; |
268 | 278 |
269 // The caller is responsible for calling Shutdown() on the returned pointer | 279 // The caller is responsible for calling Shutdown() on the returned pointer |
270 // to clean up the corresponding resources allocated during this call. | 280 // to clean up the corresponding resources allocated during this call. |
271 virtual PlatformAudio* CreateAudio(uint32_t sample_rate, | 281 virtual PlatformAudio* CreateAudio(uint32_t sample_rate, |
272 uint32_t sample_count, | 282 uint32_t sample_count, |
273 PlatformAudio::Client* client) = 0; | 283 PlatformAudio::Client* client) = 0; |
274 | 284 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 virtual base::SharedMemory* CreateAnonymousSharedMemory(uint32_t size) = 0; | 441 virtual base::SharedMemory* CreateAnonymousSharedMemory(uint32_t size) = 0; |
432 | 442 |
433 // Returns the current preferences. | 443 // Returns the current preferences. |
434 virtual ::ppapi::Preferences GetPreferences() = 0; | 444 virtual ::ppapi::Preferences GetPreferences() = 0; |
435 }; | 445 }; |
436 | 446 |
437 } // namespace ppapi | 447 } // namespace ppapi |
438 } // namespace webkit | 448 } // namespace webkit |
439 | 449 |
440 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 450 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
OLD | NEW |