Merge pull request #1820 from asmorkalov:android_native_camera_44

pull/1787/merge
Roman Donchenko 11 years ago committed by OpenCV Buildbot
commit 4746a710bb
  1. BIN
      3rdparty/lib/armeabi-v7a/libnative_camera_r2.2.0.so
  2. BIN
      3rdparty/lib/armeabi-v7a/libnative_camera_r2.3.3.so
  3. BIN
      3rdparty/lib/armeabi-v7a/libnative_camera_r3.0.1.so
  4. BIN
      3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.0.so
  5. BIN
      3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.3.so
  6. BIN
      3rdparty/lib/armeabi-v7a/libnative_camera_r4.1.1.so
  7. BIN
      3rdparty/lib/armeabi-v7a/libnative_camera_r4.2.0.so
  8. BIN
      3rdparty/lib/armeabi-v7a/libnative_camera_r4.3.0.so
  9. BIN
      3rdparty/lib/armeabi-v7a/libnative_camera_r4.4.0.so
  10. BIN
      3rdparty/lib/armeabi/libnative_camera_r2.2.0.so
  11. BIN
      3rdparty/lib/armeabi/libnative_camera_r2.3.3.so
  12. BIN
      3rdparty/lib/armeabi/libnative_camera_r3.0.1.so
  13. BIN
      3rdparty/lib/armeabi/libnative_camera_r4.0.0.so
  14. BIN
      3rdparty/lib/armeabi/libnative_camera_r4.0.3.so
  15. BIN
      3rdparty/lib/armeabi/libnative_camera_r4.1.1.so
  16. BIN
      3rdparty/lib/armeabi/libnative_camera_r4.2.0.so
  17. BIN
      3rdparty/lib/armeabi/libnative_camera_r4.3.0.so
  18. BIN
      3rdparty/lib/armeabi/libnative_camera_r4.4.0.so
  19. BIN
      3rdparty/lib/mips/libnative_camera_r4.0.3.so
  20. BIN
      3rdparty/lib/mips/libnative_camera_r4.1.1.so
  21. BIN
      3rdparty/lib/mips/libnative_camera_r4.2.0.so
  22. BIN
      3rdparty/lib/mips/libnative_camera_r4.3.0.so
  23. BIN
      3rdparty/lib/mips/libnative_camera_r4.4.0.so
  24. BIN
      3rdparty/lib/x86/libnative_camera_r2.3.3.so
  25. BIN
      3rdparty/lib/x86/libnative_camera_r3.0.1.so
  26. BIN
      3rdparty/lib/x86/libnative_camera_r4.0.3.so
  27. BIN
      3rdparty/lib/x86/libnative_camera_r4.1.1.so
  28. BIN
      3rdparty/lib/x86/libnative_camera_r4.2.0.so
  29. BIN
      3rdparty/lib/x86/libnative_camera_r4.3.0.so
  30. BIN
      3rdparty/lib/x86/libnative_camera_r4.4.0.so
  31. 43
      modules/androidcamera/camera_wrapper/camera_wrapper.cpp
  32. 4
      platforms/scripts/camera_build.conf

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,6 +1,6 @@
#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_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.\
You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
#endif
@ -22,7 +22,7 @@
#elif defined(ANDROID_r4_1_1) || defined(ANDROID_r4_2_0)
# include <gui/ISurface.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/BufferQueue.h>
#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
std::string getProcessName()
@ -306,7 +320,8 @@ public:
}
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*
#endif
)
@ -623,7 +638,14 @@ CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback,
bufferStatus = camera->setPreviewTexture(bufferQueue);
if (bufferStatus != 0)
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 1
@ -663,7 +685,8 @@ void CameraHandler::closeCameraConnect()
}
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);
#endif
camera->disconnect();
@ -914,7 +937,8 @@ void CameraHandler::applyProperties(CameraHandler** ppcameraHandler)
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;
handler->camera->stopPreview();
@ -943,6 +967,13 @@ void CameraHandler::applyProperties(CameraHandler** ppcameraHandler)
bufferStatus = handler->camera->setPreviewTexture(bufferQueue);
if (bufferStatus != 0)
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
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; x86; 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…
Cancel
Save