summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/plugins/ANPVideoInterface.cpp
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2011-09-08 12:49:37 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-08 12:49:37 -0700
commit0ae24ff51fd869435c30e14d192c4416cc089498 (patch)
treef1d15d09b58a9886f6b87be4efd243ac52478c2f /Source/WebKit/android/plugins/ANPVideoInterface.cpp
parentfae7f9baba4266dfe9ef89b86c12dd054273c93b (diff)
parent86772c601f6ccc0e1d0e0eca429cc2a73c6c3207 (diff)
downloadexternal_webkit-0ae24ff51fd869435c30e14d192c4416cc089498.zip
external_webkit-0ae24ff51fd869435c30e14d192c4416cc089498.tar.gz
external_webkit-0ae24ff51fd869435c30e14d192c4416cc089498.tar.bz2
Merge "Add Plugin API for a video framerate callback."
Diffstat (limited to 'Source/WebKit/android/plugins/ANPVideoInterface.cpp')
-rw-r--r--Source/WebKit/android/plugins/ANPVideoInterface.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/WebKit/android/plugins/ANPVideoInterface.cpp b/Source/WebKit/android/plugins/ANPVideoInterface.cpp
index 8eb9846..f39d0b1 100644
--- a/Source/WebKit/android/plugins/ANPVideoInterface.cpp
+++ b/Source/WebKit/android/plugins/ANPVideoInterface.cpp
@@ -70,6 +70,14 @@ static void anp_releaseNativeWindow(NPP instance, ANativeWindow* window) {
mediaLayer->releaseNativeWindowForVideo(window);
}
+static void anp_setFramerateCallback(NPP instance, const ANativeWindow* window, ANPVideoFrameCallbackProc callback) {
+ WebCore::MediaLayer* mediaLayer = mediaLayerForInstance(instance);
+ if (!mediaLayer)
+ return;
+
+ mediaLayer->setFramerateCallback(window, callback);
+}
+
///////////////////////////////////////////////////////////////////////////////
#define ASSIGN(obj, name) (obj)->name = anp_##name
@@ -81,3 +89,11 @@ void ANPVideoInterfaceV0_Init(ANPInterface* value) {
ASSIGN(i, setWindowDimensions);
ASSIGN(i, releaseNativeWindow);
}
+
+void ANPVideoInterfaceV1_Init(ANPInterface* value) {
+ // initialize the functions from the previous interface
+ ANPVideoInterfaceV0_Init(value);
+ // add any new functions or override existing functions
+ ANPVideoInterfaceV1* i = reinterpret_cast<ANPVideoInterfaceV1*>(value);
+ ASSIGN(i, setFramerateCallback);
+}