aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alBuffer.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old buffer_samples functionsChris Robinson2018-01-211-161/+15
| | | | | | | The symbols are still there and exported to retain ABI compatibility, but they no longer do anything except set an AL_INVALID_OPERATION error. They're also removed from the function and enum tables, since they're not part of any supported extension.
* Avoid repeating some codeChris Robinson2018-01-211-12/+6
|
* Add methods to "map" a buffer's storageChris Robinson2018-01-201-12/+109
| | | | | | | | | | | | | | | | | | | | | | Requires the MAP_READ_BIT or MAP_WRITE_BIT flags to be OR'd with the format upon a call to alBufferData, to enable mappable storage for the given access types. This will fail if the format requires internal conversion and doesn't resemble the original input data, so the app can be guaranteed the size, type, and layout of the original data is the same as what's in storage. Then alMapBufferSOFT may be called with appropriate bit flags to get a readable and/or writable pointer to the buffer's sample storage. alUnmapBufferSOFT must be called when access is finished. It is currently invalid to map a buffer that is attached to a source, or to attach a buffer to a source that is currently mapped. This restriction may be eased in the future, at least to allow read- only access while in use (perhaps also to allow writing, if coherency can be achieved). Currently the access flags occupy the upper 8 bits of a 32-bit bitfield to avoid clashing with format enum values, which don't use more than 16 or 17 bits. This means any future formats are limited to 24-bit enum values, and also means only 8 flags are possible when declaring storage. The alternative would be to add a new function (alBufferStorage?) with a separate flags parameter.
* Return the effective alignment from SanitizeAlignmentChris Robinson2018-01-191-28/+26
|
* Store 8-bit sample types directly as unsigned byteChris Robinson2018-01-191-12/+12
|
* Remove unnecessary private AL_SOFT_buffer_samples2 definitionsChris Robinson2018-01-191-3/+0
|
* Make a function static that's only used in one source fileChris Robinson2018-01-171-1/+2
|
* Reformat the format arrayChris Robinson2018-01-171-36/+36
|
* Store mulaw and alaw samples directly in the bufferChris Robinson2018-01-171-24/+15
| | | | | | | They're now decompressed on the fly in the mixer. This is not a significant performance issue given that it only needs a 512-byte lookup table, and the buffer stores half as much data (it may actually be faster, requiring less overall memory).
* Remove a couple more uses of BYTE3Chris Robinson2017-03-311-2/+0
|
* Remove the (u)byte3 sample formatsChris Robinson2017-03-311-4/+0
| | | | | They're not accessible since the removal of the buffer_samples extension, and were kind of clunky to work with as 24-bit packed values.
* Use ALsizei in more placesChris Robinson2017-01-181-10/+10
|
* Use separate macros for atomics that don't take a memory orderChris Robinson2016-12-201-9/+9
|
* Remove use of DECL_CONSTChris Robinson2016-09-061-4/+4
| | | | | No idea if it was really gaining us anything, but removing it fixes a crash I was getting with libs built with Clang.
* Initialize some enums to dummy valuesChris Robinson2016-08-311-8/+9
|
* Use separate arrays for UIntMap keys and valuesChris Robinson2016-07-041-2/+2
|
* Avoid using realloc in a number of placesChris Robinson2016-05-211-12/+23
|
* Hold the buffer map lock while handling the bufferChris Robinson2016-05-101-1/+42
|
* Start AL_SOFT_buffer_samples2 as a replacement for AL_SOFT_buffer_samplesChris Robinson2016-04-251-6/+9
|
* Support AL_EXT_MULAW_BFORMATChris Robinson2014-10-311-0/+2
|
* Add preliminary AL_EXT_BFORMAT supportChris Robinson2014-10-311-0/+28
| | | | | Currently missing the AL_ORIENTATION source property. Gain stepping also does not work.
* Make the buffer's pack and unpack properties atomicChris Robinson2014-09-031-9/+9
|
* Update COPYING to the latest ↵François Cami2014-08-181-2/+2
| | | | https://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt to fix the FSF' address Fix the FSF' address in the source
* Remove an unused variableChris Robinson2014-07-011-2/+0
|
* Standardize some New/Delete methodsChris Robinson2014-06-301-6/+6
|
* Load soundfont samples into an ALbufferChris Robinson2014-06-291-29/+45
| | | | | Also remove ALsoundfont's now-unneeded sample storage functions and struct fields.
* Mark a few more functions as constChris Robinson2014-05-231-4/+4
|
* Initialize newformat to AL_NONE instead of a valid formatChris Robinson2014-05-151-6/+2
|
* Make RefCount a non-integer typeChris Robinson2014-05-141-3/+3
| | | | | It should only be accessed through the appropriate functions to ensure proper atomicity.
* Only require MSADPCM block alignment to be a multiple of 2Chris Robinson2014-03-061-2/+2
|
* Move the sample conversion routines to a separate fileChris Robinson2014-03-051-1261/+3
|
* Implement a simplistic MSADPCM encoderChris Robinson2014-03-051-19/+47
| | | | It's not particularly good, but it's better than silence.
* Allocate enough temp space for the ADPCM decoders and encodersChris Robinson2014-03-051-4/+4
|
* Use specialized methods for converting ALshort to IMA4 and MSADPCMChris Robinson2014-03-051-2/+32
| | | | As before, to avoid unnecessary direct copies
* Use specialized methods for converting IMA4 and MSADPCM to ALshortChris Robinson2014-03-051-8/+39
| | | | | Since the decoder methods already convert to ALshort, there's no need to use a temp buffer that's just going to copy directly to the destination.
* Use maxi to clamp an int to a lower-boundChris Robinson2014-03-051-1/+1
|
* Expand the sign bit on the initial MSADPCM delta valueChris Robinson2014-03-051-0/+1
|
* Add an extension to support MSADPCM buffer formatsChris Robinson2014-03-041-27/+309
|
* Add an extension to alter the block alignment for buffer unpack/pack opsChris Robinson2014-03-041-16/+71
| | | | | | | | | | | | | | | | This is for unpacking (reading, e.g. alBufferData) and packing (writing, e.g. alGetBufferSamplesSOFT) operations. The alignments are specified in sample frames, with 0 meaning the default (65 for IMA4, 1 otherwise). IMA4 alignment must be a multiple of 8, plus 1 (e.g. alignment = n*8 + 1), otherwise an error will occur during (un)packing. Chenging the block alignment does not affect already-loaded sample data, only future unpack/pack operations... so for example, this is perfectly valid: // Load mono IMA4 data with a block alignment of 1024 bytes, or 2041 sample // frames. alBufferi(buffer, AL_UNPACK_BLOCK_ALIGNMENT_SOFT, 2041); alBufferData(buffer, AL_FORMAT_MONO_IMA4, data, data_len, srate); alBufferi(buffer, AL_UNPACK_BLOCK_ALIGNMENT_SOFT, 0);
* Parameterize the block alignmentChris Robinson2014-03-041-111/+152
|
* Use alloca for temp space decoding/encoding IMA4 blocksChris Robinson2014-03-031-4/+11
|
* Reduce explicit template declarations and ignore IMA4-to-IMA4 conversionsChris Robinson2014-03-031-159/+35
| | | | | | Since we never store IMA4 data in buffers, we should only ever convert from (user input) or to (user output) IMA4. Once we allow user-specified pack/unpack block alignment, this wouldn't be a simple memcpy anyway.
* Store the original frame size alignment in the bufferChris Robinson2014-03-031-8/+22
|
* Use C99 inline in more placesChris Robinson2013-11-041-0/+2
|
* Use C99 inline semanticsChris Robinson2013-11-041-0/+3
|
* Use an UNUSED macro instead of void-tagging unused parametersChris Robinson2013-10-071-16/+4
|
* Remove al_try usage from alBuffer.cChris Robinson2013-10-071-246/+230
|
* Start using a simpler method for error handlingChris Robinson2013-10-061-335/+328
| | | | This helps avoid the al_try/al_throwerr/al_endtry stuff.
* Use a separate value for the maximum buffer channelsChris Robinson2013-07-231-4/+4
| | | | | | | Unlike the device, input buffers are accessed based on channel numbers instead of enums. This means the maximum number of channels they hold depends on the number of channels any one format can have, rather than the total number of recognized channels. Currently, this is 8 for 7.1.
* Silence some clang warningsChris Robinson2013-06-051-6/+7
|