gavl

connectors.h
1/*****************************************************************
2 * gavl - a general purpose audio/video processing library
3 *
4 * Copyright (c) 2001 - 2024 Members of the Gmerlin project
5 * http://github.com/bplaum
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 * *****************************************************************/
20
21
22
27
28#ifndef GAVL_CONNECTORS_H_INCLUDED
29#define GAVL_CONNECTORS_H_INCLUDED
30
31#include <gavl/gavl.h>
32#include <gavl/trackinfo.h>
33#include <gavl/compression.h>
34
35#ifdef __cplusplus
36 extern "C" {
37#endif
38
47
54
55
56 typedef void (*gavl_connector_lock_func_t)(void * priv);
57
61
62 typedef void (*gavl_connector_free_func_t)(void * priv);
63
64
90
92
93 typedef enum
94 {
95 GAVL_SOURCE_EOF = 0,
96 GAVL_SOURCE_OK = 1,
97 GAVL_SOURCE_AGAIN = 2,
98 } gavl_source_status_t;
99
107
108 typedef gavl_source_status_t
109(*gavl_audio_source_func_t)(void * priv, gavl_audio_frame_t ** frame);
110
118
119 typedef gavl_source_status_t
120(*gavl_video_source_func_t)(void * priv, gavl_video_frame_t ** frame);
121
129
130 typedef gavl_source_status_t
131(*gavl_packet_source_func_t)(void * priv, gavl_packet_t ** p);
132
133
136
137#define GAVL_SOURCE_SRC_ALLOC (1<<0)
138
139
143
144#define GAVL_SOURCE_SRC_FRAMESIZE_MAX (1<<2)
145
149
150#define GAVL_SOURCE_SRC_DISCONTINUOUS (1<<3)
151
152
153/* Called by the source */
154
162
163GAVL_PUBLIC
164 gavl_video_source_t *
165 gavl_video_source_create(gavl_video_source_func_t func,
166 void * priv, int src_flags,
167 const gavl_video_format_t * src_format);
168
169GAVL_PUBLIC
170 void gavl_video_source_set_pts_offset(gavl_video_source_t * src, int64_t offset);
171
172
173GAVL_PUBLIC
174 void gavl_video_source_drain(gavl_video_source_t * s);
175
176
187
188GAVL_PUBLIC
189 gavl_video_source_t *
190 gavl_video_source_create_source(gavl_video_source_func_t func,
191 void * priv, int src_flags,
192 gavl_video_source_t * src);
193
200
201GAVL_PUBLIC void
202 gavl_video_source_set_lock_funcs(gavl_video_source_t * src,
203 gavl_connector_lock_func_t lock_func,
204 gavl_connector_lock_func_t unlock_func,
205 void * priv);
206
213
214GAVL_PUBLIC void
215 gavl_video_source_set_free_func(gavl_video_source_t * src,
216 gavl_connector_free_func_t free_func);
217
218
219
224
225
226GAVL_PUBLIC
227 gavl_video_options_t * gavl_video_source_get_options(gavl_video_source_t * s);
228
234
235GAVL_PUBLIC
236 void gavl_video_source_reset(gavl_video_source_t * s);
237
244
245GAVL_PUBLIC
246 void gavl_video_source_destroy(gavl_video_source_t * s);
247
248/* Called by the destination */
249
258
259GAVL_PUBLIC
260 void gavl_video_source_support_hw(gavl_video_source_t * s);
261
266
267GAVL_PUBLIC
268 const gavl_video_format_t *
269 gavl_video_source_get_src_format(gavl_video_source_t * s);
270
275
276GAVL_PUBLIC
277 int gavl_video_source_get_src_flags(gavl_video_source_t * s);
278
283
284GAVL_PUBLIC
285 const gavl_video_format_t *
286 gavl_video_source_get_dst_format(gavl_video_source_t * s);
287
302
303GAVL_PUBLIC
304 void
305 gavl_video_source_set_dst(gavl_video_source_t * s, int dst_flags,
306 const gavl_video_format_t * dst_format);
307
316
317
318GAVL_PUBLIC
319 gavl_source_status_t
320 gavl_video_source_read_frame(void * s, gavl_video_frame_t ** frame);
321
322/* Called by source */
323
331
332GAVL_PUBLIC
333 gavl_audio_source_t *
334 gavl_audio_source_create(gavl_audio_source_func_t func,
335 void * priv, int src_flags,
336 const gavl_audio_format_t * src_format);
337
338
339GAVL_PUBLIC
340 void gavl_audio_source_drain(gavl_audio_source_t * s);
341
342GAVL_PUBLIC
343 void gavl_audio_source_set_pts_offset(gavl_audio_source_t * src, int64_t offset);
344
345
356
357GAVL_PUBLIC
358 gavl_audio_source_t *
359 gavl_audio_source_create_source(gavl_audio_source_func_t func,
360 void * priv, int src_flags,
361 gavl_audio_source_t * src);
362
363
370
371GAVL_PUBLIC void
372 gavl_audio_source_set_lock_funcs(gavl_audio_source_t * src,
373 gavl_connector_lock_func_t lock_func,
374 gavl_connector_lock_func_t unlock_func,
375 void * priv);
376
383
384GAVL_PUBLIC void
385 gavl_audio_source_set_free_func(gavl_audio_source_t * src,
386 gavl_connector_free_func_t free_func);
387
388
389
394
395GAVL_PUBLIC
396 const gavl_audio_format_t *
397 gavl_audio_source_get_src_format(gavl_audio_source_t * s);
398
403
404GAVL_PUBLIC
405 const gavl_audio_format_t *
406 gavl_audio_source_get_dst_format(gavl_audio_source_t * s);
407
412
413GAVL_PUBLIC int
414 gavl_audio_source_get_dst_flags(gavl_audio_source_t * s);
415
431
432GAVL_PUBLIC
433 void
434 gavl_audio_source_set_dst(gavl_audio_source_t * s, int dst_flags,
435 const gavl_audio_format_t * dst_format);
436
450
451GAVL_PUBLIC
452 gavl_source_status_t
453 gavl_audio_source_read_frame(void*s, gavl_audio_frame_t ** frame);
454
463
464GAVL_PUBLIC
465 void
466 gavl_audio_source_skip(gavl_audio_source_t * s, int num_samples);
467
468
469GAVL_PUBLIC
470 void
471gavl_audio_source_skip_to(gavl_audio_source_t * s,
472 int64_t t, int scale);
473
482
483GAVL_PUBLIC
484 int gavl_audio_source_read_samples(void*s, gavl_audio_frame_t * frame,
485 int num_samples);
486
491
492GAVL_PUBLIC
493 gavl_audio_options_t * gavl_audio_source_get_options(gavl_audio_source_t * s);
494
500
501GAVL_PUBLIC
502 void gavl_audio_source_reset(gavl_audio_source_t * s);
503
510
511GAVL_PUBLIC
512 void gavl_audio_source_destroy(gavl_audio_source_t * s);
513
514
515/* Packet source */
516
526
527GAVL_PUBLIC
528 gavl_packet_source_t *
529 gavl_packet_source_create(gavl_packet_source_func_t func,
530 void * priv, int src_flags, const gavl_dictionary_t * s);
531
532GAVL_PUBLIC
533 void gavl_packet_source_set_pts_offset(gavl_packet_source_t * src, int64_t offset);
534
535
536GAVL_PUBLIC
537 void gavl_packet_source_drain(gavl_packet_source_t * src);
538
539/* Call after seeking */
540GAVL_PUBLIC
541 void gavl_packet_source_reset(gavl_packet_source_t * s);
542
543GAVL_PUBLIC const gavl_dictionary_t *
544gavl_packet_source_get_stream(gavl_packet_source_t * s);
545
546GAVL_PUBLIC gavl_dictionary_t *
547gavl_packet_source_get_stream_nc(gavl_packet_source_t * s);
548
549
556
557GAVL_PUBLIC
558 gavl_packet_source_t *
559 gavl_packet_source_create_source(gavl_packet_source_func_t func,
560 void * priv, int src_flags,
561 gavl_packet_source_t * src);
562
563
570
571GAVL_PUBLIC void
572 gavl_packet_source_set_lock_funcs(gavl_packet_source_t * src,
573 gavl_connector_lock_func_t lock_func,
574 gavl_connector_lock_func_t unlock_func,
575 void * priv);
576
583
584GAVL_PUBLIC void
585 gavl_packet_source_set_free_func(gavl_packet_source_t * src,
586 gavl_connector_free_func_t free_func);
587
588
589
594
595// GAVL_PUBLIC const gavl_compression_info_t *
596// gavl_packet_source_get_ci(gavl_packet_source_t * s);
597
602
603GAVL_PUBLIC const gavl_audio_format_t *
604 gavl_packet_source_get_audio_format(gavl_packet_source_t * s);
605
610
611GAVL_PUBLIC const gavl_video_format_t *
612 gavl_packet_source_get_video_format(gavl_packet_source_t * s);
613
618
619GAVL_PUBLIC int
620 gavl_packet_source_get_timescale(gavl_packet_source_t * s);
621
626
627GAVL_PUBLIC gavl_source_status_t
628 gavl_packet_source_read_packet(void*s, gavl_packet_t ** p);
629
630
631GAVL_PUBLIC gavl_source_status_t
632gavl_packet_source_peek_packet(void*sp, gavl_packet_t ** p);
633
634
638
639GAVL_PUBLIC void
640 gavl_packet_source_destroy(gavl_packet_source_t * s);
641
645
659
662
663 typedef enum
664 {
665 GAVL_SINK_ERROR,
666 GAVL_SINK_OK,
667 } gavl_sink_status_t;
668
669
677
678 typedef gavl_audio_frame_t *
679(*gavl_audio_sink_get_func)(void * priv);
680
686
687 typedef gavl_sink_status_t
688(*gavl_audio_sink_put_func)(void * priv, gavl_audio_frame_t * f);
689
697
698GAVL_PUBLIC gavl_audio_sink_t *
699 gavl_audio_sink_create(gavl_audio_sink_get_func get_func,
700 gavl_audio_sink_put_func put_func,
701 void * priv,
702 const gavl_audio_format_t * format);
703
710
711GAVL_PUBLIC void
712 gavl_audio_sink_set_lock_funcs(gavl_audio_sink_t * sink,
713 gavl_connector_lock_func_t lock_func,
714 gavl_connector_lock_func_t unlock_func,
715 void * priv);
716
723
724GAVL_PUBLIC void
725 gavl_audio_sink_set_free_func(gavl_audio_sink_t * sink,
726 gavl_connector_free_func_t free_func);
727
728
729
734
735GAVL_PUBLIC const gavl_audio_format_t *
736 gavl_audio_sink_get_format(gavl_audio_sink_t * s);
737
746
747GAVL_PUBLIC gavl_audio_frame_t *
748 gavl_audio_sink_get_frame(gavl_audio_sink_t * s);
749
758
759GAVL_PUBLIC gavl_sink_status_t
760 gavl_audio_sink_put_frame(gavl_audio_sink_t * s, gavl_audio_frame_t * f);
761
765
766GAVL_PUBLIC void
767 gavl_audio_sink_destroy(gavl_audio_sink_t * s);
768
769
770
778
779 typedef gavl_video_frame_t *
780(*gavl_video_sink_get_func)(void * priv);
781
787
788 typedef gavl_sink_status_t
789(*gavl_video_sink_put_func)(void * priv, gavl_video_frame_t * f);
790
798
799GAVL_PUBLIC gavl_video_sink_t *
800 gavl_video_sink_create(gavl_video_sink_get_func get_func,
801 gavl_video_sink_put_func put_func,
802 void * priv,
803 const gavl_video_format_t * format);
804
811
812GAVL_PUBLIC void
813 gavl_video_sink_set_lock_funcs(gavl_video_sink_t * sink,
814 gavl_connector_lock_func_t lock_func,
815 gavl_connector_lock_func_t unlock_func,
816 void * priv);
817
824
825GAVL_PUBLIC void
826 gavl_video_sink_set_free_func(gavl_video_sink_t * sink,
827 gavl_connector_free_func_t free_func);
828
829
834
835GAVL_PUBLIC const gavl_video_format_t *
836 gavl_video_sink_get_format(gavl_video_sink_t * s);
837
846
847GAVL_PUBLIC gavl_video_frame_t *
848 gavl_video_sink_get_frame(gavl_video_sink_t * s);
849
858
859GAVL_PUBLIC gavl_sink_status_t
860 gavl_video_sink_put_frame(gavl_video_sink_t * s, gavl_video_frame_t * f);
861
865
866GAVL_PUBLIC void
867 gavl_video_sink_destroy(gavl_video_sink_t * s);
868
869
870
878
879 typedef gavl_packet_t *
880(*gavl_packet_sink_get_func)(void * priv);
881
887
888 typedef gavl_sink_status_t
889(*gavl_packet_sink_put_func)(void * priv, gavl_packet_t * p);
890
897
898GAVL_PUBLIC gavl_packet_sink_t *
899 gavl_packet_sink_create(gavl_packet_sink_get_func get_func,
900 gavl_packet_sink_put_func put_func,
901 void * priv);
902
909
910GAVL_PUBLIC void
911 gavl_packet_sink_set_lock_funcs(gavl_packet_sink_t * sink,
912 gavl_connector_lock_func_t lock_func,
913 gavl_connector_lock_func_t unlock_func,
914 void * priv);
915
922
923GAVL_PUBLIC void
924 gavl_packet_sink_set_free_func(gavl_packet_sink_t * sink,
925 gavl_connector_free_func_t free_func);
926
927
936
937GAVL_PUBLIC gavl_packet_t *
938 gavl_packet_sink_get_packet(gavl_packet_sink_t * s);
939
940GAVL_PUBLIC void
941gavl_packet_sink_reset(gavl_packet_sink_t * s);
942
943
952
953GAVL_PUBLIC gavl_sink_status_t
954 gavl_packet_sink_put_packet(gavl_packet_sink_t * s, gavl_packet_t * p);
955
959
960GAVL_PUBLIC void
961 gavl_packet_sink_destroy(gavl_packet_sink_t * s);
962
963
967
968/* Packet buffer */
969
970 typedef struct gavl_packet_buffer_s
971gavl_packet_buffer_t;
972
973GAVL_PUBLIC
974gavl_packet_buffer_t * gavl_packet_buffer_create(const gavl_dictionary_t * stream_info);
975
976GAVL_PUBLIC
977 void gavl_packet_buffer_destroy(gavl_packet_buffer_t *);
978
979GAVL_PUBLIC
980 void gavl_packet_buffer_flush(gavl_packet_buffer_t *);
981
982GAVL_PUBLIC
983 void gavl_packet_buffer_clear(gavl_packet_buffer_t *);
984
985GAVL_PUBLIC
986 gavl_packet_sink_t * gavl_packet_buffer_get_sink(gavl_packet_buffer_t *);
987
988GAVL_PUBLIC
989 gavl_packet_source_t * gavl_packet_buffer_get_source(gavl_packet_buffer_t *);
990
991/* Set output PTS (called after seeking) */
992
993GAVL_PUBLIC
994 void gavl_packet_buffer_set_out_pts(gavl_packet_buffer_t * buf, int64_t pts);
995
996/*
997 * Mark the last packet with GAVL_PACKET_LAST.
998 * Introduces a delay of 1 for low-delay streams
999 */
1000
1001GAVL_PUBLIC
1002 void gavl_packet_buffer_set_mark_last(gavl_packet_buffer_t * buf, int mark);
1003
1004GAVL_PUBLIC
1005 void gavl_packet_buffer_set_calc_frame_durations(gavl_packet_buffer_t * buf, int calc);
1006
1010
1011#ifdef __cplusplus
1012}
1013#endif
1014
1015#endif // GAVL_CONNECTORS_H_INCLUDED
gavl.h
gavl_audio_options_t
struct gavl_audio_options_s gavl_audio_options_t
Opaque container for audio conversion options.
Definition gavl.h:1004
gavl_video_sink_t
struct gavl_video_sink_s gavl_video_sink_t
Video sink.
Definition gavl.h:83
gavl_video_sink_set_free_func
GAVL_PUBLIC void gavl_video_sink_set_free_func(gavl_video_sink_t *sink, gavl_connector_free_func_t free_func)
Set free function.
gavl_audio_sink_create
GAVL_PUBLIC gavl_audio_sink_t * gavl_audio_sink_create(gavl_audio_sink_get_func get_func, gavl_audio_sink_put_func put_func, void *priv, const gavl_audio_format_t *format)
Create an audio sink.
gavl_video_sink_set_lock_funcs
GAVL_PUBLIC void gavl_video_sink_set_lock_funcs(gavl_video_sink_t *sink, gavl_connector_lock_func_t lock_func, gavl_connector_lock_func_t unlock_func, void *priv)
Set lock functions.
gavl_packet_sink_put_func
gavl_sink_status_t(* gavl_packet_sink_put_func)(void *priv, gavl_packet_t *p)
Prototype for putting a frame.
Definition connectors.h:889
gavl_video_sink_destroy
GAVL_PUBLIC void gavl_video_sink_destroy(gavl_video_sink_t *s)
Destroy a video sink.
gavl_sink_status_t
gavl_sink_status_t
Return status of the sink functions.
Definition connectors.h:664
gavl_audio_sink_t
struct gavl_audio_sink_s gavl_audio_sink_t
Audio sink.
Definition gavl.h:74
gavl_packet_sink_t
struct gavl_packet_sink_s gavl_packet_sink_t
Packet sink.
Definition gavl.h:92
gavl_audio_sink_set_free_func
GAVL_PUBLIC void gavl_audio_sink_set_free_func(gavl_audio_sink_t *sink, gavl_connector_free_func_t free_func)
Set free function.
gavl_video_sink_create
GAVL_PUBLIC gavl_video_sink_t * gavl_video_sink_create(gavl_video_sink_get_func get_func, gavl_video_sink_put_func put_func, void *priv, const gavl_video_format_t *format)
Create a video sink.
gavl_audio_sink_put_func
gavl_sink_status_t(* gavl_audio_sink_put_func)(void *priv, gavl_audio_frame_t *f)
Prototype for putting a frame.
Definition connectors.h:688
gavl_audio_sink_get_func
gavl_audio_frame_t *(* gavl_audio_sink_get_func)(void *priv)
Prototype for getting a frame buffer.
Definition connectors.h:679
gavl_packet_sink_get_packet
GAVL_PUBLIC gavl_packet_t * gavl_packet_sink_get_packet(gavl_packet_sink_t *s)
Get a buffer for a packet.
gavl_packet_sink_set_free_func
GAVL_PUBLIC void gavl_packet_sink_set_free_func(gavl_packet_sink_t *sink, gavl_connector_free_func_t free_func)
Set free function.
gavl_audio_sink_destroy
GAVL_PUBLIC void gavl_audio_sink_destroy(gavl_audio_sink_t *s)
Destroy an audio sink.
gavl_video_sink_put_frame
GAVL_PUBLIC gavl_sink_status_t gavl_video_sink_put_frame(gavl_video_sink_t *s, gavl_video_frame_t *f)
Output a frame.
gavl_video_sink_get_func
gavl_video_frame_t *(* gavl_video_sink_get_func)(void *priv)
Prototype for getting a frame buffer.
Definition connectors.h:780
gavl_packet_sink_put_packet
GAVL_PUBLIC gavl_sink_status_t gavl_packet_sink_put_packet(gavl_packet_sink_t *s, gavl_packet_t *p)
Output a frame.
gavl_video_sink_get_frame
GAVL_PUBLIC gavl_video_frame_t * gavl_video_sink_get_frame(gavl_video_sink_t *s)
Get a buffer for a frame.
gavl_packet_sink_create
GAVL_PUBLIC gavl_packet_sink_t * gavl_packet_sink_create(gavl_packet_sink_get_func get_func, gavl_packet_sink_put_func put_func, void *priv)
Create a packet sink.
gavl_packet_sink_get_func
gavl_packet_t *(* gavl_packet_sink_get_func)(void *priv)
Prototype for getting a packet buffer.
Definition connectors.h:880
gavl_video_sink_put_func
gavl_sink_status_t(* gavl_video_sink_put_func)(void *priv, gavl_video_frame_t *f)
Prototype for putting a frame.
Definition connectors.h:789
gavl_audio_sink_set_lock_funcs
GAVL_PUBLIC void gavl_audio_sink_set_lock_funcs(gavl_audio_sink_t *sink, gavl_connector_lock_func_t lock_func, gavl_connector_lock_func_t unlock_func, void *priv)
Set lock functions.
gavl_packet_sink_set_lock_funcs
GAVL_PUBLIC void gavl_packet_sink_set_lock_funcs(gavl_packet_sink_t *sink, gavl_connector_lock_func_t lock_func, gavl_connector_lock_func_t unlock_func, void *priv)
Set lock functions.
gavl_audio_sink_put_frame
GAVL_PUBLIC gavl_sink_status_t gavl_audio_sink_put_frame(gavl_audio_sink_t *s, gavl_audio_frame_t *f)
Output a frame.
gavl_audio_sink_get_frame
GAVL_PUBLIC gavl_audio_frame_t * gavl_audio_sink_get_frame(gavl_audio_sink_t *s)
Get a buffer for a frame.
gavl_audio_sink_get_format
GAVL_PUBLIC const gavl_audio_format_t * gavl_audio_sink_get_format(gavl_audio_sink_t *s)
Get the format.
gavl_packet_sink_destroy
GAVL_PUBLIC void gavl_packet_sink_destroy(gavl_packet_sink_t *s)
Destroy a packet sink.
gavl_video_sink_get_format
GAVL_PUBLIC const gavl_video_format_t * gavl_video_sink_get_format(gavl_video_sink_t *s)
Get the format.
GAVL_SINK_OK
@ GAVL_SINK_OK
Frame was successfully processed.
Definition connectors.h:666
GAVL_SINK_ERROR
@ GAVL_SINK_ERROR
Something went wrong.
Definition connectors.h:665
gavl_packet_source_read_packet
GAVL_PUBLIC gavl_source_status_t gavl_packet_source_read_packet(void *s, gavl_packet_t **p)
Read one packet.
gavl_packet_source_func_t
gavl_source_status_t(* gavl_packet_source_func_t)(void *priv, gavl_packet_t **p)
Prototype for obtaining one packet.
Definition connectors.h:131
gavl_video_source_create_source
GAVL_PUBLIC gavl_video_source_t * gavl_video_source_create_source(gavl_video_source_func_t func, void *priv, int src_flags, gavl_video_source_t *src)
Create a video source from another source.
gavl_packet_source_create
GAVL_PUBLIC gavl_packet_source_t * gavl_packet_source_create(gavl_packet_source_func_t func, void *priv, int src_flags, const gavl_dictionary_t *s)
Create a packet source.
gavl_video_source_create
GAVL_PUBLIC gavl_video_source_t * gavl_video_source_create(gavl_video_source_func_t func, void *priv, int src_flags, const gavl_video_format_t *src_format)
Create a video source.
gavl_audio_source_read_frame
GAVL_PUBLIC gavl_source_status_t gavl_audio_source_read_frame(void *s, gavl_audio_frame_t **frame)
Read an audio frame.
gavl_audio_source_get_dst_format
GAVL_PUBLIC const gavl_audio_format_t * gavl_audio_source_get_dst_format(gavl_audio_source_t *s)
Get the output format.
gavl_audio_source_set_dst
GAVL_PUBLIC void gavl_audio_source_set_dst(gavl_audio_source_t *s, int dst_flags, const gavl_audio_format_t *dst_format)
Set the destination mode.
gavl_video_source_set_dst
GAVL_PUBLIC void gavl_video_source_set_dst(gavl_video_source_t *s, int dst_flags, const gavl_video_format_t *dst_format)
Set the destination mode.
gavl_audio_source_create
GAVL_PUBLIC gavl_audio_source_t * gavl_audio_source_create(gavl_audio_source_func_t func, void *priv, int src_flags, const gavl_audio_format_t *src_format)
Create an audio source.
gavl_video_source_t
struct gavl_video_source_s gavl_video_source_t
Forward declaration of the video source.
Definition gavl.h:50
gavl_audio_source_set_free_func
GAVL_PUBLIC void gavl_audio_source_set_free_func(gavl_audio_source_t *src, gavl_connector_free_func_t free_func)
Set free function.
gavl_audio_source_skip
GAVL_PUBLIC void gavl_audio_source_skip(gavl_audio_source_t *s, int num_samples)
Skip audio samples at the input.
gavl_audio_source_create_source
GAVL_PUBLIC gavl_audio_source_t * gavl_audio_source_create_source(gavl_audio_source_func_t func, void *priv, int src_flags, gavl_audio_source_t *src)
Create an audio source from another source.
gavl_source_status_t
gavl_source_status_t
Return value of the source function.
Definition connectors.h:94
gavl_video_source_get_src_format
GAVL_PUBLIC const gavl_video_format_t * gavl_video_source_get_src_format(gavl_video_source_t *s)
Get the native format.
gavl_audio_source_reset
GAVL_PUBLIC void gavl_audio_source_reset(gavl_audio_source_t *s)
Reset an audio source.
gavl_video_source_get_src_flags
GAVL_PUBLIC int gavl_video_source_get_src_flags(gavl_video_source_t *s)
Get the source flags.
gavl_video_source_read_frame
GAVL_PUBLIC gavl_source_status_t gavl_video_source_read_frame(void *s, gavl_video_frame_t **frame)
Read a video frame.
gavl_video_source_set_lock_funcs
GAVL_PUBLIC void gavl_video_source_set_lock_funcs(gavl_video_source_t *src, gavl_connector_lock_func_t lock_func, gavl_connector_lock_func_t unlock_func, void *priv)
Set lock functions.
gavl_video_source_set_free_func
GAVL_PUBLIC void gavl_video_source_set_free_func(gavl_video_source_t *src, gavl_connector_free_func_t free_func)
Set free function.
gavl_audio_source_read_samples
GAVL_PUBLIC int gavl_audio_source_read_samples(void *s, gavl_audio_frame_t *frame, int num_samples)
Read audio samples.
gavl_video_source_get_options
GAVL_PUBLIC gavl_video_options_t * gavl_video_source_get_options(gavl_video_source_t *s)
Get conversion options of a video source.
gavl_packet_source_create_source
GAVL_PUBLIC gavl_packet_source_t * gavl_packet_source_create_source(gavl_packet_source_func_t func, void *priv, int src_flags, gavl_packet_source_t *src)
Create a packet source from another packet source.
gavl_video_source_support_hw
GAVL_PUBLIC void gavl_video_source_support_hw(gavl_video_source_t *s)
Enable hardware surfaces.
gavl_audio_source_t
struct gavl_audio_source_s gavl_audio_source_t
Forward declaration of the audio source.
Definition gavl.h:58
gavl_packet_source_get_audio_format
GAVL_PUBLIC const gavl_audio_format_t * gavl_packet_source_get_audio_format(gavl_packet_source_t *s)
Get the compression info.
gavl_audio_source_get_options
GAVL_PUBLIC gavl_audio_options_t * gavl_audio_source_get_options(gavl_audio_source_t *s)
Get conversion options of an audio source.
gavl_video_source_func_t
gavl_source_status_t(* gavl_video_source_func_t)(void *priv, gavl_video_frame_t **frame)
Prototype for obtaining one video frame.
Definition connectors.h:120
gavl_audio_source_func_t
gavl_source_status_t(* gavl_audio_source_func_t)(void *priv, gavl_audio_frame_t **frame)
Prototype for obtaining one audio frame.
Definition connectors.h:109
gavl_packet_source_destroy
GAVL_PUBLIC void gavl_packet_source_destroy(gavl_packet_source_t *s)
Destroy a packet source.
gavl_packet_source_t
struct gavl_packet_source_s gavl_packet_source_t
Forward declaration of the packet source.
Definition gavl.h:66
gavl_video_source_get_dst_format
GAVL_PUBLIC const gavl_video_format_t * gavl_video_source_get_dst_format(gavl_video_source_t *s)
Get the output format.
gavl_packet_source_get_timescale
GAVL_PUBLIC int gavl_packet_source_get_timescale(gavl_packet_source_t *s)
Get the time scale.
gavl_packet_source_set_free_func
GAVL_PUBLIC void gavl_packet_source_set_free_func(gavl_packet_source_t *src, gavl_connector_free_func_t free_func)
Set free function.
gavl_audio_source_set_lock_funcs
GAVL_PUBLIC void gavl_audio_source_set_lock_funcs(gavl_audio_source_t *src, gavl_connector_lock_func_t lock_func, gavl_connector_lock_func_t unlock_func, void *priv)
Set lock functions.
gavl_packet_source_get_video_format
GAVL_PUBLIC const gavl_video_format_t * gavl_packet_source_get_video_format(gavl_packet_source_t *s)
Get the video format.
gavl_audio_source_destroy
GAVL_PUBLIC void gavl_audio_source_destroy(gavl_audio_source_t *s)
Destroy an audio source.
gavl_packet_source_set_lock_funcs
GAVL_PUBLIC void gavl_packet_source_set_lock_funcs(gavl_packet_source_t *src, gavl_connector_lock_func_t lock_func, gavl_connector_lock_func_t unlock_func, void *priv)
Set lock functions.
gavl_video_source_reset
GAVL_PUBLIC void gavl_video_source_reset(gavl_video_source_t *s)
Reset a video source.
gavl_video_source_destroy
GAVL_PUBLIC void gavl_video_source_destroy(gavl_video_source_t *s)
Destroy a video source.
gavl_audio_source_get_dst_flags
GAVL_PUBLIC int gavl_audio_source_get_dst_flags(gavl_audio_source_t *s)
Get the output flags.
gavl_audio_source_get_src_format
GAVL_PUBLIC const gavl_audio_format_t * gavl_audio_source_get_src_format(gavl_audio_source_t *s)
Get the native format.
GAVL_SOURCE_OK
@ GAVL_SOURCE_OK
Frame available.
Definition connectors.h:96
GAVL_SOURCE_EOF
@ GAVL_SOURCE_EOF
End of file, no more frames available.
Definition connectors.h:95
GAVL_SOURCE_AGAIN
@ GAVL_SOURCE_AGAIN
No frame available right now, might try later.
Definition connectors.h:97
gavl_video_format_t
struct gavl_video_format_s gavl_video_format_t
Video format.
Definition gavl.h:102
gavl_video_options_t
struct gavl_video_options_s gavl_video_options_t
Definition gavl.h:3230
gavl_audio_format_t
Audio Format.
Definition gavl.h:273
gavl_audio_frame_t
Generic container for audio samples.
Definition gavl.h:624