Merge pull request #1820 from asmorkalov:android_native_camera_44
This commit is contained in:
commit
4746a710bb
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.2.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.3.3.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.3.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r3.0.1.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r3.0.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.1.1.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.1.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.2.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.3.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.3.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.4.0.so
vendored
Executable file
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.4.0.so
vendored
Executable file
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r2.2.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r2.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r2.3.3.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r2.3.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r3.0.1.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r3.0.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.1.1.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.1.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.2.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.3.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.3.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.4.0.so
vendored
Executable file
BIN
3rdparty/lib/armeabi/libnative_camera_r4.4.0.so
vendored
Executable file
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/mips/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.1.1.so
vendored
BIN
3rdparty/lib/mips/libnative_camera_r4.1.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.2.0.so
vendored
BIN
3rdparty/lib/mips/libnative_camera_r4.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.3.0.so
vendored
BIN
3rdparty/lib/mips/libnative_camera_r4.3.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/mips/libnative_camera_r4.4.0.so
vendored
Executable file
BIN
3rdparty/lib/mips/libnative_camera_r4.4.0.so
vendored
Executable file
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r2.3.3.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r2.3.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r3.0.1.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r3.0.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.1.1.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r4.1.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.2.0.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r4.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.3.0.so
vendored
BIN
3rdparty/lib/x86/libnative_camera_r4.3.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.4.0.so
vendored
Executable file
BIN
3rdparty/lib/x86/libnative_camera_r4.4.0.so
vendored
Executable file
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && \
|
#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && \
|
||||||
!defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3) && !defined(ANDROID_r4_1_1) && \
|
!defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3) && !defined(ANDROID_r4_1_1) && \
|
||||||
!defined(ANDROID_r4_2_0) && !defined(ANDROID_r4_3_0)
|
!defined(ANDROID_r4_2_0) && !defined(ANDROID_r4_3_0) && !defined(ANDROID_r4_4_0)
|
||||||
# error Building camera wrapper for your version of Android is not supported by OpenCV.\
|
# error Building camera wrapper for your version of Android is not supported by OpenCV.\
|
||||||
You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
|
You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
|
||||||
#endif
|
#endif
|
||||||
@ -22,7 +22,7 @@
|
|||||||
#elif defined(ANDROID_r4_1_1) || defined(ANDROID_r4_2_0)
|
#elif defined(ANDROID_r4_1_1) || defined(ANDROID_r4_2_0)
|
||||||
# include <gui/ISurface.h>
|
# include <gui/ISurface.h>
|
||||||
# include <gui/BufferQueue.h>
|
# include <gui/BufferQueue.h>
|
||||||
#elif defined(ANDROID_r4_3_0)
|
#elif defined(ANDROID_r4_3_0) || defined(ANDROID_r4_4_0)
|
||||||
# include <gui/IGraphicBufferProducer.h>
|
# include <gui/IGraphicBufferProducer.h>
|
||||||
# include <gui/BufferQueue.h>
|
# include <gui/BufferQueue.h>
|
||||||
#else
|
#else
|
||||||
@ -74,6 +74,20 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#elif defined(ANDROID_r4_4_0)
|
||||||
|
class ConsumerListenerStub: public android::BnConsumerListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void onFrameAvailable()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
virtual void onBuffersReleased()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
virtual ~ConsumerListenerStub()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string getProcessName()
|
std::string getProcessName()
|
||||||
@ -306,7 +320,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void postData(int32_t msgType, const sp<IMemory>& dataPtr
|
virtual void postData(int32_t msgType, const sp<IMemory>& dataPtr
|
||||||
#if defined(ANDROID_r4_0_0) || defined(ANDROID_r4_0_3) || defined(ANDROID_r4_1_1) || defined(ANDROID_r4_2_0) || defined(ANDROID_r4_3_0)
|
#if defined(ANDROID_r4_0_0) || defined(ANDROID_r4_0_3) || defined(ANDROID_r4_1_1) || defined(ANDROID_r4_2_0) \
|
||||||
|
|| defined(ANDROID_r4_3_0) || defined(ANDROID_r4_4_0)
|
||||||
,camera_frame_metadata_t*
|
,camera_frame_metadata_t*
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@ -623,7 +638,14 @@ CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback,
|
|||||||
bufferStatus = camera->setPreviewTexture(bufferQueue);
|
bufferStatus = camera->setPreviewTexture(bufferQueue);
|
||||||
if (bufferStatus != 0)
|
if (bufferStatus != 0)
|
||||||
LOGE("initCameraConnect: failed setPreviewTexture call; camera might not work correctly");
|
LOGE("initCameraConnect: failed setPreviewTexture call; camera might not work correctly");
|
||||||
#endif
|
# elif defined(ANDROID_r4_4_0)
|
||||||
|
sp<BufferQueue> bufferQueue = new BufferQueue();
|
||||||
|
sp<IConsumerListener> queueListener = new ConsumerListenerStub();
|
||||||
|
bufferQueue->consumerConnect(queueListener, true);
|
||||||
|
bufferStatus = handler->camera->setPreviewTarget(bufferQueue);
|
||||||
|
if (bufferStatus != 0)
|
||||||
|
LOGE("applyProperties: failed setPreviewTexture call; camera might not work correctly");
|
||||||
|
# endif
|
||||||
|
|
||||||
#if (defined(ANDROID_r2_2_0) || defined(ANDROID_r2_3_3) || defined(ANDROID_r3_0_1))
|
#if (defined(ANDROID_r2_2_0) || defined(ANDROID_r2_3_3) || defined(ANDROID_r3_0_1))
|
||||||
# if 1
|
# if 1
|
||||||
@ -663,7 +685,8 @@ void CameraHandler::closeCameraConnect()
|
|||||||
}
|
}
|
||||||
|
|
||||||
camera->stopPreview();
|
camera->stopPreview();
|
||||||
#if defined(ANDROID_r4_0_0) || defined(ANDROID_r4_0_3) || defined(ANDROID_r4_1_1) || defined(ANDROID_r4_2_0) || defined(ANDROID_r4_3_0)
|
#if defined(ANDROID_r4_0_0) || defined(ANDROID_r4_0_3) || defined(ANDROID_r4_1_1) || defined(ANDROID_r4_2_0) \
|
||||||
|
|| defined(ANDROID_r4_3_0) || defined(ANDROID_r4_3_0)
|
||||||
camera->setPreviewCallbackFlags(CAMERA_FRAME_CALLBACK_FLAG_NOOP);
|
camera->setPreviewCallbackFlags(CAMERA_FRAME_CALLBACK_FLAG_NOOP);
|
||||||
#endif
|
#endif
|
||||||
camera->disconnect();
|
camera->disconnect();
|
||||||
@ -914,7 +937,8 @@ void CameraHandler::applyProperties(CameraHandler** ppcameraHandler)
|
|||||||
|
|
||||||
CameraParameters curCameraParameters((*ppcameraHandler)->params.flatten());
|
CameraParameters curCameraParameters((*ppcameraHandler)->params.flatten());
|
||||||
|
|
||||||
#if defined(ANDROID_r4_0_0) || defined(ANDROID_r4_0_3) || defined(ANDROID_r4_1_1) || defined(ANDROID_r4_2_0) || defined(ANDROID_r4_3_0)
|
#if defined(ANDROID_r4_0_0) || defined(ANDROID_r4_0_3) || defined(ANDROID_r4_1_1) || defined(ANDROID_r4_2_0) \
|
||||||
|
|| defined(ANDROID_r4_3_0) || defined(ANDROID_r4_4_0)
|
||||||
CameraHandler* handler=*ppcameraHandler;
|
CameraHandler* handler=*ppcameraHandler;
|
||||||
|
|
||||||
handler->camera->stopPreview();
|
handler->camera->stopPreview();
|
||||||
@ -943,6 +967,13 @@ void CameraHandler::applyProperties(CameraHandler** ppcameraHandler)
|
|||||||
bufferStatus = handler->camera->setPreviewTexture(bufferQueue);
|
bufferStatus = handler->camera->setPreviewTexture(bufferQueue);
|
||||||
if (bufferStatus != 0)
|
if (bufferStatus != 0)
|
||||||
LOGE("applyProperties: failed setPreviewTexture call; camera might not work correctly");
|
LOGE("applyProperties: failed setPreviewTexture call; camera might not work correctly");
|
||||||
|
# elif defined(ANDROID_r4_4_0)
|
||||||
|
sp<BufferQueue> bufferQueue = new BufferQueue();
|
||||||
|
sp<IConsumerListener> queueListener = new ConsumerListenerStub();
|
||||||
|
bufferQueue->consumerConnect(queueListener, true);
|
||||||
|
bufferStatus = handler->camera->setPreviewTarget(bufferQueue);
|
||||||
|
if (bufferStatus != 0)
|
||||||
|
LOGE("applyProperties: failed setPreviewTexture call; camera might not work correctly");
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
handler->camera->setPreviewCallbackFlags( CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK | CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK);//with copy
|
handler->camera->setPreviewCallbackFlags( CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK | CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK);//with copy
|
||||||
|
@ -25,3 +25,7 @@ native_camera_r4.3.0; armeabi; 14; $ANDROID_STUB_ROOT/4.3.0
|
|||||||
native_camera_r4.3.0; armeabi-v7a; 14; $ANDROID_STUB_ROOT/4.3.0
|
native_camera_r4.3.0; armeabi-v7a; 14; $ANDROID_STUB_ROOT/4.3.0
|
||||||
native_camera_r4.3.0; x86; 14; $ANDROID_STUB_ROOT/4.3.0
|
native_camera_r4.3.0; x86; 14; $ANDROID_STUB_ROOT/4.3.0
|
||||||
native_camera_r4.3.0; mips; 14; $ANDROID_STUB_ROOT/4.3.0
|
native_camera_r4.3.0; mips; 14; $ANDROID_STUB_ROOT/4.3.0
|
||||||
|
native_camera_r4.4.0; armeabi; 14; $ANDROID_STUB_ROOT/4.4.0
|
||||||
|
native_camera_r4.4.0; armeabi-v7a; 14; $ANDROID_STUB_ROOT/4.4.0
|
||||||
|
native_camera_r4.4.0; x86; 14; $ANDROID_STUB_ROOT/4.4.0
|
||||||
|
native_camera_r4.4.0; mips; 14; $ANDROID_STUB_ROOT/4.4.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user