0.0.002
ddat interop with dat js cable interop with cabal js ddat's frontend = dat-thang cable fe = cable-thang dillo support based on cel's dillo-dat bootstrap node xplatform support Signed-off-by: divo <418@cryspace.space>
This commit is contained in:
1 parent
f0f91540be
commit
b735900f2e
323 files changed
+134347
-343
No files matched your search
@@ -0,0 +1,56 @@
|
||||
#ifndef CABLE_MEDIA_H
|
||||
#define CABLE_MEDIA_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define CABLE_MEDIA_SESSION_BYTES 16u
|
||||
#define CABLE_MEDIA_HEADER_BYTES 42u
|
||||
#define CABLE_MEDIA_MAX_PACKET_BYTES 4096u
|
||||
#define CABLE_MEDIA_AAC_RATE 48000u
|
||||
#define CABLE_MEDIA_AAC_BITRATE 96000u
|
||||
#define CABLE_MEDIA_AAC_CHANNELS 1u
|
||||
#define CABLE_MEDIA_AAC_SAMPLES 1024u
|
||||
|
||||
enum cable_media_kind {
|
||||
CABLE_MEDIA_AUDIO_START = 1,
|
||||
CABLE_MEDIA_AUDIO_FRAME = 2,
|
||||
CABLE_MEDIA_AUDIO_STOP = 3,
|
||||
CABLE_MEDIA_VIDEO_START = 4,
|
||||
CABLE_MEDIA_VIDEO_FRAME = 5,
|
||||
CABLE_MEDIA_VIDEO_STOP = 6
|
||||
};
|
||||
|
||||
typedef struct cable_media_packet {
|
||||
uint8_t kind;
|
||||
uint8_t session[CABLE_MEDIA_SESSION_BYTES];
|
||||
uint64_t sequence;
|
||||
uint64_t timestamp_us;
|
||||
const uint8_t *payload;
|
||||
size_t payload_length;
|
||||
} cable_media_packet_t;
|
||||
|
||||
int cable_media_packet_write(const cable_media_packet_t *packet,
|
||||
uint8_t *output, size_t capacity, size_t *written);
|
||||
int cable_media_packet_read(cable_media_packet_t *packet,
|
||||
const uint8_t *input, size_t length);
|
||||
|
||||
typedef struct cable_aac_encoder { void *implementation; } cable_aac_encoder_t;
|
||||
typedef struct cable_aac_decoder { void *implementation; } cable_aac_decoder_t;
|
||||
typedef int (*cable_aac_frame_fn)(void *context, const uint8_t *adts,
|
||||
size_t length);
|
||||
typedef int (*cable_pcm_samples_fn)(void *context, const int16_t *samples,
|
||||
size_t sample_count);
|
||||
|
||||
int cable_aac_encoder_open(cable_aac_encoder_t *encoder);
|
||||
int cable_aac_encoder_frame(cable_aac_encoder_t *encoder,
|
||||
const int16_t samples[CABLE_MEDIA_AAC_SAMPLES],
|
||||
cable_aac_frame_fn output, void *context);
|
||||
void cable_aac_encoder_close(cable_aac_encoder_t *encoder);
|
||||
int cable_aac_decoder_open(cable_aac_decoder_t *decoder);
|
||||
int cable_aac_decoder_frame(cable_aac_decoder_t *decoder,
|
||||
const uint8_t *adts, size_t length,
|
||||
cable_pcm_samples_fn output, void *context);
|
||||
void cable_aac_decoder_close(cable_aac_decoder_t *decoder);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user