updating sample plugins to support fixed surface dimensions.

This commit is contained in:
Derek Sollenberger
2009-10-13 11:43:48 -04:00
parent 46ab498e50
commit bb660dd555
4 changed files with 32 additions and 3 deletions

View File

@@ -63,10 +63,12 @@ public class SamplePluginStub implements PluginStub {
}
});
// TODO provide way for native plugin code to reset the size
if (nativeIsFixedSurface(npp)) {
//TODO get the fixed dimensions from the plugin
//view.getHolder().setFixedSize(width, height);
int width = nativeGetSurfaceWidth(npp);
int height = nativeGetSurfaceHeight(npp);
view.getHolder().setFixedSize(width, height);
}
return view;
@@ -114,5 +116,7 @@ public class SamplePluginStub implements PluginStub {
private native void nativeSurfaceCreated(int npp, View surfaceView);
private native void nativeSurfaceChanged(int npp, int format, int width, int height);
private native void nativeSurfaceDestroyed(int npp);
private native int nativeGetSurfaceWidth(int npp);
private native int nativeGetSurfaceHeight(int npp);
private native boolean nativeIsFixedSurface(int npp);
}