Added an API IOMX::createRendererFromJavaSurface.
This api allows to instantiate a renderer by specifying the hosting java Surface object. This hides the implementation details of (java-)Surface, (native-)Surface and friends.
diff --git a/include/media/IOMX.h b/include/media/IOMX.h
index 0014d5c..10e0197 100644
--- a/include/media/IOMX.h
+++ b/include/media/IOMX.h
@@ -25,6 +25,8 @@
#include <OMX_Core.h>
#include <OMX_Video.h>
+#include "jni.h"
+
namespace android {
class IMemory;
@@ -102,15 +104,22 @@
size_t encodedWidth, size_t encodedHeight,
size_t displayWidth, size_t displayHeight) = 0;
- // Note: This method is _not_ virtual, it exists as a wrapper around
+ // Note: These methods are _not_ virtual, it exists as a wrapper around
// the virtual "createRenderer" method above facilitating extraction
- // of the ISurface from a regular Surface.
+ // of the ISurface from a regular Surface or a java Surface object.
sp<IOMXRenderer> createRenderer(
const sp<Surface> &surface,
const char *componentName,
OMX_COLOR_FORMATTYPE colorFormat,
size_t encodedWidth, size_t encodedHeight,
size_t displayWidth, size_t displayHeight);
+
+ sp<IOMXRenderer> createRendererFromJavaSurface(
+ JNIEnv *env, jobject javaSurface,
+ const char *componentName,
+ OMX_COLOR_FORMATTYPE colorFormat,
+ size_t encodedWidth, size_t encodedHeight,
+ size_t displayWidth, size_t displayHeight);
};
struct omx_message {