Skip to content

Commit 61627f2

Browse files
committed
Add: New API draft
Signed-off-by: Kasiewicz, Marek <[email protected]>
1 parent fcefbb9 commit 61627f2

8 files changed

+991
-0
lines changed

doc/new_API/List-of-changes.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### List of changes in API
2+
3+
# Removal of "frame" mode and rtp "mode", modified pipeline mode stays as only API for MTL sessions
4+
5+
# Polymorphic session classes used to reduce code repetition
6+
7+
# Replacing callback with event polling function to notify app about events in lib
8+
9+
# Change of usage pattern for zero copy/external frame mode
10+
11+
# More readable function names

doc/new_API/internal.h

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// This is an internal definition, not exposed in the public header.
2+
struct media_lib_session {
3+
// Must be the first field for polymorphism.
4+
media_lib_session_vtable_t* vtable;
5+
6+
// Pointer to the parent library instance.
7+
media_lib_instance_t* instance;
8+
9+
// Session configuration (common)
10+
media_lib_type_t media_type; // MEDIA_LIB_TYPE_VIDEO or MEDIA_LIB_TYPE_AUDIO
11+
media_lib_session_type_t session_role; // Receiver or transmitter
12+
media_lib_buffer_ownership_t ownership; // Buffer ownership mode
13+
14+
// Common session parameters (from base config)
15+
size_t buffer_size;
16+
uint32_t num_buffers;
17+
char address[256]; // Alternatively, store a pointer if dynamically allocated.
18+
uint16_t port;
19+
uint32_t timeout_ms;
20+
21+
/* Media type-specific data */
22+
union {
23+
struct {
24+
/* Video-specific fields: width, height, format, etc. */
25+
} video;
26+
struct {
27+
/* Audio-specific fields: sample rate, channels, format, etc. */
28+
} audio;
29+
} media;
30+
31+
// Callback functions and user data.
32+
media_lib_transmit_callback_t tx_callback;
33+
void* tx_callback_user_data;
34+
media_lib_receive_callback_t rx_callback;
35+
void* rx_callback_user_data;
36+
37+
// Internal state for managing the session.
38+
// For example: buffer pool pointer, current state flags, connection handles, etc.
39+
void* internal_data;
40+
41+
// Statistics for monitoring performance.
42+
media_lib_session_stats_t stats;
43+
};

0 commit comments

Comments
 (0)