55void remux_channel(
char *out,
const char *in,
int bps,
int in_len,
int in_stream_channels,
int out_stream_channels,
int pos_in_stream,
int pos_out_stream)
57 int samples = in_len / (in_stream_channels * bps);
62 in += pos_in_stream * bps;
63 out += pos_out_stream * bps;
65 for (i = 0; i < samples; ++i) {
68 out += bps * out_stream_channels;
69 in += bps * in_stream_channels;
79 width = (width + 47) / 48 * 48;
94 fprintf(stderr,
"[AJA] Unimplemented codec. Please report a bug.");
119 if(!buf)
return NULL;
162 for(
unsigned int i = 0u; i < buf->
tile_count; ++i) {
179 case UYVY:
return "UYVY";
180 case YUYV:
return "YUYV";
181 case v210:
return "v210";
182 case RGBA:
return "RGBA";
183 case RGB:
return "RGB";
184 case BGR:
return "BGR";
185 case R10k:
return "R10k";
187 fprintf(stderr,
"\nError getting codec name for codec ID %d - unsupported in Windows, report to "
188 "ultragrid-dev@cesnet.cz\n", (
int)
codec);
189 return "_UNSUPPORTED_";
194 if (strcmp(
name,
"UYVY") == 0)
return UYVY;
195 else if (strcmp(
name,
"YUYV") == 0)
return YUYV;
196 else if (strcmp(
name,
"v210") == 0)
return v210;
197 else if (strcmp(
name,
"RGBA") == 0)
return RGBA;
198 else if (strcmp(
name,
"RGB") == 0)
return RGB;
199 else if (strcmp(
name,
"BGR") == 0)
return BGR;
200 else if (strcmp(
name,
"R10k") == 0)
return R10k;
202 fprintf(stderr,
"\nError getting codec from name \"%s\" - unsupported in Windows, report to "
203 "ultragrid-dev@cesnet.cz\n",
name);
212 assert(
frame != NULL);
struct video_frame * frame
struct video_frame * vf_alloc(int count)
Allocates blank video frame.
void vf_free(struct video_frame *buf)
Frees video_frame structure.
struct video_desc video_desc_from_frame(const struct video_frame *frame)
Returns struct video_desc from video frame.
void vf_data_deleter(struct video_frame *buf)
int vc_get_linesize(unsigned int width, codec_t codec)
struct video_frame * vf_alloc_desc(struct video_desc desc)
Allocates video frame accordig given desc.
struct video_frame * vf_alloc_desc_data(struct video_desc desc)
const char * get_codec_name(codec_t codec)
void remux_channel(char *out, const char *in, int bps, int in_len, int in_stream_channels, int out_stream_channels, int pos_in_stream, int pos_out_stream)
codec_t get_codec_from_name(const char *name)
This file contains definition of some common audio types.
char * data
Raw tile data. Pointer must be at least 4B aligned.
unsigned int data_len
length of the data
enum interlacing_t interlacing
unsigned int width
width of every tile (!)
unsigned int height
height of every tile (!)
void(* data_deleter)(struct video_frame *)
void(* recycle)(struct video_frame *)
Struct video_frame represents a video frame and contains video description.
enum interlacing_t interlacing
struct tile tiles[FLEXIBLE_ARRAY_MEMBER]
struct video_frame_callbacks callbacks
@ YUYV
YCbCr 422 8-bit - Y0 Cb Y1 Cr.
@ R10k
RGB 10-bit packed - RGBX, big-endian (2 bit padding)
@ RGB
RGB 8-bit (packed into 24-bit word)
@ UYVY
YCbCr 422 8-bit - Cb Y0 Cr Y1.
@ VIDEO_CODEC_NONE
dummy color spec
@ RGBA
RGBA 8-bit, big-endian.
@ v210
YCbCr 422 10-bit - xVY0U|xY2UY1|xUY3V|xY5VY4, little-endian (2 bit padding /'x'/),...
This is an umbrella header for video functions.