OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ |
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
11 #include "base/sync_socket.h" | 11 #include "base/sync_socket.h" |
| 12 #include "third_party/ppapi/c/pp_completion_callback.h" |
| 13 #include "third_party/ppapi/c/pp_errors.h" |
12 #include "third_party/ppapi/c/pp_stdint.h" | 14 #include "third_party/ppapi/c/pp_stdint.h" |
| 15 #include "third_party/ppapi/c/pp_video.h" |
13 | 16 |
14 class AudioMessageFilter; | 17 class AudioMessageFilter; |
15 | 18 |
16 namespace skia { | 19 namespace skia { |
17 class PlatformCanvas; | 20 class PlatformCanvas; |
18 } | 21 } |
19 | 22 |
20 namespace WebKit { | 23 namespace WebKit { |
21 class WebFileChooserCompletion; | 24 class WebFileChooserCompletion; |
22 struct WebFileChooserParams; | 25 struct WebFileChooserParams; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 68 |
66 // Stops the playback. Returns false on error or if called before the stream | 69 // Stops the playback. Returns false on error or if called before the stream |
67 // is created or after the stream is closed. | 70 // is created or after the stream is closed. |
68 virtual bool StopPlayback() = 0; | 71 virtual bool StopPlayback() = 0; |
69 | 72 |
70 // Closes the stream. Make sure to call this before the object is | 73 // Closes the stream. Make sure to call this before the object is |
71 // destructed. | 74 // destructed. |
72 virtual void ShutDown() = 0; | 75 virtual void ShutDown() = 0; |
73 }; | 76 }; |
74 | 77 |
| 78 class PlatformVideoDecoder { |
| 79 public: |
| 80 virtual ~PlatformVideoDecoder() {} |
| 81 |
| 82 // Returns false on failure. |
| 83 virtual bool Decode(PP_VideoCompressedDataBuffer& input_buffer) = 0; |
| 84 virtual int32_t Flush(PP_CompletionCallback& callback) = 0; |
| 85 virtual bool ReturnUncompressedDataBuffer( |
| 86 PP_VideoUncompressedDataBuffer& buffer) = 0; |
| 87 }; |
| 88 |
75 // Indicates that the given instance has been created. | 89 // Indicates that the given instance has been created. |
76 virtual void InstanceCreated(pepper::PluginInstance* instance) = 0; | 90 virtual void InstanceCreated(pepper::PluginInstance* instance) = 0; |
77 | 91 |
78 // Indicates that the given instance is being destroyed. This is called from | 92 // Indicates that the given instance is being destroyed. This is called from |
79 // the destructor, so it's important that the instance is not dereferenced | 93 // the destructor, so it's important that the instance is not dereferenced |
80 // from this call. | 94 // from this call. |
81 virtual void InstanceDeleted(pepper::PluginInstance* instance) = 0; | 95 virtual void InstanceDeleted(pepper::PluginInstance* instance) = 0; |
82 | 96 |
83 // The caller will own the pointer returned from this. | 97 // The caller will own the pointer returned from this. |
84 virtual PlatformImage2D* CreateImage2D(int width, int height) = 0; | 98 virtual PlatformImage2D* CreateImage2D(int width, int height) = 0; |
85 | 99 |
| 100 // The caller will own the pointer returned from this. |
| 101 virtual PlatformVideoDecoder* CreateVideoDecoder( |
| 102 const PP_VideoDecoderConfig& decoder_config) = 0; |
| 103 |
86 // Notifies that the number of find results has changed. | 104 // Notifies that the number of find results has changed. |
87 virtual void DidChangeNumberOfFindResults(int identifier, | 105 virtual void DidChangeNumberOfFindResults(int identifier, |
88 int total, | 106 int total, |
89 bool final_result) = 0; | 107 bool final_result) = 0; |
90 | 108 |
91 // Notifies that the index of the currently selected item has been updated. | 109 // Notifies that the index of the currently selected item has been updated. |
92 virtual void DidChangeSelectedFindResult(int identifier, int index) = 0; | 110 virtual void DidChangeSelectedFindResult(int identifier, int index) = 0; |
93 | 111 |
94 // The caller will own the pointer returned from this. | 112 // The caller will own the pointer returned from this. |
95 virtual PlatformAudio* CreateAudio(uint32_t sample_rate, | 113 virtual PlatformAudio* CreateAudio(uint32_t sample_rate, |
96 uint32_t sample_count, | 114 uint32_t sample_count, |
97 PlatformAudio::Client* client) = 0; | 115 PlatformAudio::Client* client) = 0; |
98 | 116 |
99 // Runs a file chooser. | 117 // Runs a file chooser. |
100 virtual bool RunFileChooser( | 118 virtual bool RunFileChooser( |
101 const WebKit::WebFileChooserParams& params, | 119 const WebKit::WebFileChooserParams& params, |
102 WebKit::WebFileChooserCompletion* chooser_completion) = 0; | 120 WebKit::WebFileChooserCompletion* chooser_completion) = 0; |
103 }; | 121 }; |
104 | 122 |
105 } // namespace pepper | 123 } // namespace pepper |
106 | 124 |
107 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ | 125 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ |
OLD | NEW |