summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebCore/plugins/android/PluginViewAndroid.cpp2
-rw-r--r--WebKit/android/plugins/ANPSoundInterface.cpp12
-rw-r--r--WebKit/android/plugins/android_npapi.h7
3 files changed, 21 insertions, 0 deletions
diff --git a/WebCore/plugins/android/PluginViewAndroid.cpp b/WebCore/plugins/android/PluginViewAndroid.cpp
index cb069bc..f0890ae 100644
--- a/WebCore/plugins/android/PluginViewAndroid.cpp
+++ b/WebCore/plugins/android/PluginViewAndroid.cpp
@@ -91,6 +91,7 @@
///////////////////////////////////////////////////////////////////////////////
extern void ANPAudioTrackInterfaceV0_Init(ANPInterface* value);
+extern void ANPAudioTrackInterfaceV1_Init(ANPInterface* value);
extern void ANPBitmapInterfaceV0_Init(ANPInterface* value);
extern void ANPCanvasInterfaceV0_Init(ANPInterface* value);
extern void ANPEventInterfaceV0_Init(ANPInterface* value);
@@ -115,6 +116,7 @@ struct VarProcPair {
static const VarProcPair gVarProcs[] = {
{ VARPROCLINE(AudioTrackInterfaceV0) },
+ { VARPROCLINE(AudioTrackInterfaceV1) },
{ VARPROCLINE(BitmapInterfaceV0) },
{ VARPROCLINE(CanvasInterfaceV0) },
{ VARPROCLINE(EventInterfaceV0) },
diff --git a/WebKit/android/plugins/ANPSoundInterface.cpp b/WebKit/android/plugins/ANPSoundInterface.cpp
index 8e31d69..91778e3 100644
--- a/WebKit/android/plugins/ANPSoundInterface.cpp
+++ b/WebKit/android/plugins/ANPSoundInterface.cpp
@@ -136,6 +136,10 @@ static bool ANPTrackIsStopped(ANPAudioTrack* track) {
return track->mTrack->stopped();
}
+static uint32_t ANPTrackLatency(ANPAudioTrack* track) {
+ return track->mTrack->latency();
+}
+
///////////////////////////////////////////////////////////////////////////////
void ANPAudioTrackInterfaceV0_Init(ANPInterface* value) {
@@ -147,3 +151,11 @@ void ANPAudioTrackInterfaceV0_Init(ANPInterface* value) {
si->stop = ANPTrackStop;
si->isStopped = ANPTrackIsStopped;
}
+
+void ANPAudioTrackInterfaceV1_Init(ANPInterface* value) {
+ // initialize the functions from the previous interface
+ ANPAudioTrackInterfaceV0_Init(value);
+ // add any new functions or override existing functions
+ ANPAudioTrackInterfaceV1* si = reinterpret_cast<ANPAudioTrackInterfaceV1*>(value);
+ si->trackLatency = ANPTrackLatency;
+}
diff --git a/WebKit/android/plugins/android_npapi.h b/WebKit/android/plugins/android_npapi.h
index 25cee97..87ca8cc 100644
--- a/WebKit/android/plugins/android_npapi.h
+++ b/WebKit/android/plugins/android_npapi.h
@@ -120,6 +120,8 @@ typedef uint32_t ANPMatrixFlag;
#define kSystemInterfaceV0_ANPGetValue ((NPNVariable)1010)
#define kEventInterfaceV0_ANPGetValue ((NPNVariable)1011)
+#define kAudioTrackInterfaceV1_ANPGetValue ((NPNVariable)1012)
+
/** queries for the drawing models supported on this device.
NPN_GetValue(inst, kSupportedDrawingModel_ANPGetValue, uint32_t* bits)
@@ -762,6 +764,11 @@ struct ANPAudioTrackInterfaceV0 : ANPInterface {
bool (*isStopped)(ANPAudioTrack*);
};
+struct ANPAudioTrackInterfaceV1 : ANPAudioTrackInterfaceV0 {
+ /** Returns the track's latency in milliseconds. */
+ uint32_t (*trackLatency)(ANPAudioTrack*);
+};
+
///////////////////////////////////////////////////////////////////////////////
// DEFINITION OF VALUES PASSED THROUGH NPP_HandleEvent