Skip to content

Commit

Permalink
update to version 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
svenpaulsen committed Oct 27, 2022
1 parent 0e4ea5c commit 54b1af3
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 22 deletions.
4 changes: 2 additions & 2 deletions bin/android-aarch64/libodin.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/android-x86_64/libodin.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/ios-aarch64/libodin.dylib
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/ios-x86_64/libodin.dylib
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/linux-aarch64/libodin.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/linux-x86_64/libodin.so
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/macos-aarch64/libodin.dylib
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/macos-x86_64/libodin.dylib
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/windows-x86_64/odin.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions bin/windows-x86_64/odin.lib
Git LFS file not shown
80 changes: 78 additions & 2 deletions include/odin.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <stdint.h>
#include <stdlib.h>

#define ODIN_VERSION "1.2.1"
#define ODIN_VERSION "1.2.2"

/**
* Supported channel layouts in audio functions.
Expand Down Expand Up @@ -390,6 +390,48 @@ typedef struct OdinEvent {
};
} OdinEvent;

/**
* Statistics for the underlying connection of a room.
*/
typedef struct OdinConnectionStats {
/**
* The amount of outgoing UDP datagrams observed
*/
uint64_t udp_tx_datagrams;
/**
* The amount of outgoing acknowledgement frames observed
*/
uint64_t udp_tx_acks;
/**
* The total amount of bytes which have been transferred inside outgoing UDP datagrams
*/
uint64_t udp_tx_bytes;
/**
* The amount of incoming UDP datagrams observed
*/
uint64_t udp_rx_datagrams;
/**
* The amount of incoming acknowledgement frames observed
*/
uint64_t udp_rx_acks;
/**
* The total amount of bytes which have been transferred inside incoming UDP datagrams
*/
uint64_t udp_rx_bytes;
/**
* Current congestion window of the connection
*/
uint64_t cwnd;
/**
* Congestion events on the connection
*/
uint64_t congestion_events;
/**
* Current best estimate of the connection latency (round-trip-time) in milliseconds
*/
float rtt;
} OdinConnectionStats;

/**
* Per-room configuration of the ODIN audio processing module which provides a variety of smart
* enhancement algorithms.
Expand Down Expand Up @@ -459,6 +501,28 @@ typedef struct OdinAudioStreamConfig {
uint8_t channel_count;
} OdinAudioStreamConfig;

/**
* Audio stream statistics.
*/
typedef struct OdinAudioStreamStats {
/**
* The number of packets processed by the medias jitter buffer.
*/
uint32_t jitter_packets_processed;
/**
* The number of packets dropped because they seemed to arrive too early.
*/
uint32_t jitter_packets_dropped_too_early;
/**
* The number of packets processed because they seemed to arrive too late.
*/
uint32_t jitter_packets_dropped_too_late;
/**
* The number of packets marked as lost during transmission.
*/
uint32_t jitter_packets_lost;
} OdinAudioStreamStats;

typedef size_t OdinResamplerHandle;

/**
Expand Down Expand Up @@ -576,6 +640,11 @@ OdinReturnCode odin_room_customer(OdinRoomHandle room,
*/
OdinReturnCode odin_room_peer_id(OdinRoomHandle room, uint64_t *out_peer_id);

/**
* Retrieves statistics for the underlying connection of the specified `OdinRoomHandle`.
*/
OdinReturnCode odin_room_connection_stats(OdinRoomHandle room, struct OdinConnectionStats *stats);

/**
* Updates the custom user data for either your own peer or the specified `OdinRoomHandle` itself.
* All user data is synced automatically, which allows storing of arbitrary information for each
Expand Down Expand Up @@ -679,6 +748,13 @@ OdinReturnCode odin_audio_read_data(OdinMediaStreamHandle stream,
size_t out_buffer_len,
enum OdinChannelLayout out_channel_layout);

/**
* Retrieves statistics for the specified `OdinMediaStreamHandle`.
*
* Note: This will only work for output streams.
*/
OdinReturnCode odin_audio_stats(OdinMediaStreamHandle stream, struct OdinAudioStreamStats *stats);

/**
* Reads up to `out_buffer_len` samples from the given streams and mixes them into the `out_buffer`.
* All audio streams will be read based on a 48khz sample rate so make sure to allocate the buffer
Expand Down Expand Up @@ -721,7 +797,7 @@ OdinResamplerHandle odin_resampler_create(uint32_t from_rate,
/**
* Resamples a single chunk of audio. If the ODIN resampler instance was created with multiple
* channels, the data is assumed to be interleaved. The `output_capacity` argument also serves as
* an out parameter when the provided capacity wasn't enough to fullfil the resample request, in
* an out parameter when the provided capacity wasn't enough to fulfill the resample request, in
* which case this function will write the minimum required buffer size into the given variable.
* On success, the written size for the processed sample is returned in both, the return value
* and the `output_capacity` out parameter.
Expand Down

0 comments on commit 54b1af3

Please sign in to comment.