Skip to content

Commit fcad152

Browse files
committed
Release 1.0.24
* Updated build scripts. * Updated module versions in dependencies.
2 parents 4aef2fa + 3301caf commit fcad152

File tree

10 files changed

+174
-45
lines changed

10 files changed

+174
-45
lines changed

CHANGELOG

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
* RECENT CHANGES
33
*******************************************************************************
44

5+
=== 1.0.24 ===
6+
* Updated build scripts.
7+
* Updated module versions in dependencies.
8+
59
=== 1.0.23 ===
610
* Updated module versions in dependencies.
711

include/lsp-plug.in/dsp-units/shared/AudioStream.h

+39-7
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ namespace lsp
7777
float *pData; // Pointer to channel data
7878
} channel_t;
7979

80+
typedef void (*copy_function_t)(float *dst, const float *src, size_t count);
81+
8082
protected:
8183
ipc::SharedMem hMem; // Shared memory descriptor
8284
sh_header_t *pHeader; // Header of the shared buffer
@@ -94,6 +96,8 @@ namespace lsp
9496
bool check_channels_synchronized();
9597
status_t open_internal();
9698
status_t create_internal(size_t channels, const alloc_params_t *params);
99+
status_t read_internal(size_t channel, float *dst, size_t samples, copy_function_t copy_func);
100+
status_t write_internal(size_t channel, const float *src, size_t samples, copy_function_t copy_func);
97101

98102
protected:
99103
static bool calc_params(alloc_params_t *params, size_t channels, size_t length);
@@ -183,26 +187,32 @@ namespace lsp
183187

184188
public:
185189
/**
186-
* Return number of channels
190+
* Return number of channels, RT safe
187191
* @return number of channels
188192
*/
189193
size_t channels() const;
190194

191195
/**
192-
* Get number of samples per channel
193-
* @return number of samples per channel
196+
* Get number of frames (or samples per channel) in the buffer, RT safe
197+
* @return number of frames
194198
*/
195199
size_t length() const;
196200

197201
/**
198-
* Begin I/O operation on the stream
202+
* Begin I/O operation on the stream, RT safe
199203
* @param block_size the desired block size that will be read or written, zero value means infinite block size
200204
* @return status of operation
201205
*/
202206
status_t begin(ssize_t block_size = 0);
203207

204208
/**
205-
* Read contents of specific channel
209+
* Get change counter
210+
* @return change counter
211+
*/
212+
uint32_t counter() const;
213+
214+
/**
215+
* Read contents of specific channel, RT safe
206216
* Should be called between begin() and end() calls
207217
*
208218
* @param channel number of channel
@@ -213,18 +223,40 @@ namespace lsp
213223
status_t read(size_t channel, float *dst, size_t samples);
214224

215225
/**
216-
* Read contents of specific channel
226+
* Read sanitized contents (removed NaNs, Infs and denormals) of specific channel, RT safe
217227
* Should be called between begin() and end() calls
218228
*
219229
* @param channel number of channel
220230
* @param dst destination buffer to store data
221231
* @param samples number of samples to read
222232
* @return status of operation
223233
*/
234+
status_t read_sanitized(size_t channel, float *dst, size_t samples);
235+
236+
/**
237+
* Write contents of the specific channel, RT safe
238+
* Should be called between begin() and end() calls
239+
*
240+
* @param channel number of channel
241+
* @param src source buffer to take data
242+
* @param samples number of samples to write
243+
* @return status of operation
244+
*/
224245
status_t write(size_t channel, const float *src, size_t samples);
225246

226247
/**
227-
* End I/O operations on the stream
248+
* Write sanitized contents (removed NaNs, Infs and denormals) of the specific channel, RT safe
249+
* Should be called between begin() and end() calls
250+
*
251+
* @param channel number of channel
252+
* @param src source buffer to take data
253+
* @param samples number of samples to write
254+
* @return status of operation
255+
*/
256+
status_t write_sanitized(size_t channel, const float *src, size_t samples);
257+
258+
/**
259+
* End I/O operations on the stream, RT safe
228260
* @return status of operation
229261
*/
230262
status_t end();

include/lsp-plug.in/dsp-units/shared/Catalog.h

+17-2
Original file line numberDiff line numberDiff line change
@@ -150,25 +150,40 @@ namespace lsp
150150
*/
151151
size_t size() const;
152152

