Ticket #54125: patch-audacity-portmixer.diff

File patch-audacity-portmixer.diff, 7.9 KB (added by RJVB (René Bertin), 8 years ago)
  • configure.in

    Description: Add features needed to make portmixer work with audacity.
    Author: Audacity Team
    Last-Update: 2011-12-07
    Synced with version 190600_20161030 on 20170507
    
    diff --git configure.in configure.in
    index 13816fb7a34eb9aea37050b86e3543aa0adc9282..83c239a12f38fe652948d4293ab161346f377301 100644
    case "${host_os}" in 
    420420                   DLL_LIBS="$DLL_LIBS -lossaudio"
    421421                   LIBS="$LIBS -lossaudio"
    422422           fi
     423           INCLUDES="$INCLUDES pa_unix_oss.h"
    423424           AC_DEFINE(PA_USE_OSS,1)
    424425        fi
    425426
  • include/pa_win_ds.h

    diff --git include/pa_win_ds.h include/pa_win_ds.h
    index 5d3864168c4508b5ad6559f5ac73b64097637d98..ba1c24546a1c12b8f15706c1b6fd96db2979388e 100644
    typedef struct PaWinDirectSoundStreamInfo{ 
    8686
    8787}PaWinDirectSoundStreamInfo;
    8888
     89/** Retrieve the GUID of the input device.
     90
     91 @param stream The stream to query.
     92
     93 @return A pointer to the GUID, or NULL if none.
     94*/
     95LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
     96
     97/** Retrieve the GUID of the output device.
     98
     99 @param stream The stream to query.
     100
     101 @return A pointer to the GUID, or NULL if none.
     102*/
     103LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );
    89104
    90105
    91106#ifdef __cplusplus
  • include/portaudio.h

    diff --git include/portaudio.h include/portaudio.h
    index 8a94aafbbb8104bbda9a5320d1d6fc4b843adf7e..9c8a2959f20c50c392124c6d7f13f326470b0cfe 100644
    signed long Pa_GetStreamReadAvailable( PaStream* stream ); 
    11971197signed long Pa_GetStreamWriteAvailable( PaStream* stream );
    11981198
    11991199
     1200/** Retrieve the host type handling an open stream.
     1201
     1202 @return Returns a non-negative value representing the host API type
     1203 handling an open stream or, a PaErrorCode (which are always negative)
     1204 if PortAudio is not initialized or an error is encountered.
     1205*/
     1206PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream );
     1207
     1208
    12001209/* Miscellaneous utilities */
    12011210
    12021211
  • src/common/pa_front.c

    diff --git src/common/pa_front.c src/common/pa_front.c
    index 188cee9e5578f0e050cddbe3c86a9463dc2b22e2..52f44a677dc0f4f3699e019be452337a2ac928d7 100644
    PaError Pa_OpenStream( PaStream** stream, 
    12571257                                  hostApiInputParametersPtr, hostApiOutputParametersPtr,
    12581258                                  sampleRate, framesPerBuffer, streamFlags, streamCallback, userData );
    12591259
    1260     if( result == paNoError )
     1260    if( result == paNoError ) {
    12611261        AddOpenStream( *stream );
     1262        PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type;
     1263    }
    12621264
    12631265
    12641266    PA_LOGAPI(("Pa_OpenStream returned:\n" ));
    signed long Pa_GetStreamWriteAvailable( PaStream* stream ) 
    17701772    return result;
    17711773}
    17721774
     1775PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream )
     1776{
     1777    PaError error = PaUtil_ValidateStreamPointer( stream );
     1778    PaHostApiTypeId result;
     1779
     1780#ifdef PA_LOG_API_CALLS
     1781    PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" );
     1782    PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream );
     1783#endif
     1784
     1785    if( error == paNoError )
     1786    {
     1787        result = PA_STREAM_REP(stream)->hostApiType;
     1788    }
     1789    else
     1790    {
     1791        result = (PaHostApiTypeId) error;
     1792    }
     1793
     1794#ifdef PA_LOG_API_CALLS
     1795    PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" );
     1796    PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) );
     1797#endif
     1798
     1799    return result;
     1800}
    17731801
    17741802PaError Pa_GetSampleSize( PaSampleFormat format )
    17751803{
  • src/common/pa_stream.c

    diff --git src/common/pa_stream.c src/common/pa_stream.c
    index 03a0ee6ee32e8752949d75a05d57fa5380329858..c4376f93b969bd02a0f90f1eb07478db8efe1501 100644
    void PaUtil_InitializeStreamRepresentation( PaUtilStreamRepresentation *streamRe 
    9393    streamRepresentation->streamInfo.inputLatency = 0.;
    9494    streamRepresentation->streamInfo.outputLatency = 0.;
    9595    streamRepresentation->streamInfo.sampleRate = 0.;
     96
     97    streamRepresentation->hostApiType = 0;
    9698}
    9799
    98100
  • src/common/pa_stream.h

    diff --git src/common/pa_stream.h src/common/pa_stream.h
    index 678e2ad5ea0897904aaed1fd14c055a74a96f6ba..70572c7523dfce1cc77738979663bb6f98702d06 100644
    typedef struct PaUtilStreamRepresentation { 
    152152    PaStreamFinishedCallback *streamFinishedCallback;
    153153    void *userData;
    154154    PaStreamInfo streamInfo;
     155    PaHostApiTypeId hostApiType;
    155156} PaUtilStreamRepresentation;
    156157
    157158
  • src/hostapi/alsa/pa_linux_alsa.c

    diff --git src/hostapi/alsa/pa_linux_alsa.c src/hostapi/alsa/pa_linux_alsa.c
    index 584cde8901d7f16630ca1e4bc864059da0edd8f3..558fb3d11c5fbdc0deeffe633e62f29b93c06fdf 100644
    typedef struct 
    621621    StreamDirection streamDir;
    622622
    623623    snd_pcm_channel_area_t *channelAreas;  /* Needed for channel adaption */
     624    int card;
    624625} PaAlsaStreamComponent;
    625626
    626627/* Implementation specific stream structure */
    static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa 
    18731874{
    18741875    PaError result = paNoError;
    18751876    PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError;
     1877    snd_pcm_info_t* pcmInfo;
    18761878    assert( params->channelCount > 0 );
    18771879
    18781880    /* Make sure things have an initial value */
    static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa 
    19001902    self->device = params->device;
    19011903
    19021904    PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) );
     1905
     1906    snd_pcm_info_alloca( &pcmInfo );
     1907    self->card = snd_pcm_info_get_card( pcmInfo );
    19031908    self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm );
    19041909
    19051910    PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) );
    PaError PaAlsa_GetStreamInputCard( PaStream* s, int* card ) 
    46054610    /* XXX: More descriptive error? */
    46064611    PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );
    46074612
    4608     alsa_snd_pcm_info_alloca( &pcmInfo );
    4609     PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
    4610     *card = alsa_snd_pcm_info_get_card( pcmInfo );
     4613    *card = stream->capture.card;
    46114614
    46124615error:
    46134616    return result;
    PaError PaAlsa_GetStreamOutputCard( PaStream* s, int* card ) 
    46244627    /* XXX: More descriptive error? */
    46254628    PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );
    46264629
    4627     alsa_snd_pcm_info_alloca( &pcmInfo );
    4628     PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
    4629     *card = alsa_snd_pcm_info_get_card( pcmInfo );
     4630    *card = stream->playback.card;
    46304631
    46314632error:
    46324633    return result;
  • src/hostapi/coreaudio/pa_mac_core_blocking.c

    diff --git src/hostapi/coreaudio/pa_mac_core_blocking.c src/hostapi/coreaudio/pa_mac_core_blocking.c
    index 679c6ba0aec3e17a30bf9f6fae0434133852b65a..a69e08589aba8c0cf1d099a1af98a908371fbc0b 100644
     
    6666#ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
    6767# define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
    6868# define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) )
     69#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
     70# define OSAtomicOr32( a, b ) BitOrAtomic( a, (UInt32 *) b )
     71# define OSAtomicAnd32( a, b ) BitAndAtomic( a, (UInt32 *) b )
    6972#else
    7073# include <libkern/OSAtomic.h>
    7174#endif
  • src/hostapi/oss/pa_unix_oss.c

    diff --git src/hostapi/oss/pa_unix_oss.c src/hostapi/oss/pa_unix_oss.c
    index 51e963048fa66d1e7748c4e63928fe1dd6d3db66..f257d80398fbbaf5f7886bcd74e14fe3b32c669f 100644
    error: 
    20432043#endif
    20442044}
    20452045
     2046const char *PaOSS_GetStreamInputDevice( PaStream* s )
     2047{
     2048    PaOssStream *stream = (PaOssStream*)s;
     2049
     2050    if( stream->capture )
     2051    {
     2052      return stream->capture->devName;
     2053    }
     2054
     2055   return NULL;
     2056}
     2057
     2058const char *PaOSS_GetStreamOutputDevice( PaStream* s )
     2059{
     2060    PaOssStream *stream = (PaOssStream*)s;
     2061
     2062    if( stream->playback )
     2063    {
     2064      return stream->playback->devName;
     2065    }
     2066
     2067   return NULL;
     2068}