Ticket #47172: audacity-portmixer.patch
File audacity-portmixer.patch, 9.5 KB (added by RJVB (René Bertin), 10 years ago) |
---|
-
include/pa_win_ds.h
Description: Add features needed to make portmixer work with audacity. Author: Audacity Team Last-Update: 2011-12-07
86 86 87 87 }PaWinDirectSoundStreamInfo; 88 88 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 */ 95 LPGUID 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 */ 103 LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s ); 89 104 90 105 91 106 #ifdef __cplusplus -
include/portaudio.h
1146 1146 signed long Pa_GetStreamWriteAvailable( PaStream* stream ); 1147 1147 1148 1148 1149 /** Retrieve the host type handling an open stream. 1150 1151 @return Returns a non-negative value representing the host API type 1152 handling an open stream or, a PaErrorCode (which are always negative) 1153 if PortAudio is not initialized or an error is encountered. 1154 */ 1155 PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream ); 1156 1157 1149 1158 /* Miscellaneous utilities */ 1150 1159 1151 1160 -
new file include/pa_unix_oss.h
- + 1 #ifndef PA_UNIX_OSS_H 2 #define PA_UNIX_OSS_H 3 4 /* 5 * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $ 6 * PortAudio Portable Real-Time Audio Library 7 * OSS-specific extensions 8 * 9 * Copyright (c) 1999-2000 Ross Bencina and Phil Burk 10 * 11 * Permission is hereby granted, free of charge, to any person obtaining 12 * a copy of this software and associated documentation files 13 * (the "Software"), to deal in the Software without restriction, 14 * including without limitation the rights to use, copy, modify, merge, 15 * publish, distribute, sublicense, and/or sell copies of the Software, 16 * and to permit persons to whom the Software is furnished to do so, 17 * subject to the following conditions: 18 * 19 * The above copyright notice and this permission notice shall be 20 * included in all copies or substantial portions of the Software. 21 * 22 * Any person wishing to distribute modifications to the Software is 23 * requested to send the modifications to the original developer so that 24 * they can be incorporated into the canonical version. 25 * 26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 27 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 29 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 30 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 31 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 32 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 33 * 34 */ 35 36 /** @file 37 * OSS-specific PortAudio API extension header file. 38 */ 39 40 #ifdef __cplusplus 41 extern "C" { 42 #endif 43 44 const char *PaOSS_GetStreamInputDevice( PaStream *s ); 45 46 const char *PaOSS_GetStreamOutputDevice( PaStream *s ); 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif 53 #ifndef PA_UNIX_OSS_H 54 #define PA_UNIX_OSS_H 55 56 /* 57 * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $ 58 * PortAudio Portable Real-Time Audio Library 59 * OSS-specific extensions 60 * 61 * Copyright (c) 1999-2000 Ross Bencina and Phil Burk 62 * 63 * Permission is hereby granted, free of charge, to any person obtaining 64 * a copy of this software and associated documentation files 65 * (the "Software"), to deal in the Software without restriction, 66 * including without limitation the rights to use, copy, modify, merge, 67 * publish, distribute, sublicense, and/or sell copies of the Software, 68 * and to permit persons to whom the Software is furnished to do so, 69 * subject to the following conditions: 70 * 71 * The above copyright notice and this permission notice shall be 72 * included in all copies or substantial portions of the Software. 73 * 74 * Any person wishing to distribute modifications to the Software is 75 * requested to send the modifications to the original developer so that 76 * they can be incorporated into the canonical version. 77 * 78 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 80 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 81 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 82 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 83 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 84 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 85 * 86 */ 87 88 /** @file 89 * OSS-specific PortAudio API extension header file. 90 */ 91 92 #ifdef __cplusplus 93 extern "C" { 94 #endif 95 96 const char *PaOSS_GetStreamInputDevice( PaStream *s ); 97 98 const char *PaOSS_GetStreamOutputDevice( PaStream *s ); 99 100 #ifdef __cplusplus 101 } 102 #endif 103 104 #endif -
src/common/pa_front.c
1216 1216 hostApiInputParametersPtr, hostApiOutputParametersPtr, 1217 1217 sampleRate, framesPerBuffer, streamFlags, streamCallback, userData ); 1218 1218 1219 if( result == paNoError ) 1219 if( result == paNoError ) { 1220 1220 AddOpenStream( *stream ); 1221 PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type; 1222 } 1221 1223 1222 1224 1223 1225 PA_LOGAPI(("Pa_OpenStream returned:\n" )); … … 1729 1731 return result; 1730 1732 } 1731 1733 1734 PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream ) 1735 { 1736 PaError error = PaUtil_ValidateStreamPointer( stream ); 1737 PaHostApiTypeId result; 1738 1739 #ifdef PA_LOG_API_CALLS 1740 PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" ); 1741 PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); 1742 #endif 1743 1744 if( error == paNoError ) 1745 { 1746 result = PA_STREAM_REP(stream)->hostApiType; 1747 } 1748 else 1749 { 1750 result = (PaHostApiTypeId) error; 1751 } 1752 1753 #ifdef PA_LOG_API_CALLS 1754 PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" ); 1755 PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); 1756 #endif 1757 1758 return result; 1759 } 1732 1760 1733 1761 PaError Pa_GetSampleSize( PaSampleFormat format ) 1734 1762 { -
src/common/pa_stream.c
93 93 streamRepresentation->streamInfo.inputLatency = 0.; 94 94 streamRepresentation->streamInfo.outputLatency = 0.; 95 95 streamRepresentation->streamInfo.sampleRate = 0.; 96 97 streamRepresentation->hostApiType = 0; 96 98 } 97 99 98 100 -
src/common/pa_stream.h
152 152 PaStreamFinishedCallback *streamFinishedCallback; 153 153 void *userData; 154 154 PaStreamInfo streamInfo; 155 PaHostApiTypeId hostApiType; 155 156 } PaUtilStreamRepresentation; 156 157 157 158 -
src/hostapi/coreaudio/pa_mac_core_blocking.c
66 66 #ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS 67 67 # define OSAtomicOr32( a, b ) ( (*(b)) |= (a) ) 68 68 # 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 ) 69 72 #else 70 73 # include <libkern/OSAtomic.h> 71 74 #endif -
src/hostapi/alsa/pa_linux_alsa.c
621 621 StreamDirection streamDir; 622 622 623 623 snd_pcm_channel_area_t *channelAreas; /* Needed for channel adaption */ 624 int card; 624 625 } PaAlsaStreamComponent; 625 626 626 627 /* Implementation specific stream structure */ … … 1873 1874 { 1874 1875 PaError result = paNoError; 1875 1876 PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError; 1877 snd_pcm_info_t* pcmInfo; 1876 1878 assert( params->channelCount > 0 ); 1877 1879 1878 1880 /* Make sure things have an initial value */ … … 1900 1902 self->device = params->device; 1901 1903 1902 1904 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 ); 1903 1908 self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm ); 1904 1909 1905 1910 PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) ); … … 4588 4593 /* XXX: More descriptive error? */ 4589 4594 PA_UNLESS( stream->capture.pcm, paDeviceUnavailable ); 4590 4595 4591 alsa_snd_pcm_info_alloca( &pcmInfo ); 4592 PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) ); 4593 *card = alsa_snd_pcm_info_get_card( pcmInfo ); 4596 *card = stream->capture.card; 4594 4597 4595 4598 error: 4596 4599 return result; … … 4607 4610 /* XXX: More descriptive error? */ 4608 4611 PA_UNLESS( stream->playback.pcm, paDeviceUnavailable ); 4609 4612 4610 alsa_snd_pcm_info_alloca( &pcmInfo ); 4611 PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) ); 4612 *card = alsa_snd_pcm_info_get_card( pcmInfo ); 4613 *card = stream->playback.card; 4613 4614 4614 4615 error: 4615 4616 return result; -
src/hostapi/oss/pa_unix_oss.c
2043 2043 #endif 2044 2044 } 2045 2045 2046 const 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 2058 const 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 } -
configure.in
405 405 DLL_LIBS="$DLL_LIBS -lossaudio" 406 406 LIBS="$LIBS -lossaudio" 407 407 fi 408 INCLUDES="$INCLUDES pa_unix_oss.h" 408 409 AC_DEFINE(PA_USE_OSS,1) 409 410 fi 410 411