153+
/**
154+
* Ensure that catalog is opened
155+
* @return true if catalog is opened
156+
*/
157+
bool opened() const;
158+
153159
public:
154160
/**
155161
* Create catalog record. If record already exists, it will be replaced.
162+
* @param record pointer to store catalog record
156163
* @param magic record type
157164
* @param name unique record name (UTF-8 encoded string)
158165
* @param id associated shared segment identifier (UTF-8 encoded string)
159166
* @return record index or negative error code
160167
*/
161-
ssize_t publish(uint32_t magic, const char *name, const char *id);
168+
ssize_t publish(Record *record, uint32_t magic, const char *name, const char *id);
162169

163170
/**
164171
* Create catalog record. If record already exists, it will be replaced.
172+
* @param record pointer to store catalog record
165173
* @param magic record type
166174
* @param name unique record name
167175
* @param id associated shared segment identifier
168176
* @param lock lock the record flag
169177
* @return record index or negative error code
170178
*/
171-
ssize_t publish(uint32_t magic, const LSPString *name, const LSPString *id);
179+
ssize_t publish(Record *record, uint32_t magic, const LSPString *name, const LSPString *id);
180+
181+
/**
182+
* Ensure that record is valid
183+
* @param record record to validate
184+
* @return true if record is valid
185+
*/
186+
bool validate(const Record *record) const;
172187

