[vlc-devel] [PATCH 1/3] qtsound: added audio capture functionality for MAC OS X

Rémi Denis-Courmont remi at remlab.net
Fri Oct 14 17:33:26 CEST 2011


On Fri, 14 Oct 2011 17:24:05 +0200, Michael Feurstein
<michael.feurstein at gmail.com> wrote:
> Tested with Built-in Input, Built-in Microphone and Griffin iMic USB
system
> Usage: qtsound://"Built-In Input" or qtsound://"iMic USB audio system"
> ---
>  configure.ac              |   17 +-
>  modules/access/Modules.am |   18 ++-
>  modules/access/qtsound.m  |  609
>  +++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 633 insertions(+), 11 deletions(-)
>  create mode 100644 modules/access/qtsound.m
> 
> diff --git a/configure.ac b/configure.ac
> index 925fd14..20b69de 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2122,19 +2122,16 @@ then
>  fi
>  
>  dnl
> -dnl QTCapture
> -AC_ARG_ENABLE(macosx-qtcapture,
> -  [  --enable-macosx-qtcapture Mac OS X qtcapture (iSight) module
> (default enabled on Mac OS X)])
> -if test "x${enable_macosx_qtcapture}" != "xno" &&
> -  (test "${SYS}" = "darwin" || test "${enable_macosx_qtcapture}" =
"yes")
> +dnl QTKit
> +AC_ARG_ENABLE(macosx-qtkit,
> +  [  --enable-macosx-qtkit Mac OS X qtcapture (video) and qtsound
(audio)
> module (default enabled on Mac OS X)])
> +if test "x${enable_macosx_qtkit}" != "xno" &&
> +  (test "${SYS}" = "darwin" || test "${enable_macosx_qtkit}" = "yes")
>  then
> -  VLC_ADD_LIBS([qtcapture], [-Wl,-framework,Cocoa])
> -  VLC_ADD_LIBS([qtcapture], [-Wl,-framework,QTKit])
> -  VLC_ADD_LIBS([qtcapture], [-Wl,-framework,CoreAudio])
> -  VLC_ADD_LIBS([qtcapture], [-Wl,-framework,QuartzCore])
> -  VLC_ADD_LIBS([qtcapture], [-Wl,-framework,CoreVideo])
>    VLC_ADD_PLUGIN([qtcapture])
> +  VLC_ADD_PLUGIN([qtsound])
>  fi
> +AM_CONDITIONAL(HAVE_QTKIT, [test "x${enable_macosx_qtkit}" != "xno" &&
> [test "${SYS}" = "darwin"]])

The second nested level of brackets should not be needed.

(...)
> +static int Open( vlc_object_t *p_this )
> +{
> +    demux_t *p_demux = (demux_t*)p_this;
> +    demux_sys_t *p_sys;
> +    es_format_t audiofmt;
> +    char *psz_uid = NULL;
> +    int audiocodec;
> +    bool success;
> +    NSString *qtk_curraudiodevice_uid;
> +    NSAutoreleasePool *pool;
> +    NSArray *myAudioDevices, *audioformat_array;
> +    QTFormatDescription *audio_format;
> +    QTCaptureDeviceInput *audioInput;
> +    NSError *o_returnedAudioError;
> +
> +    /* Only when selected */
> +    if( *p_demux->psz_access == '\0' )
> +        return VLC_EGENERIC;

This should not be required. In fact, it should never happen.
The plugin has a priority of zero already.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list