Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added version-check to CI #543

Closed
wants to merge 85 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
3697751
Wrote check-version script and added to workflow
dheerajd5 Aug 18, 2023
91c5d48
Merge branch 'develop' into master
dheerajd5 Aug 20, 2023
fc992e6
Update scripts/ci_checks/linux-checks/check-version.sh
dheerajd5 Sep 1, 2023
3153b15
API: rework encoding configuration
gavv Jul 14, 2023
6d76c0e
API: simplify receiver config
gavv Jul 14, 2023
1e231b7
Introduce ChannelSet, ChannelLayout, ChannelPosition
gavv Jul 18, 2023
129066d
Rename error_to_string to error_code_to_str
gavv Jul 18, 2023
17f3035
Support embedded capacity in SlabPool
gavv Jul 19, 2023
a9588a8
FormatMap: support registration and searching by spec
gavv Jul 19, 2023
cbf45e7
API: support multiple channel layouts
gavv Jul 18, 2023
25cc81e
Add tests for mono encoding & fix bugs in channel mappers
gavv Jul 20, 2023
15faacb
Fix uninitialized access
gavv Jul 20, 2023
52b7ffa
Fix sanitizer complaints
gavv Jul 20, 2023
b475154
Rename "breakage playback" to "choppy playback" in code and CLI
gavv Jul 20, 2023
7d964dd
API: extract roc_media_encoding
gavv Jul 20, 2023
26b25a8
API: add ROC_CHANNEL_LAYOUT_MULTITRACK
gavv Jul 20, 2023
7a7f1b3
API: implement roc_context_register_encoding()
gavv Jul 20, 2023
24a8939
Add public_api tests for encoding registration + multitrack layout
gavv Jul 20, 2023
4bad913
Better panic message
gavv Jul 20, 2023
297928c
Fix sanitizers
gavv Jul 20, 2023
417758d
API: improve config checks & add tests
gavv Jul 20, 2023
67041f5
Rename files in public_api
gavv Jul 20, 2023
b690751
Rename valid() to is_valid()
gavv Jul 20, 2023
7d47467
Add Depacketizer::is_valid()
gavv Jul 20, 2023
429ff57
Work around problems with unmatched enum values
gavv Jul 20, 2023
10a4015
Add and use ROC_ATTR_NODISCARD
gavv Jul 20, 2023
74b5c24
Fix start allocation size in SlabPool
gavv Jul 21, 2023
c3ad37a
Fix minor channel set bugs
gavv Jul 23, 2023
3ad57c6
Extend maximum channel count to 1024
gavv Jul 23, 2023
3858a2a
Cover channel mapping in pipeline tests
gavv Jul 23, 2023
14648fa
Port FreqEstimator to doubles
gavv Jul 25, 2023
c90c82a
Introduce FreqEstimator profiles
gavv Jul 25, 2023
782cbfb
Rename boolean parameters
gavv Jul 25, 2023
e5abf14
API: introduce clock sync backend & profile
gavv Jul 25, 2023
146a7b7
Update CLI options according to recent changes
gavv Jul 25, 2023
af767bf
Fix latency reports
gavv Jul 25, 2023
2ce6168
Fix default latency preset
gavv Jul 25, 2023
183c6e9
API: improve comments
gavv Jul 26, 2023
1afdedc
Fix logging
gavv Jul 26, 2023
0cd2d16
Remove frame length parameter from channel mapper & resampler
gavv Jul 26, 2023
561dada
Remove internal_frame_size parameter from pipeline
gavv Jul 26, 2023
b35f5c2
Reduce default packet size to 2.5ms
gavv Jul 26, 2023
4ba005f
Rename Converter(Source|Sink) to Transcoder(Source|Sink)
gavv Jul 28, 2023
bd7bc43
Rename roc-conv to roc-copy
gavv Jul 28, 2023
ae14c5f
Update sphinx API reference
gavv Jul 28, 2023
4329d18
Support sphinx 5
gavv Jul 28, 2023
4257dc5
Fix formatting script
gavv Aug 2, 2023
d5a683d
Matrix-based mapping of surround channel layouts
gavv Aug 2, 2023
c056abc
Fix typo
gavv Aug 6, 2023
96d45d6
API: Simplify interface configuration
gavv Aug 7, 2023
2a23ec2
API: Rename roc_clock_source enum values
gavv Aug 7, 2023
62373c9
Enable and fix PulseAudio examples
gavv Aug 7, 2023
9eea5c6
Channel mapper tiny improve (#541)
baranovmv Aug 7, 2023
5a10a38
pipeline: Slot deletion API
gavv Aug 7, 2023
8a7d2ec
core: Support iteration of hashmap elements
gavv Aug 7, 2023
7241e1c
Refinements FormatMap
gavv Aug 7, 2023
d2e0ff1
core: Hide some code in .cpp files
gavv Aug 7, 2023
b85c29f
core: Refactor UseCounted
gavv Aug 7, 2023
c283157
Refactor pools and factories
gavv Aug 8, 2023
d5f7674
FormatMap: use PoolAllocation policy for nodes
gavv Aug 8, 2023
6e452fa
Rename IAllocator to IArena
gavv Aug 8, 2023
b0e0348
Fix buffer alignment
gavv Aug 8, 2023
0f4bf4f
Use hashmaps for sender and receiver slots
gavv Aug 8, 2023
6ebc337
HeapArena: rename method
gavv Aug 8, 2023
14b1679
Unconditional poisoning
gavv Aug 8, 2023
81351f5
Refinements in RefCounted and UseCounted
gavv Aug 8, 2023
5e33676
Fix hashsum_int() on macOS
gavv Aug 8, 2023
7e0f9f6
Hashmap improvements
gavv Aug 9, 2023
1a524be
peer: Slot unlink API
gavv Aug 9, 2023
ef1ca8b
peer: Derive Context from UseCounted
gavv Aug 9, 2023
314c0d3
Add and use is_empty()
gavv Aug 9, 2023
5c08223
core: Rename Poisoner to PoisonOps
gavv Aug 9, 2023
e0c7de1
API: Add interface for slot removal
gavv Aug 9, 2023
a2f47ee
Fix use-after free bug in slot removal
gavv Aug 9, 2023
a8a78cc
Simplify sender endpoint configuration
gavv Aug 9, 2023
d6dae6a
API: refine error handling during slot configuration
gavv Aug 9, 2023
179a9ac
Simplify pipeline slot and endpoint configuration
gavv Aug 9, 2023
44a254b
Use RefCounted and SharedPtr for peer::Context
gavv Aug 10, 2023
5c6f3a2
Use RefCounted and SharedPtr for IConnHandler and remove UseCounted
gavv Aug 10, 2023
52a758b
Rename peers to nodes
gavv Aug 10, 2023
7594834
packet::ConcurrentQueue: add non-blocking wait-free mode
gavv Aug 10, 2023
efe2d81
Add node::SenderEncoder and node::ReceiverDecoder
gavv Aug 10, 2023
9f28650
API: add roc_sender_encoder() and roc_receiver_decoder()
gavv Aug 10, 2023
d62b4b7
Cleanup commit
dheerajd5 Sep 1, 2023
5d2bc00
Conflict resolution
dheerajd5 Sep 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
API: rework encoding configuration
- rename roc_frame_encoding to roc_format
  (format is lower level setting compared to encoding;
   encoding defines format, channels, and rate)

- remove remove packet_sample_rate and packet_channels
  (this parameters are derived from packet encoding)
  • Loading branch information
gavv authored and dheerajd5 committed Sep 1, 2023
commit 3153b155579f5418dce6957904e63e1f8dc1eb51
4 changes: 2 additions & 2 deletions src/public_api/examples/basic_sender_sine_wave.c
Original file line number Diff line number Diff line change
@@ -79,9 +79,9 @@ int main() {
memset(&sender_config, 0, sizeof(sender_config));

/* Setup input frame format. */
sender_config.frame_sample_rate = MY_SAMPLE_RATE;
sender_config.frame_format = ROC_FORMAT_PCM_FLOAT32;
sender_config.frame_channels = ROC_CHANNEL_SET_STEREO;
sender_config.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;
sender_config.frame_sample_rate = MY_SAMPLE_RATE;

/* Turn on internal CPU timer.
* Sender must send packets with steady rate, so we should either implement
8 changes: 4 additions & 4 deletions src/public_api/examples/send_receive_rtp.c
Original file line number Diff line number Diff line change
@@ -47,9 +47,9 @@ static void* receiver_loop(void* arg) {
roc_receiver_config receiver_config;
memset(&receiver_config, 0, sizeof(receiver_config));

receiver_config.frame_sample_rate = MY_SAMPLE_RATE;
receiver_config.frame_format = ROC_FORMAT_PCM_FLOAT32;
receiver_config.frame_channels = ROC_CHANNEL_SET_STEREO;
receiver_config.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;
receiver_config.frame_sample_rate = MY_SAMPLE_RATE;

/* Receiver should clock itself. */
receiver_config.clock_source = ROC_CLOCK_INTERNAL;
@@ -124,9 +124,9 @@ static void* sender_loop(void* arg) {
roc_sender_config sender_config;
memset(&sender_config, 0, sizeof(sender_config));

sender_config.frame_sample_rate = MY_SAMPLE_RATE;
sender_config.frame_format = ROC_FORMAT_PCM_FLOAT32;
sender_config.frame_channels = ROC_CHANNEL_SET_STEREO;
sender_config.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;
sender_config.frame_sample_rate = MY_SAMPLE_RATE;

/* Sender should not use any FEC scheme. */
sender_config.fec_encoding = ROC_FEC_ENCODING_DISABLE;
8 changes: 4 additions & 4 deletions src/public_api/examples/send_receive_rtp_with_fecframe.c
Original file line number Diff line number Diff line change
@@ -50,9 +50,9 @@ static void* receiver_loop(void* arg) {
roc_receiver_config receiver_config;
memset(&receiver_config, 0, sizeof(receiver_config));

receiver_config.frame_sample_rate = MY_SAMPLE_RATE;
receiver_config.frame_format = ROC_FORMAT_PCM_FLOAT32;
receiver_config.frame_channels = ROC_CHANNEL_SET_STEREO;
receiver_config.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;
receiver_config.frame_sample_rate = MY_SAMPLE_RATE;

/* Receiver should clock itself. */
receiver_config.clock_source = ROC_CLOCK_INTERNAL;
@@ -150,9 +150,9 @@ static void* sender_loop(void* arg) {
roc_sender_config sender_config;
memset(&sender_config, 0, sizeof(sender_config));

sender_config.frame_sample_rate = MY_SAMPLE_RATE;
sender_config.frame_format = ROC_FORMAT_PCM_FLOAT32;
sender_config.frame_channels = ROC_CHANNEL_SET_STEREO;
sender_config.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;
sender_config.frame_sample_rate = MY_SAMPLE_RATE;

/* Sender should use Reed-Solomon FEC scheme. */
sender_config.fec_encoding = ROC_FEC_ENCODING_RS8M;
79 changes: 37 additions & 42 deletions src/public_api/include/roc/config.h
Original file line number Diff line number Diff line change
@@ -261,14 +261,14 @@ typedef enum roc_packet_encoding {
ROC_PACKET_ENCODING_AVP_L16 = 2
} roc_packet_encoding;

/** Frame encoding. */
typedef enum roc_frame_encoding {
/** Sample format. */
typedef enum roc_format {
/** PCM floats.
* Uncompressed samples coded as floats in range [-1; 1].
* Uncompressed samples coded as 32-bit native-endian floats in range [-1; 1].
* Channels are interleaved, e.g. two channels are encoded as "L R L R ...".
*/
ROC_FRAME_ENCODING_PCM_FLOAT = 1
} roc_frame_encoding;
ROC_FORMAT_PCM_FLOAT32 = 1
} roc_format;

/** Channel set. */
typedef enum roc_channel_set {
@@ -365,42 +365,34 @@ typedef struct roc_context_config {

/** Sender configuration.
*
* It is safe to memset() this struct with zeros to get a default config. It is also
* safe to memcpy() this struct to get a copy of config.
* For most fields, zero value means "use default", and you can memset() this struct
* with zeros and then set only a few fields that don't have defaults. It is safe to
* use memcpy() to get a copy of config, the struct is flat.
*
* \see roc_sender
*/
typedef struct roc_sender_config {
/** The rate of the samples in the frames passed to sender.
* Number of samples per channel per second.
* If \c frame_sample_rate and \c packet_sample_rate are different,
* resampler should be enabled.
* Should be set.
/** The sample format in the frames passed to sender.
* Should be set (zero value is invalid).
*/
unsigned int frame_sample_rate;
roc_format frame_format;

/** The channel set in the frames passed to sender.
* Should be set.
* Should be set (zero value is invalid).
*/
roc_channel_set frame_channels;

/** The sample encoding in the frames passed to sender.
* Should be set.
*/
roc_frame_encoding frame_encoding;

/** The rate of the samples in the packets generated by sender.
* Number of samples per channel per second.
* If zero, default value is used.
*/
unsigned int packet_sample_rate;

/** The channel set in the packets generated by sender.
* If zero, default value is used.
/** The rate of the samples in the frames passed to sender.
* Number of samples per channel per second (e.g. 44100).
* Should be set (zero value is invalid).
*/
roc_channel_set packet_channels;
unsigned int frame_sample_rate;

/** The sample encoding in the packets generated by sender.
/** The encoding used for packets produced by sender.
* Encoding defines sample format, channel set, and sample rate in network
* packets, which may be different from frame format, channels, and rate.
* When necessary, conversion is performed automatically. If sample rates
* are different, resampling should be enabled via \c resampler_profile.
* If zero, default value is used.
*/
roc_packet_encoding packet_encoding;
@@ -422,11 +414,12 @@ typedef struct roc_sender_config {

/** Clock source to use.
* Defines whether write operation will be blocking or non-blocking.
* If zero, default value is used.
* If zero, default value is used (\c ROC_CLOCK_EXTERNAL).
*/
roc_clock_source clock_source;

/** Resampler backend to use.
* If zero, default value is used.
*/
roc_resampler_backend resampler_backend;

@@ -460,35 +453,37 @@ typedef struct roc_sender_config {

/** Receiver configuration.
*
* It is safe to memset() this struct with zeros to get a default config. It is also
* safe to memcpy() this struct to get a copy of config.
* For most fields, zero value means "use default", and you can memset() this struct
* with zeros and then set only a few fields that don't have defaults. It is safe to
* use memcpy() to get a copy of config, the struct is flat.
*
* \see roc_receiver
*/
typedef struct roc_receiver_config {
/** The rate of the samples in the frames returned to the user.
* Number of samples per channel per second.
* Should be set.
/** The sample format in the frames returned by received.
* Should be set (zero value is invalid).
*/
unsigned int frame_sample_rate;
roc_format frame_format;

/** The channel set in the frames returned to the user.
* Should be set.
/** The channel set in the frames returned by received.
* Should be set (zero value is invalid).
*/
roc_channel_set frame_channels;

/** The sample encoding in the frames returned to the user.
* Should be set.
/** The rate of the samples in the frames returned by received.
* Number of samples per channel per second.
* Should be set (zero value is invalid).
*/
roc_frame_encoding frame_encoding;
unsigned int frame_sample_rate;

/** Clock source to use.
* Defines whether read operation will be blocking or non-blocking.
* If zero, default value is used.
* If zero, default value is used (\c ROC_CLOCK_EXTERNAL).
*/
roc_clock_source clock_source;

/** Resampler backend to use.
* If zero, default value is used.
*/
roc_resampler_backend resampler_backend;

36 changes: 12 additions & 24 deletions src/public_api/src/config_helpers.cpp
Original file line number Diff line number Diff line change
@@ -28,10 +28,8 @@ bool context_config_from_user(peer::ContextConfig& out, const roc_context_config
}

bool sender_config_from_user(pipeline::SenderConfig& out, const roc_sender_config& in) {
if (in.frame_sample_rate != 0) {
out.input_sample_spec.set_sample_rate(in.frame_sample_rate);
} else {
roc_log(LogError, "bad configuration: invalid frame_sample_rate");
if (in.frame_format != ROC_FORMAT_PCM_FLOAT32) {
roc_log(LogError, "bad configuration: invalid frame_format");
return false;
}

@@ -40,20 +38,10 @@ bool sender_config_from_user(pipeline::SenderConfig& out, const roc_sender_confi
return false;
}

if (in.frame_encoding != ROC_FRAME_ENCODING_PCM_FLOAT) {
roc_log(LogError, "bad configuration: invalid frame_encoding");
return false;
}

if (in.packet_sample_rate != 0 && in.packet_sample_rate != 44100) {
roc_log(LogError,
"bad configuration:"
" invalid packet_sample_rate, only 44100 is currently supported");
return false;
}

if (in.packet_channels != 0 && in.packet_channels != ROC_CHANNEL_SET_STEREO) {
roc_log(LogError, "bad configuration: invalid packet_channels");
if (in.frame_sample_rate != 0) {
out.input_sample_spec.set_sample_rate(in.frame_sample_rate);
} else {
roc_log(LogError, "bad configuration: invalid frame_sample_rate");
return false;
}

@@ -130,10 +118,8 @@ bool sender_config_from_user(pipeline::SenderConfig& out, const roc_sender_confi

bool receiver_config_from_user(pipeline::ReceiverConfig& out,
const roc_receiver_config& in) {
if (in.frame_sample_rate != 0) {
out.common.output_sample_spec.set_sample_rate(in.frame_sample_rate);
} else {
roc_log(LogError, "bad configuration: invalid frame_sample_rate");
if (in.frame_format != ROC_FORMAT_PCM_FLOAT32) {
roc_log(LogError, "bad configuration: invalid frame_format");
return false;
}

@@ -142,8 +128,10 @@ bool receiver_config_from_user(pipeline::ReceiverConfig& out,
return false;
}

if (in.frame_encoding != ROC_FRAME_ENCODING_PCM_FLOAT) {
roc_log(LogError, "bad configuration: invalid frame_encoding");
if (in.frame_sample_rate != 0) {
out.common.output_sample_spec.set_sample_rate(in.frame_sample_rate);
} else {
roc_log(LogError, "bad configuration: invalid frame_sample_rate");
return false;
}

10 changes: 5 additions & 5 deletions src/tests/public_api/test_context.cpp
Original file line number Diff line number Diff line change
@@ -55,9 +55,9 @@ TEST(context, reference_counting) {
{
roc_sender_config sender_config;
memset(&sender_config, 0, sizeof(sender_config));
sender_config.frame_sample_rate = 44100;
sender_config.frame_format = ROC_FORMAT_PCM_FLOAT32;
sender_config.frame_channels = ROC_CHANNEL_SET_STEREO;
sender_config.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;
sender_config.frame_sample_rate = 44100;

roc_sender* sender = NULL;
CHECK(roc_sender_open(context, &sender_config, &sender) == 0);
@@ -68,10 +68,10 @@ TEST(context, reference_counting) {
{
roc_receiver_config receiver_config;
memset(&receiver_config, 0, sizeof(receiver_config));
receiver_config.frame_sample_rate = 44100;
receiver_config.frame_format = ROC_FORMAT_PCM_FLOAT32;
receiver_config.frame_channels = ROC_CHANNEL_SET_STEREO;
receiver_config.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;

receiver_config.frame_sample_rate = 44100
;
roc_receiver* receiver = NULL;
CHECK(roc_receiver_open(context, &receiver_config, &receiver) == 0);
CHECK(receiver);
4 changes: 2 additions & 2 deletions src/tests/public_api/test_receiver.cpp
Original file line number Diff line number Diff line change
@@ -28,9 +28,9 @@ TEST_GROUP(receiver) {
CHECK(context);

memset(&receiver_config, 0, sizeof(receiver_config));
receiver_config.frame_sample_rate = 44100;
receiver_config.frame_format = ROC_FORMAT_PCM_FLOAT32;
receiver_config.frame_channels = ROC_CHANNEL_SET_STEREO;
receiver_config.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;
receiver_config.frame_sample_rate = 44100;
}

void teardown() {
4 changes: 2 additions & 2 deletions src/tests/public_api/test_sender.cpp
Original file line number Diff line number Diff line change
@@ -29,9 +29,9 @@ TEST_GROUP(sender) {

memset(&sender_config, 0, sizeof(sender_config));
sender_config.fec_encoding = ROC_FEC_ENCODING_DISABLE;
sender_config.frame_sample_rate = 44100;
sender_config.frame_format = ROC_FORMAT_PCM_FLOAT32;
sender_config.frame_channels = ROC_CHANNEL_SET_STEREO;
sender_config.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;
sender_config.frame_sample_rate = 44100;
}

void teardown() {
8 changes: 4 additions & 4 deletions src/tests/public_api/test_sender_receiver.cpp
Original file line number Diff line number Diff line change
@@ -41,9 +41,9 @@ TEST_GROUP(sender_receiver) {

void init_config(unsigned flags) {
memset(&sender_conf, 0, sizeof(sender_conf));
sender_conf.frame_sample_rate = test::SampleRate;
sender_conf.frame_format = ROC_FORMAT_PCM_FLOAT32;
sender_conf.frame_channels = ROC_CHANNEL_SET_STEREO;
sender_conf.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;
sender_conf.frame_sample_rate = test::SampleRate;
sender_conf.clock_source = ROC_CLOCK_INTERNAL;
sender_conf.resampler_profile = ROC_RESAMPLER_PROFILE_DISABLE;
sender_conf.packet_length =
@@ -61,9 +61,9 @@ TEST_GROUP(sender_receiver) {
}

memset(&receiver_conf, 0, sizeof(receiver_conf));
receiver_conf.frame_sample_rate = test::SampleRate;
receiver_conf.frame_format = ROC_FORMAT_PCM_FLOAT32;
receiver_conf.frame_channels = ROC_CHANNEL_SET_STEREO;
receiver_conf.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;
receiver_conf.frame_sample_rate = test::SampleRate;
receiver_conf.clock_source = ROC_CLOCK_INTERNAL;
receiver_conf.resampler_profile = ROC_RESAMPLER_PROFILE_DISABLE;
receiver_conf.target_latency = test::Latency * 1000000000ul / test::SampleRate;