gmerlin-avdecoder
avdec.h
Go to the documentation of this file.
1/*****************************************************************
2 * gmerlin-avdecoder - a general purpose multimedia decoding library
3 *
4 * Copyright (c) 2001 - 2012 Members of the Gmerlin project
5 * gmerlin-general@lists.sourceforge.net
6 * http://gmerlin.sourceforge.net
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * *****************************************************************/
21
22/* Public entry points */
23
29#include <gavl/gavl.h>
30#include <gavl/compression.h>
31#include <gavl/metadata.h>
32#include <gavl/chapterlist.h>
33#include <gavl/connectors.h>
34#include <gavl/edl.h>
35#include <gavl/msg.h>
36
37#include "bgavdefs.h" // This is ugly, but works
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
76typedef struct bgav_s bgav_t;
77
83BGAV_PUBLIC
85
116typedef gavl_dictionary_t bgav_metadata_t;
117
124BGAV_PUBLIC
125const char * bgav_metadata_get_author(const bgav_metadata_t*metadata);
126
133BGAV_PUBLIC
134const char * bgav_metadata_get_title(const bgav_metadata_t * metadata);
135
142BGAV_PUBLIC
143const char * bgav_metadata_get_comment(const bgav_metadata_t * metadata);
144
151BGAV_PUBLIC
152const char * bgav_metadata_get_copyright(const bgav_metadata_t * metadata);
153
160BGAV_PUBLIC
161const char * bgav_metadata_get_album(const bgav_metadata_t * metadata);
162
169BGAV_PUBLIC
170const char * bgav_metadata_get_artist(const bgav_metadata_t * metadata);
171
178BGAV_PUBLIC
179const char * bgav_metadata_get_albumartist(const bgav_metadata_t * metadata);
180
187BGAV_PUBLIC
188const char * bgav_metadata_get_genre(const bgav_metadata_t * metadata);
189
196BGAV_PUBLIC
197const char * bgav_metadata_get_date(const bgav_metadata_t * metadata);
198
205BGAV_PUBLIC
207
208/***************************************************
209 * Housekeeping Functions
210 ***************************************************/
211
212/***************************************************
213 * Set parameters
214 ***************************************************/
215
216
221typedef struct bgav_options_s bgav_options_t;
222
232BGAV_PUBLIC
234
249BGAV_PUBLIC
251
261BGAV_PUBLIC
263
270BGAV_PUBLIC
272
282BGAV_PUBLIC
284
294BGAV_PUBLIC
296
311BGAV_PUBLIC
313
323BGAV_PUBLIC
325
335BGAV_PUBLIC
337
338
339/* HTTP Options */
340
351BGAV_PUBLIC
353
363BGAV_PUBLIC
365
375BGAV_PUBLIC
377
388BGAV_PUBLIC
390
399BGAV_PUBLIC
401
410BGAV_PUBLIC
412
421BGAV_PUBLIC
423
424/* Set FTP options */
425
432BGAV_PUBLIC
434
443BGAV_PUBLIC
445
457BGAV_PUBLIC
459 const char* encoding);
460
471BGAV_PUBLIC
473 int audio_dynrange);
474
475
489BGAV_PUBLIC
491
503BGAV_PUBLIC
505
515BGAV_PUBLIC
517
533BGAV_PUBLIC
535 int seek_subtitles);
536
546BGAV_PUBLIC
548 int pp_level);
549
558BGAV_PUBLIC
560 float pp_level);
561
570BGAV_PUBLIC
572
573
585BGAV_PUBLIC
587 const char * file);
588
600BGAV_PUBLIC
602 int prefer);
603
610BGAV_PUBLIC
612 int datetime);
613
623BGAV_PUBLIC
625 int factor);
626
638BGAV_PUBLIC
640 int vdpau);
641
651BGAV_PUBLIC
653 int vaapi);
654
663BGAV_PUBLIC
665 int enable);
666
675BGAV_PUBLIC
677 int enable);
678
679
688BGAV_PUBLIC
690 int enable);
691
692
700/* Set callbacks */
701
712typedef void (*bgav_metadata_change_callback)(void*data, const bgav_metadata_t * metadata);
713
721BGAV_PUBLIC void
724 void * data);
725
735typedef void (*bgav_buffer_callback)(void*data, float percentage);
736
744BGAV_PUBLIC void
746 bgav_buffer_callback callback,
747 void * data);
748
760typedef int (*bgav_user_pass_callback)(void*data, const char * resource,
761 char ** username, char ** password);
762
774BGAV_PUBLIC void
777 void * data);
778
789typedef void (*bgav_aspect_callback)(void*data, int stream,
790 int pixel_width, int pixel_height);
791
792
800BGAV_PUBLIC void
802 bgav_aspect_callback callback,
803 void * data);
804
812typedef void (*bgav_index_callback)(void*data, float percentage);
813
821BGAV_PUBLIC void
823 bgav_index_callback callback,
824 void * data);
825
826BGAV_PUBLIC void
827bgav_set_msg_callback_by_id(bgav_t* b,
828 int id,
829 gavl_handle_msg_func callback,
830 void * data);
831
832
833
834/* Device description */
835
853typedef struct
854 {
855 char * device;
856 char * name;
858
859/* Scan for devices */
860
868BGAV_PUBLIC
870
878BGAV_PUBLIC
879int bgav_check_device_vcd(const char * device, char ** name);
880
888BGAV_PUBLIC
890
898BGAV_PUBLIC
899int bgav_check_device_dvd(const char * device, char ** name);
900
908BGAV_PUBLIC
910
918BGAV_PUBLIC
919int bgav_check_device_dvb(const char * device, char ** name);
920
927BGAV_PUBLIC
929
936BGAV_PUBLIC
937int bgav_eject_disc(const char * device);
938
945BGAV_PUBLIC
946const char * bgav_get_disc_name(bgav_t * bgav);
947
948/******************************************************
949 * Open
950 ******************************************************/
951
952/* Open a file or URL, return 1 on success */
953
961BGAV_PUBLIC
962int bgav_open(bgav_t * bgav, const char * location);
963
971BGAV_PUBLIC
972int bgav_open_vcd(bgav_t * bgav, const char * location);
973
981BGAV_PUBLIC
982int bgav_open_dvd(bgav_t * bgav, const char * location);
983
995BGAV_PUBLIC
996int bgav_open_dvb(bgav_t * bgav, const char * location);
997
1010BGAV_PUBLIC
1012 int (*read_callback)(void * priv, uint8_t * data, int len),
1013 int64_t (*seek_callback)(void * priv, int64_t pos, int whence),
1014 void * priv,
1015 const char * filename, const char * mimetype, int64_t total_bytes);
1016
1017
1018
1019
1020
1021/* Close and destroy everything */
1022
1028BGAV_PUBLIC
1029void bgav_close(bgav_t * bgav);
1030
1037BGAV_PUBLIC
1038const gavl_dictionary_t * bgav_get_edl(bgav_t * bgav);
1039
1040/***************************************************
1041 * Check for redirecting: You MUST check if you opened
1042 * a redirector, because reading data from redirectors
1043 * crashes
1044 * After you read the URLs, close the bgav_t object
1045 * and open a new one with one of the URLs.
1046 ***************************************************/
1047
1070#if 0
1071
1072
1079BGAV_PUBLIC
1080int bgav_redirector_get_num_urls(bgav_t * bgav);
1081
1089BGAV_PUBLIC
1090const char * bgav_redirector_get_url(bgav_t * bgav, int index);
1091
1099BGAV_PUBLIC
1100const char * bgav_redirector_get_name(bgav_t * bgav, int index);
1101
1109BGAV_PUBLIC
1110const gavl_dictionary_t * bgav_redirector_get_metadata(bgav_t * b, int index);
1111
1112#endif
1113
1114/***************************************************
1115 * Get information about the file
1116 ***************************************************/
1117
1131BGAV_PUBLIC
1133
1140BGAV_PUBLIC
1141const char * bgav_get_description(bgav_t * bgav);
1142
1150BGAV_PUBLIC
1152
1153/* Query stream numbers */
1154
1162BGAV_PUBLIC
1163int bgav_num_audio_streams(bgav_t * bgav, int track);
1164
1172BGAV_PUBLIC
1173int bgav_num_video_streams(bgav_t * bgav, int track);
1174
1187BGAV_PUBLIC
1188int bgav_num_subtitle_streams(bgav_t * bgav, int track);
1189
1197BGAV_PUBLIC
1198int bgav_num_text_streams(bgav_t * bgav, int track);
1199
1207BGAV_PUBLIC
1208int bgav_num_overlay_streams(bgav_t * bgav, int track);
1209
1217BGAV_PUBLIC
1218const char * bgav_get_track_name(bgav_t * bgav, int track);
1219
1227BGAV_PUBLIC
1228const bgav_metadata_t * bgav_get_metadata(bgav_t * bgav,int track);
1229
1244BGAV_PUBLIC
1245gavl_dictionary_t * bgav_get_media_info(bgav_t * bgav);
1246
1247
1259BGAV_PUBLIC
1260int bgav_select_track(bgav_t * bgav, int track);
1261
1274BGAV_PUBLIC
1275int bgav_get_num_chapters(bgav_t * bgav, int track, int * timescale);
1276
1285BGAV_PUBLIC const char *
1286bgav_get_chapter_name(bgav_t * bgav, int track, int chapter);
1287
1296BGAV_PUBLIC
1297int64_t bgav_get_chapter_time(bgav_t * bgav, int track, int chapter);
1298
1309BGAV_PUBLIC
1310const gavl_chapter_list_t * bgav_get_chapter_list(bgav_t * bgav, int track);
1311
1312
1328BGAV_PUBLIC
1329const char * bgav_get_audio_language(bgav_t * bgav, int stream);
1330
1338BGAV_PUBLIC
1339int bgav_get_audio_bitrate(bgav_t * bgav, int stream);
1340
1348BGAV_PUBLIC
1349const bgav_metadata_t *
1351
1360BGAV_PUBLIC
1362
1370BGAV_PUBLIC
1371const char * bgav_get_subtitle_language(bgav_t * bgav, int stream);
1372
1380BGAV_PUBLIC
1381const bgav_metadata_t *
1383
1391BGAV_PUBLIC
1392const bgav_metadata_t *
1394
1403BGAV_PUBLIC
1404const bgav_metadata_t *
1405bgav_get_text_metadata_t(bgav_t * b, int track, int stream);
1406
1414BGAV_PUBLIC
1415const bgav_metadata_t *
1417
1426BGAV_PUBLIC
1427const bgav_metadata_t *
1428bgav_get_overlay_metadata_t(bgav_t * b, int track, int stream);
1429
1430
1438BGAV_PUBLIC
1439const bgav_metadata_t *
1441
1450BGAV_PUBLIC
1451const bgav_metadata_t *
1453
1454
1470
1501BGAV_PUBLIC
1504
1517BGAV_PUBLIC
1520
1533BGAV_PUBLIC
1536
1537
1549BGAV_PUBLIC
1550int bgav_read_audio_packet(bgav_t * bgav, int stream, gavl_packet_t * p);
1551
1561BGAV_PUBLIC
1562gavl_packet_source_t *
1564
1565
1577BGAV_PUBLIC
1578int bgav_read_video_packet(bgav_t * bgav, int stream, gavl_packet_t * p);
1579
1589BGAV_PUBLIC
1590gavl_packet_source_t *
1592
1602BGAV_PUBLIC
1603gavl_packet_source_t *
1605
1613BGAV_PUBLIC
1614gavl_packet_source_t *
1616
1617
1628BGAV_PUBLIC
1629int bgav_set_audio_stream(bgav_t * bgav, int stream, bgav_stream_action_t action);
1630
1641BGAV_PUBLIC
1642int bgav_set_video_stream(bgav_t * bgav, int stream, bgav_stream_action_t action);
1643
1654BGAV_PUBLIC
1655int bgav_set_subtitle_stream(bgav_t * bgav, int stream,
1656 bgav_stream_action_t action);
1657
1668BGAV_PUBLIC
1669int bgav_set_text_stream(bgav_t * bgav, int stream,
1670 bgav_stream_action_t action);
1671
1682BGAV_PUBLIC
1683int bgav_set_overlay_stream(bgav_t * bgav, int stream,
1684 bgav_stream_action_t action);
1685
1686/***************************************************
1687 * Stream handling functions
1688 ***************************************************/
1689
1690/*
1691 * You MUST these, if you want to decode anything.
1692 * After bgav_open(), all streams are switched off by
1693 * default
1694 */
1695
1696
1710BGAV_PUBLIC
1711int bgav_start(bgav_t * bgav);
1712
1713BGAV_PUBLIC
1714int bgav_pause(bgav_t * bgav);
1715
1716BGAV_PUBLIC
1717int bgav_resume(bgav_t * bgav);
1718
1719
1735BGAV_PUBLIC
1737
1751 BGAV_PUBLIC
1752 const gavl_audio_format_t * bgav_get_audio_format_t(bgav_t * bgav, int track, int stream);
1753
1770BGAV_PUBLIC
1772
1790BGAV_PUBLIC
1791const gavl_video_format_t * bgav_get_video_format_t(bgav_t * bgav, int t, int stream);
1792
1805BGAV_PUBLIC
1807
1819BGAV_PUBLIC
1820int bgav_get_text_timescale(bgav_t * bgav, int stream);
1821
1822
1842BGAV_PUBLIC
1844
1845
1863BGAV_PUBLIC const gavl_video_format_t *
1865
1876BGAV_PUBLIC
1877int bgav_subtitle_is_text(bgav_t * bgav, int stream);
1878
1890BGAV_PUBLIC
1891const char * bgav_get_audio_description(bgav_t * bgav, int stream);
1892
1907BGAV_PUBLIC
1908const char * bgav_get_audio_info(bgav_t * bgav, int stream);
1909
1910
1922BGAV_PUBLIC
1923const char * bgav_get_video_description(bgav_t * bgav, int stream);
1924
1936BGAV_PUBLIC
1937const char * bgav_get_subtitle_description(bgav_t * bgav, int stream);
1938
1939
1954BGAV_PUBLIC
1955const char * bgav_get_subtitle_info(bgav_t * bgav, int stream);
1956
1966BGAV_PUBLIC
1968
1969/***************************************************
1970 * Decoding functions
1971 ***************************************************/
1972
1994BGAV_PUBLIC
1995int bgav_video_has_still(bgav_t * bgav, int stream);
1996
2005BGAV_PUBLIC
2006int bgav_read_video(bgav_t * bgav, gavl_video_frame_t * frame, int stream);
2007
2021BGAV_PUBLIC
2022void bgav_skip_video(bgav_t * bgav, int stream,
2023 int64_t * time, int scale,
2024 int exact);
2025
2039BGAV_PUBLIC
2040gavl_video_source_t * bgav_get_video_source(bgav_t * bgav, int stream);
2041
2050BGAV_PUBLIC
2051gavl_video_source_t * bgav_get_overlay_source(bgav_t * bgav, int stream);
2052
2053
2063BGAV_PUBLIC
2064int bgav_read_audio(bgav_t * bgav, gavl_audio_frame_t * frame, int stream,
2065 int num_samples);
2066
2079BGAV_PUBLIC
2080gavl_audio_source_t * bgav_get_audio_source(bgav_t * bgav, int stream);
2081
2082
2083
2095BGAV_PUBLIC
2096int bgav_has_subtitle(bgav_t * bgav, int stream);
2097
2113BGAV_PUBLIC
2114int bgav_read_subtitle_overlay(bgav_t * bgav, gavl_overlay_t * ovl, int stream);
2115
2135BGAV_PUBLIC
2136int bgav_read_subtitle_text(bgav_t * bgav, char ** ret, int *ret_alloc,
2137 int64_t * start_time, int64_t * duration,
2138 int stream);
2139
2140/***************************************************
2141 * Seek to a timestamp. This also resyncs all streams
2142 ***************************************************/
2143
2180BGAV_PUBLIC
2182
2191BGAV_PUBLIC
2192void bgav_seek(bgav_t * bgav, gavl_time_t * time);
2193
2194
2218BGAV_PUBLIC
2219void bgav_seek_scaled(bgav_t * bgav, int64_t * time, int scale);
2220
2225#define BGAV_TIMESTAMP_UNDEFINED GAVL_TIME_UNDEFINED // Don't change this
2242BGAV_PUBLIC
2244
2245
2258BGAV_PUBLIC
2259int64_t bgav_audio_duration(bgav_t * bgav, int stream);
2260
2272BGAV_PUBLIC
2273int64_t bgav_audio_start_time(bgav_t * bgav, int stream);
2274
2287BGAV_PUBLIC
2288int64_t bgav_video_duration(bgav_t * bgav, int stream);
2289
2301BGAV_PUBLIC
2302int64_t bgav_video_start_time(bgav_t * bgav, int stream);
2303
2304
2314BGAV_PUBLIC
2315int64_t bgav_subtitle_duration(bgav_t * bgav, int stream);
2316
2326BGAV_PUBLIC
2327int64_t bgav_text_duration(bgav_t * bgav, int stream);
2328
2338BGAV_PUBLIC
2339int64_t bgav_overlay_duration(bgav_t * bgav, int stream);
2340
2341
2342
2356BGAV_PUBLIC
2357void bgav_seek_audio(bgav_t * bgav, int stream, int64_t sample);
2358
2372BGAV_PUBLIC
2373void bgav_seek_video(bgav_t * bgav, int stream, int64_t time);
2374
2390BGAV_PUBLIC
2391int64_t bgav_video_keyframe_before(bgav_t * bgav, int stream, int64_t time);
2392
2408BGAV_PUBLIC
2409int64_t bgav_video_keyframe_after(bgav_t * bgav, int stream, int64_t time);
2410
2411
2422BGAV_PUBLIC
2423void bgav_seek_subtitle(bgav_t * bgav, int stream, int64_t time);
2424
2435BGAV_PUBLIC
2436void bgav_seek_text(bgav_t * bgav, int stream, int64_t time);
2437
2448BGAV_PUBLIC
2449void bgav_seek_overlay(bgav_t * bgav, int stream, int64_t time);
2450
2451
2469typedef struct bgav_stream_decoder_s bgav_stream_decoder_t;
2470
2475BGAV_PUBLIC
2477
2483BGAV_PUBLIC bgav_options_t *
2485
2502BGAV_PUBLIC gavl_audio_source_t *
2504 gavl_packet_source_t * src,
2505 const gavl_compression_info_t * ci,
2506 const gavl_audio_format_t * fmt,
2507 gavl_dictionary_t * m);
2508
2525BGAV_PUBLIC gavl_video_source_t *
2527 gavl_packet_source_t * src,
2528 const gavl_compression_info_t * ci,
2529 const gavl_video_format_t * fmt,
2530 gavl_dictionary_t * m);
2531
2548BGAV_PUBLIC gavl_video_source_t *
2550 gavl_packet_source_t * src,
2551 const gavl_compression_info_t * ci,
2552 const gavl_video_format_t * fmt,
2553 gavl_dictionary_t * m);
2554
2565BGAV_PUBLIC int64_t
2567
2574BGAV_PUBLIC void
2576
2581BGAV_PUBLIC void
2583
2593BGAV_PUBLIC gavl_codec_id_t *
2595
2604BGAV_PUBLIC
2606
2607BGAV_PUBLIC
2608int bgav_set_stream_action_all(bgav_t * bgav, int idx, bgav_stream_action_t action);
2609
2615/***************************************************
2616 * Debugging functions
2617 ***************************************************/
2618
2627BGAV_PUBLIC
2628void bgav_dump(bgav_t * bgav);
2629
2630/* Dump infos about the installed codecs */
2631
2639BGAV_PUBLIC
2641
2642/* Dump known media formats */
2643
2651BGAV_PUBLIC
2653
2661BGAV_PUBLIC
2663
2671BGAV_PUBLIC
2673
2681BGAV_PUBLIC
2683
2684
2685#ifdef __cplusplus
2686}
2687#endif
2688
struct bgav_stream_decoder_s bgav_stream_decoder_t
Forward declaration for a stream decoder.
Definition avdec.h:2469
BGAV_PUBLIC int64_t bgav_stream_decoder_skip(bgav_stream_decoder_t *dec, int64_t t, int scale)
Skip to a specified time.
BGAV_PUBLIC bgav_options_t * bgav_stream_decoder_get_options(bgav_stream_decoder_t *dec)
Get options for a stream decoder.
BGAV_PUBLIC void bgav_stream_decoder_reset(bgav_stream_decoder_t *dec)
Reset a stream decoder.
BGAV_PUBLIC gavl_codec_id_t * bgav_supported_video_compressions()
Get supported video compressions.
BGAV_PUBLIC void bgav_stream_decoder_destroy(bgav_stream_decoder_t *dec)
Destroy a stream decoder.
BGAV_PUBLIC gavl_video_source_t * bgav_stream_decoder_connect_overlay(bgav_stream_decoder_t *dec, gavl_packet_source_t *src, const gavl_compression_info_t *ci, const gavl_video_format_t *fmt, gavl_dictionary_t *m)
Connect an overlay stream decoder.
BGAV_PUBLIC gavl_audio_source_t * bgav_stream_decoder_connect_audio(bgav_stream_decoder_t *dec, gavl_packet_source_t *src, const gavl_compression_info_t *ci, const gavl_audio_format_t *fmt, gavl_dictionary_t *m)
Connect an audio stream decoder.
BGAV_PUBLIC bgav_stream_decoder_t * bgav_stream_decoder_create()
Create a stream decoder.
BGAV_PUBLIC gavl_video_source_t * bgav_stream_decoder_connect_video(bgav_stream_decoder_t *dec, gavl_packet_source_t *src, const gavl_compression_info_t *ci, const gavl_video_format_t *fmt, gavl_dictionary_t *m)
Connect a video stream decoder.
BGAV_PUBLIC gavl_codec_id_t * bgav_supported_audio_compressions()
Get supported audio compressions.
gavl_codec_id_t
BGAV_PUBLIC void bgav_subreaders_dump()
Dump informations about all available subtitle readers to stderr.
BGAV_PUBLIC void bgav_dump(bgav_t *bgav)
Dump informations of all tracks to stderr.
BGAV_PUBLIC void bgav_codecs_dump()
Dump informations about all available codecs to stderr.
BGAV_PUBLIC void bgav_inputs_dump()
Dump informations about all available input modules to stderr.
BGAV_PUBLIC void bgav_formats_dump()
Dump informations about all available format demuxers to stderr.
BGAV_PUBLIC void bgav_redirectors_dump()
Dump informations about all available redirectors to stderr.
BGAV_PUBLIC gavl_audio_source_t * bgav_get_audio_source(bgav_t *bgav, int stream)
Return the audio source for this 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)
Decode a text subtitle.
BGAV_PUBLIC int bgav_has_subtitle(bgav_t *bgav, int stream)
Check, if a new subtitle is available.
BGAV_PUBLIC int bgav_read_audio(bgav_t *bgav, gavl_audio_frame_t *frame, int stream, int num_samples)
Decode audio samples.
BGAV_PUBLIC gavl_video_source_t * bgav_get_overlay_source(bgav_t *bgav, int stream)
Return the video source for an overlay stream.
BGAV_PUBLIC int bgav_video_has_still(bgav_t *bgav, int stream)
Determine if a still image is available for reading.
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_PUBLIC int bgav_read_subtitle_overlay(bgav_t *bgav, gavl_overlay_t *ovl, int stream)
Decode an overlay subtitle.
BGAV_PUBLIC gavl_video_source_t * bgav_get_video_source(bgav_t *bgav, int stream)
Return the video source for a video stream.
BGAV_PUBLIC int bgav_read_video(bgav_t *bgav, gavl_video_frame_t *frame, int stream)
Decode a video frame.
struct bgav_s bgav_t
Opaque decoder structure.
Definition avdec.h:76
BGAV_PUBLIC void bgav_close(bgav_t *bgav)
Close a decoder and free all associated memory.
BGAV_PUBLIC bgav_t * bgav_create()
Create a decoder instance.
BGAV_PUBLIC const gavl_dictionary_t * bgav_get_edl(bgav_t *bgav)
Get an EDL from an open decoder.
BGAV_PUBLIC const char * bgav_get_disc_name(bgav_t *bgav)
Get the name of a disc.
BGAV_PUBLIC bgav_device_info_t * bgav_find_devices_dvb()
Scan for DVB capable devices.
BGAV_PUBLIC int bgav_check_device_dvb(const char *device, char **name)
Test if a device is DVB capable.
BGAV_PUBLIC int bgav_check_device_dvd(const char *device, char **name)
Test if a device is DVD capable.
BGAV_PUBLIC void bgav_device_info_destroy(bgav_device_info_t *arr)
Destroy a device info array.
BGAV_PUBLIC int bgav_check_device_vcd(const char *device, char **name)
Test if a device is VCD capable.
BGAV_PUBLIC bgav_device_info_t * bgav_find_devices_vcd()
Scan for VCD capable devices.
BGAV_PUBLIC int bgav_eject_disc(const char *device)
Eject a disc.
BGAV_PUBLIC bgav_device_info_t * bgav_find_devices_dvd()
Scan for DVD capable devices.
BGAV_PUBLIC const char * bgav_metadata_get_author(const bgav_metadata_t *metadata)
Get the author (or composer) of the track.
BGAV_PUBLIC const char * bgav_metadata_get_date(const bgav_metadata_t *metadata)
Get the date of the recording.
BGAV_PUBLIC const char * bgav_metadata_get_album(const bgav_metadata_t *metadata)
Get the album this track comes from.
BGAV_PUBLIC int bgav_metadata_get_track(const bgav_metadata_t *metadata)
Get the track index.
BGAV_PUBLIC const char * bgav_metadata_get_title(const bgav_metadata_t *metadata)
Get the title of the track.
BGAV_PUBLIC const char * bgav_metadata_get_albumartist(const bgav_metadata_t *metadata)
Get the album artist of this track.
BGAV_PUBLIC const char * bgav_metadata_get_genre(const bgav_metadata_t *metadata)
Get the genre this track belongs to.
BGAV_PUBLIC const char * bgav_metadata_get_copyright(const bgav_metadata_t *metadata)
Get the copyright notice of the track.
gavl_dictionary_t bgav_metadata_t
Opaque metadata container.
Definition avdec.h:116
BGAV_PUBLIC const char * bgav_metadata_get_comment(const bgav_metadata_t *metadata)
Get an additional comment of the track.
BGAV_PUBLIC const char * bgav_metadata_get_artist(const bgav_metadata_t *metadata)
Get the artist (or performer) of this track.
BGAV_PUBLIC int bgav_open_dvb(bgav_t *bgav, const char *location)
Open a DVB device.
BGAV_PUBLIC int bgav_open(bgav_t *bgav, const char *location)
Open a file or URL.
BGAV_PUBLIC int bgav_open_dvd(bgav_t *bgav, const char *location)
Open a DVD device.
BGAV_PUBLIC int bgav_open_vcd(bgav_t *bgav, const char *location)
Open a VCD device.
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, int64_t pos, int whence), void *priv, const char *filename, const char *mimetype, int64_t total_bytes)
Open a decoder with callbacks.
BGAV_PUBLIC void bgav_options_set_http_proxy_host(bgav_options_t *opt, const char *host)
Set proxy host.
BGAV_PUBLIC void bgav_options_set_http_proxy_port(bgav_options_t *opt, int port)
Set proxy port.
BGAV_PUBLIC void bgav_options_set_default_subtitle_encoding(bgav_options_t *opt, const char *encoding)
Set default subtitle encoding.
BGAV_PUBLIC void bgav_options_set_threads(bgav_options_t *opt, int threads)
Set number of threads.
BGAV_PUBLIC void bgav_options_set_shrink(bgav_options_t *opt, int factor)
Shrink factor.
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:789
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:760
BGAV_PUBLIC void bgav_options_set_http_proxy_auth(bgav_options_t *opt, int enable)
Enable or disable proxy authentication.
BGAV_PUBLIC void bgav_options_set_prefer_ffmpeg_demuxers(bgav_options_t *opt, int prefer)
Preference of ffmpeg demultiplexers.
BGAV_PUBLIC void bgav_options_set_ftp_anonymous_password(bgav_options_t *opt, const char *pass)
Set anonymous password.
BGAV_PUBLIC void bgav_options_set_seek_subtitles(bgav_options_t *opt, int seek_subtitles)
Enable external subtitle files.
BGAV_PUBLIC void bgav_options_set_cache_time(bgav_options_t *opt, int t)
Set the index creation time for caching.
void(* bgav_index_callback)(void *data, float percentage)
Function to be called periodically while an index is built.
Definition avdec.h:812
void(* bgav_metadata_change_callback)(void *data, const bgav_metadata_t *metadata)
Enumeration for log levels.
Definition avdec.h:712
BGAV_PUBLIC void bgav_options_set_dump_packets(bgav_options_t *opt, int enable)
Dump packets.
BGAV_PUBLIC void bgav_options_set_http_shoutcast_metadata(bgav_options_t *opt, int enable)
Enable or disable shoutcast metadata streaming.
struct bgav_options_s bgav_options_t
Opaque option container.
Definition avdec.h:221
BGAV_PUBLIC void bgav_options_set_rtp_port_base(bgav_options_t *opt, int p)
Set RTP port pase.
BGAV_PUBLIC void bgav_options_set_connect_timeout(bgav_options_t *opt, int timeout)
Set connect timeout.
BGAV_PUBLIC void bgav_options_set_sample_accurate(bgav_options_t *opt, int enable)
Try to be sample accurate.
BGAV_PUBLIC void bgav_options_set_dvb_channels_file(bgav_options_t *opt, const char *file)
Set DVB channels file.
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_PUBLIC void bgav_options_set_network_bandwidth(bgav_options_t *opt, int bandwidth)
Set network bandwidth.
BGAV_PUBLIC void bgav_options_copy(bgav_options_t *dst, const bgav_options_t *src)
Copy options.
BGAV_PUBLIC void bgav_options_set_pp_level(bgav_options_t *opt, int pp_level)
Set postprocessing level.
BGAV_PUBLIC void bgav_options_set_postprocessing_level(bgav_options_t *opt, float pp_level)
Set postprocessing level.
BGAV_PUBLIC void bgav_options_set_vaapi(bgav_options_t *opt, int vaapi)
VAAPI acceleration.
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_PUBLIC void bgav_options_set_aspect_callback(bgav_options_t *opt, bgav_aspect_callback callback, void *data)
Set aspect ratio change callback.
BGAV_PUBLIC bgav_options_t * bgav_options_create()
Create an options container.
BGAV_PUBLIC void bgav_options_set_ftp_anonymous(bgav_options_t *opt, int enable)
Enable or disable anonymous ftp login.
BGAV_PUBLIC void bgav_options_set_vdpau(bgav_options_t *opt, int vdpau)
VDPAU acceleration.
BGAV_PUBLIC void bgav_options_set_read_timeout(bgav_options_t *opt, int timeout)
Set read timeout.
BGAV_PUBLIC void bgav_options_set_http_proxy_pass(bgav_options_t *opt, const char *pass)
Set proxy password.
void(* bgav_buffer_callback)(void *data, float percentage)
Function to be called if the input module is buffering data.
Definition avdec.h:735
BGAV_PUBLIC void bgav_options_set_http_proxy_user(bgav_options_t *opt, const char *user)
Set proxy username.
BGAV_PUBLIC void bgav_options_set_audio_dynrange(bgav_options_t *opt, int audio_dynrange)
Enable dynamic range control.
BGAV_PUBLIC void bgav_options_set_index_callback(bgav_options_t *opt, bgav_index_callback callback, void *data)
Set index build callback.
BGAV_PUBLIC void bgav_options_set_rtp_try_tcp(bgav_options_t *opt, int enable)
Try TCP before UDP.
BGAV_PUBLIC void bgav_options_set_cache_size(bgav_options_t *opt, int s)
Set the maximum total size of the index cache.
BGAV_PUBLIC void bgav_options_set_dump_headers(bgav_options_t *opt, int enable)
Dump file headers.
BGAV_PUBLIC void bgav_options_destroy(bgav_options_t *opt)
Destroy option cotainer.
BGAV_PUBLIC bgav_options_t * bgav_get_options(bgav_t *bgav)
Get the options of a decoder instance.
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_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_PUBLIC void bgav_options_set_dump_indices(bgav_options_t *opt, int enable)
Dump file indices.
BGAV_PUBLIC void bgav_options_set_http_use_proxy(bgav_options_t *opt, int enable)
Set proxy usage.
BGAV_PUBLIC gavl_packet_source_t * bgav_get_audio_packet_source(bgav_t *bgav, int stream)
Get a packet source for an audio stream.
BGAV_PUBLIC gavl_packet_source_t * bgav_get_text_packet_source(bgav_t *bgav, int stream)
Get a packet source for a text subtitle stream.
BGAV_PUBLIC int bgav_get_overlay_compression_info(bgav_t *bgav, int stream, gavl_compression_info_t *info)
Get overlay compression info.
BGAV_PUBLIC gavl_packet_source_t * bgav_get_video_packet_source(bgav_t *bgav, int stream)
Get a packet source for a video stream.
BGAV_PUBLIC gavl_packet_source_t * bgav_get_overlay_packet_source(bgav_t *bgav, int stream)
Get a packet source for an overlay stream.
BGAV_PUBLIC int bgav_get_audio_compression_info(bgav_t *bgav, int stream, gavl_compression_info_t *info)
Get audio compression info.
BGAV_PUBLIC int bgav_read_audio_packet(bgav_t *bgav, int stream, gavl_packet_t *p)
Read compressed audio packet.
BGAV_PUBLIC int bgav_read_video_packet(bgav_t *bgav, int stream, gavl_packet_t *p)
Read compressed video packet.
BGAV_PUBLIC int bgav_get_video_compression_info(bgav_t *bgav, int stream, gavl_compression_info_t *info)
Get video compression info.
BGAV_PUBLIC void bgav_seek_overlay(bgav_t *bgav, int stream, int64_t time)
Seek to a specific overlay position.
BGAV_PUBLIC int64_t bgav_text_duration(bgav_t *bgav, int stream)
Get the text duration.
BGAV_PUBLIC void bgav_seek_video(bgav_t *bgav, int stream, int64_t time)
Seek to a specific video time.
BGAV_PUBLIC int64_t bgav_overlay_duration(bgav_t *bgav, int stream)
Get the overlay duration.
BGAV_PUBLIC void bgav_seek_audio(bgav_t *bgav, int stream, int64_t sample)
Seek to a specific audio sample.
BGAV_PUBLIC int64_t bgav_audio_duration(bgav_t *bgav, int stream)
Get the audio duration.
BGAV_PUBLIC int64_t bgav_video_start_time(bgav_t *bgav, int stream)
Get the video start time.
BGAV_PUBLIC void bgav_seek_text(bgav_t *bgav, int stream, int64_t time)
Seek to a specific text position.
BGAV_PUBLIC int64_t bgav_video_duration(bgav_t *bgav, int stream)
Get the video duration.
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_PUBLIC void bgav_seek_subtitle(bgav_t *bgav, int stream, int64_t time)
Seek to a specific subtitle position.
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_PUBLIC int64_t bgav_audio_start_time(bgav_t *bgav, int stream)
Get the audio start time.
BGAV_PUBLIC int bgav_can_seek_sample(bgav_t *bgav)
Check if a track is seekabkle with sample accuracy.
BGAV_PUBLIC int64_t bgav_subtitle_duration(bgav_t *bgav, int stream)
Get the subtitle duration.
BGAV_PUBLIC void bgav_seek_scaled(bgav_t *bgav, int64_t *time, int scale)
Seek to a specific stream position.
BGAV_PUBLIC void bgav_seek(bgav_t *bgav, gavl_time_t *time)
Seek to a specific time.
BGAV_PUBLIC int bgav_can_seek(bgav_t *bgav)
Check if a track is seekabkle.
BGAV_PUBLIC int bgav_start(bgav_t *bgav)
Start all codecs.
BGAV_PUBLIC const gavl_video_format_t * bgav_get_video_format(bgav_t *bgav, int stream)
Get the format of a video stream.
BGAV_PUBLIC const char * bgav_get_audio_info(bgav_t *bgav, int stream)
Get additional info about an audio stream.
BGAV_PUBLIC const char * bgav_get_audio_description(bgav_t *bgav, int stream)
Get the description of an audio stream.
BGAV_PUBLIC int bgav_subtitle_is_text(bgav_t *bgav, int stream)
Check if a subtitle is text or graphics based.
BGAV_PUBLIC const gavl_audio_format_t * bgav_get_audio_format_t(bgav_t *bgav, int track, int stream)
Get the format of an audio stream.
BGAV_PUBLIC gavl_frame_table_t * bgav_get_frame_table(bgav_t *bgav, int stream)
Get the frame table of a video stream.
BGAV_PUBLIC const gavl_video_format_t * bgav_get_subtitle_format(bgav_t *bgav, int stream)
Get the video format of a subtitle stream.
BGAV_PUBLIC int bgav_can_pause(bgav_t *bgav)
Query if a track is pausable.
BGAV_PUBLIC const gavl_video_format_t * bgav_get_video_format_t(bgav_t *bgav, int t, int stream)
Get the format of a video stream.
BGAV_PUBLIC const gavl_audio_format_t * bgav_get_audio_format(bgav_t *bgav, int stream)
Get the format of an audio stream of the current track.
BGAV_PUBLIC const gavl_video_format_t * bgav_get_overlay_format(bgav_t *bgav, int stream)
Get the format of an overlay stream.
BGAV_PUBLIC const char * bgav_get_video_description(bgav_t *bgav, int stream)
Get the description of a video stream.
BGAV_PUBLIC const char * bgav_get_subtitle_description(bgav_t *bgav, int stream)
Get the description of a subtitle stream.
BGAV_PUBLIC int bgav_get_text_timescale(bgav_t *bgav, int stream)
Get the timescale for a text stream.
BGAV_PUBLIC const char * bgav_get_subtitle_info(bgav_t *bgav, int stream)
Get additional info about a subtitle stream.
BGAV_PUBLIC const bgav_metadata_t * bgav_get_text_metadata(bgav_t *b, int stream)
Get the metadata of a text stream of the current track.
BGAV_PUBLIC const bgav_metadata_t * bgav_get_text_metadata_t(bgav_t *b, int track, int stream)
Get the metadata of a text stream.
BGAV_PUBLIC int bgav_get_audio_bitrate(bgav_t *bgav, int stream)
Get the bitrate of an audio stream.
BGAV_PUBLIC const bgav_metadata_t * bgav_get_video_metadata_t(bgav_t *b, int t, int s)
Get the metadata of a video 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_PUBLIC const bgav_metadata_t * bgav_get_audio_metadata_t(bgav_t *b, int t, int s)
Get the metadata of an audio stream.
BGAV_PUBLIC int bgav_set_overlay_stream(bgav_t *bgav, int stream, bgav_stream_action_t action)
Select mode for an overlay 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_PUBLIC int bgav_set_text_stream(bgav_t *bgav, int stream, bgav_stream_action_t action)
Select mode for a text stream.
BGAV_PUBLIC const char * bgav_get_subtitle_language(bgav_t *bgav, int stream)
Get the language of a subtitle stream.
BGAV_PUBLIC const bgav_metadata_t * bgav_get_overlay_metadata_t(bgav_t *b, int track, int stream)
Get the metadata of an overlay stream.
BGAV_PUBLIC const bgav_metadata_t * bgav_get_video_metadata(bgav_t *bgav, int stream)
Get the metadata of a video stream of the current track.
bgav_stream_action_t
Stream action.
Definition avdec.h:1463
BGAV_PUBLIC const bgav_metadata_t * bgav_get_subtitle_metadata(bgav_t *bgav, int stream)
Get the metadata of a subtitle stream.
BGAV_PUBLIC const bgav_metadata_t * bgav_get_audio_metadata(bgav_t *bgav, int stream)
Get the metadata of an audio stream of the current track.
BGAV_PUBLIC const bgav_metadata_t * bgav_get_overlay_metadata(bgav_t *b, int stream)
Get the metadata of an overlay stream of the current track.
BGAV_PUBLIC int bgav_set_subtitle_stream(bgav_t *bgav, int stream, bgav_stream_action_t action)
Select mode for a subtitle stream.
BGAV_PUBLIC const char * bgav_get_audio_language(bgav_t *bgav, int stream)
Get the language of an audio stream.
@ BGAV_STREAM_READRAW
Definition avdec.h:1467
@ BGAV_STREAM_MUTE
Definition avdec.h:1464
@ BGAV_STREAM_PARSE
Definition avdec.h:1466
@ BGAV_STREAM_DECODE
Definition avdec.h:1465
int64_t gavl_time_t
BGAV_PUBLIC const char * bgav_get_chapter_name(bgav_t *bgav, int track, int chapter)
Get the name of a chapter.
BGAV_PUBLIC gavl_time_t bgav_get_duration(bgav_t *bgav, int track)
Get the duration of a track.
BGAV_PUBLIC const char * bgav_get_track_name(bgav_t *bgav, int track)
Get the name a track.
BGAV_PUBLIC int bgav_get_num_chapters(bgav_t *bgav, int track, int *timescale)
Get the number of chapters.
BGAV_PUBLIC int bgav_select_track(bgav_t *bgav, int track)
Select a track.
BGAV_PUBLIC const bgav_metadata_t * bgav_get_metadata(bgav_t *bgav, int track)
Get metadata for a track.
BGAV_PUBLIC int bgav_num_video_streams(bgav_t *bgav, int track)
Get the number of video streams of a track.
BGAV_PUBLIC const char * bgav_get_description(bgav_t *bgav)
Get a technical description of the format.
BGAV_PUBLIC int bgav_num_audio_streams(bgav_t *bgav, int track)
Get the number of audio streams of a track.
BGAV_PUBLIC int bgav_num_text_streams(bgav_t *bgav, int track)
Get the number of text streams of a track.
BGAV_PUBLIC int bgav_num_overlay_streams(bgav_t *bgav, int track)
Get the number of overlay streams of a track.
BGAV_PUBLIC int64_t bgav_get_chapter_time(bgav_t *bgav, int track, int chapter)
Get the name of a chapter.
BGAV_PUBLIC int bgav_num_subtitle_streams(bgav_t *bgav, int track)
Get the number of subtitle streams of a track.
BGAV_PUBLIC const gavl_chapter_list_t * bgav_get_chapter_list(bgav_t *bgav, int track)
Get the chapter list.
BGAV_PUBLIC gavl_dictionary_t * bgav_get_media_info(bgav_t *bgav)
Get media information.
BGAV_PUBLIC int bgav_num_tracks(bgav_t *bgav)
Get the number of tracks.
Info structure for a device.
Definition avdec.h:854
char * name
Definition avdec.h:856
char * device
Definition avdec.h:855