aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-24 16:58:49 -0800
committerChris Robinson <[email protected]>2018-11-24 16:58:49 -0800
commit9e10f632c7a5d66b0f896753e197970eec3ab7cf (patch)
treee8370fd4a8ebffa3fc110aaffe4aab218ac284ec /Alc/backends
parent16a60dc371254ba4936f4f5c13c32d060b9911ac (diff)
Replace remaining uses of std::vector with al::vector
Which uses a custom allocator that uses our allocation functions.
Diffstat (limited to 'Alc/backends')
-rw-r--r--Alc/backends/alsa.cpp14
-rw-r--r--Alc/backends/dsound.cpp8
-rw-r--r--Alc/backends/oss.cpp14
-rw-r--r--Alc/backends/pulseaudio.cpp6
-rw-r--r--Alc/backends/wasapi.cpp12
-rw-r--r--Alc/backends/wave.cpp2
-rw-r--r--Alc/backends/winmm.cpp6
7 files changed, 31 insertions, 31 deletions
diff --git a/Alc/backends/alsa.cpp b/Alc/backends/alsa.cpp
index 35c1f834..1a048fc7 100644
--- a/Alc/backends/alsa.cpp
+++ b/Alc/backends/alsa.cpp
@@ -253,8 +253,8 @@ struct DevMap {
{ }
};
-std::vector<DevMap> PlaybackDevices;
-std::vector<DevMap> CaptureDevices;
+al::vector<DevMap> PlaybackDevices;
+al::vector<DevMap> CaptureDevices;
const char *prefix_name(snd_pcm_stream_t stream)
@@ -263,9 +263,9 @@ const char *prefix_name(snd_pcm_stream_t stream)
return (stream==SND_PCM_STREAM_PLAYBACK) ? "device-prefix" : "capture-prefix";
}
-std::vector<DevMap> probe_devices(snd_pcm_stream_t stream)
+al::vector<DevMap> probe_devices(snd_pcm_stream_t stream)
{
- std::vector<DevMap> devlist;
+ al::vector<DevMap> devlist;
snd_ctl_card_info_t *info;
snd_ctl_card_info_malloc(&info);
@@ -425,7 +425,7 @@ int verify_state(snd_pcm_t *handle)
struct ALCplaybackAlsa final : public ALCbackend {
snd_pcm_t *pcmHandle{nullptr};
- std::vector<char> buffer;
+ al::vector<char> buffer;
std::atomic<ALenum> killNow{AL_TRUE};
std::thread thread;
@@ -926,7 +926,7 @@ ClockLatency ALCplaybackAlsa_getClockLatency(ALCplaybackAlsa *self)
struct ALCcaptureAlsa final : public ALCbackend {
snd_pcm_t *pcmHandle{nullptr};
- std::vector<char> buffer;
+ al::vector<char> buffer;
bool doCapture{false};
ll_ringbuffer_t *ring{nullptr};
@@ -1129,7 +1129,7 @@ void ALCcaptureAlsa_stop(ALCcaptureAlsa *self)
{
/* The ring buffer implicitly captures when checking availability.
* Direct access needs to explicitly capture it into temp storage. */
- std::vector<char> temp(snd_pcm_frames_to_bytes(self->pcmHandle, avail));
+ al::vector<char> temp(snd_pcm_frames_to_bytes(self->pcmHandle, avail));
ALCcaptureAlsa_captureSamples(self, temp.data(), avail);
self->buffer = std::move(temp);
}
diff --git a/Alc/backends/dsound.cpp b/Alc/backends/dsound.cpp
index 085dab90..4f1186ee 100644
--- a/Alc/backends/dsound.cpp
+++ b/Alc/backends/dsound.cpp
@@ -142,10 +142,10 @@ struct DevMap {
{ }
};
-std::vector<DevMap> PlaybackDevices;
-std::vector<DevMap> CaptureDevices;
+al::vector<DevMap> PlaybackDevices;
+al::vector<DevMap> CaptureDevices;
-bool checkName(const std::vector<DevMap> &list, const std::string &name)
+bool checkName(const al::vector<DevMap> &list, const std::string &name)
{
return std::find_if(list.cbegin(), list.cend(),
[&name](const DevMap &entry) -> bool
@@ -158,7 +158,7 @@ BOOL CALLBACK DSoundEnumDevices(GUID *guid, const WCHAR *desc, const WCHAR* UNUS
if(!guid)
return TRUE;
- auto& devices = *reinterpret_cast<std::vector<DevMap>*>(data);
+ auto& devices = *reinterpret_cast<al::vector<DevMap>*>(data);
const std::string basename{DEVNAME_HEAD + wstr_to_utf8(desc)};
int count{1};
diff --git a/Alc/backends/oss.cpp b/Alc/backends/oss.cpp
index 3985cd27..7b8d234a 100644
--- a/Alc/backends/oss.cpp
+++ b/Alc/backends/oss.cpp
@@ -91,7 +91,7 @@ struct DevMap {
{ }
};
-bool checkName(const std::vector<DevMap> &list, const std::string &name)
+bool checkName(const al::vector<DevMap> &list, const std::string &name)
{
return std::find_if(list.cbegin(), list.cend(),
[&name](const DevMap &entry) -> bool
@@ -99,22 +99,22 @@ bool checkName(const std::vector<DevMap> &list, const std::string &name)
) != list.cend();
}
-std::vector<DevMap> PlaybackDevices;
-std::vector<DevMap> CaptureDevices;
+al::vector<DevMap> PlaybackDevices;
+al::vector<DevMap> CaptureDevices;
#ifdef ALC_OSS_COMPAT
#define DSP_CAP_OUTPUT 0x00020000
#define DSP_CAP_INPUT 0x00010000
-void ALCossListPopulate(std::vector<DevMap> *devlist, int type)
+void ALCossListPopulate(al::vector<DevMap> *devlist, int type)
{
devlist->emplace_back(DefaultName, (type==DSP_CAP_INPUT) ? DefaultCapture : DefaultPlayback);
}
#else
-void ALCossListAppend(std::vector<DevMap> *list, const char *handle, size_t hlen, const char *path, size_t plen)
+void ALCossListAppend(al::vector<DevMap> *list, const char *handle, size_t hlen, const char *path, size_t plen)
{
#ifdef ALC_OSS_DEVNODE_TRUC
for(size_t i{0};i < plen;i++)
@@ -160,7 +160,7 @@ void ALCossListAppend(std::vector<DevMap> *list, const char *handle, size_t hlen
TRACE("Got device \"%s\", \"%s\"\n", entry.name.c_str(), entry.device_name.c_str());
}
-void ALCossListPopulate(std::vector<DevMap> *devlist, int type_flag)
+void ALCossListPopulate(al::vector<DevMap> *devlist, int type_flag)
{
int fd{open("/dev/mixer", O_RDONLY)};
if(fd < 0)
@@ -243,7 +243,7 @@ int log2i(ALCuint x)
struct ALCplaybackOSS final : public ALCbackend {
int fd{-1};
- std::vector<ALubyte> mix_data;
+ al::vector<ALubyte> mix_data;
std::atomic<ALenum> killNow{AL_TRUE};
std::thread thread;
diff --git a/Alc/backends/pulseaudio.cpp b/Alc/backends/pulseaudio.cpp
index 9563cdd4..c64c3ed7 100644
--- a/Alc/backends/pulseaudio.cpp
+++ b/Alc/backends/pulseaudio.cpp
@@ -511,7 +511,7 @@ struct DevMap {
{ }
};
-bool checkName(const std::vector<DevMap> &list, const std::string &name)
+bool checkName(const al::vector<DevMap> &list, const std::string &name)
{
return std::find_if(list.cbegin(), list.cend(),
[&name](const DevMap &entry) -> bool
@@ -519,8 +519,8 @@ bool checkName(const std::vector<DevMap> &list, const std::string &name)
) != list.cend();
}
-std::vector<DevMap> PlaybackDevices;
-std::vector<DevMap> CaptureDevices;
+al::vector<DevMap> PlaybackDevices;
+al::vector<DevMap> CaptureDevices;
struct PulsePlayback final : public ALCbackend {
diff --git a/Alc/backends/wasapi.cpp b/Alc/backends/wasapi.cpp
index 52f324f7..3d6c3e8c 100644
--- a/Alc/backends/wasapi.cpp
+++ b/Alc/backends/wasapi.cpp
@@ -123,7 +123,7 @@ struct DevMap {
{ }
};
-bool checkName(const std::vector<DevMap> &list, const std::string &name)
+bool checkName(const al::vector<DevMap> &list, const std::string &name)
{
return std::find_if(list.cbegin(), list.cend(),
[&name](const DevMap &entry) -> bool
@@ -131,8 +131,8 @@ bool checkName(const std::vector<DevMap> &list, const std::string &name)
) != list.cend();
}
-std::vector<DevMap> PlaybackDevices;
-std::vector<DevMap> CaptureDevices;
+al::vector<DevMap> PlaybackDevices;
+al::vector<DevMap> CaptureDevices;
HANDLE ThreadHdl;
@@ -251,7 +251,7 @@ void get_device_formfactor(IMMDevice *device, EndpointFormFactor *formfactor)
}
-void add_device(IMMDevice *device, const WCHAR *devid, std::vector<DevMap> &list)
+void add_device(IMMDevice *device, const WCHAR *devid, al::vector<DevMap> &list)
{
std::string basename, guidstr;
std::tie(basename, guidstr) = get_device_name_and_guid(device);
@@ -285,7 +285,7 @@ WCHAR *get_device_id(IMMDevice *device)
return devid;
}
-HRESULT probe_devices(IMMDeviceEnumerator *devenum, EDataFlow flowdir, std::vector<DevMap> &list)
+HRESULT probe_devices(IMMDeviceEnumerator *devenum, EDataFlow flowdir, al::vector<DevMap> &list)
{
IMMDeviceCollection *coll;
HRESULT hr = devenum->EnumAudioEndpoints(flowdir, DEVICE_STATE_ACTIVE, &coll);
@@ -1248,7 +1248,7 @@ FORCE_ALIGN int ALCwasapiCapture_recordProc(ALCwasapiCapture *self)
althrd_setname(RECORD_THREAD_NAME);
- std::vector<float> samples;
+ al::vector<float> samples;
while(!self->mKillNow.load(std::memory_order_relaxed))
{
UINT32 avail;
diff --git a/Alc/backends/wave.cpp b/Alc/backends/wave.cpp
index d1356338..d9219336 100644
--- a/Alc/backends/wave.cpp
+++ b/Alc/backends/wave.cpp
@@ -82,7 +82,7 @@ struct ALCwaveBackend final : public ALCbackend {
FILE *mFile;
long mDataStart;
- std::vector<ALbyte> mBuffer;
+ al::vector<ALbyte> mBuffer;
ATOMIC(ALenum) killNow;
std::thread thread;
diff --git a/Alc/backends/winmm.cpp b/Alc/backends/winmm.cpp
index f17b5d1f..f1aee5b3 100644
--- a/Alc/backends/winmm.cpp
+++ b/Alc/backends/winmm.cpp
@@ -51,10 +51,10 @@ namespace {
#define DEVNAME_HEAD "OpenAL Soft on "
-std::vector<std::string> PlaybackDevices;
-std::vector<std::string> CaptureDevices;
+al::vector<std::string> PlaybackDevices;
+al::vector<std::string> CaptureDevices;
-bool checkName(const std::vector<std::string> &list, const std::string &name)
+bool checkName(const al::vector<std::string> &list, const std::string &name)
{ return std::find(list.cbegin(), list.cend(), name) != list.cend(); }
void ProbePlaybackDevices(void)