Fixed #1183
 * QT capture device for Mac
 * iOS device for iOS (capture device only works for iOS 4.0 or above)
 * Add NSAutoReleasePool for sdl_dev (Mac)
 * Add NSAutoReleasePool for vid_dev_test (Mac)
 * build system for compilation of Obj-C files (.m)



git-svn-id: https://svn.pjsip.org/repos/pjproject/branches/projects/2.0-dev@3395 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjmedia/build/os-auto.mak.in b/pjmedia/build/os-auto.mak.in
index 11c96bc..6e96cf1 100644
--- a/pjmedia/build/os-auto.mak.in
+++ b/pjmedia/build/os-auto.mak.in
@@ -1,5 +1,11 @@
 # @configure_input@
 
+# Define the desired video device backend
+# Valid values are:
+#   - mac_os
+#   - iphone_os
+AC_PJMEDIA_VIDEO = @ac_pjmedia_video@
+
 # SDL flags
 SDL_CFLAGS = @ac_sdl_cflags@
 SDL_LDFLAGS = @ac_sdl_ldflags@
@@ -12,9 +18,17 @@
 V4L2_CFLAGS = @ac_v4l2_cflags@
 V4L2_LDFLAGS = @ac_v4l2_ldflags@
 
+# QT
+AC_PJMEDIA_VIDEO_HAS_QT = @ac_pjmedia_video_has_qt@
+QT_CFLAGS = @ac_qt_cflags@
+
+# iOS
+IOS_CFLAGS = @ac_ios_cflags@
+
 # PJMEDIA features exclusion
 export CFLAGS += @ac_no_small_filter@ @ac_no_large_filter@ @ac_no_speex_aec@ \
-		 $(SDL_CFLAGS) $(FFMPEG_CFLAGS) $(V4L2_CFLAGS)
+		 $(SDL_CFLAGS) $(FFMPEG_CFLAGS) $(V4L2_CFLAGS) $(QT_CFLAGS) \
+		 $(IOS_CFLAGS)
 export LDFLAGS += $(SDL_LDFLAGS) $(FFMPEG_LDFLAGS) $(V4L2_LDFLAGS)
 
 # Define the desired sound device backend
@@ -132,4 +146,29 @@
 export CFLAGS += -DPJMEDIA_AUDIO_DEV_HAS_PORTAUDIO=0 -DPJMEDIA_AUDIO_DEV_HAS_WMME=0
 endif
 
+#
+# QT video device
+#
+ifeq ($(AC_PJMEDIA_VIDEO_HAS_QT),yes)
+export PJMEDIA_VIDEODEV_OBJS += qt_dev.o
+endif
 
+#
+# iOS video device
+#
+ifeq ($(AC_PJMEDIA_VIDEO),iphone_os)
+export PJMEDIA_VIDEODEV_OBJS += ios_dev.o
+endif
+
+#
+# Determine whether we should compile the obj-c version of a particular source code
+#
+ifeq ($(AC_PJMEDIA_VIDEO),mac_os)
+# Mac OS specific, use obj-c
+export PJMEDIA_VIDEODEV_OBJS += sdl_dev_m.o
+export PJMEDIA_TEST_OBJS += vid_dev_test_m.o
+else
+# Other platforms, compile .c
+export PJMEDIA_VIDEODEV_OBJS += sdl_dev.o
+export PJMEDIA_TEST_OBJS += vid_dev_test.o
+endif