avdec.h File Reference
`#include <gavl/gavl.h>`
`#include <gavl/compression.h>`
`#include <gavl/metadata.h>`
`#include "bgavdefs.h"`

Go to the source code of this file.

## Data Structures

struct | bgav_device_info_t
| Info structure for a device. More...
struct | bgav_edl_segment_t
| One segment of a physical stream to appear in a logical stream. More...
struct | bgav_edl_stream_t
| A locical stream. More...
struct | bgav_edl_track_t
| A locical track. More...
struct | bgav_edl_s
| EDL structure. More...

## Macros

#define | BGAV_TIMESTAMP_UNDEFINED GAVL_TIME_UNDEFINED
| Time value indicating an invalid time. More...

## Typedefs

typedef struct bgav_edl_s | bgav_edl_t
| Forward declaration. More...
typedef struct bgav_s | bgav_t
| Opaque decoder structure. More...
typedef gavl_metadata_t | bgav_metadata_t
| Opaque metadata container. More...
typedef struct bgav_options_s | bgav_options_t
| Opaque option container. More...
typedef void(* | bgav_log_callback) (void *data, bgav_log_level_t level, const char *log_domain, const char *message)
| Function to be called for loggins messages. More...
typedef void(* | bgav_name_change_callback) (void *data, const char *name)
| Function to be called if the track name changes. More...
typedef void(* | bgav_metadata_change_callback) (void *data, const bgav_metadata_t *metadata)
| Function to be called if the metadata change. More...
typedef void(* | bgav_buffer_callback) (void *data, float percentage)
| Function to be called if the input module is buffering data. More...
typedef int(* | bgav_user_pass_callback) (void *data, const char *resource, char **username, char **password)
| Function to be called if the input module needs authentication data. More...
typedef void(* | bgav_aspect_callback) (void *data, int stream, int pixel_width, int pixel_height)
| Function to be called if a change of the aspect ratio was detected. More...
typedef void(* | bgav_index_callback) (void *data, float percentage)
| Function to be called periodically while an index is built. More...

## Enumerations

enum | bgav_log_level_t { BGAV_LOG_DEBUG = (1<<0), BGAV_LOG_WARNING = (1<<1), BGAV_LOG_ERROR = (1<<2), BGAV_LOG_INFO = (1<<3) }
| Enumeration for log levels. More...
enum | bgav_stream_action_t { BGAV_STREAM_MUTE = 0, BGAV_STREAM_DECODE = 1, BGAV_STREAM_PARSE = 2, BGAV_STREAM_READRAW = 3 }
| Stream action. More...

## Functions