173188
/**
174189
* Read record from catalog

include/lsp-plug.in/dsp-units/version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// Define version of headers
2626
#define LSP_DSP_UNITS_MAJOR 1
2727
#define LSP_DSP_UNITS_MINOR 0
28-
#define LSP_DSP_UNITS_MICRO 23
28+
#define LSP_DSP_UNITS_MICRO 24
2929

3030
#if defined(LSP_DSP_UNITS_PUBLISHER)
3131
#define LSP_DSP_UNITS_PUBLIC LSP_EXPORT_MODIFIER

make/modules.mk

+9-4
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,15 @@ $(ALL_SRC_MODULES) $(ALL_HDR_MODULES):
8080
$(GIT) -C "$($(@)_PATH)" reset --hard
8181
$(GIT) -C "$($(@)_PATH)" fetch origin --force --prune --prune-tags
8282
$(GIT) -C "$($(@)_PATH)" fetch origin 'refs/tags/*:refs/tags/*' --force
83-
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout -B "$($(@)_BRANCH)" "origin/$($(@)_BRANCH)" || \
84-
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout "refs/tags/$($(@)_BRANCH)" || \
85-
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout -B "$($(@)_NAME)-$($(@)_BRANCH)" "origin/$($(@)_NAME)-$($(@)_BRANCH)" || \
86-
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout "refs/tags/$($(@)_NAME)-$($(@)_BRANCH)"
83+
if $(GIT) -C "$($(@)_PATH)" rev-parse -q --verify "origin/$($(@)_BRANCH)" >/dev/null; then \
84+
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout -B "$($(@)_BRANCH)" "origin/$($(@)_BRANCH)" >/dev/null; \
85+
elif $(GIT) -C "$($(@)_PATH)" rev-parse -q --verify "refs/tags/$($(@)_BRANCH)" >/dev/null; then \
86+
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout "refs/tags/$($(@)_BRANCH)"; \
87+
elif $(GIT) -C "$($(@)_PATH)" rev-parse -q --verify "origin/$($(@)_NAME)-$($(@)_BRANCH)" >/dev/null; then \
88+
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout -B "$($(@)_NAME)-$($(@)_BRANCH)" "origin/$($(@)_NAME)-$($(@)_BRANCH)"; \
89+
else \
90+
$(GIT) -c advice.detachedHead=false -C "$($(@)_PATH)" checkout "refs/tags/$($(@)_NAME)-$($(@)_BRANCH)"; \
91+
fi
8792

8893
fetch: $(SRC_MODULES) $(HDR_MODULES)
8994

modules.mk

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,31 @@
2020

2121
#------------------------------------------------------------------------------
2222
# Variables that describe source code dependencies
23-
LSP_COMMON_LIB_VERSION := 1.0.36
23+
LSP_COMMON_LIB_VERSION := 1.0.37
2424
LSP_COMMON_LIB_NAME := lsp-common-lib
2525
LSP_COMMON_LIB_TYPE := src
2626
LSP_COMMON_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_COMMON_LIB_NAME).git
2727
LSP_COMMON_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_COMMON_LIB_NAME).git
2828

29-
LSP_DSP_LIB_VERSION := 1.0.24
29+
LSP_DSP_LIB_VERSION := 1.0.25
3030
LSP_DSP_LIB_NAME := lsp-dsp-lib
3131
LSP_DSP_LIB_TYPE := src
3232
LSP_DSP_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_DSP_LIB_NAME).git
3333
LSP_DSP_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_DSP_LIB_NAME).git
3434

35-
LSP_LLTL_LIB_VERSION := 1.0.19
35+
LSP_LLTL_LIB_VERSION := 1.0.20
3636
LSP_LLTL_LIB_NAME := lsp-lltl-lib
3737
LSP_LLTL_LIB_TYPE := src
3838
LSP_LLTL_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_LLTL_LIB_NAME).git
3939
LSP_LLTL_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_LLTL_LIB_NAME).git
4040

41-
LSP_RUNTIME_LIB_VERSION := 1.0.22
41+
LSP_RUNTIME_LIB_VERSION := 1.0.23
4242
LSP_RUNTIME_LIB_NAME := lsp-runtime-lib
4343
LSP_RUNTIME_LIB_TYPE := src
4444
LSP_RUNTIME_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_RUNTIME_LIB_NAME).git
4545
LSP_RUNTIME_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_RUNTIME_LIB_NAME).git
4646

47-
LSP_TEST_FW_VERSION := 1.0.25
47+
LSP_TEST_FW_VERSION := 1.0.26
4848
LSP_TEST_FW_NAME := lsp-test-fw
4949
LSP_TEST_FW_TYPE := src
5050
LSP_TEST_FW_URL_RO := https://github.com/lsp-plugins/$(LSP_TEST_FW_NAME).git

project.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ ARTIFACT_ID = LSP_DSP_UNITS
2323
ARTIFACT_NAME = lsp-dsp-units
2424
ARTIFACT_DESC = High-level classes for performing DSP
2525
ARTIFACT_HEADERS = lsp-plug.in
26-
ARTIFACT_VERSION = 1.0.23
26+
ARTIFACT_VERSION = 1.0.24
2727

src/main/shared/AudioStream.cpp

+29-4
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,11 @@ namespace lsp
353353
return (pHeader != NULL) ? pHeader->nLength : 0;
354354
}
355355

356+
uint32_t AudioStream::counter() const
357+
{
358+
return (pHeader != NULL) ? pHeader->nCounter : 0;
359+
}
360+
356361
status_t AudioStream::begin(ssize_t block_size)
357362
{
358363
if (pHeader == NULL)
@@ -417,7 +422,7 @@ namespace lsp
417422
return STATUS_OK;
418423
}
419424

420-
status_t AudioStream::read(size_t channel, float *dst, size_t samples)
425+
status_t AudioStream::read_internal(size_t channel, float *dst, size_t samples, copy_function_t copy_func)
421426
{
422427
if (pHeader == NULL)
423428
return STATUS_CLOSED;
@@ -449,7 +454,7 @@ namespace lsp
449454
while ((samples > 0) && (c->nCount < nAvail))
450455
{
451456
size_t to_read = lsp_min(samples, nAvail - c->nCount, length - c->nPosition);
452-
dsp::copy(dst, &c->pData[c->nPosition], to_read);
457+
copy_func(dst, &c->pData[c->nPosition], to_read);
453458

454459
samples -= to_read;
455460
dst += to_read;
@@ -467,7 +472,17 @@ namespace lsp
467472
return STATUS_OK;
468473
}
469474

470-
status_t AudioStream::write(size_t channel, const float *src, size_t samples)
475+
status_t AudioStream::read(size_t channel, float *dst, size_t samples)
476+
{
477+
return read_internal(channel, dst, samples, dsp::copy);
478+
}
479+
480+
status_t AudioStream::read_sanitized(size_t channel, float *dst, size_t samples)
481+
{
482+
return read_internal(channel, dst, samples, dsp::sanitize2);
483+
}
484+
485+
status_t AudioStream::write_internal(size_t channel, const float *src, size_t samples, copy_function_t copy_func)
471486
{
472487
if (pHeader == NULL)
473488
return STATUS_CLOSED;
@@ -487,7 +502,7 @@ namespace lsp
487502
while (samples > 0)
488503
{
489504
size_t to_write = lsp_min(samples, length - c->nPosition);
490-
dsp::copy(&c->pData[c->nPosition], src, to_write);
505+
copy_func(&c->pData[c->nPosition], src, to_write);
491506

492507
samples -= to_write;
493508
src += to_write;
@@ -498,6 +513,16 @@ namespace lsp
498513
return STATUS_OK;
499514
}
500515

516+
status_t AudioStream::write(size_t channel, const float *src, size_t samples)
517+
{
518+
return write_internal(channel, src, samples, dsp::copy);
519+
}
520+
521+
status_t AudioStream::write_sanitized(size_t channel, const float *src, size_t samples)
522+
{
523+
return write_internal(channel, src, samples, dsp::sanitize2);
524+
}
525+
501526
bool AudioStream::check_channels_synchronized()
502527
{
503528
for (size_t i=1; i<nChannels; ++i)

0 commit comments

Comments
 (0)