am 0edada08: Merge change 25101 into eclair
Merge commit '0edada085e175e81b6d38a48b5b022917b410a98' into eclair-plus-aosp * commit '0edada085e175e81b6d38a48b5b022917b410a98': Added an API IOMX::createRendererFromJavaSurface.
This commit is contained in:
@@ -11,6 +11,7 @@ LOCAL_SHARED_LIBRARIES := \
|
|||||||
libstagefright
|
libstagefright
|
||||||
|
|
||||||
LOCAL_C_INCLUDES:= \
|
LOCAL_C_INCLUDES:= \
|
||||||
|
$(JNI_H_INCLUDE) \
|
||||||
frameworks/base/media/libstagefright \
|
frameworks/base/media/libstagefright \
|
||||||
$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include
|
$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include
|
||||||
|
|
||||||
@@ -32,6 +33,7 @@ LOCAL_SHARED_LIBRARIES := \
|
|||||||
libstagefright
|
libstagefright
|
||||||
|
|
||||||
LOCAL_C_INCLUDES:= \
|
LOCAL_C_INCLUDES:= \
|
||||||
|
$(JNI_H_INCLUDE) \
|
||||||
frameworks/base/media/libstagefright \
|
frameworks/base/media/libstagefright \
|
||||||
$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include
|
$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
#include <OMX_Core.h>
|
#include <OMX_Core.h>
|
||||||
#include <OMX_Video.h>
|
#include <OMX_Video.h>
|
||||||
|
|
||||||
|
#include "jni.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
class IMemory;
|
class IMemory;
|
||||||
@@ -102,15 +104,22 @@ public:
|
|||||||
size_t encodedWidth, size_t encodedHeight,
|
size_t encodedWidth, size_t encodedHeight,
|
||||||
size_t displayWidth, size_t displayHeight) = 0;
|
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
|
// 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(
|
sp<IOMXRenderer> createRenderer(
|
||||||
const sp<Surface> &surface,
|
const sp<Surface> &surface,
|
||||||
const char *componentName,
|
const char *componentName,
|
||||||
OMX_COLOR_FORMATTYPE colorFormat,
|
OMX_COLOR_FORMATTYPE colorFormat,
|
||||||
size_t encodedWidth, size_t encodedHeight,
|
size_t encodedWidth, size_t encodedHeight,
|
||||||
size_t displayWidth, size_t displayHeight);
|
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 {
|
struct omx_message {
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ LOCAL_SHARED_LIBRARIES += libdl
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := \
|
LOCAL_C_INCLUDES := \
|
||||||
|
$(JNI_H_INCLUDE) \
|
||||||
$(call include-path-for, graphics corecg) \
|
$(call include-path-for, graphics corecg) \
|
||||||
$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include
|
$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,31 @@ sp<IOMXRenderer> IOMX::createRenderer(
|
|||||||
displayWidth, displayHeight);
|
displayWidth, displayHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sp<IOMXRenderer> IOMX::createRendererFromJavaSurface(
|
||||||
|
JNIEnv *env, jobject javaSurface,
|
||||||
|
const char *componentName,
|
||||||
|
OMX_COLOR_FORMATTYPE colorFormat,
|
||||||
|
size_t encodedWidth, size_t encodedHeight,
|
||||||
|
size_t displayWidth, size_t displayHeight) {
|
||||||
|
jclass surfaceClass = env->FindClass("android/view/Surface");
|
||||||
|
if (surfaceClass == NULL) {
|
||||||
|
LOGE("Can't find android/view/Surface");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
jfieldID surfaceID = env->GetFieldID(surfaceClass, "mSurface", "I");
|
||||||
|
if (surfaceID == NULL) {
|
||||||
|
LOGE("Can't find Surface.mSurface");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
sp<Surface> surface = (Surface *)env->GetIntField(javaSurface, surfaceID);
|
||||||
|
|
||||||
|
return createRenderer(
|
||||||
|
surface, componentName, colorFormat, encodedWidth,
|
||||||
|
encodedHeight, displayWidth, displayHeight);
|
||||||
|
}
|
||||||
|
|
||||||
class BpOMX : public BpInterface<IOMX> {
|
class BpOMX : public BpInterface<IOMX> {
|
||||||
public:
|
public:
|
||||||
BpOMX(const sp<IBinder> &impl)
|
BpOMX(const sp<IBinder> &impl)
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ LOCAL_SHARED_LIBRARIES += libdl
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := external/tremor/Tremor \
|
LOCAL_C_INCLUDES := external/tremor/Tremor \
|
||||||
|
$(JNI_H_INCLUDE) \
|
||||||
$(call include-path-for, graphics corecg) \
|
$(call include-path-for, graphics corecg) \
|
||||||
$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include \
|
$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include \
|
||||||
$(TOP)/frameworks/base/media/libstagefright/omx
|
$(TOP)/frameworks/base/media/libstagefright/omx
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ LOCAL_SRC_FILES += \
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
LOCAL_C_INCLUDES:= \
|
LOCAL_C_INCLUDES:= \
|
||||||
|
$(JNI_H_INCLUDE) \
|
||||||
$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include \
|
$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include \
|
||||||
$(TOP)/external/opencore/android
|
$(TOP)/external/opencore/android
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ LOCAL_C_INCLUDES := $(PV_INCLUDES)
|
|||||||
LOCAL_CFLAGS := $(PV_CFLAGS_MINUS_VISIBILITY)
|
LOCAL_CFLAGS := $(PV_CFLAGS_MINUS_VISIBILITY)
|
||||||
|
|
||||||
LOCAL_C_INCLUDES += $(TOP)/hardware/ti/omap3/liboverlay
|
LOCAL_C_INCLUDES += $(TOP)/hardware/ti/omap3/liboverlay
|
||||||
|
LOCAL_C_INCLUDES += $(JNI_H_INCLUDE)
|
||||||
|
|
||||||
LOCAL_SRC_FILES:= \
|
LOCAL_SRC_FILES:= \
|
||||||
OMX.cpp \
|
OMX.cpp \
|
||||||
|
|||||||
Reference in New Issue
Block a user