Browse Source

modules: add USE_AVCAPTURE and try to detect it

master^2
Alfred E. Heggestad 7 years ago
parent
commit
397f660e14
2 changed files with 28 additions and 0 deletions
  1. +16
    -0
      mk/modules.mk
  2. +12
    -0
      src/config.c

+ 16
- 0
mk/modules.mk View File

@ -7,6 +7,7 @@
#
# USE_ALSA ALSA audio driver
# USE_AMR Adaptive Multi-Rate (AMR) audio codec
# USE_AVCAPTURE AVFoundation video capture for OSX/iOS
# USE_BV32 BroadVoice32 Wideband Audio codec
# USE_CAIRO Cairo module
# USE_CONS Console input driver
@ -64,6 +65,7 @@ USE_AMR := $(shell [ -d $(SYSROOT)/include/opencore-amrnb ] || \
USE_BV32 := $(shell [ -f $(SYSROOT)/include/bv32/bv32.h ] || \
[ -f $(SYSROOT)/local/include/bv32/bv32.h ] && echo "yes")
USE_CAIRO := $(shell [ -f $(SYSROOT)/include/cairo/cairo.h ] || \
[ -f $(SYSROOT)/local/include/cairo/cairo.h ] || \
[ -f $(SYSROOT_ALT)/include/cairo/cairo.h ] && echo "yes")
USE_DTLS := $(shell [ -f $(SYSROOT)/include/openssl/dtls1.h ] || \
[ -f $(SYSROOT)/local/include/openssl/dtls1.h ] || \
@ -98,6 +100,7 @@ USE_ILBC := $(shell [ -f $(SYSROOT)/include/iLBC_define.h ] || \
USE_ISAC := $(shell [ -f $(SYSROOT)/include/isac.h ] || \
[ -f $(SYSROOT)/local/include/isac.h ] && echo "yes")
USE_MPG123 := $(shell [ -f $(SYSROOT)/include/mpg123.h ] || \
[ -f $(SYSROOT)/local/include/mpg123.h ] || \
[ -f $(SYSROOT_ALT)/include/mpg123.h ] && echo "yes")
USE_OPUS := $(shell [ -f $(SYSROOT)/include/opus/opus.h ] || \
[ -f $(SYSROOT_ALT)/include/opus/opus.h ] || \
@ -186,7 +189,17 @@ endif
endif
USE_AVFOUNDATION := \
$(shell [ -d /System/Library/Frameworks/AVFoundation.framework ] \
&& echo "yes")
ifneq ($(USE_AVFOUNDATION),)
USE_AVCAPTURE := yes
else
USE_QTCAPTURE := yes
endif
endif
ifeq ($(OS),linux)
@ -223,6 +236,9 @@ endif
ifneq ($(USE_AMR),)
MODULES += amr
endif
ifneq ($(USE_AVCAPTURE),)
MODULES += avcapture
endif
ifneq ($(USE_BV32),)
MODULES += bv32
endif

+ 12
- 0
src/config.c View File

@ -346,7 +346,13 @@ static const char *default_audio_device(void)
static const char *default_video_device(void)
{
#ifdef DARWIN
#ifdef QTCAPTURE_RUNLOOP
return "qtcapture,nil";
#else
return "avcapture,nil";
#endif
#else
return "v4l2,/dev/video0";
#endif
@ -608,7 +614,13 @@ int config_write_template(const char *file, const struct config *cfg)
(void)re_fprintf(f, "\n# Video source modules\n");
#if defined (DARWIN)
#ifdef QTCAPTURE_RUNLOOP
(void)re_fprintf(f, "module\t\t\t" MOD_PRE "qtcapture" MOD_EXT "\n");
#else
(void)re_fprintf(f, "module\t\t\t" MOD_PRE "avcapture" MOD_EXT "\n");
#endif
#else
(void)re_fprintf(f, "#module\t\t\t" MOD_PRE "v4l" MOD_EXT "\n");
(void)re_fprintf(f, "#module\t\t\t" MOD_PRE "v4l2" MOD_EXT "\n");

Loading…
Cancel
Save