gavl.h
Go to the documentation of this file.
/*****************************************************************
* gavl - a general purpose audio/video processing library
*
* Copyright (c) 2001 - 2024 Members of the Gmerlin project
* http://github.com/bplaum
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* *****************************************************************/
#ifndef GAVL_H_INCLUDED
#define GAVL_H_INCLUDED
#include <inttypes.h>
#include <gavl/gavldefs.h>
#include <gavl/gavltime.h>
#include <gavl/timecode.h>
#include <gavl/threadpool.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
typedef struct gavl_video_source_s gavl_video_source_t;
typedef struct gavl_audio_source_s gavl_audio_source_t;
typedef struct gavl_packet_source_s gavl_packet_source_t;
typedef struct
gavl_audio_sink_s gavl_audio_sink_t;
typedef struct
gavl_video_sink_s gavl_video_sink_t;
typedef struct
gavl_packet_sink_s gavl_packet_sink_t;
typedef struct
gavl_packet_s gavl_packet_t;
typedef struct gavl_video_format_s gavl_video_format_t;
typedef struct gavl_video_frame_s gavl_video_frame_t;
/* Quality levels */
#define GAVL_QUALITY_FASTEST 1
#define GAVL_QUALITY_BEST 5
#define GAVL_QUALITY_DEFAULT 2
#define GAVL_ACCEL_MMX (1<<0)
#define GAVL_ACCEL_MMXEXT (1<<1)
#define GAVL_ACCEL_SSE (1<<2)
#define GAVL_ACCEL_SSE2 (1<<3)
#define GAVL_ACCEL_SSE3 (1<<4)
#define GAVL_ACCEL_3DNOW (1<<5)
#define GAVL_ACCEL_3DNOWEXT (1<<6)
#define GAVL_ACCEL_SSSE3 (1<<7)
#define GAVL_ACCEL_AVX (1<<8)
#define GAVL_ACCEL_AVX2 (1<<9)
#define GAVL_ACCEL_NEON (1<<10)
GAVL_PUBLIC int gavl_accel_supported(void);
/* Sample formats: all multibyte numbers are native endian */
#define GAVL_MAX_CHANNELS 128
typedef enum
{
GAVL_SAMPLE_NONE = 0,
GAVL_SAMPLE_U8 = 1,
GAVL_SAMPLE_S8 = 2,
GAVL_SAMPLE_U16 = 3,
GAVL_SAMPLE_S16 = 4,
GAVL_SAMPLE_S32 = 5,
GAVL_SAMPLE_FLOAT = 6,
GAVL_SAMPLE_DOUBLE = 7
} gavl_sample_format_t;
typedef enum
{
GAVL_INTERLEAVE_NONE = 0,
GAVL_INTERLEAVE_2 = 1,
GAVL_INTERLEAVE_ALL = 2
} gavl_interleave_mode_t;
typedef enum
{
GAVL_CHID_NONE = 0,
GAVL_CHID_FRONT_CENTER,
GAVL_CHID_FRONT_LEFT,
GAVL_CHID_FRONT_RIGHT,
GAVL_CHID_FRONT_CENTER_LEFT,
GAVL_CHID_FRONT_CENTER_RIGHT,
GAVL_CHID_REAR_LEFT,
GAVL_CHID_REAR_RIGHT,
GAVL_CHID_REAR_CENTER,
GAVL_CHID_SIDE_LEFT,
GAVL_CHID_SIDE_RIGHT,
GAVL_CHID_LFE,
GAVL_CHID_AUX,
} gavl_channel_id_t;
typedef struct
{
uint32_t samples_per_frame;
uint32_t samplerate;
uint32_t num_channels;
gavl_sample_format_t sample_format;
gavl_interleave_mode_t interleave_mode;
float center_level;
float rear_level;
gavl_channel_id_t channel_locations[GAVL_MAX_CHANNELS];
} gavl_audio_format_t;
/* Audio format -> string conversions */
GAVL_PUBLIC
const char * gavl_sample_format_to_string(gavl_sample_format_t format);
GAVL_PUBLIC
const char * gavl_sample_format_to_short_string(gavl_sample_format_t format);
GAVL_PUBLIC
gavl_sample_format_t gavl_string_to_sample_format(const char * str);
GAVL_PUBLIC
gavl_sample_format_t gavl_short_string_to_sample_format(const char * format);
GAVL_PUBLIC
int gavl_num_sample_formats(void);
GAVL_PUBLIC
gavl_sample_format_t gavl_get_sample_format(int index);
GAVL_PUBLIC
const char * gavl_channel_id_to_string(gavl_channel_id_t id);
GAVL_PUBLIC
const char * gavl_channel_id_to_short_string(gavl_channel_id_t id);
GAVL_PUBLIC
gavl_channel_id_t gavl_short_string_to_channel_id(const char * id);
GAVL_PUBLIC
const char * gavl_interleave_mode_to_string(gavl_interleave_mode_t mode);
GAVL_PUBLIC
const char * gavl_interleave_mode_to_short_string(gavl_interleave_mode_t mode);
GAVL_PUBLIC
gavl_interleave_mode_t gavl_short_string_to_interleave_mode(const char * mode);
GAVL_PUBLIC
void gavl_audio_format_dump(const gavl_audio_format_t * format);
GAVL_PUBLIC
int gavl_audio_format_buffer_size(const gavl_audio_format_t * format);
GAVL_PUBLIC
void gavl_audio_format_dumpi(const gavl_audio_format_t * format, int indent);
GAVL_PUBLIC
int gavl_channel_index(const gavl_audio_format_t * format, gavl_channel_id_t id);
GAVL_PUBLIC
int gavl_front_channels(const gavl_audio_format_t * format);
GAVL_PUBLIC
int gavl_rear_channels(const gavl_audio_format_t * format);
GAVL_PUBLIC
int gavl_side_channels(const gavl_audio_format_t * format);
GAVL_PUBLIC
int gavl_aux_channels(const gavl_audio_format_t * format);
GAVL_PUBLIC
int gavl_lfe_channels(const gavl_audio_format_t * format);
GAVL_PUBLIC
void gavl_audio_format_copy(gavl_audio_format_t * dst,
const gavl_audio_format_t * src);
GAVL_PUBLIC
int gavl_audio_formats_equal(const gavl_audio_format_t * format_1,
const gavl_audio_format_t * format_2);
GAVL_PUBLIC
void gavl_set_channel_setup(gavl_audio_format_t * format);
GAVL_PUBLIC
int gavl_bytes_per_sample(gavl_sample_format_t format);
GAVL_PUBLIC
int gavl_nearest_samplerate(int in_rate, const int * supported);
typedef union
{
uint8_t * u_8;
int8_t * s_8;
uint16_t * u_16;
int16_t * s_16;
uint32_t * u_32;
int32_t * s_32;
float * f;
double * d;
} gavl_audio_samples_t;
typedef union
{
uint8_t * u_8[GAVL_MAX_CHANNELS];
int8_t * s_8[GAVL_MAX_CHANNELS];
uint16_t * u_16[GAVL_MAX_CHANNELS];
int16_t * s_16[GAVL_MAX_CHANNELS];
uint32_t * u_32[GAVL_MAX_CHANNELS];
int32_t * s_32[GAVL_MAX_CHANNELS];
float * f[GAVL_MAX_CHANNELS];
double * d[GAVL_MAX_CHANNELS];
} gavl_audio_channels_t;
typedef struct
{
gavl_audio_samples_t samples;
gavl_audio_channels_t channels;
int valid_samples;
int64_t timestamp;
int channel_stride;
int buf_idx;
} gavl_audio_frame_t;
GAVL_PUBLIC
gavl_audio_frame_t * gavl_audio_frame_create(const gavl_audio_format_t* format);
GAVL_PUBLIC
void gavl_audio_frame_null(gavl_audio_frame_t * frame);
GAVL_PUBLIC
void gavl_audio_frame_destroy(gavl_audio_frame_t * frame);
GAVL_PUBLIC
void gavl_audio_frame_mute(gavl_audio_frame_t * frame,
const gavl_audio_format_t * format);
GAVL_PUBLIC
void gavl_audio_frame_mute_samples(gavl_audio_frame_t * frame,
const gavl_audio_format_t * format,
int num_samples);
GAVL_PUBLIC
void gavl_audio_frame_mute_channel(gavl_audio_frame_t * frame,
const gavl_audio_format_t * format,
int channel);
GAVL_PUBLIC
int gavl_audio_frame_copy(const gavl_audio_format_t * format,
gavl_audio_frame_t * dst,
const gavl_audio_frame_t * src,
int dst_pos,
int src_pos,
int dst_size,
int src_size);
GAVL_PUBLIC
void gavl_audio_frame_copy_ptrs(const gavl_audio_format_t * format,
gavl_audio_frame_t * dst,
const gavl_audio_frame_t * src);
GAVL_PUBLIC
void gavl_audio_frame_get_subframe(const gavl_audio_format_t * format,
gavl_audio_frame_t * src,
gavl_audio_frame_t * dst,
int start, int len);
GAVL_PUBLIC
int gavl_audio_frames_equal(const gavl_audio_format_t * format,
const gavl_audio_frame_t * f1,
const gavl_audio_frame_t * f2);
GAVL_PUBLIC
int gavl_audio_frame_continuous(const gavl_audio_format_t * format,
const gavl_audio_frame_t * f);
GAVL_PUBLIC
void gavl_audio_frame_set_channels(gavl_audio_frame_t * f,
const gavl_audio_format_t * format,
uint8_t * data);
GAVL_PUBLIC
void gavl_audio_frame_from_data(gavl_audio_frame_t * f,
const gavl_audio_format_t * format,
uint8_t * data, int len);
GAVL_PUBLIC
void gavl_audio_frame_to_packet_metadata(const gavl_audio_frame_t * frame,
gavl_packet_t * pkt);
GAVL_PUBLIC
void gavl_packet_to_audio_frame_metadata(const gavl_packet_t * p, gavl_audio_frame_t * frame);
GAVL_PUBLIC
void gavl_audio_frame_set_from_packet(gavl_audio_frame_t * frame,
const gavl_audio_format_t * format,
gavl_packet_t * p);
GAVL_PUBLIC
int gavl_audio_frame_skip(const gavl_audio_format_t * format,
gavl_audio_frame_t * f, int num_samples);
GAVL_PUBLIC
int gavl_audio_frame_plot(const gavl_audio_format_t * format,
const gavl_audio_frame_t * frame,
const char * name_base);
#define GAVL_AUDIO_FRONT_TO_REAR_COPY (1<<0)
#define GAVL_AUDIO_FRONT_TO_REAR_MUTE (1<<1)
#define GAVL_AUDIO_FRONT_TO_REAR_DIFF (1<<2)
#define GAVL_AUDIO_FRONT_TO_REAR_MASK \
(GAVL_AUDIO_FRONT_TO_REAR_COPY | \
GAVL_AUDIO_FRONT_TO_REAR_MUTE | \
GAVL_AUDIO_FRONT_TO_REAR_DIFF)
/* Options for mixing stereo to mono */
#define GAVL_AUDIO_STEREO_TO_MONO_LEFT (1<<3)
#define GAVL_AUDIO_STEREO_TO_MONO_RIGHT (1<<4)
#define GAVL_AUDIO_STEREO_TO_MONO_MIX (1<<5)
#define GAVL_AUDIO_STEREO_TO_MONO_MASK \
(GAVL_AUDIO_STEREO_TO_MONO_LEFT | \
GAVL_AUDIO_STEREO_TO_MONO_RIGHT | \
GAVL_AUDIO_STEREO_TO_MONO_MIX)
#define GAVL_AUDIO_NORMALIZE_MIX_MATRIX (1<<6)
typedef enum
{
GAVL_AUDIO_DITHER_NONE = 0,
GAVL_AUDIO_DITHER_AUTO = 1,
GAVL_AUDIO_DITHER_RECT = 2,
GAVL_AUDIO_DITHER_TRI = 3,
GAVL_AUDIO_DITHER_SHAPED = 4,
} gavl_audio_dither_mode_t;
typedef enum
{
GAVL_RESAMPLE_AUTO = 0,
GAVL_RESAMPLE_ZOH = 1,
GAVL_RESAMPLE_LINEAR = 2,
GAVL_RESAMPLE_SINC_FAST = 3,
GAVL_RESAMPLE_SINC_MEDIUM = 4,
GAVL_RESAMPLE_SINC_BEST = 5
} gavl_resample_mode_t;
typedef struct gavl_audio_options_s gavl_audio_options_t;
GAVL_PUBLIC
void gavl_audio_options_set_quality(gavl_audio_options_t * opt, int quality);
GAVL_PUBLIC
int gavl_audio_options_get_quality(const gavl_audio_options_t * opt);
GAVL_PUBLIC
void gavl_audio_options_set_dither_mode(gavl_audio_options_t * opt, gavl_audio_dither_mode_t mode);
GAVL_PUBLIC
gavl_audio_dither_mode_t
gavl_audio_options_get_dither_mode(const gavl_audio_options_t * opt);
GAVL_PUBLIC
void gavl_audio_options_set_resample_mode(gavl_audio_options_t * opt, gavl_resample_mode_t mode);
GAVL_PUBLIC
gavl_resample_mode_t
gavl_audio_options_get_resample_mode(const gavl_audio_options_t * opt);
GAVL_PUBLIC
void gavl_audio_options_set_conversion_flags(gavl_audio_options_t * opt,
int flags);
GAVL_PUBLIC
int gavl_audio_options_get_conversion_flags(const gavl_audio_options_t * opt);
GAVL_PUBLIC
void gavl_audio_options_set_defaults(gavl_audio_options_t * opt);
GAVL_PUBLIC
void gavl_audio_options_set_mix_matrix(gavl_audio_options_t * opt,
const double ** matrix);
GAVL_PUBLIC
const double **
gavl_audio_options_get_mix_matrix(const gavl_audio_options_t * opt);
GAVL_PUBLIC
gavl_audio_options_t * gavl_audio_options_create(void);
GAVL_PUBLIC
void gavl_audio_options_copy(gavl_audio_options_t * dst,
const gavl_audio_options_t * src);
GAVL_PUBLIC
void gavl_audio_options_destroy(gavl_audio_options_t * opt);
/* Audio converter */
typedef struct gavl_audio_converter_s gavl_audio_converter_t;
GAVL_PUBLIC
gavl_audio_converter_t * gavl_audio_converter_create(void);
GAVL_PUBLIC
void gavl_audio_converter_destroy(gavl_audio_converter_t* cnv);
GAVL_PUBLIC
gavl_audio_options_t * gavl_audio_converter_get_options(gavl_audio_converter_t*cnv);
GAVL_PUBLIC
int gavl_audio_converter_init(gavl_audio_converter_t* cnv,
const gavl_audio_format_t * input_format,
const gavl_audio_format_t * output_format);
GAVL_PUBLIC
int gavl_audio_converter_init_resample(gavl_audio_converter_t * cnv,
const gavl_audio_format_t * format);
GAVL_PUBLIC
int gavl_audio_converter_reinit(gavl_audio_converter_t* cnv);
GAVL_PUBLIC
void gavl_audio_convert(gavl_audio_converter_t * cnv,
const gavl_audio_frame_t * input_frame,
gavl_audio_frame_t * output_frame);
GAVL_PUBLIC
int gavl_audio_converter_set_resample_ratio(gavl_audio_converter_t * cnv,
double ratio ) ;
GAVL_PUBLIC
void gavl_audio_converter_resample(gavl_audio_converter_t * cnv,
gavl_audio_frame_t * input_frame,
gavl_audio_frame_t * output_frame,
double ratio);
typedef struct gavl_volume_control_s gavl_volume_control_t;
/* Create / destroy */
GAVL_PUBLIC
gavl_volume_control_t * gavl_volume_control_create(void);
GAVL_PUBLIC
void gavl_volume_control_destroy(gavl_volume_control_t *ctrl);
GAVL_PUBLIC
void gavl_volume_control_set_format(gavl_volume_control_t *ctrl,
const gavl_audio_format_t * format);
GAVL_PUBLIC
void gavl_volume_control_set_volume(gavl_volume_control_t * ctrl,
float volume);
GAVL_PUBLIC
void gavl_volume_control_apply(gavl_volume_control_t *ctrl,
gavl_audio_frame_t * frame);
GAVL_PUBLIC
int gavl_volume_to_int(float volume, float one, int steps);
GAVL_PUBLIC
float gavl_volume_to_float(int volume, float one, int steps);
#define GAVL_MAX_PLANES 4
typedef struct
{
int32_t x;
int32_t y;
int32_t w;
int32_t h;
} gavl_rectangle_i_t;
typedef struct
{
double x;
double y;
double w;
double h;
} gavl_rectangle_f_t;
GAVL_PUBLIC
void gavl_rectangle_i_init(gavl_rectangle_i_t * r);
GAVL_PUBLIC
void gavl_rectangle_f_init(gavl_rectangle_f_t * r);
GAVL_PUBLIC
void gavl_rectangle_i_crop_to_format(gavl_rectangle_i_t * r,
const gavl_video_format_t * format);
GAVL_PUBLIC
void gavl_rectangle_f_crop_to_format(gavl_rectangle_f_t * r,
const gavl_video_format_t * format);
GAVL_PUBLIC
void gavl_rectangle_crop_to_format_noscale(gavl_rectangle_i_t * src_rect,
gavl_rectangle_i_t * dst_rect,
const gavl_video_format_t * src_format,
const gavl_video_format_t * dst_format);
GAVL_PUBLIC
void gavl_rectangle_crop_to_format_scale(gavl_rectangle_f_t * src_rect,
gavl_rectangle_i_t * dst_rect,
const gavl_video_format_t * src_format,
const gavl_video_format_t * dst_format);
GAVL_PUBLIC
void gavl_rectangle_crop_to_format_scale_f(gavl_rectangle_f_t * src_rect,
gavl_rectangle_f_t * dst_rect,
const gavl_video_format_t * src_format,
const gavl_video_format_t * dst_format);
GAVL_PUBLIC
void gavl_rectangle_i_set_all(gavl_rectangle_i_t * r, const gavl_video_format_t * format);
GAVL_PUBLIC
void gavl_rectangle_f_set_all(gavl_rectangle_f_t * r, const gavl_video_format_t * format);
GAVL_PUBLIC
void gavl_rectangle_i_crop_left(gavl_rectangle_i_t * r, int num_pixels);
GAVL_PUBLIC
void gavl_rectangle_i_crop_right(gavl_rectangle_i_t * r, int num_pixels);
GAVL_PUBLIC
void gavl_rectangle_i_crop_top(gavl_rectangle_i_t * r, int num_pixels);
GAVL_PUBLIC
void gavl_rectangle_i_crop_bottom(gavl_rectangle_i_t * r, int num_pixels);
GAVL_PUBLIC
void gavl_rectangle_f_crop_left(gavl_rectangle_f_t * r, double num_pixels);
GAVL_PUBLIC
void gavl_rectangle_f_crop_right(gavl_rectangle_f_t * r, double num_pixels);
GAVL_PUBLIC
void gavl_rectangle_f_crop_top(gavl_rectangle_f_t * r, double num_pixels);
GAVL_PUBLIC
void gavl_rectangle_f_crop_bottom(gavl_rectangle_f_t * r, double num_pixels);
GAVL_PUBLIC
void gavl_rectangle_i_align(gavl_rectangle_i_t * r, int h_align, int v_align);
GAVL_PUBLIC
void gavl_rectangle_i_align_to_format(gavl_rectangle_i_t * r,
const gavl_video_format_t * format);
GAVL_PUBLIC
void gavl_rectangle_i_copy(gavl_rectangle_i_t * dst, const gavl_rectangle_i_t * src);
GAVL_PUBLIC
void gavl_rectangle_f_copy(gavl_rectangle_f_t * dst, const gavl_rectangle_f_t * src);
GAVL_PUBLIC
void gavl_rectangle_i_to_f(gavl_rectangle_f_t * dst, const gavl_rectangle_i_t * src);
GAVL_PUBLIC
void gavl_rectangle_f_to_i(gavl_rectangle_i_t * dst, const gavl_rectangle_f_t * src);
GAVL_PUBLIC
int gavl_rectangle_i_is_empty(const gavl_rectangle_i_t * r);
GAVL_PUBLIC
int gavl_rectangle_f_is_empty(const gavl_rectangle_f_t * r);
GAVL_PUBLIC
void gavl_rectangle_fit_aspect(gavl_rectangle_i_t * dst_rect,
const gavl_video_format_t * src_format,
const gavl_rectangle_f_t * src_rect,
const gavl_video_format_t * dst_format,
float zoom, float squeeze);
GAVL_PUBLIC
void gavl_rectangle_fit_aspect_f(gavl_rectangle_f_t * r,
const gavl_video_format_t * src_format,
const gavl_rectangle_f_t * src_rect,
const gavl_video_format_t * dst_format,
float zoom, float squeeze, int do_orient);
GAVL_PUBLIC
void gavl_rectangle_i_dump(const gavl_rectangle_i_t * r);
GAVL_PUBLIC
void gavl_rectangle_f_dump(const gavl_rectangle_f_t * r);
#define GAVL_PIXFMT_PLANAR (1<<8)
#define GAVL_PIXFMT_RGB (1<<9)
#define GAVL_PIXFMT_YUV (1<<10)
#define GAVL_PIXFMT_YUVJ (1<<11)
#define GAVL_PIXFMT_ALPHA (1<<12)
#define GAVL_PIXFMT_GRAY (1<<13)
enum gavl_pixelformat_e
{
GAVL_PIXELFORMAT_NONE = 0,
GAVL_GRAY_8 = 1 | GAVL_PIXFMT_GRAY,
GAVL_GRAY_16 = 2 | GAVL_PIXFMT_GRAY,
GAVL_GRAY_FLOAT = 3 | GAVL_PIXFMT_GRAY,
GAVL_GRAYA_16 = 1 | GAVL_PIXFMT_GRAY | GAVL_PIXFMT_ALPHA,
GAVL_GRAYA_32 = 2 | GAVL_PIXFMT_GRAY | GAVL_PIXFMT_ALPHA,
GAVL_GRAYA_FLOAT = 3 | GAVL_PIXFMT_GRAY | GAVL_PIXFMT_ALPHA,
GAVL_RGB_15 = 1 | GAVL_PIXFMT_RGB,
GAVL_BGR_15 = 2 | GAVL_PIXFMT_RGB,
GAVL_RGB_16 = 3 | GAVL_PIXFMT_RGB,
GAVL_BGR_16 = 4 | GAVL_PIXFMT_RGB,
GAVL_RGB_24 = 5 | GAVL_PIXFMT_RGB,
GAVL_BGR_24 = 6 | GAVL_PIXFMT_RGB,
GAVL_RGB_32 = 7 | GAVL_PIXFMT_RGB,
GAVL_BGR_32 = 8 | GAVL_PIXFMT_RGB,
GAVL_RGBA_32 = 9 | GAVL_PIXFMT_RGB | GAVL_PIXFMT_ALPHA,
GAVL_RGB_48 = 10 | GAVL_PIXFMT_RGB,
GAVL_RGBA_64 = 11 | GAVL_PIXFMT_RGB | GAVL_PIXFMT_ALPHA,
GAVL_RGB_FLOAT = 12 | GAVL_PIXFMT_RGB,
GAVL_RGBA_FLOAT = 13 | GAVL_PIXFMT_RGB | GAVL_PIXFMT_ALPHA,
GAVL_YUY2 = 1 | GAVL_PIXFMT_YUV,
GAVL_UYVY = 2 | GAVL_PIXFMT_YUV,
GAVL_YUVA_32 = 3 | GAVL_PIXFMT_YUV | GAVL_PIXFMT_ALPHA,
GAVL_YUVA_64 = 4 | GAVL_PIXFMT_YUV | GAVL_PIXFMT_ALPHA,
GAVL_YUV_FLOAT = 5 | GAVL_PIXFMT_YUV,
GAVL_YUVA_FLOAT = 6 | GAVL_PIXFMT_YUV | GAVL_PIXFMT_ALPHA,
GAVL_YUV_420_P = 1 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV,
GAVL_YUV_422_P = 2 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV,
GAVL_YUV_444_P = 3 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV,
GAVL_YUV_411_P = 4 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV,
GAVL_YUV_410_P = 5 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV,
GAVL_YUVJ_420_P = 6 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV | GAVL_PIXFMT_YUVJ,
GAVL_YUVJ_422_P = 7 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV | GAVL_PIXFMT_YUVJ,
GAVL_YUVJ_444_P = 8 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV | GAVL_PIXFMT_YUVJ,
GAVL_YUV_444_P_16 = 9 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV,
GAVL_YUV_422_P_16 = 10 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV,
};
typedef enum gavl_pixelformat_e gavl_pixelformat_t;
#define GAVL_PIXELFORMAT_1D_8 GAVL_GRAY_8
#define GAVL_PIXELFORMAT_2D_8 GAVL_GRAYA_16
#define GAVL_PIXELFORMAT_3D_8 GAVL_RGB_24
#define GAVL_PIXELFORMAT_4D_8 GAVL_RGBA_32
#define GAVL_PIXELFORMAT_1D_16 GAVL_GRAY_16
#define GAVL_PIXELFORMAT_2D_16 GAVL_GRAYA_32
#define GAVL_PIXELFORMAT_3D_16 GAVL_RGB_48
#define GAVL_PIXELFORMAT_4D_16 GAVL_RGBA_64
#define GAVL_PIXELFORMAT_1D_FLOAT GAVL_GRAY_FLOAT
#define GAVL_PIXELFORMAT_2D_FLOAT GAVL_GRAYA_FLOAT
#define GAVL_PIXELFORMAT_3D_FLOAT GAVL_RGB_FLOAT
#define GAVL_PIXELFORMAT_4D_FLOAT GAVL_RGBA_FLOAT
typedef enum
{
GAVL_CCH_NONE = 0,
GAVL_CCH_RED,
GAVL_CCH_GREEN,
GAVL_CCH_BLUE,
GAVL_CCH_Y,
GAVL_CCH_CB,
GAVL_CCH_CR,
GAVL_CCH_ALPHA,
} gavl_color_channel_t;
/*
* Colormodel related functions
*/
#define gavl_pixelformat_is_gray(fmt) ((fmt) & GAVL_PIXFMT_GRAY)
#define gavl_pixelformat_is_rgb(fmt) ((fmt) & GAVL_PIXFMT_RGB)
#define gavl_pixelformat_is_yuv(fmt) ((fmt) & GAVL_PIXFMT_YUV)
#define gavl_pixelformat_is_jpeg_scaled(fmt) ((fmt) & GAVL_PIXFMT_YUVJ)
#define gavl_pixelformat_has_alpha(fmt) ((fmt) & GAVL_PIXFMT_ALPHA)
#define gavl_pixelformat_is_planar(fmt) ((fmt) & GAVL_PIXFMT_PLANAR)
GAVL_PUBLIC
int gavl_pixelformat_num_channels(gavl_pixelformat_t pixelformat);
GAVL_PUBLIC gavl_color_channel_t
gavl_pixelformat_get_channel(gavl_pixelformat_t pixelformat, int index);
GAVL_PUBLIC
int gavl_pixelformat_num_planes(gavl_pixelformat_t pixelformat);
GAVL_PUBLIC
void gavl_pixelformat_chroma_sub(gavl_pixelformat_t pixelformat, int * sub_h, int * sub_v);
GAVL_PUBLIC
int gavl_pixelformat_bytes_per_component(gavl_pixelformat_t pixelformat);
GAVL_PUBLIC
int gavl_pixelformat_bytes_per_pixel(gavl_pixelformat_t pixelformat);
GAVL_PUBLIC
int gavl_pixelformat_bits_per_pixel(gavl_pixelformat_t pixelformat);
GAVL_PUBLIC
int gavl_pixelformat_conversion_penalty(gavl_pixelformat_t src,
gavl_pixelformat_t dst);
GAVL_PUBLIC gavl_pixelformat_t
gavl_pixelformat_get_best(gavl_pixelformat_t src,
const gavl_pixelformat_t * dst_supported,
int * penalty);
GAVL_PUBLIC
const char * gavl_pixelformat_to_string(gavl_pixelformat_t pixelformat);
GAVL_PUBLIC
const char * gavl_pixelformat_to_short_string(gavl_pixelformat_t pixelformat);
GAVL_PUBLIC
gavl_pixelformat_t gavl_string_to_pixelformat(const char * name);
GAVL_PUBLIC
gavl_pixelformat_t gavl_short_string_to_pixelformat(const char * name);
GAVL_PUBLIC
const uint32_t * gavl_pixelformat_get_masks(gavl_pixelformat_t pixelformat);
GAVL_PUBLIC
int gavl_num_pixelformats(void);
GAVL_PUBLIC
gavl_pixelformat_t gavl_get_pixelformat(int index);
/* */
typedef enum
{
GAVL_CHROMA_PLACEMENT_DEFAULT = 0,
GAVL_CHROMA_PLACEMENT_MPEG2,
GAVL_CHROMA_PLACEMENT_DVPAL
} gavl_chroma_placement_t;
GAVL_PUBLIC
const char * gavl_chroma_placement_to_string(gavl_chroma_placement_t mode);
GAVL_PUBLIC
const char * gavl_chroma_placement_to_short_string(gavl_chroma_placement_t mode);
GAVL_PUBLIC
gavl_chroma_placement_t gavl_short_string_to_chroma_placement(const char * mode);
/* Changing the values alters the gmerlin-avdecoder index format */
typedef enum
{
GAVL_FRAMERATE_UNKNOWN = -1,
GAVL_FRAMERATE_CONSTANT = 0,
GAVL_FRAMERATE_VARIABLE = 1,
GAVL_FRAMERATE_STILL = 2,
} gavl_framerate_mode_t;
GAVL_PUBLIC
const char * gavl_framerate_mode_to_string(gavl_framerate_mode_t mode);
GAVL_PUBLIC
const char * gavl_framerate_mode_to_short_string(gavl_framerate_mode_t mode);
GAVL_PUBLIC
gavl_framerate_mode_t gavl_short_string_to_framerate_mode(const char * mode);
/* Changing the values alters the gmerlin-avdecoder index format */
typedef enum
{
GAVL_INTERLACE_UNKNOWN = -1,
GAVL_INTERLACE_NONE = 0,
GAVL_INTERLACE_TOP_FIRST = 1,
GAVL_INTERLACE_BOTTOM_FIRST = 2,
GAVL_INTERLACE_MIXED = (0x10 | 1),
GAVL_INTERLACE_MIXED_TOP = (0x10 | 2),
GAVL_INTERLACE_MIXED_BOTTOM = (0x10 | 3),
} gavl_interlace_mode_t;
GAVL_PUBLIC
const char * gavl_interlace_mode_to_string(gavl_interlace_mode_t mode);
GAVL_PUBLIC
const char * gavl_interlace_mode_to_short_string(gavl_interlace_mode_t mode);
GAVL_PUBLIC
gavl_interlace_mode_t gavl_short_string_to_interlace_mode(const char * mode);
GAVL_PUBLIC
int gavl_interlace_mode_is_mixed(gavl_interlace_mode_t mode);
#include <gavl/hw.h> // Needs forward declarations
/* Video format structure */
#define GAVL_IMAGE_ORIENT_FLIP_H (1<<2)
typedef enum
{
GAVL_IMAGE_ORIENT_NORMAL = 0, // EXIF: 1
GAVL_IMAGE_ORIENT_ROT90_CW = 1, // EXIF: 8
GAVL_IMAGE_ORIENT_ROT180_CW = 2, // EXIF: 3
GAVL_IMAGE_ORIENT_ROT270_CW = 3, // EXIF: 6
GAVL_IMAGE_ORIENT_FH = (GAVL_IMAGE_ORIENT_FLIP_H | GAVL_IMAGE_ORIENT_NORMAL), // EXIF: 2
GAVL_IMAGE_ORIENT_FH_ROT90_CW = (GAVL_IMAGE_ORIENT_FLIP_H | GAVL_IMAGE_ORIENT_ROT90_CW), // EXIF: 7
GAVL_IMAGE_ORIENT_FH_ROT180_CW = (GAVL_IMAGE_ORIENT_FLIP_H | GAVL_IMAGE_ORIENT_ROT180_CW), // EXIF: 4
GAVL_IMAGE_ORIENT_FH_ROT270_CW = (GAVL_IMAGE_ORIENT_FLIP_H | GAVL_IMAGE_ORIENT_ROT270_CW), // EXIF: 5
} gavl_image_orientation_t;
struct gavl_video_format_s
{
uint32_t frame_width;
uint32_t frame_height;
uint32_t image_width;
uint32_t image_height;
/* Support for nonsquare pixels */
uint32_t pixel_width;
uint32_t pixel_height;
gavl_pixelformat_t pixelformat;
uint32_t frame_duration;
uint32_t timescale;
gavl_framerate_mode_t framerate_mode;
gavl_chroma_placement_t chroma_placement;
gavl_interlace_mode_t interlace_mode;
gavl_timecode_format_t timecode_format;
gavl_hw_context_t * hwctx;
gavl_image_orientation_t orientation;
};
GAVL_PUBLIC
void gavl_video_format_copy(gavl_video_format_t * dst,
const gavl_video_format_t * src);
GAVL_PUBLIC
int gavl_video_formats_equal(const gavl_video_format_t * format_1,
const gavl_video_format_t * format_2);
GAVL_PUBLIC
void gavl_video_format_get_chroma_offset(const gavl_video_format_t * format, int field, int plane,
float * off_x, float * off_y);
GAVL_PUBLIC
void gavl_video_format_fit_to_source(gavl_video_format_t * dst,
const gavl_video_format_t * src);
GAVL_PUBLIC
int gavl_video_format_get_image_size(const gavl_video_format_t * format);
GAVL_PUBLIC
void gavl_video_format_get_frame_layout(const gavl_video_format_t * format,
int * offsets,
int * strides,
int * buffersizes,
int multiplane);
GAVL_PUBLIC
void gavl_video_format_set_frame_size(gavl_video_format_t * format,
int pad_h, int pad_v);
GAVL_PUBLIC
int gavl_get_color_channel_format(const gavl_video_format_t * frame_format,
gavl_video_format_t * channel_format,
gavl_color_channel_t ch);
GAVL_PUBLIC
void gavl_get_field_format(const gavl_video_format_t * frame_format,
gavl_video_format_t * field_format,
int field);
GAVL_PUBLIC
void gavl_video_format_dump(const gavl_video_format_t * format);
GAVL_PUBLIC
void gavl_video_format_dumpi(const gavl_video_format_t * format, int indent);
GAVL_PUBLIC
void gavl_video_format_normalize_orientation(gavl_video_format_t * in_format,
gavl_video_format_t * out_format);
GAVL_PUBLIC const char *
gavl_image_orientation_to_string(gavl_image_orientation_t orient);
GAVL_PUBLIC int
gavl_image_orientation_is_transposed(gavl_image_orientation_t orient);
struct gavl_video_frame_s
{
uint8_t * planes[GAVL_MAX_PLANES];
int strides[GAVL_MAX_PLANES];
void * client_data;
int64_t timestamp;
int64_t duration;
gavl_interlace_mode_t interlace_mode;
gavl_timecode_t timecode;
int dummy; // !< Used to be reference count. Was renamed to keep ABI compatibility
gavl_rectangle_i_t src_rect;
int32_t dst_x;
int32_t dst_y;
gavl_hw_context_t * hwctx;
void * storage;
int buf_idx;
};
GAVL_PUBLIC
gavl_video_frame_t * gavl_video_frame_create(const gavl_video_format_t * format);
GAVL_PUBLIC
gavl_video_frame_t * gavl_video_frame_create_nopad(const gavl_video_format_t*format);
GAVL_PUBLIC
void gavl_video_frame_destroy(gavl_video_frame_t*frame);
GAVL_PUBLIC
void gavl_video_frame_null(gavl_video_frame_t*frame);
GAVL_PUBLIC
void gavl_video_frame_clear(gavl_video_frame_t * frame,
const gavl_video_format_t * format);
GAVL_PUBLIC
void gavl_video_frame_fill(gavl_video_frame_t * frame,
const gavl_video_format_t * format,
const float * color);
GAVL_PUBLIC
void gavl_video_frame_absdiff(gavl_video_frame_t * dst,
const gavl_video_frame_t * src1,
const gavl_video_frame_t * src2,
const gavl_video_format_t * format);
GAVL_PUBLIC
void gavl_video_frame_psnr(double * psnr,
const gavl_video_frame_t * src1,
const gavl_video_frame_t * src2,
const gavl_video_format_t * format);
GAVL_PUBLIC
int gavl_video_frame_ssim(const gavl_video_frame_t * src1,
const gavl_video_frame_t * src2,
gavl_video_frame_t * dst,
const gavl_video_format_t * format);
GAVL_PUBLIC
void gavl_video_frame_copy(const gavl_video_format_t * format,
gavl_video_frame_t * dst,
const gavl_video_frame_t * src);
GAVL_PUBLIC
void gavl_video_frame_copy_plane(const gavl_video_format_t * format,
gavl_video_frame_t * dst,
const gavl_video_frame_t * src, int plane);
GAVL_PUBLIC
void gavl_video_frame_copy_flip_x(const gavl_video_format_t * format,
gavl_video_frame_t * dst,
const gavl_video_frame_t * src);
GAVL_PUBLIC
void gavl_video_frame_copy_flip_y(const gavl_video_format_t * format,
gavl_video_frame_t * dst,
const gavl_video_frame_t * src);
GAVL_PUBLIC
void gavl_video_frame_copy_flip_xy(const gavl_video_format_t * format,
gavl_video_frame_t * dst,
const gavl_video_frame_t * src);
GAVL_PUBLIC
void gavl_video_frame_copy_metadata(gavl_video_frame_t * dst,
const gavl_video_frame_t * src);
GAVL_PUBLIC
void gavl_video_frame_get_subframe(gavl_pixelformat_t pixelformat,
const gavl_video_frame_t * src,
gavl_video_frame_t * dst,
const gavl_rectangle_i_t * src_rect);
GAVL_PUBLIC
void gavl_video_frame_get_field(gavl_pixelformat_t pixelformat,
const gavl_video_frame_t * src,
gavl_video_frame_t * dst,
int field);
GAVL_PUBLIC
void gavl_video_frame_dump(gavl_video_frame_t * frame,
const gavl_video_format_t * format,
const char * namebase);
GAVL_PUBLIC
void gavl_video_frame_dump_metadata(const gavl_video_format_t * format,
const gavl_video_frame_t * frame);
GAVL_PUBLIC
void gavl_video_frame_set_strides(gavl_video_frame_t * frame,
const gavl_video_format_t * format);
GAVL_PUBLIC
void gavl_video_frame_set_planes(gavl_video_frame_t * frame,
const gavl_video_format_t * format,
uint8_t * buffer);
GAVL_PUBLIC
int gavl_video_frame_continuous(const gavl_video_format_t * format,
const gavl_video_frame_t * frame);
GAVL_PUBLIC
int gavl_video_frame_extract_channel(const gavl_video_format_t * format,
gavl_color_channel_t ch,
const gavl_video_frame_t * src,
gavl_video_frame_t * dst);
GAVL_PUBLIC
int gavl_video_frame_insert_channel(const gavl_video_format_t * format,
gavl_color_channel_t ch,
const gavl_video_frame_t * src,
gavl_video_frame_t * dst);
GAVL_PUBLIC
int gavl_video_frames_equal(const gavl_video_format_t * format,
const gavl_video_frame_t * f1,
const gavl_video_frame_t * f2);
GAVL_PUBLIC
void gavl_video_frame_normalize_orientation(const gavl_video_format_t * in_format,
const gavl_video_format_t * out_format,
const gavl_video_frame_t * in_frame,
gavl_video_frame_t * out_frame);
GAVL_PUBLIC
void gavl_video_frame_to_packet_metadata(const gavl_video_frame_t * frame,
gavl_packet_t * pkt);
GAVL_PUBLIC
void gavl_packet_to_video_frame_metadata(const gavl_packet_t * p, gavl_video_frame_t * frame);
GAVL_PUBLIC
void gavl_video_frame_set_from_packet(gavl_video_frame_t * frame,
const gavl_video_format_t * format,
gavl_packet_t * p);
/*****************************
Conversion options
******************************/
#define GAVL_FORCE_DEINTERLACE (1<<0)
#define GAVL_CONVOLVE_CHROMA (1<<1)
#define GAVL_CONVOLVE_NORMALIZE (1<<2)
#define GAVL_RESAMPLE_CHROMA (1<<3)
#define GAVL_FORCE_SW (1<<4)
typedef enum
{
GAVL_ALPHA_IGNORE = 0,
GAVL_ALPHA_BLEND_COLOR
} gavl_alpha_mode_t;
typedef enum
{
GAVL_DEINTERLACE_NONE = 0,
GAVL_DEINTERLACE_COPY = 1,
GAVL_DEINTERLACE_SCALE = 2,
GAVL_DEINTERLACE_BLEND = 3
} gavl_deinterlace_mode_t;
typedef enum
{
GAVL_DEINTERLACE_DROP_TOP,
GAVL_DEINTERLACE_DROP_BOTTOM,
} gavl_deinterlace_drop_mode_t;
typedef enum
{
GAVL_SCALE_AUTO,
GAVL_SCALE_NEAREST,
GAVL_SCALE_BILINEAR,
GAVL_SCALE_QUADRATIC,
GAVL_SCALE_CUBIC_BSPLINE,
GAVL_SCALE_CUBIC_MITCHELL,
GAVL_SCALE_CUBIC_CATMULL,
GAVL_SCALE_SINC_LANCZOS,
GAVL_SCALE_NONE,
} gavl_scale_mode_t;
typedef enum
{
GAVL_DOWNSCALE_FILTER_AUTO = 0,
GAVL_DOWNSCALE_FILTER_NONE,
GAVL_DOWNSCALE_FILTER_WIDE,
GAVL_DOWNSCALE_FILTER_GAUSS,
} gavl_downscale_filter_t;
typedef struct gavl_video_options_s gavl_video_options_t;
/* Default Options */
GAVL_PUBLIC
void gavl_video_options_set_defaults(gavl_video_options_t * opt);
GAVL_PUBLIC
gavl_video_options_t * gavl_video_options_create(void);
GAVL_PUBLIC
void gavl_video_options_copy(gavl_video_options_t * dst,
const gavl_video_options_t * src);
GAVL_PUBLIC
void gavl_video_options_destroy(gavl_video_options_t * opt);
GAVL_PUBLIC
void gavl_video_options_set_rectangles(gavl_video_options_t * opt,
const gavl_rectangle_f_t * src_rect,
const gavl_rectangle_i_t * dst_rect);
GAVL_PUBLIC
void gavl_video_options_get_rectangles(const gavl_video_options_t * opt,
gavl_rectangle_f_t * src_rect,
gavl_rectangle_i_t * dst_rect);
GAVL_PUBLIC
void gavl_video_options_set_quality(gavl_video_options_t * opt, int quality);
GAVL_PUBLIC
int gavl_video_options_get_quality(const gavl_video_options_t * opt);
GAVL_PUBLIC
void gavl_video_options_set_conversion_flags(gavl_video_options_t * opt,
int conversion_flags);
GAVL_PUBLIC
int gavl_video_options_get_conversion_flags(const gavl_video_options_t * opt);
GAVL_PUBLIC
void gavl_video_options_set_alpha_mode(gavl_video_options_t * opt,
gavl_alpha_mode_t alpha_mode);
GAVL_PUBLIC gavl_alpha_mode_t
gavl_video_options_get_alpha_mode(const gavl_video_options_t * opt);
GAVL_PUBLIC
void gavl_video_options_set_scale_mode(gavl_video_options_t * opt,
gavl_scale_mode_t scale_mode);
GAVL_PUBLIC gavl_scale_mode_t
gavl_video_options_get_scale_mode(const gavl_video_options_t * opt);
GAVL_PUBLIC
void gavl_video_options_set_scale_order(gavl_video_options_t * opt,
int order);
GAVL_PUBLIC
int gavl_video_options_get_scale_order(const gavl_video_options_t * opt);
GAVL_PUBLIC
void gavl_video_options_set_background_color(gavl_video_options_t * opt,
const double * color);
GAVL_PUBLIC
void gavl_video_options_get_background_color(const gavl_video_options_t * opt,
double * color);
GAVL_PUBLIC
void gavl_video_options_set_deinterlace_mode(gavl_video_options_t * opt,
gavl_deinterlace_mode_t deinterlace_mode);
GAVL_PUBLIC gavl_deinterlace_mode_t
gavl_video_options_get_deinterlace_mode(const gavl_video_options_t * opt);
GAVL_PUBLIC
void gavl_video_options_set_deinterlace_drop_mode(gavl_video_options_t * opt,
gavl_deinterlace_drop_mode_t deinterlace_drop_mode);
GAVL_PUBLIC gavl_deinterlace_drop_mode_t
gavl_video_options_get_deinterlace_drop_mode(const gavl_video_options_t * opt);
GAVL_PUBLIC
void gavl_video_options_set_downscale_filter(gavl_video_options_t * opt,
gavl_downscale_filter_t f);
GAVL_PUBLIC gavl_downscale_filter_t
gavl_video_options_get_downscale_filter(const gavl_video_options_t * opt);
GAVL_PUBLIC
void gavl_video_options_set_downscale_blur(gavl_video_options_t * opt,
float f);
GAVL_PUBLIC
float gavl_video_options_get_downscale_blur(const gavl_video_options_t * opt);
/* Set an externally created thread pool. If this is not called, a private thread pool will be created if needed.
This function has the advantage that one thread pool can be shared among different elements of a video
pipeline, which will reduce the overhead */
GAVL_PUBLIC
void gavl_video_options_set_thread_pool(gavl_video_options_t * opt, gavl_thread_pool_t * tp);
GAVL_PUBLIC
gavl_thread_pool_t * gavl_video_options_get_thread_pool(const gavl_video_options_t * opt);
/***************************************************
* Create and destroy video converters
***************************************************/
typedef struct gavl_video_converter_s gavl_video_converter_t;
GAVL_PUBLIC
gavl_video_converter_t * gavl_video_converter_create(void);
GAVL_PUBLIC
void gavl_video_converter_destroy(gavl_video_converter_t*cnv);
/**************************************************
* Get options. Change the options with the gavl_video_options_set_*
* functions above
**************************************************/
GAVL_PUBLIC gavl_video_options_t *
gavl_video_converter_get_options(gavl_video_converter_t*cnv);
GAVL_PUBLIC
int gavl_video_converter_init(gavl_video_converter_t* cnv,
const gavl_video_format_t * input_format,
const gavl_video_format_t * output_format);
GAVL_PUBLIC
int gavl_video_converter_reinit(gavl_video_converter_t* cnv);
/***************************************************
* Convert a frame
***************************************************/
GAVL_PUBLIC
void gavl_video_convert(gavl_video_converter_t * cnv,
const gavl_video_frame_t * input_frame,
gavl_video_frame_t * output_frame);
typedef struct gavl_video_scaler_s gavl_video_scaler_t;
GAVL_PUBLIC
gavl_video_scaler_t * gavl_video_scaler_create(void);
GAVL_PUBLIC
void gavl_video_scaler_destroy(gavl_video_scaler_t * scaler);
GAVL_PUBLIC gavl_video_options_t *
gavl_video_scaler_get_options(gavl_video_scaler_t * scaler);
GAVL_PUBLIC
int gavl_video_scaler_init(gavl_video_scaler_t * scaler,
const gavl_video_format_t * src_format,
const gavl_video_format_t * dst_format);
GAVL_PUBLIC
int gavl_video_scaler_init_convolve(gavl_video_scaler_t * scaler,
const gavl_video_format_t * format,
int h_radius, const float * h_coeffs,
int v_radius, const float * v_coeffs);
GAVL_PUBLIC
void gavl_video_scaler_scale(gavl_video_scaler_t * scaler,
const gavl_video_frame_t * input_frame,
gavl_video_frame_t * output_frame);
typedef struct gavl_video_deinterlacer_s gavl_video_deinterlacer_t;
GAVL_PUBLIC
gavl_video_deinterlacer_t * gavl_video_deinterlacer_create(void);
GAVL_PUBLIC
void gavl_video_deinterlacer_destroy(gavl_video_deinterlacer_t * deinterlacer);
GAVL_PUBLIC gavl_video_options_t *
gavl_video_deinterlacer_get_options(gavl_video_deinterlacer_t * deinterlacer);
GAVL_PUBLIC
int gavl_video_deinterlacer_init(gavl_video_deinterlacer_t * deinterlacer,
const gavl_video_format_t * src_format);
GAVL_PUBLIC
void gavl_video_deinterlacer_deinterlace(gavl_video_deinterlacer_t * deinterlacer,
const gavl_video_frame_t * input_frame,
gavl_video_frame_t * output_frame);
/**************************************************
* Transparent overlays
**************************************************/
/* Overlay struct */
typedef gavl_video_frame_t gavl_overlay_t;
typedef struct gavl_overlay_blend_context_s gavl_overlay_blend_context_t;
GAVL_PUBLIC
gavl_overlay_blend_context_t * gavl_overlay_blend_context_create(void);
GAVL_PUBLIC
void gavl_overlay_blend_context_destroy(gavl_overlay_blend_context_t * ctx);
GAVL_PUBLIC gavl_video_options_t *
gavl_overlay_blend_context_get_options(gavl_overlay_blend_context_t * ctx);
GAVL_PUBLIC
int gavl_overlay_blend_context_init(gavl_overlay_blend_context_t * ctx,
const gavl_video_format_t * frame_format,
gavl_video_format_t * overlay_format);
GAVL_PUBLIC
void gavl_overlay_blend_context_set_overlay(gavl_overlay_blend_context_t * ctx,
gavl_overlay_t * ovl);
GAVL_PUBLIC
void gavl_overlay_blend(gavl_overlay_blend_context_t * ctx,
gavl_video_frame_t * dst_frame);
GAVL_PUBLIC gavl_video_sink_t *
gavl_overlay_blend_context_get_sink(gavl_overlay_blend_context_t * ctx);
typedef struct gavl_image_transform_s gavl_image_transform_t;
typedef void (*gavl_image_transform_func)(void * priv,
double xdst,
double ydst,
double * xsrc,
double * ysrc);
GAVL_PUBLIC
gavl_image_transform_t * gavl_image_transform_create(void);
GAVL_PUBLIC
void gavl_image_transform_destroy(gavl_image_transform_t * t);
GAVL_PUBLIC
int gavl_image_transform_init(gavl_image_transform_t * t,
gavl_video_format_t * format,
gavl_image_transform_func func, void * priv);
GAVL_PUBLIC
void gavl_image_transform_transform(gavl_image_transform_t * t,
gavl_video_frame_t * in_frame,
gavl_video_frame_t * out_frame);
GAVL_PUBLIC gavl_video_options_t *
gavl_image_transform_get_options(gavl_image_transform_t * t);
typedef struct
{
int64_t offset;
/* Primary */
int64_t num_entries;
int64_t entries_alloc;
struct
{
int64_t num_frames;
int64_t duration;
} * entries;
int num_timecodes;
int timecodes_alloc;
struct
{
int64_t pts;
gavl_timecode_t tc;
} * timecodes;
/* Secondary */
} gavl_frame_table_t;
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_create(void);
GAVL_PUBLIC gavl_frame_table_t *
gavl_frame_table_create_audio(int samplerate, int64_t offset, int64_t duration,
gavl_timecode_format_t * fmt_ret);
GAVL_PUBLIC gavl_frame_table_t *
gavl_frame_table_create_cfr(int64_t offset, int64_t frame_duration,
int64_t num_frames,
gavl_timecode_t start_timecode);
GAVL_PUBLIC gavl_frame_table_t *
gavl_frame_table_copy(const gavl_frame_table_t * tab);
GAVL_PUBLIC void gavl_frame_table_destroy(gavl_frame_table_t * t);
GAVL_PUBLIC void gavl_frame_table_append_entry(gavl_frame_table_t * t, int64_t duration);
GAVL_PUBLIC void
gavl_frame_table_append_timecode(gavl_frame_table_t * t,
int64_t pts, gavl_timecode_t tc);
GAVL_PUBLIC int64_t
gavl_frame_table_frame_to_time(const gavl_frame_table_t * t,
int64_t frame, int * duration);
GAVL_PUBLIC int64_t
gavl_frame_table_time_to_frame(const gavl_frame_table_t * t,
int64_t time,
int64_t * start_time);
GAVL_PUBLIC gavl_timecode_t
gavl_frame_table_time_to_timecode(const gavl_frame_table_t * t,
int64_t time,
int64_t * start_time,
const gavl_timecode_format_t * fmt);
GAVL_PUBLIC int64_t
gavl_frame_table_timecode_to_time(const gavl_frame_table_t * t,
gavl_timecode_t tc,
const gavl_timecode_format_t * fmt);
GAVL_PUBLIC gavl_timecode_t
gavl_frame_table_frame_to_timecode(const gavl_frame_table_t * t,
int64_t frame,
int64_t * start_time,
const gavl_timecode_format_t * fmt);
GAVL_PUBLIC int64_t
gavl_frame_table_num_frames(const gavl_frame_table_t * t);
GAVL_PUBLIC int64_t
gavl_frame_table_duration(const gavl_frame_table_t * t);
GAVL_PUBLIC int64_t
gavl_frame_table_end_time(const gavl_frame_table_t * t);
GAVL_PUBLIC
int gavl_frame_table_save(const gavl_frame_table_t * t,
const char * filename);
GAVL_PUBLIC
gavl_frame_table_t * gavl_frame_table_load(const char * filename);
GAVL_PUBLIC void
gavl_frame_table_dump(const gavl_frame_table_t * t);
typedef struct gavl_video_frame_pool_s gavl_video_frame_pool_t;
GAVL_PUBLIC
gavl_video_frame_pool_t *
gavl_video_frame_pool_create(gavl_hw_context_t * hwctx);
GAVL_PUBLIC
gavl_video_frame_t * gavl_video_frame_pool_get(gavl_video_frame_pool_t *p);
GAVL_PUBLIC
void gavl_video_frame_pool_release(gavl_video_frame_t * frame);
GAVL_PUBLIC
int gavl_video_frame_pool_set_format(gavl_video_frame_pool_t *p, const gavl_video_format_t * fmt);
GAVL_PUBLIC
const gavl_video_format_t * gavl_video_frame_pool_get_format(const gavl_video_frame_pool_t *p);
GAVL_PUBLIC
void gavl_video_frame_pool_destroy(gavl_video_frame_pool_t *p);
GAVL_PUBLIC
void gavl_video_frame_pool_reset(gavl_video_frame_pool_t *p);
/* Debayer routines */
#define GAVL_BAYER_GREEN_FIRST (1<<0)
#define GAVL_BAYER_BLUE_LINE (1<<1)
// GB
// RG
#define GAVL_BAYER_GBRG (GAVL_BAYER_GREEN_FIRST|GAVL_BAYER_BLUE_LINE)
// GR
// BG
#define GAVL_BAYER_GRBG (GAVL_BAYER_GREEN_FIRST)
// BG
// GR
#define GAVL_BAYER_BGGR (GAVL_BAYER_BLUE_LINE)
// RG
// GB
#define GAVL_BAYER_RGGB 0
GAVL_PUBLIC
void gavl_video_frame_debayer(gavl_video_options_t * opt,
gavl_video_frame_t * src, gavl_video_frame_t * dst,
int bayer_format, gavl_video_format_t * dst_format);
#ifdef __cplusplus
}
#endif
#endif /* GAVL_H_INCLUDED */
gavl_video_options_get_deinterlace_mode
GAVL_PUBLIC gavl_deinterlace_mode_t gavl_video_options_get_deinterlace_mode(const gavl_video_options_t *opt)
Get the deinterlace mode.
gavl_video_options_set_deinterlace_mode
GAVL_PUBLIC void gavl_video_options_set_deinterlace_mode(gavl_video_options_t *opt, gavl_deinterlace_mode_t deinterlace_mode)
Set the deinterlace mode.
gavl_accel_supported
GAVL_PUBLIC int gavl_accel_supported(void)
Get the supported acceleration flags.
gavl_audio_converter_get_options
GAVL_PUBLIC gavl_audio_options_t * gavl_audio_converter_get_options(gavl_audio_converter_t *cnv)
gets options of an audio converter
gavl_audio_converter_resample
GAVL_PUBLIC void gavl_audio_converter_resample(gavl_audio_converter_t *cnv, gavl_audio_frame_t *input_frame, gavl_audio_frame_t *output_frame, double ratio)
Convert audio.
gavl_audio_converter_destroy
GAVL_PUBLIC void gavl_audio_converter_destroy(gavl_audio_converter_t *cnv)
Destroys an audio converter and frees all associated memory.
gavl_audio_converter_t
struct gavl_audio_converter_s gavl_audio_converter_t
Opaque audio converter structure.
Definition gavl.h:1189
gavl_audio_converter_create
GAVL_PUBLIC gavl_audio_converter_t * gavl_audio_converter_create(void)
Creates an audio converter.
gavl_audio_convert
GAVL_PUBLIC void gavl_audio_convert(gavl_audio_converter_t *cnv, const gavl_audio_frame_t *input_frame, gavl_audio_frame_t *output_frame)
Convert audio.
gavl_audio_converter_init
GAVL_PUBLIC int gavl_audio_converter_init(gavl_audio_converter_t *cnv, const gavl_audio_format_t *input_format, const gavl_audio_format_t *output_format)
Initialize an audio converter.
gavl_audio_converter_init_resample
GAVL_PUBLIC int gavl_audio_converter_init_resample(gavl_audio_converter_t *cnv, const gavl_audio_format_t *format)
Initialize an audio converter just for resampling.
gavl_audio_converter_set_resample_ratio
GAVL_PUBLIC int gavl_audio_converter_set_resample_ratio(gavl_audio_converter_t *cnv, double ratio)
Set samplerate conversion ratio.
gavl_audio_converter_reinit
GAVL_PUBLIC int gavl_audio_converter_reinit(gavl_audio_converter_t *cnv)
Reinitialize an audio converter.
gavl_channel_id_t
gavl_channel_id_t
Audio channel setup.
Definition gavl.h:248
gavl_sample_format_t
gavl_sample_format_t
Format of one audio sample.
Definition gavl.h:217
gavl_interleave_mode_to_short_string
GAVL_PUBLIC const char * gavl_interleave_mode_to_short_string(gavl_interleave_mode_t mode)
Convert a gavl_interleave_mode_t to a short string.
gavl_audio_format_copy
GAVL_PUBLIC void gavl_audio_format_copy(gavl_audio_format_t *dst, const gavl_audio_format_t *src)
Copy one audio format to another.
gavl_channel_index
GAVL_PUBLIC int gavl_channel_index(const gavl_audio_format_t *format, gavl_channel_id_t id)
Get the index of a particular channel for a given format.
gavl_side_channels
GAVL_PUBLIC int gavl_side_channels(const gavl_audio_format_t *format)
Get number of side channels for a given format.
gavl_set_channel_setup
GAVL_PUBLIC void gavl_set_channel_setup(gavl_audio_format_t *format)
Set the default channel setup and indices.
gavl_lfe_channels
GAVL_PUBLIC int gavl_lfe_channels(const gavl_audio_format_t *format)
Get number of LFE channels for a given format.
gavl_get_sample_format
GAVL_PUBLIC gavl_sample_format_t gavl_get_sample_format(int index)
Get the sample format from index.
gavl_channel_id_to_string
GAVL_PUBLIC const char * gavl_channel_id_to_string(gavl_channel_id_t id)
Convert a gavl_channel_id_t to a human readable string.
gavl_audio_format_dumpi
GAVL_PUBLIC void gavl_audio_format_dumpi(const gavl_audio_format_t *format, int indent)
Dump an audio format to stderr.
gavl_nearest_samplerate
GAVL_PUBLIC int gavl_nearest_samplerate(int in_rate, const int *supported)
Get the nearest samplerate out of a list of supported rates.
gavl_short_string_to_sample_format
GAVL_PUBLIC gavl_sample_format_t gavl_short_string_to_sample_format(const char *format)
Convert a short string to a gavl_sample_format_t.
gavl_sample_format_to_string
GAVL_PUBLIC const char * gavl_sample_format_to_string(gavl_sample_format_t format)
Convert a gavl_sample_format_t to a human readable string.
gavl_interleave_mode_t
gavl_interleave_mode_t
Definition gavl.h:234
gavl_string_to_sample_format
GAVL_PUBLIC gavl_sample_format_t gavl_string_to_sample_format(const char *str)
Convert a string to a sample format.
gavl_front_channels
GAVL_PUBLIC int gavl_front_channels(const gavl_audio_format_t *format)
Get number of front channels for a given format.
gavl_sample_format_to_short_string
GAVL_PUBLIC const char * gavl_sample_format_to_short_string(gavl_sample_format_t format)
Convert a gavl_sample_format_t to a human readable string.
gavl_bytes_per_sample
GAVL_PUBLIC int gavl_bytes_per_sample(gavl_sample_format_t format)
Get the number of bytes per sample for a given sample format.
gavl_audio_format_dump
GAVL_PUBLIC void gavl_audio_format_dump(const gavl_audio_format_t *format)
Dump an audio format to stderr.
gavl_aux_channels
GAVL_PUBLIC int gavl_aux_channels(const gavl_audio_format_t *format)
Get number of aux channels for a given format.
gavl_rear_channels
GAVL_PUBLIC int gavl_rear_channels(const gavl_audio_format_t *format)
Get number of rear channels for a given format.
gavl_short_string_to_channel_id
GAVL_PUBLIC gavl_channel_id_t gavl_short_string_to_channel_id(const char *id)
Convert short string to a gavl_channel_id_t.
gavl_num_sample_formats
GAVL_PUBLIC int gavl_num_sample_formats(void)
Get total number of supported sample formats.
gavl_interleave_mode_to_string
GAVL_PUBLIC const char * gavl_interleave_mode_to_string(gavl_interleave_mode_t mode)
Convert a gavl_interleave_mode_t to a human readable string.
gavl_channel_id_to_short_string
GAVL_PUBLIC const char * gavl_channel_id_to_short_string(gavl_channel_id_t id)
Convert a gavl_channel_id_t to a short string.
gavl_short_string_to_interleave_mode
GAVL_PUBLIC gavl_interleave_mode_t gavl_short_string_to_interleave_mode(const char *mode)
Convert a short string to a gavl_interleave_mode_t.
gavl_audio_formats_equal
GAVL_PUBLIC int gavl_audio_formats_equal(const gavl_audio_format_t *format_1, const gavl_audio_format_t *format_2)
Compare 2 audio formats.
GAVL_MAX_CHANNELS
#define GAVL_MAX_CHANNELS
Maximum number of audio channels.
Definition gavl.h:208
GAVL_CHID_SIDE_RIGHT
@ GAVL_CHID_SIDE_RIGHT
Definition gavl.h:259
GAVL_CHID_FRONT_RIGHT
@ GAVL_CHID_FRONT_RIGHT
Definition gavl.h:252
GAVL_CHID_FRONT_LEFT
@ GAVL_CHID_FRONT_LEFT
Definition gavl.h:251
GAVL_CHID_REAR_LEFT
@ GAVL_CHID_REAR_LEFT
Definition gavl.h:255
GAVL_CHID_SIDE_LEFT
@ GAVL_CHID_SIDE_LEFT
Definition gavl.h:258
GAVL_CHID_NONE
@ GAVL_CHID_NONE
Definition gavl.h:249
GAVL_CHID_FRONT_CENTER_LEFT
@ GAVL_CHID_FRONT_CENTER_LEFT
Definition gavl.h:253
GAVL_CHID_REAR_CENTER
@ GAVL_CHID_REAR_CENTER
Definition gavl.h:257
GAVL_CHID_LFE
@ GAVL_CHID_LFE
Definition gavl.h:260
GAVL_CHID_REAR_RIGHT
@ GAVL_CHID_REAR_RIGHT
Definition gavl.h:256
GAVL_CHID_AUX
@ GAVL_CHID_AUX
Definition gavl.h:261
GAVL_CHID_FRONT_CENTER_RIGHT
@ GAVL_CHID_FRONT_CENTER_RIGHT
Definition gavl.h:254
GAVL_CHID_FRONT_CENTER
@ GAVL_CHID_FRONT_CENTER
Definition gavl.h:250
GAVL_SAMPLE_FLOAT
@ GAVL_SAMPLE_FLOAT
Definition gavl.h:224
GAVL_SAMPLE_NONE
@ GAVL_SAMPLE_NONE
Definition gavl.h:218
GAVL_SAMPLE_U8
@ GAVL_SAMPLE_U8
Definition gavl.h:219
GAVL_SAMPLE_S8
@ GAVL_SAMPLE_S8
Definition gavl.h:220
GAVL_SAMPLE_U16
@ GAVL_SAMPLE_U16
Definition gavl.h:221
GAVL_SAMPLE_S16
@ GAVL_SAMPLE_S16
Definition gavl.h:222
GAVL_SAMPLE_DOUBLE
@ GAVL_SAMPLE_DOUBLE
Definition gavl.h:225
GAVL_SAMPLE_S32
@ GAVL_SAMPLE_S32
Definition gavl.h:223
GAVL_INTERLEAVE_2
@ GAVL_INTERLEAVE_2
Definition gavl.h:236
GAVL_INTERLEAVE_ALL
@ GAVL_INTERLEAVE_ALL
Definition gavl.h:237
GAVL_INTERLEAVE_NONE
@ GAVL_INTERLEAVE_NONE
Definition gavl.h:235
gavl_audio_frame_destroy
GAVL_PUBLIC void gavl_audio_frame_destroy(gavl_audio_frame_t *frame)
Destroy an audio frame.
gavl_audio_frame_from_data
GAVL_PUBLIC void gavl_audio_frame_from_data(gavl_audio_frame_t *f, const gavl_audio_format_t *format, uint8_t *data, int len)
Set the channel pointers of an audio frame.
gavl_audio_frame_mute
GAVL_PUBLIC void gavl_audio_frame_mute(gavl_audio_frame_t *frame, const gavl_audio_format_t *format)
Mute an audio frame.
gavl_audio_frame_null
GAVL_PUBLIC void gavl_audio_frame_null(gavl_audio_frame_t *frame)
Zero all pointers in the audio frame.
gavl_audio_frame_set_channels
GAVL_PUBLIC void gavl_audio_frame_set_channels(gavl_audio_frame_t *f, const gavl_audio_format_t *format, uint8_t *data)
Set the channel pointers of an audio frame.
gavl_audio_frame_mute_samples
GAVL_PUBLIC void gavl_audio_frame_mute_samples(gavl_audio_frame_t *frame, const gavl_audio_format_t *format, int num_samples)
Mute a number of samples at the start of an audio frame.
gavl_audio_frame_copy
GAVL_PUBLIC int gavl_audio_frame_copy(const gavl_audio_format_t *format, gavl_audio_frame_t *dst, const gavl_audio_frame_t *src, int dst_pos, int src_pos, int dst_size, int src_size)
Copy audio data from one frame to another.
gavl_audio_frame_skip
GAVL_PUBLIC int gavl_audio_frame_skip(const gavl_audio_format_t *format, gavl_audio_frame_t *f, int num_samples)
Skip samples in am audio frame.
gavl_audio_frame_create
GAVL_PUBLIC gavl_audio_frame_t * gavl_audio_frame_create(const gavl_audio_format_t *format)
Create audio frame.
gavl_audio_frame_get_subframe
GAVL_PUBLIC void gavl_audio_frame_get_subframe(const gavl_audio_format_t *format, gavl_audio_frame_t *src, gavl_audio_frame_t *dst, int start, int len)
Set an audio frame to a subframe of another frame.
gavl_audio_frame_mute_channel
GAVL_PUBLIC void gavl_audio_frame_mute_channel(gavl_audio_frame_t *frame, const gavl_audio_format_t *format, int channel)
Mute a single channel of an audio frame.
gavl_audio_frame_plot
GAVL_PUBLIC int gavl_audio_frame_plot(const gavl_audio_format_t *format, const gavl_audio_frame_t *frame, const char *name_base)
Plot an audio frame to an ASCII file.
gavl_audio_frames_equal
GAVL_PUBLIC int gavl_audio_frames_equal(const gavl_audio_format_t *format, const gavl_audio_frame_t *f1, const gavl_audio_frame_t *f2)
Check if 2 audio frames are bit-identical.
gavl_audio_frame_copy_ptrs
GAVL_PUBLIC void gavl_audio_frame_copy_ptrs(const gavl_audio_format_t *format, gavl_audio_frame_t *dst, const gavl_audio_frame_t *src)
Copy audio data from one frame to another.
gavl_audio_frame_continuous
GAVL_PUBLIC int gavl_audio_frame_continuous(const gavl_audio_format_t *format, const gavl_audio_frame_t *f)
Check if an audio frames is continuous in memory.
gavl_audio_options_t
struct gavl_audio_options_s gavl_audio_options_t
Opaque container for audio conversion options.
Definition gavl.h:1004
gavl_audio_options_set_resample_mode
GAVL_PUBLIC void gavl_audio_options_set_resample_mode(gavl_audio_options_t *opt, gavl_resample_mode_t mode)
Set the resample mode for the converter.
gavl_audio_options_create
GAVL_PUBLIC gavl_audio_options_t * gavl_audio_options_create(void)
Create an options container.
gavl_audio_options_copy
GAVL_PUBLIC void gavl_audio_options_copy(gavl_audio_options_t *dst, const gavl_audio_options_t *src)
Copy audio options.
gavl_audio_dither_mode_t
gavl_audio_dither_mode_t
Dither mode.
Definition gavl.h:976
gavl_audio_options_set_conversion_flags
GAVL_PUBLIC void gavl_audio_options_set_conversion_flags(gavl_audio_options_t *opt, int flags)
Set the conversion flags.
gavl_audio_options_get_dither_mode
GAVL_PUBLIC gavl_audio_dither_mode_t gavl_audio_options_get_dither_mode(const gavl_audio_options_t *opt)
Get the dither mode for the converter.
gavl_audio_options_set_defaults
GAVL_PUBLIC void gavl_audio_options_set_defaults(gavl_audio_options_t *opt)
Set all options to their defaults.
gavl_audio_options_set_mix_matrix
GAVL_PUBLIC void gavl_audio_options_set_mix_matrix(gavl_audio_options_t *opt, const double **matrix)
Set a user defined mix matrix.
gavl_audio_options_set_dither_mode
GAVL_PUBLIC void gavl_audio_options_set_dither_mode(gavl_audio_options_t *opt, gavl_audio_dither_mode_t mode)
Set the dither mode for the converter.
gavl_resample_mode_t
gavl_resample_mode_t
Resample mode.
Definition gavl.h:989
gavl_audio_options_get_mix_matrix
GAVL_PUBLIC const double ** gavl_audio_options_get_mix_matrix(const gavl_audio_options_t *opt)
Get the mix matrix.
gavl_audio_options_get_quality
GAVL_PUBLIC int gavl_audio_options_get_quality(const gavl_audio_options_t *opt)
Get the quality level for a converter.
gavl_audio_options_get_resample_mode
GAVL_PUBLIC gavl_resample_mode_t gavl_audio_options_get_resample_mode(const gavl_audio_options_t *opt)
Get the resample mode for the converter.
gavl_audio_options_destroy
GAVL_PUBLIC void gavl_audio_options_destroy(gavl_audio_options_t *opt)
Destroy audio options.
gavl_audio_options_get_conversion_flags
GAVL_PUBLIC int gavl_audio_options_get_conversion_flags(const gavl_audio_options_t *opt)
Get the conversion flags.
gavl_audio_options_set_quality
GAVL_PUBLIC void gavl_audio_options_set_quality(gavl_audio_options_t *opt, int quality)
Set the quality level for the converter.
GAVL_RESAMPLE_SINC_BEST
@ GAVL_RESAMPLE_SINC_BEST
Definition gavl.h:995
GAVL_RESAMPLE_ZOH
@ GAVL_RESAMPLE_ZOH
Definition gavl.h:991
GAVL_RESAMPLE_LINEAR
@ GAVL_RESAMPLE_LINEAR
Definition gavl.h:992
GAVL_RESAMPLE_AUTO
@ GAVL_RESAMPLE_AUTO
Definition gavl.h:990
GAVL_RESAMPLE_SINC_MEDIUM
@ GAVL_RESAMPLE_SINC_MEDIUM
Definition gavl.h:994
GAVL_RESAMPLE_SINC_FAST
@ GAVL_RESAMPLE_SINC_FAST
Definition gavl.h:993
gavl_frame_table_save
GAVL_PUBLIC int gavl_frame_table_save(const gavl_frame_table_t *t, const char *filename)
Save a frame table to a file.
gavl_frame_table_end_time
GAVL_PUBLIC int64_t gavl_frame_table_end_time(const gavl_frame_table_t *t)
get the end time of the last frame
gavl_frame_table_load
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_load(const char *filename)
Load a frame table from a file.
gavl_frame_table_frame_to_time
GAVL_PUBLIC int64_t gavl_frame_table_frame_to_time(const gavl_frame_table_t *t, int64_t frame, int *duration)
Convert a frame index to a timestamp.
gavl_frame_table_create
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_create(void)
Create a frame table.
gavl_frame_table_frame_to_timecode
GAVL_PUBLIC gavl_timecode_t gavl_frame_table_frame_to_timecode(const gavl_frame_table_t *t, int64_t frame, int64_t *start_time, const gavl_timecode_format_t *fmt)
Convert a frame index to a timecode.
gavl_frame_table_dump
GAVL_PUBLIC void gavl_frame_table_dump(const gavl_frame_table_t *t)
Dump a frame table to stderr for debugging.
gavl_frame_table_time_to_timecode
GAVL_PUBLIC gavl_timecode_t gavl_frame_table_time_to_timecode(const gavl_frame_table_t *t, int64_t time, int64_t *start_time, const gavl_timecode_format_t *fmt)
Convert a timestamp to a timecode.
gavl_frame_table_time_to_frame
GAVL_PUBLIC int64_t gavl_frame_table_time_to_frame(const gavl_frame_table_t *t, int64_t time, int64_t *start_time)
Convert a timestamp to a frame index.
gavl_frame_table_duration
GAVL_PUBLIC int64_t gavl_frame_table_duration(const gavl_frame_table_t *t)
get the total duration of all frames
gavl_frame_table_destroy
GAVL_PUBLIC void gavl_frame_table_destroy(gavl_frame_table_t *t)
Destroy a frame table and free all memory.
gavl_frame_table_num_frames
GAVL_PUBLIC int64_t gavl_frame_table_num_frames(const gavl_frame_table_t *t)
get the total number of frames
gavl_frame_table_create_cfr
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_create_cfr(int64_t offset, int64_t frame_duration, int64_t num_frames, gavl_timecode_t start_timecode)
Create a frame table for constant framerate video.
gavl_frame_table_append_entry
GAVL_PUBLIC void gavl_frame_table_append_entry(gavl_frame_table_t *t, int64_t duration)
Append an entry.
gavl_frame_table_append_timecode
GAVL_PUBLIC void gavl_frame_table_append_timecode(gavl_frame_table_t *t, int64_t pts, gavl_timecode_t tc)
Append a timecodes.
gavl_frame_table_create_audio
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_create_audio(int samplerate, int64_t offset, int64_t duration, gavl_timecode_format_t *fmt_ret)
Create a frame table for an audio stream.
gavl_frame_table_timecode_to_time
GAVL_PUBLIC int64_t gavl_frame_table_timecode_to_time(const gavl_frame_table_t *t, gavl_timecode_t tc, const gavl_timecode_format_t *fmt)
Convert a timecode to a timestamp.
gavl_frame_table_copy
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_copy(const gavl_frame_table_t *tab)
Copy a frame table to another.
gavl_rectangle_f_crop_bottom
GAVL_PUBLIC void gavl_rectangle_f_crop_bottom(gavl_rectangle_f_t *r, double num_pixels)
Crop a float rectangle by some pixels from the bottom border.
gavl_rectangle_f_is_empty
GAVL_PUBLIC int gavl_rectangle_f_is_empty(const gavl_rectangle_f_t *r)
Check if a float rectangle is empty.
gavl_rectangle_i_is_empty
GAVL_PUBLIC int gavl_rectangle_i_is_empty(const gavl_rectangle_i_t *r)
Check if an integer rectangle is empty.
gavl_rectangle_f_crop_left
GAVL_PUBLIC void gavl_rectangle_f_crop_left(gavl_rectangle_f_t *r, double num_pixels)
Crop a float rectangle by some pixels from the left border.
gavl_rectangle_i_align
GAVL_PUBLIC void gavl_rectangle_i_align(gavl_rectangle_i_t *r, int h_align, int v_align)
Align a rectangle.
gavl_rectangle_crop_to_format_scale
GAVL_PUBLIC void gavl_rectangle_crop_to_format_scale(gavl_rectangle_f_t *src_rect, gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format)
Crop 2 rectangles to their formats when scaling is available.
gavl_rectangle_i_copy
GAVL_PUBLIC void gavl_rectangle_i_copy(gavl_rectangle_i_t *dst, const gavl_rectangle_i_t *src)
Copy an integer rectangle.
gavl_rectangle_f_crop_right
GAVL_PUBLIC void gavl_rectangle_f_crop_right(gavl_rectangle_f_t *r, double num_pixels)
Crop a float rectangle by some pixels from the right border.
gavl_rectangle_i_dump
GAVL_PUBLIC void gavl_rectangle_i_dump(const gavl_rectangle_i_t *r)
Dump a rectangle to stderr.
gavl_rectangle_i_crop_top
GAVL_PUBLIC void gavl_rectangle_i_crop_top(gavl_rectangle_i_t *r, int num_pixels)
Crop an integer rectangle by some pixels from the top border.
gavl_rectangle_i_crop_to_format
GAVL_PUBLIC void gavl_rectangle_i_crop_to_format(gavl_rectangle_i_t *r, const gavl_video_format_t *format)
Crop an integer rectangle so it fits into the image size of a video format.
gavl_rectangle_crop_to_format_noscale
GAVL_PUBLIC void gavl_rectangle_crop_to_format_noscale(gavl_rectangle_i_t *src_rect, gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format)
Set 2 rectangles as source and destination when no scaling is available.
gavl_rectangle_fit_aspect
GAVL_PUBLIC void gavl_rectangle_fit_aspect(gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_rectangle_f_t *src_rect, const gavl_video_format_t *dst_format, float zoom, float squeeze)
Calculate a destination rectangle for scaling.
gavl_rectangle_i_to_f
GAVL_PUBLIC void gavl_rectangle_i_to_f(gavl_rectangle_f_t *dst, const gavl_rectangle_i_t *src)
Convert an integer rectangle to a floating point rectangle.
gavl_rectangle_i_set_all
GAVL_PUBLIC void gavl_rectangle_i_set_all(gavl_rectangle_i_t *r, const gavl_video_format_t *format)
Let an integer rectangle span the whole image size of a video format.
gavl_rectangle_f_set_all
GAVL_PUBLIC void gavl_rectangle_f_set_all(gavl_rectangle_f_t *r, const gavl_video_format_t *format)
Let a float rectangle span the whole image size of a video format.
gavl_rectangle_f_copy
GAVL_PUBLIC void gavl_rectangle_f_copy(gavl_rectangle_f_t *dst, const gavl_rectangle_f_t *src)
Copy a float rectangle.
gavl_rectangle_f_to_i
GAVL_PUBLIC void gavl_rectangle_f_to_i(gavl_rectangle_i_t *dst, const gavl_rectangle_f_t *src)
Convert a floating point rectangle to an integer rectangle.
gavl_rectangle_f_crop_top
GAVL_PUBLIC void gavl_rectangle_f_crop_top(gavl_rectangle_f_t *r, double num_pixels)
Crop a float rectangle by some pixels from the top border.
gavl_rectangle_f_dump
GAVL_PUBLIC void gavl_rectangle_f_dump(const gavl_rectangle_f_t *r)
Dump a floating point rectangle to stderr.
gavl_rectangle_i_crop_bottom
GAVL_PUBLIC void gavl_rectangle_i_crop_bottom(gavl_rectangle_i_t *r, int num_pixels)
Crop an integer rectangle by some pixels from the bottom border.
gavl_rectangle_i_align_to_format
GAVL_PUBLIC void gavl_rectangle_i_align_to_format(gavl_rectangle_i_t *r, const gavl_video_format_t *format)
Align a rectangle to a format.
gavl_rectangle_f_crop_to_format
GAVL_PUBLIC void gavl_rectangle_f_crop_to_format(gavl_rectangle_f_t *r, const gavl_video_format_t *format)
Crop a floating point rectangle so it fits into the image size of a video format.
gavl_rectangle_i_crop_left
GAVL_PUBLIC void gavl_rectangle_i_crop_left(gavl_rectangle_i_t *r, int num_pixels)
Crop an integer rectangle by some pixels from the left border.
gavl_rectangle_i_crop_right
GAVL_PUBLIC void gavl_rectangle_i_crop_right(gavl_rectangle_i_t *r, int num_pixels)
Crop an integer rectangle by some pixels from the right border.
gavl_video_sink_t
struct gavl_video_sink_s gavl_video_sink_t
Video sink.
Definition gavl.h:83
gavl_audio_sink_t
struct gavl_audio_sink_s gavl_audio_sink_t
Audio sink.
Definition gavl.h:74
gavl_packet_sink_t
struct gavl_packet_sink_s gavl_packet_sink_t
Packet sink.
Definition gavl.h:92
gavl_video_source_t
struct gavl_video_source_s gavl_video_source_t
Forward declaration of the video source.
Definition gavl.h:50
gavl_audio_source_t
struct gavl_audio_source_s gavl_audio_source_t
Forward declaration of the audio source.
Definition gavl.h:58
gavl_packet_source_t
struct gavl_packet_source_s gavl_packet_source_t
Forward declaration of the packet source.
Definition gavl.h:66
gavl_timecode_t
uint64_t gavl_timecode_t
Typedef for timecodes.
Definition timecode.h:44
gavl_overlay_blend
GAVL_PUBLIC void gavl_overlay_blend(gavl_overlay_blend_context_t *ctx, gavl_video_frame_t *dst_frame)
Blend overlay onto video frame.
gavl_overlay_blend_context_create
GAVL_PUBLIC gavl_overlay_blend_context_t * gavl_overlay_blend_context_create(void)
Create a blend context.
gavl_overlay_blend_context_set_overlay
GAVL_PUBLIC void gavl_overlay_blend_context_set_overlay(gavl_overlay_blend_context_t *ctx, gavl_overlay_t *ovl)
Set a new overlay.
gavl_overlay_t
gavl_video_frame_t gavl_overlay_t
Overlay structure.
Definition gavl.h:3870
gavl_overlay_blend_context_init
GAVL_PUBLIC int gavl_overlay_blend_context_init(gavl_overlay_blend_context_t *ctx, const gavl_video_format_t *frame_format, gavl_video_format_t *overlay_format)
Initialize the blend context.
gavl_overlay_blend_context_t
struct gavl_overlay_blend_context_s gavl_overlay_blend_context_t
Opaque blend context.
Definition gavl.h:3878
gavl_overlay_blend_context_destroy
GAVL_PUBLIC void gavl_overlay_blend_context_destroy(gavl_overlay_blend_context_t *ctx)
Destroy a blend context and free all associated memory.
gavl_overlay_blend_context_get_sink
GAVL_PUBLIC gavl_video_sink_t * gavl_overlay_blend_context_get_sink(gavl_overlay_blend_context_t *ctx)
Get the sink for overlays.
gavl_overlay_blend_context_get_options
GAVL_PUBLIC gavl_video_options_t * gavl_overlay_blend_context_get_options(gavl_overlay_blend_context_t *ctx)
Get options from a blend context.
gavl_video_converter_init
GAVL_PUBLIC int gavl_video_converter_init(gavl_video_converter_t *cnv, const gavl_video_format_t *input_format, const gavl_video_format_t *output_format)
Initialize a video converter.
gavl_video_converter_create
GAVL_PUBLIC gavl_video_converter_t * gavl_video_converter_create(void)
Creates a video converter.
gavl_video_converter_t
struct gavl_video_converter_s gavl_video_converter_t
Opaque video converter structure.
Definition gavl.h:3562
gavl_video_convert
GAVL_PUBLIC void gavl_video_convert(gavl_video_converter_t *cnv, const gavl_video_frame_t *input_frame, gavl_video_frame_t *output_frame)
Convert video.
gavl_video_converter_reinit
GAVL_PUBLIC int gavl_video_converter_reinit(gavl_video_converter_t *cnv)
Reinitialize a video converter.
gavl_video_converter_destroy
GAVL_PUBLIC void gavl_video_converter_destroy(gavl_video_converter_t *cnv)
Destroys a video converter and frees all associated memory.
gavl_video_converter_get_options
GAVL_PUBLIC gavl_video_options_t * gavl_video_converter_get_options(gavl_video_converter_t *cnv)
gets options of a video converter
gavl_video_deinterlacer_init
GAVL_PUBLIC int gavl_video_deinterlacer_init(gavl_video_deinterlacer_t *deinterlacer, const gavl_video_format_t *src_format)
Initialize a video deinterlacer.
gavl_video_deinterlacer_create
GAVL_PUBLIC gavl_video_deinterlacer_t * gavl_video_deinterlacer_create(void)
Create a video deinterlacer.
gavl_video_deinterlacer_t
struct gavl_video_deinterlacer_s gavl_video_deinterlacer_t
Opaque deinterlacer structure.
Definition gavl.h:3779
gavl_video_deinterlacer_destroy
GAVL_PUBLIC void gavl_video_deinterlacer_destroy(gavl_video_deinterlacer_t *deinterlacer)
Destroy a video deinterlacer.
gavl_video_deinterlacer_get_options
GAVL_PUBLIC gavl_video_options_t * gavl_video_deinterlacer_get_options(gavl_video_deinterlacer_t *deinterlacer)
gets options of a deinterlacer
gavl_video_deinterlacer_deinterlace
GAVL_PUBLIC void gavl_video_deinterlacer_deinterlace(gavl_video_deinterlacer_t *deinterlacer, const gavl_video_frame_t *input_frame, gavl_video_frame_t *output_frame)
Deinterlace video.
gavl_video_format_set_frame_size
GAVL_PUBLIC void gavl_video_format_set_frame_size(gavl_video_format_t *format, int pad_h, int pad_v)
Set the frame size from the image size.
GAVL_PIXFMT_PLANAR
#define GAVL_PIXFMT_PLANAR
Definition gavl.h:1784
GAVL_PIXFMT_ALPHA
#define GAVL_PIXFMT_ALPHA
Definition gavl.h:1804
gavl_video_format_t
struct gavl_video_format_s gavl_video_format_t
Video format.
Definition gavl.h:102
gavl_pixelformat_conversion_penalty
GAVL_PUBLIC int gavl_pixelformat_conversion_penalty(gavl_pixelformat_t src, gavl_pixelformat_t dst)
Get the conversion penalty for pixelformat conversions.
gavl_pixelformat_bytes_per_pixel
GAVL_PUBLIC int gavl_pixelformat_bytes_per_pixel(gavl_pixelformat_t pixelformat)
Get bytes per pixel for packed formats.
gavl_chroma_placement_t
gavl_chroma_placement_t
Chroma placement.
Definition gavl.h:2249
GAVL_PIXFMT_GRAY
#define GAVL_PIXFMT_GRAY
Definition gavl.h:1809
gavl_get_color_channel_format
GAVL_PUBLIC int gavl_get_color_channel_format(const gavl_video_format_t *frame_format, gavl_video_format_t *channel_format, gavl_color_channel_t ch)
Get the video format for extracting/merging one channel.
gavl_framerate_mode_t
gavl_framerate_mode_t
Framerate mode.
Definition gavl.h:2290
gavl_pixelformat_e
gavl_pixelformat_e
Pixelformat definition.
Definition gavl.h:1816
gavl_short_string_to_framerate_mode
GAVL_PUBLIC gavl_framerate_mode_t gavl_short_string_to_framerate_mode(const char *mode)
Translate a short string into a framerate mode.
gavl_video_formats_equal
GAVL_PUBLIC int gavl_video_formats_equal(const gavl_video_format_t *format_1, const gavl_video_format_t *format_2)
Compare 2 video formats.
gavl_video_format_get_chroma_offset
GAVL_PUBLIC void gavl_video_format_get_chroma_offset(const gavl_video_format_t *format, int field, int plane, float *off_x, float *off_y)
Get the chroma offsets relative to the luma samples.
gavl_pixelformat_to_string
GAVL_PUBLIC const char * gavl_pixelformat_to_string(gavl_pixelformat_t pixelformat)
Translate a pixelformat into a human readable string.
gavl_num_pixelformats
GAVL_PUBLIC int gavl_num_pixelformats(void)
Get total number of supported pixelformats.
gavl_video_format_dump
GAVL_PUBLIC void gavl_video_format_dump(const gavl_video_format_t *format)
Dump a video format to stderr.
gavl_video_format_get_image_size
GAVL_PUBLIC int gavl_video_format_get_image_size(const gavl_video_format_t *format)
Get the unpadded image size.
gavl_get_pixelformat
GAVL_PUBLIC gavl_pixelformat_t gavl_get_pixelformat(int index)
Get the pixelformat from index.
gavl_interlace_mode_to_short_string
GAVL_PUBLIC const char * gavl_interlace_mode_to_short_string(gavl_interlace_mode_t mode)
Translate an interlace mode into a short string.
gavl_pixelformat_get_channel
GAVL_PUBLIC gavl_color_channel_t gavl_pixelformat_get_channel(gavl_pixelformat_t pixelformat, int index)
Get the color channel.
gavl_interlace_mode_to_string
GAVL_PUBLIC const char * gavl_interlace_mode_to_string(gavl_interlace_mode_t mode)
Translate an interlace mode into a human readable string.
gavl_pixelformat_t
enum gavl_pixelformat_e gavl_pixelformat_t
Pixelformat.
Definition gavl.h:1951
gavl_short_string_to_pixelformat
GAVL_PUBLIC gavl_pixelformat_t gavl_short_string_to_pixelformat(const char *name)
Translate a short pixelformat name into a pixelformat.
gavl_chroma_placement_to_string
GAVL_PUBLIC const char * gavl_chroma_placement_to_string(gavl_chroma_placement_t mode)
Translate a chroma placement into a human readable string.
gavl_pixelformat_get_masks
GAVL_PUBLIC const uint32_t * gavl_pixelformat_get_masks(gavl_pixelformat_t pixelformat)
Get the masks for the components.
gavl_chroma_placement_to_short_string
GAVL_PUBLIC const char * gavl_chroma_placement_to_short_string(gavl_chroma_placement_t mode)
Translate a chroma placement into a short string.
gavl_string_to_pixelformat
GAVL_PUBLIC gavl_pixelformat_t gavl_string_to_pixelformat(const char *name)
Translate a pixelformat name into a pixelformat.
gavl_interlace_mode_t
gavl_interlace_mode_t
Interlace mode.
Definition gavl.h:2331
GAVL_PIXFMT_RGB
#define GAVL_PIXFMT_RGB
Definition gavl.h:1789
gavl_framerate_mode_to_string
GAVL_PUBLIC const char * gavl_framerate_mode_to_string(gavl_framerate_mode_t mode)
Translate a framerate mode into a human readable string.
gavl_pixelformat_bits_per_pixel
GAVL_PUBLIC int gavl_pixelformat_bits_per_pixel(gavl_pixelformat_t pixelformat)
Get the effective number of bits for one pixel.
GAVL_PIXFMT_YUV
#define GAVL_PIXFMT_YUV
Definition gavl.h:1794
gavl_pixelformat_num_planes
GAVL_PUBLIC int gavl_pixelformat_num_planes(gavl_pixelformat_t pixelformat)
Get the number of planes.
gavl_color_channel_t
gavl_color_channel_t
Color channel definitions.
Definition gavl.h:1999
GAVL_PIXFMT_YUVJ
#define GAVL_PIXFMT_YUVJ
Definition gavl.h:1799
gavl_video_format_fit_to_source
GAVL_PUBLIC void gavl_video_format_fit_to_source(gavl_video_format_t *dst, const gavl_video_format_t *src)
Set the image size of a destination format from a source format.
gavl_pixelformat_to_short_string
GAVL_PUBLIC const char * gavl_pixelformat_to_short_string(gavl_pixelformat_t pixelformat)
Translate a pixelformat into a short string.
gavl_video_format_copy
GAVL_PUBLIC void gavl_video_format_copy(gavl_video_format_t *dst, const gavl_video_format_t *src)
Copy one video format to another.
gavl_pixelformat_get_best
GAVL_PUBLIC gavl_pixelformat_t gavl_pixelformat_get_best(gavl_pixelformat_t src, const gavl_pixelformat_t *dst_supported, int *penalty)
Get the best destination format for a given source format.
gavl_video_format_dumpi
GAVL_PUBLIC void gavl_video_format_dumpi(const gavl_video_format_t *format, int indent)
Dump a video format to stderr.
gavl_pixelformat_bytes_per_component
GAVL_PUBLIC int gavl_pixelformat_bytes_per_component(gavl_pixelformat_t pixelformat)
Get bytes per component for planar formats.
gavl_short_string_to_interlace_mode
GAVL_PUBLIC gavl_interlace_mode_t gavl_short_string_to_interlace_mode(const char *mode)
Translate a short string to an interlace mode.
gavl_pixelformat_num_channels
GAVL_PUBLIC int gavl_pixelformat_num_channels(gavl_pixelformat_t pixelformat)
Get the number of channels.
gavl_interlace_mode_is_mixed
GAVL_PUBLIC int gavl_interlace_mode_is_mixed(gavl_interlace_mode_t mode)
Check if an interlace mode is mixed.
gavl_framerate_mode_to_short_string
GAVL_PUBLIC const char * gavl_framerate_mode_to_short_string(gavl_framerate_mode_t mode)
Translate a framerate mode into a short string.
gavl_get_field_format
GAVL_PUBLIC void gavl_get_field_format(const gavl_video_format_t *frame_format, gavl_video_format_t *field_format, int field)
Get the video format of one field.
gavl_short_string_to_chroma_placement
GAVL_PUBLIC gavl_chroma_placement_t gavl_short_string_to_chroma_placement(const char *mode)
Translate a short string into a chroma placement.
gavl_pixelformat_chroma_sub
GAVL_PUBLIC void gavl_pixelformat_chroma_sub(gavl_pixelformat_t pixelformat, int *sub_h, int *sub_v)
Get the horizontal and vertical subsampling factors.
GAVL_CHROMA_PLACEMENT_DVPAL
@ GAVL_CHROMA_PLACEMENT_DVPAL
Definition gavl.h:2252
GAVL_CHROMA_PLACEMENT_MPEG2
@ GAVL_CHROMA_PLACEMENT_MPEG2
Definition gavl.h:2251
GAVL_CHROMA_PLACEMENT_DEFAULT
@ GAVL_CHROMA_PLACEMENT_DEFAULT
Definition gavl.h:2250
GAVL_FRAMERATE_UNKNOWN
@ GAVL_FRAMERATE_UNKNOWN
Definition gavl.h:2291
GAVL_FRAMERATE_CONSTANT
@ GAVL_FRAMERATE_CONSTANT
Definition gavl.h:2292
GAVL_FRAMERATE_STILL
@ GAVL_FRAMERATE_STILL
Definition gavl.h:2294
GAVL_FRAMERATE_VARIABLE
@ GAVL_FRAMERATE_VARIABLE
Definition gavl.h:2293
GAVL_YUVJ_420_P
@ GAVL_YUVJ_420_P
Definition gavl.h:1930
GAVL_YUV_422_P
@ GAVL_YUV_422_P
Definition gavl.h:1917
GAVL_BGR_24
@ GAVL_BGR_24
Definition gavl.h:1866
GAVL_YUV_410_P
@ GAVL_YUV_410_P
Definition gavl.h:1926
GAVL_RGB_48
@ GAVL_RGB_48
Definition gavl.h:1879
GAVL_RGB_32
@ GAVL_RGB_32
Definition gavl.h:1869
GAVL_YUV_420_P
@ GAVL_YUV_420_P
Definition gavl.h:1914
GAVL_GRAYA_32
@ GAVL_GRAYA_32
Definition gavl.h:1839
GAVL_YUVA_32
@ GAVL_YUVA_32
Definition gavl.h:1899
GAVL_RGB_16
@ GAVL_RGB_16
Definition gavl.h:1856
GAVL_UYVY
@ GAVL_UYVY
Definition gavl.h:1896
GAVL_YUV_422_P_16
@ GAVL_YUV_422_P_16
Definition gavl.h:1943
GAVL_YUV_444_P
@ GAVL_YUV_444_P
Definition gavl.h:1920
GAVL_RGB_FLOAT
@ GAVL_RGB_FLOAT
Definition gavl.h:1886
GAVL_YUVJ_422_P
@ GAVL_YUVJ_422_P
Definition gavl.h:1933
GAVL_GRAY_8
@ GAVL_GRAY_8
Definition gavl.h:1823
GAVL_RGB_24
@ GAVL_RGB_24
Definition gavl.h:1863
GAVL_RGBA_64
@ GAVL_RGBA_64
Definition gavl.h:1882
GAVL_YUY2
@ GAVL_YUY2
Definition gavl.h:1893
GAVL_YUVA_FLOAT
@ GAVL_YUVA_FLOAT
Definition gavl.h:1909
GAVL_YUVJ_444_P
@ GAVL_YUVJ_444_P
Definition gavl.h:1936
GAVL_GRAYA_FLOAT
@ GAVL_GRAYA_FLOAT
Definition gavl.h:1843
GAVL_BGR_15
@ GAVL_BGR_15
Definition gavl.h:1852
GAVL_YUV_444_P_16
@ GAVL_YUV_444_P_16
Definition gavl.h:1940
GAVL_PIXELFORMAT_NONE
@ GAVL_PIXELFORMAT_NONE
Undefined.
Definition gavl.h:1819
GAVL_GRAYA_16
@ GAVL_GRAYA_16
Definition gavl.h:1835
GAVL_YUV_411_P
@ GAVL_YUV_411_P
Definition gavl.h:1923
GAVL_GRAY_FLOAT
@ GAVL_GRAY_FLOAT
Definition gavl.h:1831
GAVL_YUV_FLOAT
@ GAVL_YUV_FLOAT
Definition gavl.h:1905
GAVL_RGBA_32
@ GAVL_RGBA_32
Definition gavl.h:1875
GAVL_GRAY_16
@ GAVL_GRAY_16
Definition gavl.h:1827
GAVL_BGR_16
@ GAVL_BGR_16
Definition gavl.h:1860
GAVL_YUVA_64
@ GAVL_YUVA_64
Definition gavl.h:1902
GAVL_RGB_15
@ GAVL_RGB_15
Definition gavl.h:1848
GAVL_RGBA_FLOAT
@ GAVL_RGBA_FLOAT
Definition gavl.h:1889
GAVL_BGR_32
@ GAVL_BGR_32
Definition gavl.h:1872
GAVL_INTERLACE_MIXED_BOTTOM
@ GAVL_INTERLACE_MIXED_BOTTOM
Definition gavl.h:2338
GAVL_INTERLACE_MIXED_TOP
@ GAVL_INTERLACE_MIXED_TOP
Definition gavl.h:2337
GAVL_INTERLACE_NONE
@ GAVL_INTERLACE_NONE
Definition gavl.h:2333
GAVL_INTERLACE_BOTTOM_FIRST
@ GAVL_INTERLACE_BOTTOM_FIRST
Definition gavl.h:2335
GAVL_INTERLACE_UNKNOWN
@ GAVL_INTERLACE_UNKNOWN
Definition gavl.h:2332
GAVL_INTERLACE_MIXED
@ GAVL_INTERLACE_MIXED
Definition gavl.h:2336
GAVL_INTERLACE_TOP_FIRST
@ GAVL_INTERLACE_TOP_FIRST
Definition gavl.h:2334
GAVL_CCH_NONE
@ GAVL_CCH_NONE
None/undefined.
Definition gavl.h:2000
GAVL_CCH_Y
@ GAVL_CCH_Y
Luminance (also grayscale).
Definition gavl.h:2004
GAVL_CCH_RED
@ GAVL_CCH_RED
Red.
Definition gavl.h:2001
GAVL_CCH_CR
@ GAVL_CCH_CR
Chrominance red (aka V).
Definition gavl.h:2006
GAVL_CCH_GREEN
@ GAVL_CCH_GREEN
Green.
Definition gavl.h:2002
GAVL_CCH_ALPHA
@ GAVL_CCH_ALPHA
Transparency (or, to be more precise opacity).
Definition gavl.h:2007
GAVL_CCH_CB
@ GAVL_CCH_CB
Chrominance blue (aka U).
Definition gavl.h:2005
GAVL_CCH_BLUE
@ GAVL_CCH_BLUE
Blue.
Definition gavl.h:2003
gavl_video_frame_pool_create
GAVL_PUBLIC gavl_video_frame_pool_t * gavl_video_frame_pool_create(gavl_hw_context_t *hwctx)
Create a video frame pool.
gavl_video_frame_pool_get
GAVL_PUBLIC gavl_video_frame_t * gavl_video_frame_pool_get(gavl_video_frame_pool_t *p)
Create a video frame pool.
gavl_video_frame_pool_t
struct gavl_video_frame_pool_s gavl_video_frame_pool_t
Video frame pool.
Definition gavl.h:4356
gavl_video_frame_pool_destroy
GAVL_PUBLIC void gavl_video_frame_pool_destroy(gavl_video_frame_pool_t *p)
Destroy a video frame pool.
gavl_video_frame_pool_reset
GAVL_PUBLIC void gavl_video_frame_pool_reset(gavl_video_frame_pool_t *p)
Reset a video frame pool.
gavl_video_frame_copy
GAVL_PUBLIC void gavl_video_frame_copy(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy one video frame to another.
gavl_video_frame_copy_plane
GAVL_PUBLIC void gavl_video_frame_copy_plane(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src, int plane)
Copy a single plane from one video frame to another.
gavl_video_frame_destroy
GAVL_PUBLIC void gavl_video_frame_destroy(gavl_video_frame_t *frame)
Destroy a video frame.
gavl_video_frame_copy_flip_x
GAVL_PUBLIC void gavl_video_frame_copy_flip_x(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy one video frame to another with horizontal flipping.
gavl_video_frame_set_strides
GAVL_PUBLIC void gavl_video_frame_set_strides(gavl_video_frame_t *frame, const gavl_video_format_t *format)
Set the strides according to the format.
gavl_video_frame_insert_channel
GAVL_PUBLIC int gavl_video_frame_insert_channel(const gavl_video_format_t *format, gavl_color_channel_t ch, const gavl_video_frame_t *src, gavl_video_frame_t *dst)
Insert one channel from a grayscale image into a video frame.
gavl_video_frame_set_planes
GAVL_PUBLIC void gavl_video_frame_set_planes(gavl_video_frame_t *frame, const gavl_video_format_t *format, uint8_t *buffer)
Set the frames according to the format.
gavl_video_frame_copy_flip_xy
GAVL_PUBLIC void gavl_video_frame_copy_flip_xy(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy one video frame to another with horizontal and vertical flipping.
gavl_video_frame_get_subframe
GAVL_PUBLIC void gavl_video_frame_get_subframe(gavl_pixelformat_t pixelformat, const gavl_video_frame_t *src, gavl_video_frame_t *dst, const gavl_rectangle_i_t *src_rect)
Get a subframe of another frame.
gavl_video_frame_copy_metadata
GAVL_PUBLIC void gavl_video_frame_copy_metadata(gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy metadata of one video frame to another.
gavl_video_frame_fill
GAVL_PUBLIC void gavl_video_frame_fill(gavl_video_frame_t *frame, const gavl_video_format_t *format, const float *color)
Fill the frame with a user specified color.
gavl_video_frame_dump
GAVL_PUBLIC void gavl_video_frame_dump(gavl_video_frame_t *frame, const gavl_video_format_t *format, const char *namebase)
Dump a video frame to files.
gavl_video_frame_copy_flip_y
GAVL_PUBLIC void gavl_video_frame_copy_flip_y(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy one video frame to another with vertical flipping.
gavl_video_frame_get_field
GAVL_PUBLIC void gavl_video_frame_get_field(gavl_pixelformat_t pixelformat, const gavl_video_frame_t *src, gavl_video_frame_t *dst, int field)
Get a field from a frame.
gavl_video_frame_psnr
GAVL_PUBLIC void gavl_video_frame_psnr(double *psnr, const gavl_video_frame_t *src1, const gavl_video_frame_t *src2, const gavl_video_format_t *format)
Calculate the PSNR of 2 source frames.
gavl_video_frame_absdiff
GAVL_PUBLIC void gavl_video_frame_absdiff(gavl_video_frame_t *dst, const gavl_video_frame_t *src1, const gavl_video_frame_t *src2, const gavl_video_format_t *format)
Fill the frame with the absolute difference of 2 source frames.
gavl_video_frame_ssim
GAVL_PUBLIC int gavl_video_frame_ssim(const gavl_video_frame_t *src1, const gavl_video_frame_t *src2, gavl_video_frame_t *dst, const gavl_video_format_t *format)
Calculate the SSIM of 2 source frames.
gavl_video_frame_extract_channel
GAVL_PUBLIC int gavl_video_frame_extract_channel(const gavl_video_format_t *format, gavl_color_channel_t ch, const gavl_video_frame_t *src, gavl_video_frame_t *dst)
Extract one channel of a video frame into a grayscale image.
gavl_video_frame_create
GAVL_PUBLIC gavl_video_frame_t * gavl_video_frame_create(const gavl_video_format_t *format)
Create video frame.
gavl_video_frame_null
GAVL_PUBLIC void gavl_video_frame_null(gavl_video_frame_t *frame)
Zero all pointers in the video frame.
gavl_video_frame_clear
GAVL_PUBLIC void gavl_video_frame_clear(gavl_video_frame_t *frame, const gavl_video_format_t *format)
Fill the frame with black color.
gavl_video_frame_continuous
GAVL_PUBLIC int gavl_video_frame_continuous(const gavl_video_format_t *format, const gavl_video_frame_t *frame)
Check if a video frame uses a continuous memory block.
gavl_video_frames_equal
GAVL_PUBLIC int gavl_video_frames_equal(const gavl_video_format_t *format, const gavl_video_frame_t *f1, const gavl_video_frame_t *f2)
Check if 2 video frames are bit-identical.
gavl_video_frame_create_nopad
GAVL_PUBLIC gavl_video_frame_t * gavl_video_frame_create_nopad(const gavl_video_format_t *format)
Create video frame without padding.
gavl_video_frame_dump_metadata
GAVL_PUBLIC void gavl_video_frame_dump_metadata(const gavl_video_format_t *format, const gavl_video_frame_t *frame)
Dump a metadata of a video frame.
gavl_video_options_set_quality
GAVL_PUBLIC void gavl_video_options_set_quality(gavl_video_options_t *opt, int quality)
Set the quality level for the converter.
gavl_video_options_set_alpha_mode
GAVL_PUBLIC void gavl_video_options_set_alpha_mode(gavl_video_options_t *opt, gavl_alpha_mode_t alpha_mode)
Set the alpha mode.
gavl_video_options_get_rectangles
GAVL_PUBLIC void gavl_video_options_get_rectangles(const gavl_video_options_t *opt, gavl_rectangle_f_t *src_rect, gavl_rectangle_i_t *dst_rect)
Get source and destination rectangles.
gavl_video_options_get_background_color
GAVL_PUBLIC void gavl_video_options_get_background_color(const gavl_video_options_t *opt, double *color)
Get the background color for alpha blending.
gavl_video_options_get_alpha_mode
GAVL_PUBLIC gavl_alpha_mode_t gavl_video_options_get_alpha_mode(const gavl_video_options_t *opt)
Get the alpha mode.
gavl_video_options_set_rectangles
GAVL_PUBLIC void gavl_video_options_set_rectangles(gavl_video_options_t *opt, const gavl_rectangle_f_t *src_rect, const gavl_rectangle_i_t *dst_rect)
Set source and destination rectangles.
gavl_video_options_destroy
GAVL_PUBLIC void gavl_video_options_destroy(gavl_video_options_t *opt)
Destroy video options.
gavl_video_options_get_quality
GAVL_PUBLIC int gavl_video_options_get_quality(const gavl_video_options_t *opt)
Get the quality level for the converter.
gavl_video_options_set_scale_mode
GAVL_PUBLIC void gavl_video_options_set_scale_mode(gavl_video_options_t *opt, gavl_scale_mode_t scale_mode)
Set the scale mode.
gavl_deinterlace_mode_t
gavl_deinterlace_mode_t
Definition gavl.h:3171
gavl_video_options_get_deinterlace_drop_mode
GAVL_PUBLIC gavl_deinterlace_drop_mode_t gavl_video_options_get_deinterlace_drop_mode(const gavl_video_options_t *opt)
Get the deinterlace drop mode.
gavl_video_options_copy
GAVL_PUBLIC void gavl_video_options_copy(gavl_video_options_t *dst, const gavl_video_options_t *src)
Copy video options.
gavl_deinterlace_drop_mode_t
gavl_deinterlace_drop_mode_t
Specifies which field to drop when deinterlacing.
Definition gavl.h:3185
gavl_video_options_t
struct gavl_video_options_s gavl_video_options_t
Definition gavl.h:3230
gavl_video_options_get_scale_order
GAVL_PUBLIC int gavl_video_options_get_scale_order(const gavl_video_options_t *opt)
Get the scale order for GAVL_SCALE_SINC_LANCZOS.
gavl_video_options_get_downscale_blur
GAVL_PUBLIC float gavl_video_options_get_downscale_blur(const gavl_video_options_t *opt)
Get blur factor for downscaling.
gavl_alpha_mode_t
gavl_alpha_mode_t
Definition gavl.h:3159
gavl_video_options_set_deinterlace_drop_mode
GAVL_PUBLIC void gavl_video_options_set_deinterlace_drop_mode(gavl_video_options_t *opt, gavl_deinterlace_drop_mode_t deinterlace_drop_mode)
Set the deinterlace drop mode.
gavl_video_options_get_downscale_filter
GAVL_PUBLIC gavl_downscale_filter_t gavl_video_options_get_downscale_filter(const gavl_video_options_t *opt)
Get the antialiasing filter for downscaling.
gavl_video_options_create
GAVL_PUBLIC gavl_video_options_t * gavl_video_options_create(void)
Create an options container.
gavl_video_options_set_defaults
GAVL_PUBLIC void gavl_video_options_set_defaults(gavl_video_options_t *opt)
Set all options to their defaults.
gavl_video_options_set_conversion_flags
GAVL_PUBLIC void gavl_video_options_set_conversion_flags(gavl_video_options_t *opt, int conversion_flags)
Set the conversion flags.
gavl_scale_mode_t
gavl_scale_mode_t
Definition gavl.h:3195
gavl_video_options_set_downscale_blur
GAVL_PUBLIC void gavl_video_options_set_downscale_blur(gavl_video_options_t *opt, float f)
Set blur factor for downscaling.
gavl_video_options_set_background_color
GAVL_PUBLIC void gavl_video_options_set_background_color(gavl_video_options_t *opt, const double *color)
Set the background color for alpha blending.
gavl_video_options_set_downscale_filter
GAVL_PUBLIC void gavl_video_options_set_downscale_filter(gavl_video_options_t *opt, gavl_downscale_filter_t f)
Set antialiasing filter for downscaling.
gavl_video_options_get_conversion_flags
GAVL_PUBLIC int gavl_video_options_get_conversion_flags(const gavl_video_options_t *opt)
Get the conversion flags.
gavl_video_options_set_scale_order
GAVL_PUBLIC void gavl_video_options_set_scale_order(gavl_video_options_t *opt, int order)
Set the scale order for GAVL_SCALE_SINC_LANCZOS.
gavl_downscale_filter_t
gavl_downscale_filter_t
Definition gavl.h:3217
gavl_video_options_get_scale_mode
GAVL_PUBLIC gavl_scale_mode_t gavl_video_options_get_scale_mode(const gavl_video_options_t *opt)
Get the scale mode.
GAVL_DEINTERLACE_NONE
@ GAVL_DEINTERLACE_NONE
Definition gavl.h:3172
GAVL_DEINTERLACE_SCALE
@ GAVL_DEINTERLACE_SCALE
Definition gavl.h:3174
GAVL_DEINTERLACE_BLEND
@ GAVL_DEINTERLACE_BLEND
Definition gavl.h:3175
GAVL_DEINTERLACE_COPY
@ GAVL_DEINTERLACE_COPY
Definition gavl.h:3173
GAVL_DEINTERLACE_DROP_TOP
@ GAVL_DEINTERLACE_DROP_TOP
Definition gavl.h:3186
GAVL_DEINTERLACE_DROP_BOTTOM
@ GAVL_DEINTERLACE_DROP_BOTTOM
Definition gavl.h:3187
GAVL_ALPHA_IGNORE
@ GAVL_ALPHA_IGNORE
Definition gavl.h:3160
GAVL_ALPHA_BLEND_COLOR
@ GAVL_ALPHA_BLEND_COLOR
Definition gavl.h:3161
GAVL_SCALE_NONE
@ GAVL_SCALE_NONE
Definition gavl.h:3204
GAVL_SCALE_NEAREST
@ GAVL_SCALE_NEAREST
Definition gavl.h:3197
GAVL_SCALE_CUBIC_MITCHELL
@ GAVL_SCALE_CUBIC_MITCHELL
Definition gavl.h:3201
GAVL_SCALE_AUTO
@ GAVL_SCALE_AUTO
Definition gavl.h:3196
GAVL_SCALE_SINC_LANCZOS
@ GAVL_SCALE_SINC_LANCZOS
Definition gavl.h:3203
GAVL_SCALE_CUBIC_CATMULL
@ GAVL_SCALE_CUBIC_CATMULL
Definition gavl.h:3202
GAVL_SCALE_CUBIC_BSPLINE
@ GAVL_SCALE_CUBIC_BSPLINE
Definition gavl.h:3200
GAVL_SCALE_QUADRATIC
@ GAVL_SCALE_QUADRATIC
Definition gavl.h:3199
GAVL_SCALE_BILINEAR
@ GAVL_SCALE_BILINEAR
Definition gavl.h:3198
GAVL_DOWNSCALE_FILTER_AUTO
@ GAVL_DOWNSCALE_FILTER_AUTO
Auto selection based on quality.
Definition gavl.h:3218
GAVL_DOWNSCALE_FILTER_NONE
@ GAVL_DOWNSCALE_FILTER_NONE
Fastest method, might produce heavy aliasing artifacts.
Definition gavl.h:3219
GAVL_DOWNSCALE_FILTER_WIDE
@ GAVL_DOWNSCALE_FILTER_WIDE
Widen the filter curve according to the scaling ratio.
Definition gavl.h:3220
GAVL_DOWNSCALE_FILTER_GAUSS
@ GAVL_DOWNSCALE_FILTER_GAUSS
Do a Gaussian preblur.
Definition gavl.h:3221
gavl_video_scaler_init
GAVL_PUBLIC int gavl_video_scaler_init(gavl_video_scaler_t *scaler, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format)
Initialize a video scaler.
gavl_video_scaler_destroy
GAVL_PUBLIC void gavl_video_scaler_destroy(gavl_video_scaler_t *scaler)
Destroy a video scaler.
gavl_video_scaler_get_options
GAVL_PUBLIC gavl_video_options_t * gavl_video_scaler_get_options(gavl_video_scaler_t *scaler)
gets options of a scaler
gavl_video_scaler_create
GAVL_PUBLIC gavl_video_scaler_t * gavl_video_scaler_create(void)
Create a video scaler.
gavl_video_scaler_t
struct gavl_video_scaler_s gavl_video_scaler_t
Opaque scaler structure.
Definition gavl.h:3679
gavl_video_scaler_scale
GAVL_PUBLIC void gavl_video_scaler_scale(gavl_video_scaler_t *scaler, const gavl_video_frame_t *input_frame, gavl_video_frame_t *output_frame)
Scale video.
gavl_video_scaler_init_convolve
GAVL_PUBLIC int gavl_video_scaler_init_convolve(gavl_video_scaler_t *scaler, const gavl_video_format_t *format, int h_radius, const float *h_coeffs, int v_radius, const float *v_coeffs)
Initialize a video scaler as a generic convolver.
gavl_image_transform_destroy
GAVL_PUBLIC void gavl_image_transform_destroy(gavl_image_transform_t *t)
Destroy a transformation engine.
gavl_image_transform_create
GAVL_PUBLIC gavl_image_transform_t * gavl_image_transform_create(void)
Create a transformation engine.
gavl_image_transform_init
GAVL_PUBLIC int gavl_image_transform_init(gavl_image_transform_t *t, gavl_video_format_t *format, gavl_image_transform_func func, void *priv)
Initialize a transformation engine.
gavl_image_transform_get_options
GAVL_PUBLIC gavl_video_options_t * gavl_image_transform_get_options(gavl_image_transform_t *t)
Get transformation options.
gavl_image_transform_t
struct gavl_image_transform_s gavl_image_transform_t
Opaque image transformation engine.
Definition gavl.h:3978
gavl_image_transform_func
void(* gavl_image_transform_func)(void *priv, double xdst, double ydst, double *xsrc, double *ysrc)
Function describing the method.
Definition gavl.h:3993
gavl_image_transform_transform
GAVL_PUBLIC void gavl_image_transform_transform(gavl_image_transform_t *t, gavl_video_frame_t *in_frame, gavl_video_frame_t *out_frame)
Transform an image.
GAVL_MAX_PLANES
#define GAVL_MAX_PLANES
Definition gavl.h:1433
gavl_volume_control_set_volume
GAVL_PUBLIC void gavl_volume_control_set_volume(gavl_volume_control_t *ctrl, float volume)
Set volume for a volume control.
gavl_volume_control_apply
GAVL_PUBLIC void gavl_volume_control_apply(gavl_volume_control_t *ctrl, gavl_audio_frame_t *frame)
Apply a volume control for an audio frame.
gavl_volume_to_float
GAVL_PUBLIC float gavl_volume_to_float(int volume, float one, int steps)
Convert an integer audio volume to a float (in dB).
gavl_volume_control_destroy
GAVL_PUBLIC void gavl_volume_control_destroy(gavl_volume_control_t *ctrl)
Destroys a volume control and frees all associated memory.
gavl_volume_control_set_format
GAVL_PUBLIC void gavl_volume_control_set_format(gavl_volume_control_t *ctrl, const gavl_audio_format_t *format)
Set format for a volume control.
gavl_volume_control_t
struct gavl_volume_control_s gavl_volume_control_t
Opaque structure for a volume control.
Definition gavl.h:1351
gavl_volume_control_create
GAVL_PUBLIC gavl_volume_control_t * gavl_volume_control_create(void)
Create volume control.
gavl_volume_to_int
GAVL_PUBLIC int gavl_volume_to_int(float volume, float one, int steps)
Convert an audio volume (in dB) to an integer.
gavl_audio_format_t
Audio Format.
Definition gavl.h:273
gavl_audio_format_t::samples_per_frame
uint32_t samples_per_frame
Definition gavl.h:274
gavl_audio_format_t::samplerate
uint32_t samplerate
Definition gavl.h:275
gavl_audio_format_t::rear_level
float rear_level
Definition gavl.h:281
gavl_audio_format_t::interleave_mode
gavl_interleave_mode_t interleave_mode
Definition gavl.h:278
gavl_audio_format_t::sample_format
gavl_sample_format_t sample_format
Definition gavl.h:277
gavl_audio_format_t::num_channels
uint32_t num_channels
Definition gavl.h:276
gavl_audio_format_t::center_level
float center_level
Definition gavl.h:280
gavl_audio_format_t::channel_locations
gavl_channel_id_t channel_locations[GAVL_MAX_CHANNELS]
Definition gavl.h:283
gavl_audio_frame_t
Generic container for audio samples.
Definition gavl.h:624
gavl_audio_frame_t::channel_stride
int channel_stride
Definition gavl.h:629
gavl_audio_frame_t::samples
gavl_audio_samples_t samples
Definition gavl.h:625
gavl_audio_frame_t::valid_samples
int valid_samples
Definition gavl.h:627
gavl_audio_frame_t::timestamp
int64_t timestamp
Definition gavl.h:628
gavl_audio_frame_t::channels
gavl_audio_channels_t channels
Definition gavl.h:626
gavl_frame_table_t
frame table structure
Definition gavl.h:4088
gavl_frame_table_t::tc
gavl_timecode_t tc
Timecode associated with this timestamp.
Definition gavl.h:4106
gavl_frame_table_t::num_timecodes
int num_timecodes
Number of timecodes.
Definition gavl.h:4100
gavl_frame_table_t::num_frames
int64_t num_frames
Number of frames.
Definition gavl.h:4096
gavl_frame_table_t::duration
int64_t duration
Duration of each of these frames.
Definition gavl.h:4097
gavl_frame_table_t::offset
int64_t offset
Timestamp of the first frame.
Definition gavl.h:4089
gavl_frame_table_t::entries_alloc
int64_t entries_alloc
Number of allocated entries (never touch this).
Definition gavl.h:4092
gavl_frame_table_t::num_entries
int64_t num_entries
Number of entries.
Definition gavl.h:4091
gavl_frame_table_t::pts
int64_t pts
Timestamp of this frame.
Definition gavl.h:4105
gavl_frame_table_t::timecodes_alloc
int timecodes_alloc
Number of allocated timecodes (never touch this).
Definition gavl.h:4101
gavl_packet_s
Packet structure.
Definition compression.h:428
gavl_rectangle_f_t
Floating point rectangle.
Definition gavl.h:1458
gavl_rectangle_f_t::x
double x
Definition gavl.h:1459
gavl_rectangle_f_t::y
double y
Definition gavl.h:1460
gavl_rectangle_f_t::w
double w
Definition gavl.h:1461
gavl_rectangle_f_t::h
double h
Definition gavl.h:1462
gavl_rectangle_i_t
Integer rectangle.
Definition gavl.h:1446
gavl_rectangle_i_t::x
int32_t x
Definition gavl.h:1447
gavl_rectangle_i_t::h
int32_t h
Definition gavl.h:1450
gavl_rectangle_i_t::y
int32_t y
Definition gavl.h:1448
gavl_rectangle_i_t::w
int32_t w
Definition gavl.h:1449
gavl_timecode_format_t
Timecode format.
Definition timecode.h:61
gavl_video_format_s
Video format.
Definition gavl.h:2405
gavl_video_format_s::frame_height
uint32_t frame_height
Definition gavl.h:2407
gavl_video_format_s::chroma_placement
gavl_chroma_placement_t chroma_placement
Definition gavl.h:2424
gavl_video_format_s::hwctx
gavl_hw_context_t * hwctx
Handle for accessing the frames. If NULL, frames are in regular RAM.
Definition gavl.h:2430
gavl_video_format_s::image_height
uint32_t image_height
Definition gavl.h:2410
gavl_video_format_s::pixel_height
uint32_t pixel_height
Definition gavl.h:2415
gavl_video_format_s::frame_width
uint32_t frame_width
Definition gavl.h:2406
gavl_video_format_s::image_width
uint32_t image_width
Definition gavl.h:2409
gavl_video_format_s::timescale
uint32_t timescale
Definition gavl.h:2421
gavl_video_format_s::interlace_mode
gavl_interlace_mode_t interlace_mode
Definition gavl.h:2426
gavl_video_format_s::framerate_mode
gavl_framerate_mode_t framerate_mode
Definition gavl.h:2423
gavl_video_format_s::pixelformat
gavl_pixelformat_t pixelformat
Definition gavl.h:2417
gavl_video_format_s::pixel_width
uint32_t pixel_width
Definition gavl.h:2414
gavl_video_format_s::timecode_format
gavl_timecode_format_t timecode_format
Definition gavl.h:2428
gavl_video_format_s::frame_duration
uint32_t frame_duration
Definition gavl.h:2419
gavl_video_frame_s
Definition gavl.h:2629
gavl_video_frame_s::planes
uint8_t * planes[GAVL_MAX_PLANES]
Definition gavl.h:2630
gavl_video_frame_s::duration
int64_t duration
Definition gavl.h:2635
gavl_video_frame_s::strides
int strides[GAVL_MAX_PLANES]
Definition gavl.h:2631
gavl_video_frame_s::client_data
void * client_data
Definition gavl.h:2633
gavl_video_frame_s::dst_y
int32_t dst_y
y offset in the destination frame. (since 1.5.0) *‍/
Definition gavl.h:2643
gavl_video_frame_s::storage
void * storage
Definition gavl.h:2646
gavl_video_frame_s::timestamp
int64_t timestamp
Definition gavl.h:2634
gavl_video_frame_s::dst_x
int32_t dst_x
x offset in the destination frame. (since 1.5.0) *‍/
Definition gavl.h:2642
gavl_video_frame_s::src_rect
gavl_rectangle_i_t src_rect
Valid rectangle in this frame (since 1.5.0) *‍/.
Definition gavl.h:2641
gavl_video_frame_s::hwctx
gavl_hw_context_t * hwctx
Handle for accessing the frame.
Definition gavl.h:2645
gavl_video_frame_s::interlace_mode
gavl_interlace_mode_t interlace_mode
Definition gavl.h:2636
gavl_video_frame_s::timecode
gavl_timecode_t timecode
Definition gavl.h:2637
gavl_audio_channels_t
Container for noninterleaved audio samples.
Definition gavl.h:592
gavl_audio_channels_t::s_16
int16_t * s_16[GAVL_MAX_CHANNELS]
Definition gavl.h:597
gavl_audio_channels_t::s_32
int32_t * s_32[GAVL_MAX_CHANNELS]
Definition gavl.h:600
gavl_audio_channels_t::f
float * f[GAVL_MAX_CHANNELS]
Definition gavl.h:602
gavl_audio_channels_t::d
double * d[GAVL_MAX_CHANNELS]
Definition gavl.h:603
gavl_audio_channels_t::s_8
int8_t * s_8[GAVL_MAX_CHANNELS]
Definition gavl.h:594
gavl_audio_channels_t::u_8
uint8_t * u_8[GAVL_MAX_CHANNELS]
Definition gavl.h:593
gavl_audio_channels_t::u_32
uint32_t * u_32[GAVL_MAX_CHANNELS]
Definition gavl.h:599
gavl_audio_channels_t::u_16
uint16_t * u_16[GAVL_MAX_CHANNELS]
Definition gavl.h:596
gavl_audio_samples_t
Container for interleaved audio samples.
Definition gavl.h:572
gavl_audio_samples_t::u_32
uint32_t * u_32
Definition gavl.h:579
gavl_audio_samples_t::s_8
int8_t * s_8
Definition gavl.h:574
gavl_audio_samples_t::u_16
uint16_t * u_16
Definition gavl.h:576
gavl_audio_samples_t::s_16
int16_t * s_16
Definition gavl.h:577
gavl_audio_samples_t::u_8
uint8_t * u_8
Definition gavl.h:573
gavl_audio_samples_t::f
float * f
Definition gavl.h:582
gavl_audio_samples_t::d
double * d
Definition gavl.h:583
gavl_audio_samples_t::s_32
int32_t * s_32
Definition gavl.h:580