avdec.h
Go to the documentation of this file.
/*****************************************************************
* gmerlin-avdecoder - a general purpose multimedia decoding library
*
* Copyright (c) 2001 - 2011 Members of the Gmerlin project
* gmerlin-general@lists.sourceforge.net
* http://gmerlin.sourceforge.net
*
* 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/>.
* *****************************************************************/
/* Public entry points */
#include <gavl/gavl.h>
#include <gavl/compression.h>
#include <gavl/metadata.h>
#include "bgavdefs.h" // This is ugly, but works
#ifdef __cplusplus
extern "C" {
#endif
typedef struct bgav_edl_s bgav_edl_t;
typedef struct bgav_s bgav_t;
BGAV_PUBLIC
bgav_t * bgav_create();
typedef gavl_metadata_t bgav_metadata_t;
BGAV_PUBLIC
const char * bgav_metadata_get_author(const bgav_metadata_t*metadata);
BGAV_PUBLIC
const char * bgav_metadata_get_title(const bgav_metadata_t * metadata);
BGAV_PUBLIC
const char * bgav_metadata_get_comment(const bgav_metadata_t * metadata);
BGAV_PUBLIC
const char * bgav_metadata_get_copyright(const bgav_metadata_t * metadata);
BGAV_PUBLIC
const char * bgav_metadata_get_album(const bgav_metadata_t * metadata);
BGAV_PUBLIC
const char * bgav_metadata_get_artist(const bgav_metadata_t * metadata);
BGAV_PUBLIC
const char * bgav_metadata_get_albumartist(const bgav_metadata_t * metadata);
BGAV_PUBLIC
const char * bgav_metadata_get_genre(const bgav_metadata_t * metadata);
BGAV_PUBLIC
const char * bgav_metadata_get_date(const bgav_metadata_t * metadata);
BGAV_PUBLIC
int bgav_metadata_get_track(const bgav_metadata_t * metadata);
/***************************************************
* Housekeeping Functions
***************************************************/
/***************************************************
* Set parameters
***************************************************/
typedef struct bgav_options_s bgav_options_t;
BGAV_PUBLIC
bgav_options_t * bgav_get_options(bgav_t * bgav);
BGAV_PUBLIC
bgav_options_t * bgav_options_create();
BGAV_PUBLIC
void bgav_options_destroy(bgav_options_t * opt);
BGAV_PUBLIC
void bgav_options_copy(bgav_options_t * dst, const bgav_options_t * src);
BGAV_PUBLIC
void bgav_options_set_connect_timeout(bgav_options_t * opt, int timeout);
BGAV_PUBLIC
void bgav_options_set_read_timeout(bgav_options_t * opt, int timeout);
BGAV_PUBLIC
void bgav_options_set_rtp_port_base(bgav_options_t * opt, int p);
BGAV_PUBLIC
void bgav_options_set_rtp_try_tcp(bgav_options_t * opt, int enable);
BGAV_PUBLIC
void bgav_options_set_network_bandwidth(bgav_options_t * opt, int bandwidth);
BGAV_PUBLIC
void bgav_options_set_network_buffer_size(bgav_options_t * opt, int size);
/* HTTP Options */
BGAV_PUBLIC
void bgav_options_set_http_use_proxy(bgav_options_t* opt, int enable);
BGAV_PUBLIC
void bgav_options_set_http_proxy_host(bgav_options_t* opt, const char * host);
BGAV_PUBLIC
void bgav_options_set_http_proxy_port(bgav_options_t* opt, int port);
BGAV_PUBLIC
void bgav_options_set_http_proxy_auth(bgav_options_t* opt, int enable);
BGAV_PUBLIC
void bgav_options_set_http_proxy_user(bgav_options_t* opt, const char * user);
BGAV_PUBLIC
void bgav_options_set_http_proxy_pass(bgav_options_t* opt, const char * pass);
BGAV_PUBLIC
void bgav_options_set_http_shoutcast_metadata(bgav_options_t* opt, int enable);
/* Set FTP options */
BGAV_PUBLIC
void bgav_options_set_ftp_anonymous(bgav_options_t* opt, int enable);
BGAV_PUBLIC
void bgav_options_set_ftp_anonymous_password(bgav_options_t* opt, const char* pass);
BGAV_PUBLIC
void bgav_options_set_default_subtitle_encoding(bgav_options_t* opt,
const char* encoding);
BGAV_PUBLIC
void bgav_options_set_audio_dynrange(bgav_options_t* opt,
int audio_dynrange);
BGAV_PUBLIC
void bgav_options_set_sample_accurate(bgav_options_t*opt, int enable);
BGAV_PUBLIC
void bgav_options_set_cache_time(bgav_options_t*opt, int t);
BGAV_PUBLIC
void bgav_options_set_cache_size(bgav_options_t*opt, int s);
BGAV_PUBLIC
void bgav_options_set_seek_subtitles(bgav_options_t* opt,
int seek_subtitles);
BGAV_PUBLIC
void bgav_options_set_pp_level(bgav_options_t* opt,
int pp_level);
BGAV_PUBLIC
void bgav_options_set_postprocessing_level(bgav_options_t* opt,
float pp_level);
BGAV_PUBLIC
void bgav_options_set_threads(bgav_options_t * opt, int threads);
BGAV_PUBLIC
void bgav_options_set_dvb_channels_file(bgav_options_t* opt,
const char * file);
BGAV_PUBLIC
void bgav_options_set_prefer_ffmpeg_demuxers(bgav_options_t* opt,
int prefer);
BGAV_PUBLIC
void bgav_options_set_dv_datetime(bgav_options_t* opt,
int datetime);
BGAV_PUBLIC
void bgav_options_set_shrink(bgav_options_t* opt,
int factor);
BGAV_PUBLIC
void bgav_options_set_vdpau(bgav_options_t* opt,
int vdpau);
BGAV_PUBLIC
void bgav_options_set_dump_headers(bgav_options_t* opt,
int enable);
BGAV_PUBLIC
void bgav_options_set_dump_indices(bgav_options_t* opt,
int enable);
typedef enum
{
BGAV_LOG_DEBUG = (1<<0),
BGAV_LOG_WARNING = (1<<1),
BGAV_LOG_ERROR = (1<<2),
BGAV_LOG_INFO = (1<<3)
} bgav_log_level_t;
typedef void (*bgav_log_callback)(void*data, bgav_log_level_t level,
const char * log_domain,
const char * message);
BGAV_PUBLIC void
bgav_options_set_log_callback(bgav_options_t* opt,
bgav_log_callback callback,
void * data);
BGAV_PUBLIC void
bgav_options_set_log_level(bgav_options_t* opt,
int level);
/* Set callbacks */
typedef void (*bgav_name_change_callback)(void*data, const char * name);
BGAV_PUBLIC void
bgav_options_set_name_change_callback(bgav_options_t* opt,
bgav_name_change_callback callback,
void * data);
typedef void (*bgav_metadata_change_callback)(void*data, const bgav_metadata_t * metadata);
BGAV_PUBLIC void
bgav_options_set_metadata_change_callback(bgav_options_t* opt,
bgav_metadata_change_callback callback,
void * data);
typedef void (*bgav_buffer_callback)(void*data, float percentage);
BGAV_PUBLIC void
bgav_options_set_buffer_callback(bgav_options_t* opt,
bgav_buffer_callback callback,
void * data);
typedef int (*bgav_user_pass_callback)(void*data, const char * resource,
char ** username, char ** password);
BGAV_PUBLIC void
bgav_options_set_user_pass_callback(bgav_options_t* opt,
bgav_user_pass_callback callback,
void * data);
typedef void (*bgav_aspect_callback)(void*data, int stream,
int pixel_width, int pixel_height);
BGAV_PUBLIC void
bgav_options_set_aspect_callback(bgav_options_t* opt,
bgav_aspect_callback callback,
void * data);
typedef void (*bgav_index_callback)(void*data, float percentage);
BGAV_PUBLIC void
bgav_options_set_index_callback(bgav_options_t* opt,
bgav_index_callback callback,
void * data);
/* Device description */
typedef struct
{
char * device;
char * name;
} bgav_device_info_t;
/* Scan for devices */
BGAV_PUBLIC
bgav_device_info_t * bgav_find_devices_vcd();
BGAV_PUBLIC
int bgav_check_device_vcd(const char * device, char ** name);
BGAV_PUBLIC
bgav_device_info_t * bgav_find_devices_dvd();
BGAV_PUBLIC
int bgav_check_device_dvd(const char * device, char ** name);
BGAV_PUBLIC
bgav_device_info_t * bgav_find_devices_dvb();
BGAV_PUBLIC
int bgav_check_device_dvb(const char * device, char ** name);
BGAV_PUBLIC
void bgav_device_info_destroy(bgav_device_info_t * arr);
BGAV_PUBLIC
int bgav_eject_disc(const char * device);
BGAV_PUBLIC
const char * bgav_get_disc_name(bgav_t * bgav);
/******************************************************
* Open
******************************************************/
/* Open a file or URL, return 1 on success */
BGAV_PUBLIC
int bgav_open(bgav_t * bgav, const char * location);
BGAV_PUBLIC
int bgav_open_vcd(bgav_t * bgav, const char * location);
BGAV_PUBLIC
int bgav_open_dvd(bgav_t * bgav, const char * location);
BGAV_PUBLIC
int bgav_open_dvb(bgav_t * bgav, const char * location);
BGAV_PUBLIC
int bgav_open_fd(bgav_t * bgav, int fd,
int64_t total_size,
const char * mimetype);
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);
/* Close and destroy everything */
BGAV_PUBLIC
void bgav_close(bgav_t * bgav);
typedef struct
{
char * url;
int track;
int stream;
int timescale;
int64_t src_time;
/* Time and duration within the destination in destination
timescale */
int64_t dst_time;
int64_t dst_duration;
/* */
int32_t speed_num;
int32_t speed_den;
} bgav_edl_segment_t;
typedef struct
{
bgav_edl_segment_t * segments;
int num_segments;
int timescale;
} bgav_edl_stream_t;
typedef struct
{
char * name;
bgav_metadata_t * metadata;
int num_audio_streams;
bgav_edl_stream_t * audio_streams;
int num_video_streams;
bgav_edl_stream_t * video_streams;
int num_subtitle_text_streams;
bgav_edl_stream_t * subtitle_text_streams;
int num_subtitle_overlay_streams;
bgav_edl_stream_t * subtitle_overlay_streams;
} bgav_edl_track_t;
struct bgav_edl_s
{
int num_tracks;
bgav_edl_track_t * tracks;
char * url;
};
BGAV_PUBLIC
bgav_edl_t * bgav_get_edl(bgav_t * bgav);
BGAV_PUBLIC
void bgav_edl_dump(const bgav_edl_t * e);
/***************************************************
* Check for redirecting: You MUST check if you opened
* a redirector, because reading data from redirectors
* crashes
* After you read the URLs, close the bgav_t object
* and open a new one with one of the URLs.
***************************************************/
BGAV_PUBLIC
int bgav_is_redirector(bgav_t * bgav);
BGAV_PUBLIC
int bgav_redirector_get_num_urls(bgav_t * bgav);
BGAV_PUBLIC
const char * bgav_redirector_get_url(bgav_t * bgav, int index);
BGAV_PUBLIC
const char * bgav_redirector_get_name(bgav_t * bgav, int index);
/***************************************************
* Get information about the file
***************************************************/
BGAV_PUBLIC
int bgav_num_tracks(bgav_t * bgav);
BGAV_PUBLIC
const char * bgav_get_description(bgav_t * bgav);
BGAV_PUBLIC
gavl_time_t bgav_get_duration(bgav_t * bgav, int track);
/* Query stream numbers */
BGAV_PUBLIC
int bgav_num_audio_streams(bgav_t * bgav, int track);
BGAV_PUBLIC
int bgav_num_video_streams(bgav_t * bgav, int track);
BGAV_PUBLIC
int bgav_num_subtitle_streams(bgav_t * bgav, int track);
BGAV_PUBLIC
const char * bgav_get_track_name(bgav_t * bgav, int track);
BGAV_PUBLIC
const bgav_metadata_t * bgav_get_metadata(bgav_t * bgav,int track);
BGAV_PUBLIC
int bgav_select_track(bgav_t * bgav, int track);
BGAV_PUBLIC
int bgav_get_num_chapters(bgav_t * bgav, int track, int * timescale);
BGAV_PUBLIC const char *
bgav_get_chapter_name(bgav_t * bgav, int track, int chapter);
BGAV_PUBLIC
int64_t bgav_get_chapter_time(bgav_t * bgav, int track, int chapter);
BGAV_PUBLIC
const char * bgav_get_audio_language(bgav_t * bgav, int stream);
BGAV_PUBLIC
int bgav_get_audio_bitrate(bgav_t * bgav, int stream);
BGAV_PUBLIC
const bgav_metadata_t *
bgav_get_audio_metadata(bgav_t * bgav, int stream);
BGAV_PUBLIC
const char * bgav_get_subtitle_language(bgav_t * bgav, int stream);
BGAV_PUBLIC
const bgav_metadata_t *
bgav_get_subtitle_metadata(bgav_t * bgav, int stream);
BGAV_PUBLIC
const bgav_metadata_t *
bgav_get_video_metadata(bgav_t * bgav, int stream);
typedef enum
{
BGAV_STREAM_MUTE = 0,
BGAV_STREAM_DECODE = 1,
BGAV_STREAM_PARSE = 2,
BGAV_STREAM_READRAW = 3
}
bgav_stream_action_t;
BGAV_PUBLIC
int bgav_get_audio_compression_info(bgav_t * bgav, int stream,
gavl_compression_info_t * info);
BGAV_PUBLIC
int bgav_get_video_compression_info(bgav_t * bgav, int stream,
gavl_compression_info_t * info);
BGAV_PUBLIC
int bgav_read_audio_packet(bgav_t * bgav, int stream, gavl_packet_t * p);
BGAV_PUBLIC
int bgav_read_video_packet(bgav_t * bgav, int stream, gavl_packet_t * p);
BGAV_PUBLIC
int bgav_set_audio_stream(bgav_t * bgav, int stream, bgav_stream_action_t action);
BGAV_PUBLIC
int bgav_set_video_stream(bgav_t * bgav, int stream, bgav_stream_action_t action);
BGAV_PUBLIC
int bgav_set_subtitle_stream(bgav_t * bgav, int stream, bgav_stream_action_t action);
/***************************************************
* Stream handling functions
***************************************************/
/*
* You MUST these, if you want to decode anything.
* After bgav_open(), all streams are switched off by
* default
*/
BGAV_PUBLIC
int bgav_start(bgav_t * bgav);
BGAV_PUBLIC
const gavl_audio_format_t * bgav_get_audio_format(bgav_t * bgav, int stream);
BGAV_PUBLIC
const gavl_video_format_t * bgav_get_video_format(bgav_t * bgav, int stream);
BGAV_PUBLIC
gavl_frame_table_t * bgav_get_frame_table(bgav_t * bgav, int stream);
BGAV_PUBLIC const gavl_video_format_t *
bgav_get_subtitle_format(bgav_t * bgav, int stream);
BGAV_PUBLIC
int bgav_subtitle_is_text(bgav_t * bgav, int stream);
BGAV_PUBLIC
const char * bgav_get_audio_description(bgav_t * bgav, int stream);
BGAV_PUBLIC
const char * bgav_get_audio_info(bgav_t * bgav, int stream);
BGAV_PUBLIC
const char * bgav_get_video_description(bgav_t * bgav, int stream);
BGAV_PUBLIC
const char * bgav_get_subtitle_description(bgav_t * bgav, int stream);
BGAV_PUBLIC
const char * bgav_get_subtitle_info(bgav_t * bgav, int stream);
BGAV_PUBLIC
int bgav_can_pause(bgav_t * bgav);
/***************************************************
* Decoding functions
***************************************************/
BGAV_PUBLIC
int bgav_video_has_still(bgav_t * bgav, int stream);
BGAV_PUBLIC
int bgav_read_video(bgav_t * bgav, gavl_video_frame_t * frame, int stream);
BGAV_PUBLIC
void bgav_skip_video(bgav_t * bgav, int stream,
int64_t * time, int scale,
int exact);
BGAV_PUBLIC
int bgav_read_audio(bgav_t * bgav, gavl_audio_frame_t * frame, int stream,
int num_samples);
BGAV_PUBLIC
int bgav_has_subtitle(bgav_t * bgav, int stream);
BGAV_PUBLIC
int bgav_read_subtitle_overlay(bgav_t * bgav, gavl_overlay_t * ovl, int stream);
BGAV_PUBLIC
int bgav_read_subtitle_text(bgav_t * bgav, char ** ret, int *ret_alloc,
int64_t * start_time, int64_t * duration,
int stream);
/***************************************************
* Seek to a timestamp. This also resyncs all streams
***************************************************/
BGAV_PUBLIC
int bgav_can_seek(bgav_t * bgav);
BGAV_PUBLIC
void bgav_seek(bgav_t * bgav, gavl_time_t * time);
BGAV_PUBLIC
void bgav_seek_scaled(bgav_t * bgav, int64_t * time, int scale);
#define BGAV_TIMESTAMP_UNDEFINED GAVL_TIME_UNDEFINED // Don't change this
BGAV_PUBLIC
int bgav_can_seek_sample(bgav_t * bgav);
BGAV_PUBLIC
int64_t bgav_audio_duration(bgav_t * bgav, int stream);
BGAV_PUBLIC
int64_t bgav_audio_start_time(bgav_t * bgav, int stream);
BGAV_PUBLIC
int64_t bgav_video_duration(bgav_t * bgav, int stream);
BGAV_PUBLIC
int64_t bgav_video_start_time(bgav_t * bgav, int stream);
BGAV_PUBLIC
int64_t bgav_subtitle_duration(bgav_t * bgav, int stream);
BGAV_PUBLIC
void bgav_seek_audio(bgav_t * bgav, int stream, int64_t sample);
BGAV_PUBLIC
void bgav_seek_video(bgav_t * bgav, int stream, int64_t time);
BGAV_PUBLIC
int64_t bgav_video_keyframe_before(bgav_t * bgav, int stream, int64_t time);
BGAV_PUBLIC
int64_t bgav_video_keyframe_after(bgav_t * bgav, int stream, int64_t time);
BGAV_PUBLIC
void bgav_seek_subtitle(bgav_t * bgav, int stream, int64_t time);
/***************************************************
* Debugging functions
***************************************************/
BGAV_PUBLIC
void bgav_dump(bgav_t * bgav);
/* Dump infos about the installed codecs */
BGAV_PUBLIC
void bgav_codecs_dump();
/* Dump known media formats */
BGAV_PUBLIC
void bgav_formats_dump();
BGAV_PUBLIC
void bgav_inputs_dump();
BGAV_PUBLIC
void bgav_redirectors_dump();
BGAV_PUBLIC
void bgav_subreaders_dump();
#ifdef __cplusplus
}
#endif
bgav_set_subtitle_stream
BGAV_PUBLIC int bgav_set_subtitle_stream(bgav_t *bgav, int stream, bgav_stream_action_t action)
Select mode for a subtitle stream.
bgav_subtitle_is_text
BGAV_PUBLIC int bgav_subtitle_is_text(bgav_t *bgav, int stream)
Check if a subtitle is text or graphics based.
bgav_metadata_t
gavl_metadata_t bgav_metadata_t
Opaque metadata container.
Definition: avdec.h:118
bgav_inputs_dump
BGAV_PUBLIC void bgav_inputs_dump()
Dump informations about all available input modules to stderr.
gavl_audio_frame_t
bgav_check_device_dvb
BGAV_PUBLIC int bgav_check_device_dvb(const char *device, char **name)
Test if a device is DVB capable.
bgav_get_video_description
BGAV_PUBLIC const char * bgav_get_video_description(bgav_t *bgav, int stream)
Get the description of a video stream.
bgav_device_info_t::device
char * device
Definition: avdec.h:901
bgav_options_set_network_bandwidth
BGAV_PUBLIC void bgav_options_set_network_bandwidth(bgav_options_t *opt, int bandwidth)
Set network bandwidth.
bgav_seek_video
BGAV_PUBLIC void bgav_seek_video(bgav_t *bgav, int stream, int64_t time)
Seek to a specific video time.
bgav_options_set_index_callback
BGAV_PUBLIC void bgav_options_set_index_callback(bgav_options_t *opt, bgav_index_callback callback, void *data)
Set index build callback.
bgav_dump
BGAV_PUBLIC void bgav_dump(bgav_t *bgav)
Dump informations of all tracks to stderr.
bgav_get_chapter_name
BGAV_PUBLIC const char * bgav_get_chapter_name(bgav_t *bgav, int track, int chapter)
Get the name of a chapter.
bgav_edl_s::tracks
bgav_edl_track_t * tracks
Logical tracks.
Definition: avdec.h:1172
bgav_find_devices_vcd
BGAV_PUBLIC bgav_device_info_t * bgav_find_devices_vcd()
Scan for VCD capable devices.
bgav_find_devices_dvb
BGAV_PUBLIC bgav_device_info_t * bgav_find_devices_dvb()
Scan for DVB capable devices.
bgav_read_subtitle_overlay
BGAV_PUBLIC int bgav_read_subtitle_overlay(bgav_t *bgav, gavl_overlay_t *ovl, int stream)
Decode an overlay subtitle.
bgav_options_set_user_pass_callback
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.
bgav_get_audio_format
BGAV_PUBLIC const gavl_audio_format_t * bgav_get_audio_format(bgav_t *bgav, int stream)
Get the format of an audio stream.
bgav_options_set_pp_level
BGAV_PUBLIC void bgav_options_set_pp_level(bgav_options_t *opt, int pp_level)
Set postprocessing level.
bgav_edl_track_t::audio_streams
bgav_edl_stream_t * audio_streams
Logical audio streams.
Definition: avdec.h:1153
bgav_get_num_chapters
BGAV_PUBLIC int bgav_get_num_chapters(bgav_t *bgav, int track, int *timescale)
Get the number of chapters.
bgav_can_seek
BGAV_PUBLIC int bgav_can_seek(bgav_t *bgav)
Check if a track is seekabkle.
bgav_get_track_name
BGAV_PUBLIC const char * bgav_get_track_name(bgav_t *bgav, int track)
Get the name a track.
bgav_options_set_http_use_proxy
BGAV_PUBLIC void bgav_options_set_http_use_proxy(bgav_options_t *opt, int enable)
Set proxy usage.
bgav_options_set_vdpau
BGAV_PUBLIC void bgav_options_set_vdpau(bgav_options_t *opt, int vdpau)
VDPAU acceleration.
bgav_edl_track_t::metadata
bgav_metadata_t * metadata
Metadata (optional)
Definition: avdec.h:1150
bgav_options_set_log_callback
BGAV_PUBLIC void bgav_options_set_log_callback(bgav_options_t *opt, bgav_log_callback callback, void *data)
Set the callback for log messages.
bgav_get_subtitle_language
BGAV_PUBLIC const char * bgav_get_subtitle_language(bgav_t *bgav, int stream)
Get the language of a subtitle stream.
bgav_get_audio_description
BGAV_PUBLIC const char * bgav_get_audio_description(bgav_t *bgav, int stream)
Get the description of an audio stream.
bgav_get_metadata
BGAV_PUBLIC const bgav_metadata_t * bgav_get_metadata(bgav_t *bgav, int track)
Get metadata for a track.
bgav_edl_stream_t
A locical stream.
Definition: avdec.h:1137
bgav_metadata_change_callback
void(* bgav_metadata_change_callback)(void *data, const bgav_metadata_t *metadata)
Function to be called if the metadata change.
Definition: avdec.h:765
bgav_check_device_vcd
BGAV_PUBLIC int bgav_check_device_vcd(const char *device, char **name)
Test if a device is VCD capable.
bgav_read_video_packet
BGAV_PUBLIC int bgav_read_video_packet(bgav_t *bgav, int stream, gavl_packet_t *p)
Read compressed video packet.
bgav_get_audio_bitrate
BGAV_PUBLIC int bgav_get_audio_bitrate(bgav_t *bgav, int stream)
Get the bitrate of an audio stream.
bgav_edl_segment_t::speed_num
int32_t speed_num
Playback speed numerator.
Definition: avdec.h:1129
bgav_edl_track_t::name
char * name
Name (optional)
Definition: avdec.h:1149
bgav_options_set_sample_accurate
BGAV_PUBLIC void bgav_options_set_sample_accurate(bgav_options_t *opt, int enable)
Try to be sample accurate.
bgav_log_callback
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.
Definition: avdec.h:700
bgav_is_redirector
BGAV_PUBLIC int bgav_is_redirector(bgav_t *bgav)
Query if the decoder opened a redirector.
bgav_get_options
BGAV_PUBLIC bgav_options_t * bgav_get_options(bgav_t *bgav)
Get the options of a decoder instance.
bgav_options_set_shrink
BGAV_PUBLIC void bgav_options_set_shrink(bgav_options_t *opt, int factor)
Shrink factor.
bgav_edl_segment_t::dst_time
int64_t dst_time
Time within the destination in destination timescale.
Definition: avdec.h:1125
bgav_t
struct bgav_s bgav_t
Opaque decoder structure.
Definition: avdec.h:78
bgav_buffer_callback
void(* bgav_buffer_callback)(void *data, float percentage)
Function to be called if the input module is buffering data.
Definition: avdec.h:788
bgav_options_destroy
BGAV_PUBLIC void bgav_options_destroy(bgav_options_t *opt)
Destroy option cotainer.
bgav_seek_audio
BGAV_PUBLIC void bgav_seek_audio(bgav_t *bgav, int stream, int64_t sample)
Seek to a specific audio sample.
bgav_edl_stream_t::segments
bgav_edl_segment_t * segments
Segments.
Definition: avdec.h:1139
bgav_options_set_http_proxy_auth
BGAV_PUBLIC void bgav_options_set_http_proxy_auth(bgav_options_t *opt, int enable)
Enable or disable proxy authentication.
bgav_options_set_buffer_callback
BGAV_PUBLIC void bgav_options_set_buffer_callback(bgav_options_t *opt, bgav_buffer_callback callback, void *data)
Set the callback for buffering notification.
bgav_device_info_destroy
BGAV_PUBLIC void bgav_device_info_destroy(bgav_device_info_t *arr)
Destroy a device info array.
bgav_close
BGAV_PUBLIC void bgav_close(bgav_t *bgav)
Close a decoder and free all associated memory.
bgav_options_set_ftp_anonymous_password
BGAV_PUBLIC void bgav_options_set_ftp_anonymous_password(bgav_options_t *opt, const char *pass)
Set anonymous password.
bgav_set_video_stream
BGAV_PUBLIC int bgav_set_video_stream(bgav_t *bgav, int stream, bgav_stream_action_t action)
Select mode for a video stream.
bgav_edl_track_t::video_streams
bgav_edl_stream_t * video_streams
Logical video streams.
Definition: avdec.h:1156
bgav_options_set_dump_indices
BGAV_PUBLIC void bgav_options_set_dump_indices(bgav_options_t *opt, int enable)
Dump file indices.
bgav_options_set_http_proxy_user
BGAV_PUBLIC void bgav_options_set_http_proxy_user(bgav_options_t *opt, const char *user)
Set proxy username.
bgav_audio_start_time
BGAV_PUBLIC int64_t bgav_audio_start_time(bgav_t *bgav, int stream)
Get the audio start time.
bgav_redirectors_dump
BGAV_PUBLIC void bgav_redirectors_dump()
Dump informations about all available redirectors to stderr.
bgav_metadata_get_comment
BGAV_PUBLIC const char * bgav_metadata_get_comment(const bgav_metadata_t *metadata)
Get an additional comment of the track.
bgav_options_set_postprocessing_level
BGAV_PUBLIC void bgav_options_set_postprocessing_level(bgav_options_t *opt, float pp_level)
Set postprocessing level.
bgav_edl_track_t::num_video_streams
int num_video_streams
Number of logical video streams.
Definition: avdec.h:1155
bgav_video_keyframe_before
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.
bgav_open
BGAV_PUBLIC int bgav_open(bgav_t *bgav, const char *location)
Open a file or URL.
bgav_device_info_t::name
char * name
Definition: avdec.h:902
gavl.h
bgav_options_set_cache_size
BGAV_PUBLIC void bgav_options_set_cache_size(bgav_options_t *opt, int s)
Set the maximum total size of the index cache.
bgav_options_set_rtp_try_tcp
BGAV_PUBLIC void bgav_options_set_rtp_try_tcp(bgav_options_t *opt, int enable)
Try TCP before UDP.
BGAV_STREAM_PARSE
Definition: avdec.h:1484
bgav_log_level_t
bgav_log_level_t
Enumeration for log levels.
Definition: avdec.h:684
bgav_video_duration
BGAV_PUBLIC int64_t bgav_video_duration(bgav_t *bgav, int stream)
Get the video duration.
bgav_formats_dump
BGAV_PUBLIC void bgav_formats_dump()
Dump informations about all available format demuxers to stderr.
bgav_can_pause
BGAV_PUBLIC int bgav_can_pause(bgav_t *bgav)
Query if a track is pausable.
bgav_metadata_get_copyright
BGAV_PUBLIC const char * bgav_metadata_get_copyright(const bgav_metadata_t *metadata)
Get the copyright notice of the track.
gavl_video_frame_t
bgav_subreaders_dump
BGAV_PUBLIC void bgav_subreaders_dump()
Dump informations about all available subtitle readers to stderr.
bgav_options_set_log_level
BGAV_PUBLIC void bgav_options_set_log_level(bgav_options_t *opt, int level)
Set the verbosity for log messages.
bgav_edl_segment_t::src_time
int64_t src_time
Time within the source in source timescale.
Definition: avdec.h:1121
bgav_video_start_time
BGAV_PUBLIC int64_t bgav_video_start_time(bgav_t *bgav, int stream)
Get the video start time.
bgav_get_description
BGAV_PUBLIC const char * bgav_get_description(bgav_t *bgav)
Get a technical description of the format.
bgav_check_device_dvd
BGAV_PUBLIC int bgav_check_device_dvd(const char *device, char **name)
Test if a device is DVD capable.
bgav_edl_dump
BGAV_PUBLIC void bgav_edl_dump(const bgav_edl_t *e)
Dump an EDL to stderr.
bgav_user_pass_callback
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.
Definition: avdec.h:813
bgav_read_video
BGAV_PUBLIC int bgav_read_video(bgav_t *bgav, gavl_video_frame_t *frame, int stream)
Decode a video frame.
bgav_stream_action_t
bgav_stream_action_t
Stream action.
Definition: avdec.h:1480
bgav_metadata_get_artist
BGAV_PUBLIC const char * bgav_metadata_get_artist(const bgav_metadata_t *metadata)
Get the artist (or performer) of this track.
bgav_edl_s
EDL structure.
Definition: avdec.h:1169
bgav_edl_track_t::num_subtitle_text_streams
int num_subtitle_text_streams
Number of logical text subtitle streams.
Definition: avdec.h:1158
gavl_compression_info_t
bgav_open_fd
BGAV_PUBLIC int bgav_open_fd(bgav_t *bgav, int fd, int64_t total_size, const char *mimetype)
Open a decoder from a filedescriptor.
bgav_open_dvb
BGAV_PUBLIC int bgav_open_dvb(bgav_t *bgav, const char *location)
Open a DVB device.
bgav_edl_s::num_tracks
int num_tracks
Number of logical tracks.
Definition: avdec.h:1171
bgav_start
BGAV_PUBLIC int bgav_start(bgav_t *bgav)
Start all codecs.
bgav_options_set_dvb_channels_file
BGAV_PUBLIC void bgav_options_set_dvb_channels_file(bgav_options_t *opt, const char *file)
Set DVB channels file.
bgav_seek
BGAV_PUBLIC void bgav_seek(bgav_t *bgav, gavl_time_t *time)
Seek to a specific time.
bgav_options_t
struct bgav_options_s bgav_options_t
Opaque option container.
Definition: avdec.h:223
bgav_options_set_http_proxy_port
BGAV_PUBLIC void bgav_options_set_http_proxy_port(bgav_options_t *opt, int port)
Set proxy port.
bgav_edl_track_t::num_audio_streams
int num_audio_streams
Number of logical audio streams.
Definition: avdec.h:1152
bgav_metadata_get_date
BGAV_PUBLIC const char * bgav_metadata_get_date(const bgav_metadata_t *metadata)
Get the date of the recording.
bgav_create
BGAV_PUBLIC bgav_t * bgav_create()
Create a decoder instance.
bgav_options_set_dump_headers
BGAV_PUBLIC void bgav_options_set_dump_headers(bgav_options_t *opt, int enable)
Dump file headers.
bgav_device_info_t
Info structure for a device.
Definition: avdec.h:899
bgav_get_duration
BGAV_PUBLIC gavl_time_t bgav_get_duration(bgav_t *bgav, int track)
Get the duration of a track.
bgav_seek_scaled
BGAV_PUBLIC void bgav_seek_scaled(bgav_t *bgav, int64_t *time, int scale)
Seek to a specific stream position.
bgav_edl_segment_t::speed_den
int32_t speed_den
Playback speed demoninator.
Definition: avdec.h:1130
bgav_get_audio_compression_info
BGAV_PUBLIC int bgav_get_audio_compression_info(bgav_t *bgav, int stream, gavl_compression_info_t *info)
Get audio compression info.
bgav_edl_track_t::subtitle_overlay_streams
bgav_edl_stream_t * subtitle_overlay_streams
Logical overlay subtitle streams.
Definition: avdec.h:1162
bgav_redirector_get_num_urls
BGAV_PUBLIC int bgav_redirector_get_num_urls(bgav_t *bgav)
Get the number of URLs found in the redirector.
bgav_set_audio_stream
BGAV_PUBLIC int bgav_set_audio_stream(bgav_t *bgav, int stream, bgav_stream_action_t action)
Select mode for an audio stream.
bgav_edl_segment_t::dst_duration
int64_t dst_duration
Duration within the destination in destination timescale.
Definition: avdec.h:1126
bgav_options_set_ftp_anonymous
BGAV_PUBLIC void bgav_options_set_ftp_anonymous(bgav_options_t *opt, int enable)
Enable or disable anonymous ftp login.
bgav_get_subtitle_format
BGAV_PUBLIC const gavl_video_format_t * bgav_get_subtitle_format(bgav_t *bgav, int stream)
Get the video format of a subtitle stream.
gavl_overlay_t
bgav_index_callback
void(* bgav_index_callback)(void *data, float percentage)
Function to be called periodically while an index is built.
Definition: avdec.h:865
bgav_read_audio
BGAV_PUBLIC int bgav_read_audio(bgav_t *bgav, gavl_audio_frame_t *frame, int stream, int num_samples)
Decode audio samples.
bgav_metadata_get_genre
BGAV_PUBLIC const char * bgav_metadata_get_genre(const bgav_metadata_t *metadata)
Get the genre this track belongs to.
bgav_get_disc_name
BGAV_PUBLIC const char * bgav_get_disc_name(bgav_t *bgav)
Get the name of a disc.
bgav_options_copy
BGAV_PUBLIC void bgav_options_copy(bgav_options_t *dst, const bgav_options_t *src)
Copy options.
BGAV_STREAM_DECODE
Definition: avdec.h:1483
bgav_metadata_get_track
BGAV_PUBLIC int bgav_metadata_get_track(const bgav_metadata_t *metadata)
Get the track index.
bgav_audio_duration
BGAV_PUBLIC int64_t bgav_audio_duration(bgav_t *bgav, int stream)
Get the audio duration.
bgav_num_tracks
BGAV_PUBLIC int bgav_num_tracks(bgav_t *bgav)
Get the number of tracks.
bgav_get_audio_metadata
BGAV_PUBLIC const bgav_metadata_t * bgav_get_audio_metadata(bgav_t *bgav, int stream)
Get the metadata of an audio stream.
bgav_options_set_rtp_port_base
BGAV_PUBLIC void bgav_options_set_rtp_port_base(bgav_options_t *opt, int p)
Set RTP port pase.
bgav_edl_segment_t
One segment of a physical stream to appear in a logical stream.
Definition: avdec.h:1113
bgav_read_audio_packet
BGAV_PUBLIC int bgav_read_audio_packet(bgav_t *bgav, int stream, gavl_packet_t *p)
Read compressed audio packet.
bgav_edl_segment_t::track
int track
Track index for multitrack inputs.
Definition: avdec.h:1117
bgav_options_set_read_timeout
BGAV_PUBLIC void bgav_options_set_read_timeout(bgav_options_t *opt, int timeout)
Set read timeout.
bgav_codecs_dump
BGAV_PUBLIC void bgav_codecs_dump()
Dump informations about all available codecs to stderr.
bgav_edl_s::url
char * url
Filename if all streams are from the same file.
Definition: avdec.h:1173
bgav_metadata_get_albumartist
BGAV_PUBLIC const char * bgav_metadata_get_albumartist(const bgav_metadata_t *metadata)
Get the album artist of this track.
bgav_video_has_still
BGAV_PUBLIC int bgav_video_has_still(bgav_t *bgav, int stream)
Determine if a still image is available for reading.
gavl_time_t
int64_t gavl_time_t
bgav_options_set_seek_subtitles
BGAV_PUBLIC void bgav_options_set_seek_subtitles(bgav_options_t *opt, int seek_subtitles)
Enable external subtitle files.
bgav_edl_segment_t::url
char * url
Location of that segment. If NULL, the "master url" in bgav_edl_t is valid.
Definition: avdec.h:1115
bgav_edl_stream_t::timescale
int timescale
Destination timescale.
Definition: avdec.h:1141
bgav_get_video_format
BGAV_PUBLIC const gavl_video_format_t * bgav_get_video_format(bgav_t *bgav, int stream)
Get the format of a video stream.
bgav_has_subtitle
BGAV_PUBLIC int bgav_has_subtitle(bgav_t *bgav, int stream)
Check, if a new subtitle is available.
bgav_eject_disc
BGAV_PUBLIC int bgav_eject_disc(const char *device)
Eject a disc.
bgav_skip_video
BGAV_PUBLIC void bgav_skip_video(bgav_t *bgav, int stream, int64_t *time, int scale, int exact)
Skip forward in a video stream.
bgav_get_video_metadata
BGAV_PUBLIC const bgav_metadata_t * bgav_get_video_metadata(bgav_t *bgav, int stream)
Get the metadata of a video stream.
bgav_options_set_default_subtitle_encoding
BGAV_PUBLIC void bgav_options_set_default_subtitle_encoding(bgav_options_t *opt, const char *encoding)
Set default subtitle encoding.
bgav_options_create
BGAV_PUBLIC bgav_options_t * bgav_options_create()
Create an options container.
bgav_options_set_threads
BGAV_PUBLIC void bgav_options_set_threads(bgav_options_t *opt, int threads)
Set number of threads.
bgav_num_audio_streams
BGAV_PUBLIC int bgav_num_audio_streams(bgav_t *bgav, int track)
Get the number of audio streams of a track.
bgav_name_change_callback
void(* bgav_name_change_callback)(void *data, const char *name)
Function to be called if the track name changes.
Definition: avdec.h:741
bgav_options_set_connect_timeout
BGAV_PUBLIC void bgav_options_set_connect_timeout(bgav_options_t *opt, int timeout)
Set connect timeout.
bgav_num_subtitle_streams
BGAV_PUBLIC int bgav_num_subtitle_streams(bgav_t *bgav, int track)
Get the number of subtitle streams of a track.
bgav_find_devices_dvd
BGAV_PUBLIC bgav_device_info_t * bgav_find_devices_dvd()
Scan for DVD capable devices.
bgav_open_vcd
BGAV_PUBLIC int bgav_open_vcd(bgav_t *bgav, const char *location)
Open a VCD device.
bgav_options_set_metadata_change_callback
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.
bgav_metadata_get_author
BGAV_PUBLIC const char * bgav_metadata_get_author(const bgav_metadata_t *metadata)
Get the author (or composer) of the track.
bgav_get_subtitle_metadata
BGAV_PUBLIC const bgav_metadata_t * bgav_get_subtitle_metadata(bgav_t *bgav, int stream)
Get the metadata of a subtitle stream.
bgav_options_set_cache_time
BGAV_PUBLIC void bgav_options_set_cache_time(bgav_options_t *opt, int t)
Set the index creation time for caching.
bgav_subtitle_duration
BGAV_PUBLIC int64_t bgav_subtitle_duration(bgav_t *bgav, int stream)
Get the subtitle duration.
bgav_options_set_dv_datetime
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.
bgav_options_set_prefer_ffmpeg_demuxers
BGAV_PUBLIC void bgav_options_set_prefer_ffmpeg_demuxers(bgav_options_t *opt, int prefer)
Preference of ffmpeg demultiplexers.
gavl_audio_format_t
gavl_frame_table_t
bgav_video_keyframe_after
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.
bgav_options_set_http_proxy_host
BGAV_PUBLIC void bgav_options_set_http_proxy_host(bgav_options_t *opt, const char *host)
Set proxy host.
bgav_get_video_compression_info
BGAV_PUBLIC int bgav_get_video_compression_info(bgav_t *bgav, int stream, gavl_compression_info_t *info)
Get video compression info.
bgav_edl_segment_t::stream
int stream
Index of the A/V stream.
Definition: avdec.h:1118
bgav_get_edl
BGAV_PUBLIC bgav_edl_t * bgav_get_edl(bgav_t *bgav)
Get an EDL from an open decoder.
bgav_open_callbacks
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.
bgav_select_track
BGAV_PUBLIC int bgav_select_track(bgav_t *bgav, int track)
Select a track.
bgav_get_subtitle_description
BGAV_PUBLIC const char * bgav_get_subtitle_description(bgav_t *bgav, int stream)
Get the description of a subtitle stream.
bgav_get_frame_table
BGAV_PUBLIC gavl_frame_table_t * bgav_get_frame_table(bgav_t *bgav, int stream)
Get the frame table of a video stream.
bgav_options_set_name_change_callback
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.
bgav_options_set_audio_dynrange
BGAV_PUBLIC void bgav_options_set_audio_dynrange(bgav_options_t *opt, int audio_dynrange)
Enable dynamic range control.
bgav_edl_track_t
A locical track.
Definition: avdec.h:1147
BGAV_STREAM_READRAW
Definition: avdec.h:1485
bgav_open_dvd
BGAV_PUBLIC int bgav_open_dvd(bgav_t *bgav, const char *location)
Open a DVD device.
bgav_get_audio_language
BGAV_PUBLIC const char * bgav_get_audio_language(bgav_t *bgav, int stream)
Get the language of an audio stream.
bgav_options_set_http_proxy_pass
BGAV_PUBLIC void bgav_options_set_http_proxy_pass(bgav_options_t *opt, const char *pass)
Set proxy password.
bgav_can_seek_sample
BGAV_PUBLIC int bgav_can_seek_sample(bgav_t *bgav)
Check if a track is seekabkle with sample accuracy.
bgav_seek_subtitle
BGAV_PUBLIC void bgav_seek_subtitle(bgav_t *bgav, int stream, int64_t time)
Seek to a specific subtitle position.
bgav_get_audio_info
BGAV_PUBLIC const char * bgav_get_audio_info(bgav_t *bgav, int stream)
Get additional info about an audio stream.
gavl_packet_t
bgav_redirector_get_url
BGAV_PUBLIC const char * bgav_redirector_get_url(bgav_t *bgav, int index)
Get the address of an URL.
bgav_options_set_network_buffer_size
BGAV_PUBLIC void bgav_options_set_network_buffer_size(bgav_options_t *opt, int size)
Set network buffer size.
bgav_options_set_http_shoutcast_metadata
BGAV_PUBLIC void bgav_options_set_http_shoutcast_metadata(bgav_options_t *opt, int enable)
Enable or disable shoutcast metadata streaming.
gavl_video_format_s
bgav_edl_segment_t::timescale
int timescale
Source timescale.
Definition: avdec.h:1119
bgav_metadata_get_title
BGAV_PUBLIC const char * bgav_metadata_get_title(const bgav_metadata_t *metadata)
Get the title of the track.
bgav_redirector_get_name
BGAV_PUBLIC const char * bgav_redirector_get_name(bgav_t *bgav, int index)
Get the address of an URL.
bgav_read_subtitle_text
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.
bgav_get_chapter_time
BGAV_PUBLIC int64_t bgav_get_chapter_time(bgav_t *bgav, int track, int chapter)
Get the name of a chapter.
bgav_options_set_aspect_callback
BGAV_PUBLIC void bgav_options_set_aspect_callback(bgav_options_t *opt, bgav_aspect_callback callback, void *data)
Set aspect ratio change callback.
BGAV_STREAM_MUTE
Definition: avdec.h:1482
bgav_get_subtitle_info
BGAV_PUBLIC const char * bgav_get_subtitle_info(bgav_t *bgav, int stream)
Get additional info about a subtitle stream.
bgav_aspect_callback
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.
Definition: avdec.h:842
bgav_edl_track_t::subtitle_text_streams
bgav_edl_stream_t * subtitle_text_streams
Logical text subtitle streams.
Definition: avdec.h:1159
bgav_metadata_get_album
BGAV_PUBLIC const char * bgav_metadata_get_album(const bgav_metadata_t *metadata)
Get the album this track comes from.
bgav_edl_stream_t::num_segments
int num_segments
Number of segments.
Definition: avdec.h:1140
bgav_num_video_streams
BGAV_PUBLIC int bgav_num_video_streams(bgav_t *bgav, int track)
Get the number of video streams of a track.
bgav_edl_track_t::num_subtitle_overlay_streams
int num_subtitle_overlay_streams
Number of logical overlay subtitle streams.
Definition: avdec.h:1161