52#include "yuri/core/frame/RawAudioFrame.h"
53#include "yuri/core/frame/CompressedVideoFrame.h"
54#include "yuri/core/frame/RawVideoFrame.h"
55#include "modules/ultragrid/YuriUltragrid.h"
65 char *received_data = NULL;
68 hdr = (uint32_t *)(
void *) pckt->data;
70 buffer_length = ntohl(hdr[2]);
73 s->
log[yuri::log::warning] <<
"Compressed audio is not yet supported!";
77 yuri::core::pRawAudioFrame
frame = yuri::core::RawAudioFrame::create_empty(
78 yuri::ultragrid::audio_uv_to_yuri(network_desc.
bps * 8), network_desc.
ch_count,
80 received_data =
reinterpret_cast<char *
>(
frame->data());
86 while (cdata != NULL) {
95 hdr = (uint32_t *)(
void *) pckt->data;
96 data_pos = ntohl(hdr[1]);
97 substream = ntohl(hdr[0]) >> 22;
113 char *received_data = NULL;
121 hdr = (uint32_t *)(
void *) pckt->data;
123 buffer_length = ntohl(hdr[2]);
125 s->
yuri_frame = yuri::ultragrid::create_yuri_from_uv_desc(&network_desc, buffer_length, s->
log);
130 auto raw = dynamic_pointer_cast<yuri::core::RawVideoFrame>(s->
yuri_frame);
132 received_data =
reinterpret_cast<char *
>(PLANE_RAW_DATA(raw, 0));
134 auto compressed = dynamic_pointer_cast<yuri::core::CompressedVideoFrame>(s->
yuri_frame);
136 received_data =
reinterpret_cast<char *
>(compressed->begin());
140 while (cdata != NULL) {
148 hdr = (uint32_t *)(
void *) pckt->data;
149 data_pos = ntohl(hdr[1]);
150 substream = ntohl(hdr[0]) >> 22;
153 s->
log[yuri::log::warning] <<
"Multiple substreams for video yet supported!";
160 memcpy(received_data + data_pos, (
unsigned char*) data,
len);
176 s->
log[yuri::log::warning] <<
"Unsupported UltraGrid pt " << cdata->
data->pt <<
"!";
struct video_frame * frame
bool parse_audio_hdr(uint32_t *hdr, struct audio_desc *desc)
bool parse_video_hdr(const uint32_t *hdr, struct video_desc *desc)
uint32_t audio_payload_hdr_t[5]
uint32_t video_payload_hdr_t[6]
yuri::core::pFrame yuri_frame
void mux_channel(char *out, const char *in, int bps, int in_len, int out_stream_channels, int pos_in_stream, double scale)
static int decode_yuri_audio_frame(struct coded_data *cdata, yuri_decoder_data *s)
static int decode_yuri_video_frame(struct coded_data *cdata, yuri_decoder_data *s)
int decode_yuri_frame(struct coded_data *cdata, void *decoder_data)