BGAV_PUBLIC bgav_t * | bgav_create ()
| Create a decoder instance. More...
BGAV_PUBLIC const char * | bgav_metadata_get_author (const bgav_metadata_t *metadata)
| Get the author (or composer) of the track. More...
BGAV_PUBLIC const char * | bgav_metadata_get_title (const bgav_metadata_t *metadata)
| Get the title of the track. More...
BGAV_PUBLIC const char * | bgav_metadata_get_comment (const bgav_metadata_t *metadata)
| Get an additional comment of the track. More...
BGAV_PUBLIC const char * | bgav_metadata_get_copyright (const bgav_metadata_t *metadata)
| Get the copyright notice of the track. More...
BGAV_PUBLIC const char * | bgav_metadata_get_album (const bgav_metadata_t *metadata)
| Get the album this track comes from. More...
BGAV_PUBLIC const char * | bgav_metadata_get_artist (const bgav_metadata_t *metadata)
| Get the artist (or performer) of this track. More...
BGAV_PUBLIC const char * | bgav_metadata_get_albumartist (const bgav_metadata_t *metadata)
| Get the album artist of this track. More...
BGAV_PUBLIC const char * | bgav_metadata_get_genre (const bgav_metadata_t *metadata)
| Get the genre this track belongs to. More...
BGAV_PUBLIC const char * | bgav_metadata_get_date (const bgav_metadata_t *metadata)
| Get the date of the recording. More...
BGAV_PUBLIC int | bgav_metadata_get_track (const bgav_metadata_t *metadata)
| Get the track index. More...
BGAV_PUBLIC bgav_options_t * | bgav_get_options (bgav_t *bgav)
| Get the options of a decoder instance. More...
BGAV_PUBLIC bgav_options_t * | bgav_options_create ()
| Create an options container. More...
BGAV_PUBLIC void | bgav_options_destroy (bgav_options_t *opt)
| Destroy option cotainer. More...
BGAV_PUBLIC void | bgav_options_copy (bgav_options_t *dst, const bgav_options_t *src)
| Copy options. More...
BGAV_PUBLIC void | bgav_options_set_connect_timeout (bgav_options_t *opt, int timeout)
| Set connect timeout. More...
BGAV_PUBLIC void | bgav_options_set_read_timeout (bgav_options_t *opt, int timeout)
| Set read timeout. More...
BGAV_PUBLIC void | bgav_options_set_rtp_port_base (bgav_options_t *opt, int p)
| Set RTP port pase. More...
BGAV_PUBLIC void | bgav_options_set_rtp_try_tcp (bgav_options_t *opt, int enable)
| Try TCP before UDP. More...
BGAV_PUBLIC void | bgav_options_set_network_bandwidth (bgav_options_t *opt, int bandwidth)
| Set network bandwidth. More...
BGAV_PUBLIC void | bgav_options_set_network_buffer_size (bgav_options_t *opt, int size)
| Set network buffer size. More...
BGAV_PUBLIC void | bgav_options_set_http_use_proxy (bgav_options_t *opt, int enable)
| Set proxy usage. More...
BGAV_PUBLIC void | bgav_options_set_http_proxy_host (bgav_options_t *opt, const char *host)
| Set proxy host. More...
BGAV_PUBLIC void | bgav_options_set_http_proxy_port (bgav_options_t *opt, int port)
| Set proxy port. More...
BGAV_PUBLIC void | bgav_options_set_http_proxy_auth (bgav_options_t *opt, int enable)
| Enable or disable proxy authentication. More...
BGAV_PUBLIC void | bgav_options_set_http_proxy_user (bgav_options_t *opt, const char *user)
| Set proxy username. More...
BGAV_PUBLIC void | bgav_options_set_http_proxy_pass (bgav_options_t *opt, const char *pass)
| Set proxy password. More...
BGAV_PUBLIC void | bgav_options_set_http_shoutcast_metadata (bgav_options_t *opt, int enable)
| Enable or disable shoutcast metadata streaming. More...
BGAV_PUBLIC void | bgav_options_set_ftp_anonymous (bgav_options_t *opt, int enable)
| Enable or disable anonymous ftp login. More...
BGAV_PUBLIC void | bgav_options_set_ftp_anonymous_password (bgav_options_t *opt, const char *pass)
| Set anonymous password. More...
BGAV_PUBLIC void | bgav_options_set_default_subtitle_encoding (bgav_options_t *opt, const char *encoding)
| Set default subtitle encoding. More...
BGAV_PUBLIC void | bgav_options_set_audio_dynrange (bgav_options_t *opt, int audio_dynrange)
| Enable dynamic range control. More...
BGAV_PUBLIC void | bgav_options_set_sample_accurate (bgav_options_t *opt, int enable)
| Try to be sample accurate. More...
BGAV_PUBLIC void | bgav_options_set_cache_time (bgav_options_t *opt, int t)
| Set the index creation time for caching. More...
BGAV_PUBLIC void | bgav_options_set_cache_size (bgav_options_t *opt, int s)
| Set the maximum total size of the index cache. More...
BGAV_PUBLIC void | bgav_options_set_seek_subtitles (bgav_options_t *opt, int seek_subtitles)
| Enable external subtitle files. More...
BGAV_PUBLIC void | bgav_options_set_pp_level (bgav_options_t *opt, int pp_level)
| Set postprocessing level. More...
BGAV_PUBLIC void | bgav_options_set_postprocessing_level (bgav_options_t *opt, float pp_level)
| Set postprocessing level. More...
BGAV_PUBLIC void | bgav_options_set_threads (bgav_options_t *opt, int threads)
| Set number of threads. More...
BGAV_PUBLIC void | bgav_options_set_dvb_channels_file (bgav_options_t *opt, const char *file)
| Set DVB channels file. More...
BGAV_PUBLIC void | bgav_options_set_prefer_ffmpeg_demuxers (bgav_options_t *opt, int prefer)
| Preference of ffmpeg demultiplexers. More...
BGAV_PUBLIC void | bgav_options_set_dv_datetime (bgav_options_t *opt, int datetime)
| Exports the date and time as timecode field of DV streams. More...
BGAV_PUBLIC void | bgav_options_set_shrink (bgav_options_t *opt, int factor)
| Shrink factor. More...
BGAV_PUBLIC void | bgav_options_set_vdpau (bgav_options_t *opt, int vdpau)
| VDPAU acceleration. More...
BGAV_PUBLIC void | bgav_options_set_dump_headers (bgav_options_t *opt, int enable)
| Dump file headers. More...
BGAV_PUBLIC void | bgav_options_set_dump_indices (bgav_options_t *opt, int enable)
| Dump file indices. More...
BGAV_PUBLIC void | bgav_options_set_log_callback (bgav_options_t *opt, bgav_log_callback callback, void *data)
| Set the callback for log messages. More...
BGAV_PUBLIC void | bgav_options_set_log_level (bgav_options_t *opt, int level)
| Set the verbosity for log messages. More...
BGAV_PUBLIC void | bgav_options_set_name_change_callback (bgav_options_t *opt, bgav_name_change_callback callback, void *data)
| Set the callback for name change events. More...
BGAV_PUBLIC void | bgav_options_set_metadata_change_callback (bgav_options_t *opt, bgav_metadata_change_callback callback, void *data)
| Set the callback for metadata change events. More...
BGAV_PUBLIC void | bgav_options_set_buffer_callback (bgav_options_t *opt, bgav_buffer_callback callback, void *data)
| Set the callback for buffering notification. More...
BGAV_PUBLIC void | bgav_options_set_user_pass_callback (bgav_options_t *opt, bgav_user_pass_callback callback, void *data)
| Set the callback for user authentication. More...
BGAV_PUBLIC void | bgav_options_set_aspect_callback (bgav_options_t *opt, bgav_aspect_callback callback, void *data)
| Set aspect ratio change callback. More...
BGAV_PUBLIC void | bgav_options_set_index_callback (bgav_options_t *opt, bgav_index_callback callback, void *data)
| Set index build callback. More...
BGAV_PUBLIC bgav_device_info_t * | bgav_find_devices_vcd ()
| Scan for VCD capable devices. More...
BGAV_PUBLIC int | bgav_check_device_vcd (const char *device, char **name)
| Test if a device is VCD capable. More...
BGAV_PUBLIC bgav_device_info_t * | bgav_find_devices_dvd ()
| Scan for DVD capable devices. More...
BGAV_PUBLIC int | bgav_check_device_dvd (const char *device, char **name)
| Test if a device is DVD capable. More...
BGAV_PUBLIC bgav_device_info_t * | bgav_find_devices_dvb ()
| Scan for DVB capable devices. More...
BGAV_PUBLIC int | bgav_check_device_dvb (const char *device, char **name)
| Test if a device is DVB capable. More...
BGAV_PUBLIC void | bgav_device_info_destroy (bgav_device_info_t *arr)
| Destroy a device info array. More...
BGAV_PUBLIC int | bgav_eject_disc (const char *device)
| Eject a disc. More...
BGAV_PUBLIC const char * | bgav_get_disc_name (bgav_t *bgav)
| Get the name of a disc. More...
BGAV_PUBLIC int | bgav_open (bgav_t *bgav, const char *location)
| Open a file or URL. More...
BGAV_PUBLIC int | bgav_open_vcd (bgav_t *bgav, const char *location)
| Open a VCD device. More...
BGAV_PUBLIC int | bgav_open_dvd (bgav_t *bgav, const char *location)
| Open a DVD device. More...
BGAV_PUBLIC int | bgav_open_dvb (bgav_t *bgav, const char *location)
| Open a DVB device. More...
BGAV_PUBLIC int | bgav_open_fd (bgav_t *bgav, int fd, int64_t total_size, const char *mimetype)
| Open a decoder from a filedescriptor. More...
BGAV_PUBLIC int | bgav_open_callbacks (bgav_t *bgav, int(*read_callback)(void *priv, uint8_t *data, int len), int64_t(*seek_callback)(void *priv, uint64_t pos, int whence), void *priv, const char *filename, const char *mimetype, int64_t total_bytes)
| Open a decoder with callbacks. More...
BGAV_PUBLIC void | bgav_close (bgav_t *bgav)
| Close a decoder and free all associated memory. More...
BGAV_PUBLIC bgav_edl_t * | bgav_get_edl (bgav_t *bgav)
| Get an EDL from an open decoder. More...
BGAV_PUBLIC void | bgav_edl_dump (const bgav_edl_t *e)
| Dump an EDL to stderr. More...
BGAV_PUBLIC int | bgav_is_redirector (bgav_t *bgav)
| Query if the decoder opened a redirector. More...
BGAV_PUBLIC int | bgav_redirector_get_num_urls (bgav_t *bgav)
| Get the number of URLs found in the redirector. More...
BGAV_PUBLIC const char * | bgav_redirector_get_url (bgav_t *bgav, int index)
| Get the address of an URL. More...
BGAV_PUBLIC const char * | bgav_redirector_get_name (bgav_t *bgav, int index)
| Get the address of an URL. More...
BGAV_PUBLIC int | bgav_num_tracks (bgav_t *bgav)
| Get the number of tracks. More...
BGAV_PUBLIC const char * | bgav_get_description (bgav_t *bgav)
| Get a technical description of the format. More...
BGAV_PUBLIC gavl_time_t | bgav_get_duration (bgav_t *bgav, int track)
| Get the duration of a track. More...
BGAV_PUBLIC int | bgav_num_audio_streams (bgav_t *bgav, int track)
| Get the number of audio streams of a track. More...
BGAV_PUBLIC int | bgav_num_video_streams (bgav_t *bgav, int track)
| Get the number of video streams of a track. More...
BGAV_PUBLIC int | bgav_num_subtitle_streams (bgav_t *bgav, int track)
| Get the number of subtitle streams of a track. More...
BGAV_PUBLIC const char * | bgav_get_track_name (bgav_t *bgav, int track)
| Get the name a track. More...
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_metadata (bgav_t *bgav, int track)
| Get metadata for a track. More...
BGAV_PUBLIC int | bgav_select_track (bgav_t *bgav, int track)
| Select a track. More...
BGAV_PUBLIC int | bgav_get_num_chapters (bgav_t *bgav, int track, int *timescale)
| Get the number of chapters. More...
BGAV_PUBLIC const char * | bgav_get_chapter_name (bgav_t *bgav, int track, int chapter)
| Get the name of a chapter. More...
BGAV_PUBLIC int64_t | bgav_get_chapter_time (bgav_t *bgav, int track, int chapter)
| Get the name of a chapter. More...
BGAV_PUBLIC const char * | bgav_get_audio_language (bgav_t *bgav, int stream)
| Get the language of an audio stream. More...
BGAV_PUBLIC int | bgav_get_audio_bitrate (bgav_t *bgav, int stream)
| Get the bitrate of an audio stream. More...
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_audio_metadata (bgav_t *bgav, int stream)
| Get the metadata of an audio stream. More...
BGAV_PUBLIC const char * | bgav_get_subtitle_language (bgav_t *bgav, int stream)
| Get the language of a subtitle stream. More...
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_subtitle_metadata (bgav_t *bgav, int stream)
| Get the metadata of a subtitle stream. More...
BGAV_PUBLIC const bgav_metadata_t * | bgav_get_video_metadata (bgav_t *bgav, int stream)
| Get the metadata of a video stream. More...
BGAV_PUBLIC int | bgav_get_audio_compression_info (bgav_t *bgav, int stream, gavl_compression_info_t *info)
| Get audio compression info. More...
BGAV_PUBLIC int | bgav_get_video_compression_info (bgav_t *bgav, int stream, gavl_compression_info_t *info)
| Get video compression info. More...
BGAV_PUBLIC int | bgav_read_audio_packet (bgav_t *bgav, int stream, gavl_packet_t *p)
| Read compressed audio packet. More...
BGAV_PUBLIC int | bgav_read_video_packet (bgav_t *bgav, int stream, gavl_packet_t *p)
| Read compressed video packet. More...
BGAV_PUBLIC int | bgav_set_audio_stream (bgav_t *bgav, int stream, bgav_stream_action_t action)
| Select mode for an audio stream. More...
BGAV_PUBLIC int | bgav_set_video_stream (bgav_t *bgav, int stream, bgav_stream_action_t action)
| Select mode for a video stream. More...
BGAV_PUBLIC int | bgav_set_subtitle_stream (bgav_t *bgav, int stream, bgav_stream_action_t action)
| Select mode for a subtitle stream. More...
BGAV_PUBLIC int | bgav_start (bgav_t *bgav)
| Start all codecs. More...
BGAV_PUBLIC const gavl_audio_format_t * | bgav_get_audio_format (bgav_t *bgav, int stream)
| Get the format of an audio stream. More...
BGAV_PUBLIC const gavl_video_format_t * | bgav_get_video_format (bgav_t *bgav, int stream)
| Get the format of a video stream. More...
BGAV_PUBLIC gavl_frame_table_t * | bgav_get_frame_table (bgav_t *bgav, int stream)
| Get the frame table of a video stream. More...
BGAV_PUBLIC const gavl_video_format_t * | bgav_get_subtitle_format (bgav_t *bgav, int stream)
| Get the video format of a subtitle stream. More...
BGAV_PUBLIC int | bgav_subtitle_is_text (bgav_t *bgav, int stream)
| Check if a subtitle is text or graphics based. More...
BGAV_PUBLIC const char * | bgav_get_audio_description (bgav_t *bgav, int stream)
| Get the description of an audio stream. More...
BGAV_PUBLIC const char * | bgav_get_audio_info (bgav_t *bgav, int stream)
| Get additional info about an audio stream. More...
BGAV_PUBLIC const char * | bgav_get_video_description (bgav_t *bgav, int stream)
| Get the description of a video stream. More...
BGAV_PUBLIC const char * | bgav_get_subtitle_description (bgav_t *bgav, int stream)
| Get the description of a subtitle stream. More...
BGAV_PUBLIC const char * | bgav_get_subtitle_info (bgav_t *bgav, int stream)
| Get additional info about a subtitle stream. More...
BGAV_PUBLIC int | bgav_can_pause (bgav_t *bgav)
| Query if a track is pausable. More...
BGAV_PUBLIC int | bgav_video_has_still (bgav_t *bgav, int stream)
| Determine if a still image is available for reading. More...
BGAV_PUBLIC int | bgav_read_video (bgav_t *bgav, gavl_video_frame_t *frame, int stream)
| Decode a video frame. More...
BGAV_PUBLIC void | bgav_skip_video (bgav_t *bgav, int stream, int64_t *time, int scale, int exact)
| Skip forward in a video stream. More...
BGAV_PUBLIC int | bgav_read_audio (bgav_t *bgav, gavl_audio_frame_t *frame, int stream, int num_samples)
| Decode audio samples. More...
BGAV_PUBLIC int | bgav_has_subtitle (bgav_t *bgav, int stream)
| Check, if a new subtitle is available. More...
BGAV_PUBLIC int | bgav_read_subtitle_overlay (bgav_t *bgav, gavl_overlay_t *ovl, int stream)
| Decode an overlay subtitle. More...
BGAV_PUBLIC int | bgav_read_subtitle_text (bgav_t *bgav, char **ret, int *ret_alloc, int64_t *start_time, int64_t *duration, int stream)
| Decode a text subtitle. More...
BGAV_PUBLIC int | bgav_can_seek (bgav_t *bgav)
| Check if a track is seekabkle. More...
BGAV_PUBLIC void | bgav_seek (bgav_t *bgav, gavl_time_t *time)
| Seek to a specific time. More...
BGAV_PUBLIC void | bgav_seek_scaled (bgav_t *bgav, int64_t *time, int scale)
| Seek to a specific stream position. More...
BGAV_PUBLIC int | bgav_can_seek_sample (bgav_t *bgav)
| Check if a track is seekabkle with sample accuracy. More...
BGAV_PUBLIC int64_t | bgav_audio_duration (bgav_t *bgav, int stream)
| Get the audio duration. More...
BGAV_PUBLIC int64_t | bgav_audio_start_time (bgav_t *bgav, int stream)
| Get the audio start time. More...
BGAV_PUBLIC int64_t | bgav_video_duration (bgav_t *bgav, int stream)
| Get the video duration. More...
BGAV_PUBLIC int64_t | bgav_video_start_time (bgav_t *bgav, int stream)
| Get the video start time. More...
BGAV_PUBLIC int64_t | bgav_subtitle_duration (bgav_t *bgav, int stream)
| Get the subtitle duration. More...
BGAV_PUBLIC void | bgav_seek_audio (bgav_t *bgav, int stream, int64_t sample)
| Seek to a specific audio sample. More...
BGAV_PUBLIC void | bgav_seek_video (bgav_t *bgav, int stream, int64_t time)
| Seek to a specific video time. More...
BGAV_PUBLIC int64_t | bgav_video_keyframe_before (bgav_t *bgav, int stream, int64_t time)
| Get the time of the closest keyframe before a given time. More...
BGAV_PUBLIC int64_t | bgav_video_keyframe_after (bgav_t *bgav, int stream, int64_t time)
| Get the time of the closest keyframe after a given time. More...
BGAV_PUBLIC void | bgav_seek_subtitle (bgav_t *bgav, int stream, int64_t time)
| Seek to a specific subtitle position. More...
BGAV_PUBLIC void | bgav_dump (bgav_t *bgav)
| Dump informations of all tracks to stderr. More...
BGAV_PUBLIC void | bgav_codecs_dump ()
| Dump informations about all available codecs to stderr. More...
BGAV_PUBLIC void | bgav_formats_dump ()
| Dump informations about all available format demuxers to stderr. More...
BGAV_PUBLIC void | bgav_inputs_dump ()
| Dump informations about all available input modules to stderr. More...
BGAV_PUBLIC void | bgav_redirectors_dump ()
| Dump informations about all available redirectors to stderr. More...
BGAV_PUBLIC void | bgav_subreaders_dump ()
| Dump informations about all available subtitle readers to stderr. More...

## Detailed Description

external api header.