modified capturing building ligic for iOS

This commit is contained in:
Artem Myagkov 2011-08-24 10:53:57 +00:00
parent 8c6782300a
commit 3a3bc18381
6 changed files with 42 additions and 20 deletions

View File

@ -414,7 +414,7 @@ set(WITH_JPEG ON CACHE BOOL "Include JPEG support")
set(WITH_JASPER ON CACHE BOOL "Include JPEG2K support")
set(WITH_TIFF ON CACHE BOOL "Include TIFF support")
set(WITH_OPENEXR ON CACHE BOOL "Include ILM support via OpenEXR")
endif()
if(UNIX)
set(WITH_FFMPEG ON CACHE BOOL "Include FFMPEG support")
@ -429,11 +429,17 @@ if(UNIX)
set(WITH_1394 ON CACHE BOOL "Include IEEE1394 support")
endif()
endif()
if(APPLE)
set(WITH_CARBON OFF CACHE BOOL "Use Carbon for UI instead of Cocoa")
set(WITH_QUICKTIME OFF CACHE BOOL "Use QuickTime for Video I/O insted of QTKit")
endif()
if(IOS)
set(WITH_AVFOUNDATION ON CACHE BOOL "Use AVFoundation for Video I/O")
endif()
set(WITH_TBB OFF CACHE BOOL "Include Intel TBB support")
set(WITH_IPP OFF CACHE BOOL "Include Intel IPP support")
set(WITH_EIGEN ON CACHE BOOL "Include Eigen2/Eigen3 support")

View File

@ -100,6 +100,9 @@
/* QuickTime video libraries */
#cmakedefine HAVE_QUICKTIME
/* AVFoundation video libraries */
#cmakedefine HAVE_AVFOUNDATION
/* TIFF codec */
#cmakedefine HAVE_TIFF

View File

@ -1,4 +1,4 @@
message (STATUS "Setting up iPhoneOS toolchain")
message (STATUS "Setting up iPhoneSimulator toolchain")
set (IPHONESIMULATOR TRUE)
# Standard settings
@ -21,4 +21,4 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
message (STATUS "iPhoneOS toolchain loaded")
message (STATUS "iPhoneSimulator toolchain loaded")

View File

@ -125,9 +125,7 @@ if(WIN32)
endif()
endif()
if(UNIX)
if(NOT IOS)
if(UNIX)
if(NOT HAVE_QT)
if(HAVE_GTK)
set(highgui_srcs ${highgui_srcs} src/window_gtk.cpp)
@ -174,8 +172,6 @@ if(UNIX)
endif()
endif()
endif(NOT IOS)
foreach(P ${HIGHGUI_INCLUDE_DIRS})
include_directories(${P})
endforeach()
@ -192,8 +188,11 @@ if(WITH_OPENNI AND HAVE_OPENNI)
endif()
#YV
if(APPLE AND NOT IOS)
add_definitions(-DHAVE_QUICKTIME=1)
if(APPLE)
if (NOT IOS)
add_definitions(-DHAVE_QUICKTIME=1)
endif()
if(NOT OPENCV_BUILD_3RDPARTY_LIBS)
add_definitions(-DHAVE_IMAGEIO=1)
endif()
@ -211,15 +210,19 @@ if(APPLE AND NOT IOS)
if(WITH_QUICKTIME)
set(highgui_srcs ${highgui_srcs} src/cap_qt.cpp)
else()
set(highgui_srcs ${highgui_srcs} src/cap_qtkit.mm)
if (WITH_AVFOUNDATION)
add_definitions(-DHAVE_AVFOUNDATION=1)
set(highgui_srcs ${highgui_srcs} src/cap_avfoundation.mm)
else()
set(highgui_srcs ${highgui_srcs} src/cap_qtkit.mm)
endif()
endif()
endif(APPLE)
endif(APPLE AND NOT IOS)
if (IOS)
add_definitions(-DHAVE_IMAGEIO=1)
set(highgui_srcs ${highgui_srcs} src/cap_avfoundation.mm)
endif()
if(WITH_ANDROID_CAMERA)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../androidcamera/include")

View File

@ -157,7 +157,7 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
defined(HAVE_DC1394_2) || defined(HAVE_DC1394) || defined(HAVE_CMU1394) || \
defined(HAVE_GSTREAMER) || defined(HAVE_MIL) || defined(HAVE_QUICKTIME) || \
defined(HAVE_UNICAP) || defined(HAVE_PVAPI) || defined(HAVE_OPENNI) || defined(HAVE_ANDROID_NATIVE_CAMERA) || \
defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR)
defined(HAVE_AVFOUNDATION)
// local variable to memorize the captured device
CvCapture *capture;
#endif
@ -281,7 +281,7 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
break;
#endif
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
#ifdef HAVE_AVFOUNDATION
case CV_CAP_AVFOUNDATION:
capture = cvCreateCameraCapture_AVFoundation (index);
if (capture)
@ -321,7 +321,7 @@ CV_IMPL CvCapture * cvCreateFileCapture (const char * filename)
result = cvCreateFileCapture_QT (filename);
#endif
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
#ifdef HAVE_AVFOUNDATION
if (! result)
result = cvCreateFileCapture_AVFoundation (filename);
#endif
@ -354,7 +354,7 @@ CV_IMPL CvVideoWriter* cvCreateVideoWriter( const char* filename, int fourcc,
result = cvCreateVideoWriter_XINE(filename, fourcc, fps, frameSize, is_color);
#endif
*/
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
#ifdef HAVE_AVFOUNDATION
if (! result)
result = cvCreateVideoWriter_AVFoundation(filename, fourcc, fps, frameSize, is_color);
#endif

View File

@ -134,6 +134,8 @@ CvCapture* cvCreateCameraCapture_DShow( int index );
CvCapture* cvCreateCameraCapture_OpenNI( int index );
CvCapture* cvCreateCameraCapture_Android( int index );
CvCapture* cvCreateCameraCapture_XIMEA( int index );
CvCapture* cvCreateCameraCapture_AVFoundation(int index);
CVAPI(int) cvHaveImageReader(const char* filename);
CVAPI(int) cvHaveImageWriter(const char* filename);
@ -143,6 +145,9 @@ CvVideoWriter* cvCreateVideoWriter_Images(const char* filename);
CvCapture* cvCreateFileCapture_XINE (const char* filename);
#define CV_CAP_GSTREAMER_1394 0
#define CV_CAP_GSTREAMER_V4L 1
#define CV_CAP_GSTREAMER_V4L2 2
@ -161,6 +166,11 @@ CvCapture * cvCreateCameraCapture_QT (const int index);
CvVideoWriter* cvCreateVideoWriter_QT ( const char* filename, int fourcc,
double fps, CvSize frameSize, int is_color );
CvCapture* cvCreateFileCapture_AVFoundation (const char * filename);
CvVideoWriter* cvCreateVideoWriter_AVFoundation( const char* filename, int fourcc,
double fps, CvSize frameSize, int is_color );
CvCapture * cvCreateCameraCapture_Unicap (const int index);
CvCapture * cvCreateCameraCapture_PvAPI (const int index);
CvVideoWriter* cvCreateVideoWriter_GStreamer( const char* filename, int fourcc,