-
Notifications
You must be signed in to change notification settings - Fork 8
/
libvlc.vapi
1993 lines (1993 loc) · 61.2 KB
/
libvlc.vapi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[CCode (cheader_filename = "vlc/libvlc.h,vlc/libvlc_vlm.h")]
namespace VLC {
/**
* Audio channels
*/
[CCode (cname = "libvlc_audio_output_channel_t", cheader_filename = "vlc/libvlc_media_player.h")]
public enum AudioChannel {
[CCode (cname = "libvlc_AudioChannel_Error")]
ERROR,
[CCode (cname = "libvlc_AudioChannel_Stereo")]
STEREO,
[CCode (cname = "libvlc_AudioChannel_RStereo")]
R_STEREO,
[CCode (cname = "libvlc_AudioChannel_Left")]
LEFT,
[CCode (cname = "libvlc_AudioChannel_Right")]
RIGHT,
[CCode (cname = "libvlc_AudioChannel_Dolbys")]
DOLBYS
}
/**
* Audio device types
*/
[CCode (cname = "libvlc_audio_output_device_types_t", cheader_filename = "vlc/libvlc_media_player.h")]
public enum AudioDevice {
[CCode (cname = "libvlc_AudioOutputDevice_Error")]
ERROR,
[CCode (cname = "libvlc_AudioOutputDevice_Mono")]
MONO,
[CCode (cname = "libvlc_AudioOutputDevice_Stereo")]
STERO,
[CCode (cname = "libvlc_AudioOutputDevice_2F2R")]
TWO_F_TWO_R,
[CCode (cname = "libvlc_AudioOutputDevice_3F2R")]
THREE_F_TWO_R,
[CCode (cname = "libvlc_AudioOutputDevice_5_1")]
FIVE_ONE,
[CCode (cname = "libvlc_AudioOutputDevice_6_1")]
SIX_ONE,
[CCode (cname = "libvlc_AudioOutputDevice_7_1")]
SEVEN_ONE,
[CCode (cname = "libvlc_AudioOutputDevice_SPDIF")]
SPDIF
}
/**
* Event types
*/
[CCode (cname = "enum libvlc_event_e", cprefix = "libvlc_", cheader_filename = "vlc/libvlc_events.h")]
public enum EventType {
[CCode (cname = "libvlc_MediaMetaChanged")]
MEDIA_META_CHANGED,
[CCode (cname = "libvlc_MediaSubItemAdded")]
MEDIA_SUB_ITEM_ADDED,
[CCode (cname = "libvlc_MediaDurationChanged")]
MEDIA_DURATION_CHANGED,
[CCode (cname = "libvlc_MediaParsedChanged")]
MEDIA_PARSED_CHANGED,
[CCode (cname = "libvlc_MediaFreed")]
MEDIA_FREED,
[CCode (cname = "libvlc_MediaStateChanged")]
MEDIA_STATE_CHANGED,
[CCode (cname = "libvlc_MediaPlayerMediaChanged")]
MEDIA_PLAYER_MEDIA_CHANGED,
[CCode (cname = "libvlc_MediaPlayerNothingSpecial")]
MEDIA_PLAYER_NOTHING_SPECIAL,
[CCode (cname = "libvlc_MediaPlayerOpening")]
MEDIA_PLAYER_OPENING,
[CCode (cname = "libvlc_MediaPlayerBuffering")]
MEDIA_PLAYER_BUFFERING,
[CCode (cname = "libvlc_MediaPlayerPlaying")]
MEDIA_PLAYER_PLAYING,
[CCode (cname = "libvlc_MediaPlayerPaused")]
MEDIA_PLAYER_PAUSED,
[CCode (cname = "libvlc_MediaPlayerStopped")]
MEDIA_PLAYER_STOPPED,
[CCode (cname = "libvlc_MediaPlayerForward")]
MEDIA_PLAYER_FORWARD,
[CCode (cname = "libvlc_MediaPlayerBackward")]
MEDIA_PLAYER_BACKWARD,
[CCode (cname = "libvlc_MediaPlayerEndReached")]
MEDIA_PLAYER_END_REACHED,
[CCode (cname = "libvlc_MediaPlayerEncounteredError")]
MEDIA_PLAYER_ENCOUNTERED_ERROR,
[CCode (cname = "libvlc_MediaPlayerTimeChanged")]
MEDIA_PLAYER_TIME_CHANGED,
[CCode (cname = "libvlc_MediaPlayerPositionChanged")]
MEDIA_PLAYER_POSITION_CHANGED,
[CCode (cname = "libvlc_MediaPlayerSeekableChanged")]
MEDIA_PLAYER_SEEKABLE_CHANGED,
[CCode (cname = "libvlc_MediaPlayerPausableChanged")]
MEDIA_PLAYER_PAUSABLE_CHANGED,
[CCode (cname = "libvlc_MediaPlayerTitleChanged")]
MEDIA_PLAYER_TITLE_CHANGED,
[CCode (cname = "libvlc_MediaPlayerSnapshotTaken")]
MEDIA_PLAYER_SNAPSHOT_TAKEN,
[CCode (cname = "libvlc_MediaPlayerLengthChanged")]
MEDIA_PLAYER_LENGTH_CHANGED,
[CCode (cname = "libvlc_MediaListItemAdded")]
MEDIA_LIST_ITEM_ADDED,
[CCode (cname = "libvlc_MediaListWillAddItem")]
MEDIA_LIST_WILL_ADD_ITEM,
[CCode (cname = "libvlc_MediaListItemDeleted")]
MEDIA_LIST_ITEM_DELETED,
[CCode (cname = "libvlc_MediaListWillDeleteItem")]
MEDIA_LIST_WILL_DELETE_ITEM,
[CCode (cname = "libvlc_MediaListViewItemAdded")]
MEDIA_LIST_VIEW_ITEM_ADDED,
[CCode (cname = "libvlc_MediaListViewWillAddItem")]
MEDIA_LIST_VIEW_WILL_ADD_ITEM,
[CCode (cname = "libvlc_MediaListViewItemDeleted")]
MEDIA_LIST_VIEW_ITEM_DELETED,
[CCode (cname = "libvlc_MediaListViewWillDeleteItem")]
MEDIA_LIST_VIEW_WILL_DELETE_ITEM,
[CCode (cname = "libvlc_MediaListPlayerPlayed")]
MEDIA_LIST_PLAYER_PLAYED,
[CCode (cname = "libvlc_MediaListPlayerNextItemSet")]
MEDIA_LIST_PLAYER_NEXT_ITEM_SET,
[CCode (cname = "libvlc_MediaListPlayerStopped")]
MEDIA_LIST_PLAYER_STOPPED,
[CCode (cname = "libvlc_MediaDiscovererStarted")]
MEDIA_DISCOVERER_STARTED,
[CCode (cname = "libvlc_MediaDiscovererEnded")]
MEDIA_DISCOVERER_ENDED,
[CCode (cname = "libvlc_VlmMediaAdded")]
VLM_MEDIA_ADDED,
[CCode (cname = "libvlc_VlmMediaRemoved")]
VLM_MEDIA_REMOVED,
[CCode (cname = "libvlc_VlmMediaChanged")]
VLM_MEDIA_CHANGED,
[CCode (cname = "libvlc_VlmMediaInstanceStarted")]
VLM_MEDIA_INSTANCE_STARTED,
[CCode (cname = "libvlc_VlmMediaInstanceStopped")]
VLM_MEDIA_INSTANCE_STOPPED,
[CCode (cname = "libvlc_VlmMediaInstanceStatusInit")]
VLM_MEDIA_INSTANCE_STATUS_INIT,
[CCode (cname = "libvlc_VlmMediaInstanceStatusOpening")]
VLM_MEDIA_INSTANCE_STATUS_OPENING,
[CCode (cname = "libvlc_VlmMediaInstanceStatusPlaying")]
VLM_MEDIA_INSTANCE_STATUS_PLAYING,
[CCode (cname = "libvlc_VlmMediaInstanceStatusPause")]
VLM_MEDIA_INSTANCE_STATUS_PAUSE,
[CCode (cname = "libvlc_VlmMediaInstanceStatusEnd")]
VLM_MEDIA_INSTANCE_STATUS_END,
[CCode (cname = "libvlc_VlmMediaInstanceStatusError")]
VLM_MEDIA_INSTANCE_STATUS_ERROR
}
/**
* Metadata types
*/
[CCode (cname = "libvlc_meta_t", cheader_filename = "vlc/libvlc_media.h")]
public enum Meta {
[CCode (cname = "libvlc_meta_Title")]
TITLE,
[CCode (cname = "libvlc_meta_Artist")]
ARTIST,
[CCode (cname = "libvlc_meta_Genre")]
GENRE,
[CCode (cname = "libvlc_meta_Copyright")]
COPYRIGHT,
[CCode (cname = "libvlc_meta_Album")]
ALBUM,
[CCode (cname = "libvlc_meta_TrackNumber")]
TRACK_NUMBER,
[CCode (cname = "libvlc_meta_Description")]
DESCRIPTION,
[CCode (cname = "libvlc_meta_Rating")]
RATING,
[CCode (cname = "libvlc_meta_Date")]
DATE,
[CCode (cname = "libvlc_meta_Setting")]
SETTING,
[CCode (cname = "libvlc_meta_URL")]
URL,
[CCode (cname = "libvlc_meta_Language")]
LANGUAGE,
[CCode (cname = "libvlc_meta_NowPlaying")]
NOW_PLAYING,
[CCode (cname = "libvlc_meta_Publisher")]
PUBLISHER,
[CCode (cname = "libvlc_meta_EncodedBy")]
ENCODED_BY,
[CCode (cname = "libvlc_meta_ArtworkURL")]
ARTWORK_URL,
[CCode (cname = "libvlc_meta_TrackID")]
TRACK_ID
}
[CCode (cname = "int", cheader_filename = "vlc/libvlc_media.h")]
[Flags]
public enum Option {
[CCode (cname = "libvlc_media_option_trusted")]
TRUSTED,
[CCode (cname = "libvlc_media_option_unique")]
UNIQUE
}
/**
* Playback modes for playlist.
*/
[CCode (cname = "libvlc_playback_mode_t", cheader_filename = "vlc/libvlc_media_list_player.h")]
public enum PlaybackMode {
[CCode (cname = "libvlc_playback_mode_default")]
DEFAULT,
[CCode (cname = "libvlc_playback_mode_loop")]
LOOP,
[CCode (cname = "libvlc_playback_mode_repeat")]
REPEAT
}
[CCode (cname = "libvlc_state_t", cheader_filename = "vlc/libvlc_media.h")]
public enum State {
[CCode (cname = "libvlc_NothingSpecial")]
NOTHING_SPECIAL,
[CCode (cname = "libvlc_Opening")]
OPENING,
[CCode (cname = "libvlc_Buffering")]
BUFFERING,
[CCode (cname = "libvlc_Playing")]
PLAYING,
[CCode (cname = "libvlc_Paused")]
PAUSED,
[CCode (cname = "libvlc_Stopped")]
STOPPED,
[CCode (cname = "libvlc_Ended")]
ENDED,
[CCode (cname = "libvlc_Error")]
ERROR
}
[CCode (cname = "libvlc_track_type_t", cheader_filename = "vlc/libvlc_media.h")]
public enum TrackType {
[CCode (cname = "libvlc_track_unknown")]
UNKNOWN,
[CCode (cname = "libvlc_track_audio")]
AUDIO,
[CCode (cname = "libvlc_track_video")]
VIDEO,
[CCode (cname = "libvlc_track_text")]
TEXT
}
[CCode (cname = "libvlc_audio_output_t", free_function = "libvlc_audio_output_list_release")]
[Compact]
public class AudioList {
public audio_output? get (int i) {
return ((audio_output[]) this)[i];
}
}
/**
* Media discovery
*
* LibVLC media discovery finds available media via various means.
* This corresponds to the service discovery functionality in VLC media player.
* Different plugins find potential medias locally (e.g. user media directory),
* from peripherals (e.g. video capture device), on the local network
* (e.g. SAP) or on the Internet (e.g. Internet radios).
*/
[CCode (cname = "libvlc_media_discoverer_t", free_function = "libvlc_media_discoverer_release", cheader_filename = "vlc/libvlc_media_discoverer.h")]
[Compact]
public class Discoverer<T> {
public EventManager event_manager {
[CCode (cname = "libvlc_media_discoverer_event_manager")]
get;
}
/**
* Query if media service discover object is running.
*/
public bool is_running {
[CCode (cname = "libvlc_media_discoverer_is_running")]
get;
}
/**
* Media service discover object's localized name.
*/
public string localized_name {
[CCode (cname = "libvlc_media_discoverer_localized_name")]
get;
}
/**
* Get media service discover media list.
*/
public MediaList<T> media_list {
[CCode (cname = "libvlc_media_discoverer_media_list", simple_generics = true)]
get;
}
}
[CCode (cname = "libvlc_event_manager_t")]
[Compact]
public class EventManager {}
[CCode (cname = "libvlc_instance_t", unref_function = "libvlc_release", ref_function = "libvlc_retain")]
public class Instance {
public EventManager event_manager {
[CCode (cname = "libvlc_vlm_get_event_manager")]
get;
}
/**
* Create and initialize a libvlc instance.
*
* This functions accept a list of "command line" arguments similar to the
* main(). These arguments affect the LibVLC instance default
* configuration.
*
* Arguments are meant to be passed from the command line to LibVLC, just
* like VLC media player does. The list of valid arguments depends on the
* LibVLC version, the operating system and platform, and set of available
* LibVLC plugins. Invalid or unsupported arguments will cause the function
* to fail. Also, some arguments may alter the behaviour or otherwise
* interfere with other LibVLC functions.
*
* There is absolutely no warranty or promise of forward, backward and
* cross-platform compatibility with regards to arguments. We recommend
* that you do not use them, other than when debugging.
*/
[CCode (cname = "libvlc_new")]
public static Instance? create ([CCode (array_length_pos = 0.1)] string[]? args = null);
/**
* Add a broadcast, with one input.
*
* @param name the name of the new broadcast
* @param input the input MRL
* @param output the output MRL (the parameter to the "sout" variable)
* @param options additional options
* @param enabled boolean for enabling the new broadcast
* @param loop Should this broadcast be played in loop?
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_add_broadcast")]
public bool add_broadcast (string name, string input, string output, [CCode (array_length_pos = 3.1)] string[] options, bool enabled, bool loop);
/**
* Add a media's input MRL. This will add the specified one.
*
* @param name the media to work on
* @param input the input MRL
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_add_input")]
public bool add_input (string name, string input);
/**
* Add a vod, with one input.
*
* @param name the name of the new vod media
* @param input the input MRL
* @param options additional options
* @param enabled boolean for enabling the new vod
* @param mux the muxer of the vod media
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_add_vod")]
public bool add_vod (string name, string input, [CCode (array_length_pos = 2.1)] string[] options, bool enabled, string mux);
/**
* Edit the parameters of a media. This will delete all existing inputs and
* add the specified one.
*
* @param name the name of the new broadcast
* @param input the input MRL
* @param output the output MRL (the parameter to the "sout" variable)
* @param options additional options
* @param enabled enable the new broadcast
* @param loop Should this broadcast be played in loop?
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_change_media")]
public bool change_media (string name, string input, string output, [CCode (array_length_pos = 3.1)] string[] options, bool enabled, bool loop);
/**
* Create new media list player.
*
* @return media list player instance or null on error
*/
[CCode (cname = "libvlc_media_list_player_new", simple_generics = true)]
public ListPlayer<T>? create_list_player<T> ();
/**
* Create an empty media list.
* @return empty media list, or null on error
*/
[CCode (cname = "libvlc_media_list_new", simple_generics = true)]
public MediaList<T>? create_media_list<T> ();
/**
* Create an empty Media Player object
*/
[CCode (cname = "libvlc_media_player_new", simple_generics = true)]
public Player<T>? create_player<T> ();
/**
* Get count of devices for audio output, these devices are hardware oriented
* like analog or digital output of sound card
*
* @param audio_output name of audio output
* @return number of devices
* @see audio_output
*/
[CCode (cname = "libvlc_audio_output_device_count")]
public int get_audio_device_count (string audio_output);
/**
* Get id name of device
*
* @param audio_output name of audio output, {@link audio_output}
* @param device device index
* @return id name of device, use for setting device, need to be free after use
*/
[CCode (cname = "libvlc_audio_output_device_id")]
public unowned string get_audio_device_id (string audio_output, int device);
/**
* Get long name of device, if not available short name given
*
* @param audio_output name of audio output, {@link audio_output}
* @param device device index
* @return long name of device
*/
[CCode (cname = "libvlc_audio_output_device_longname")]
public unowned string get_audio_device_name (string audio_output, int device);
/**
* Get the list of available audio outputs
*
* @return list of available audio outputs. In case of error, null is returned.
*/
[CCode (cname = "libvlc_audio_output_list_get")]
public AudioList? get_audio_output_list ();
/**
* Discover media service by name.
*
* @param name service name
* @return media discover object or null in case of error
*/
[CCode (cname = "libvlc_media_discoverer_new_from_name", simple_generics = true)]
public Discoverer<T>? get_discoverer_from_name<T> (string name);
/**
* Get media instance length by name or instance id
*
* @param name name of vlm media instance
* @param instance instance id
* @return length of media item or -1 on error
*/
[CCode (cname = "libvlc_vlm_get_media_instance_length")]
public int get_media_instance_length (string name, int instance);
/**
* Get media instance position by name or instance id
*
* @param name name of vlm media instance
* @param instance instance id
* @return position as float or -1 on error
*/
[CCode (cname = "libvlc_vlm_get_media_instance_position")]
public float get_media_instance_position (string name, int instance);
/**
* Get media instance time by name or instance id
*
* @param name name of vlm media instance
* @param instance instance id
* @return time as integer or -1 on error
*/
[CCode (cname = "libvlc_vlm_get_media_instance_time")]
public int get_media_instance_time (string name, int instance);
/**
* Get media instance playback rate by name or instance id
*
* @param name name of vlm media instance
* @param instance instance id
* @return playback rate or -1 on error
*/
[CCode (cname = "libvlc_vlm_get_media_instance_rate")]
public int get_media_instance_rate (string name, int instance);
/**
* Create a media for an already open file descriptor.
* The file descriptor shall be open for reading (or reading and writing).
*
* Regular file descriptors, pipe read descriptors and character device
* descriptors (including TTYs) are supported on all platforms.
* Block device descriptors are supported where available.
* Directory descriptors are supported on systems that provide fdopendir().
* Sockets are supported on all platforms where they are file descriptors,
* i.e. all except Windows.
*
* This library will <b>not</b> automatically close the file descriptor
* under any circumstance. Nevertheless, a file descriptor can usually only be
* rendered once in a media player. To render it a second time, the file
* descriptor should probably be rewound to the beginning with lseek().
*
* @param fd open file descriptor
* @return the newly created media or null on error
*/
[CCode (cname = "libvlc_media_new_fd", simple_generics = true)]
public Media<S>? open_media_fd<S> (int fd);
/**
* Create a media with a certain given media resource location,
* for instance a valid URL.
*
* To refer to a local file with this function, the file: URI syntax
* '''must'''> be used (see IETF RFC3986). We recommend using
* {@link open_media_path} instead when dealing with local files.
*
* @param mrl the media location
* @return the newly created media or null on error
*/
[CCode (cname = "libvlc_media_new_location", simple_generics = true)]
public Media<S>? open_media_location<S> (string mrl);
/**
* Create a media as an empty node with a given name.
*
* @param name the name of the node
* @return the new empty media or null on error
*/
[CCode (cname = "libvlc_media_new_as_node", simple_generics = true)]
public Media<S>? open_media_node<S> (string name);
/**
* Create a media for a certain file path.
*
* @param path local filesystem path
* @return the newly created media or null on error
*/
[CCode (cname = "libvlc_media_new_path", simple_generics = true)]
public Media<S>? open_media_path<S> (string path);
/**
* Pause the named broadcast.
*
* @param name the name of the broadcast
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_pause_media")]
public bool pause_media (string name);
/**
* Play the named broadcast.
*
* @param name the name of the broadcast
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_play_media")]
public bool play_media (string name);
/**
* Start playing (if there is any item in the playlist).
*
* Additionnal playlist item options can be specified for addition to the
* item before it is played.
*
* @param id the item to play. If this is a negative number, the next item
* will be selected. Otherwise, the item with the given ID will be played
* @param options the options to add to the item
*/
[Deprecated]
[CCode (cname = "libvlc_playlist_play")]
public void play_playlist (int id, [CCode (array_length_pos = 1.1)] string[] options);
[CCode (cname = "libvlc_retain")]
public void ref ();
/**
* Release the vlm instance
*/
[CCode (cname = "libvlc_vlm_release")]
public void release_vlm ();
/**
* Delete a media (VOD or broadcast).
*
* @param name the media to delete
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_del_media")]
public bool remove_media (string name);
/**
* Seek in the named broadcast.
*
* @param name the name of the broadcast
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_seek_media")]
public bool seek_media (string name, float percentage);
/**
* Enable or disable a media (VOD or broadcast).
*
* @param name the media to work on
* @param enabled the new status
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_set_enabled")]
public bool set_enabled (string name, bool enabled);
/**
* Set a media's input MRL. This will delete all existing inputs and
* add the specified one.
*
* @param name the media to work on
* @param input the input MRL
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_set_input")]
public bool set_input (string name, string input);
/**
* Set a media's loop status.
*
* @param name the media to work on
* @param loop the new status
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_set_loop")]
public bool set_loop (string name, bool loop);
/**
* Set a media's vod muxer.
*
* @param name the media to work on
* @param mux the new muxer
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_set_mux")]
public bool set_mux (string name, string mux);
/**
* Set the output for a media.
*
* @param name the media to work on
* @param output the output MRL (the parameter to the "sout" variable)
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_set_output")]
public bool set_output (string name, string output);
/**
* Return information about the named media as a JSON
* string representation.
*
* This function is mainly intended for debugging use,
* if you want programmatic access to the state of
* an instance, please use the corresponding
* {@link get_media_instance_length} and friends.
*
* @param name the name of the media, if the name is an empty string, all media is described
* @return string with information about named media, or null on error
*/
[CCode (cname = "libvlc_vlm_show_media")]
public unowned string? show_media (string name);
/**
* Stop the named broadcast.
*
* @param name the name of the broadcast
* @return false on success, true on error
*/
[CCode (cname = "libvlc_vlm_stop_media")]
public bool stop_media (string name);
[CCode (cname = "libvlc_release")]
public void unref ();
}
/**
* Plays a list of media, in a certain order.
*
* This is required to especially support playlist files.
* The normal {@link Player} can only play a single media, and does not
* handle playlist files properly.
*/
[CCode (cname = "libvlc_media_list_player_t", free_function = "libvlc_media_list_player_release", cheader_filename = "vlc/libvlc_media_list_player.h")]
[Compact]
public class ListPlayer<T> {
/**
* The event manager.
*/
public EventManager event_manager {
[CCode (cname = "libvlc_media_list_player_event_manager")]
get;
}
/**
* The media list associated with the player
*/
public MediaList<T> list {
[CCode (cname = "libvlc_media_list_player_set_media_list", simple_generics = true)]
get;
}
/**
* The playback mode for the playlist
*/
public PlaybackMode mode {
[CCode (cname = "libvlc_media_list_player_set_playback_mode")]
set;
}
/**
* The media player.
*/
public Player<T>? player {
[CCode (cname = "libvlc_media_list_player_set_media_player", simple_generics = true)]
set;
}
/**
* The current state of media list player
*/
public State state {
[CCode (cname = "libvlc_media_list_player_get_state")]
get;
}
/**
* Play next item from media list
*
* @return false upon success, true if there is no next item
*/
[CCode (cname = "libvlc_media_list_player_next")]
public bool next ();
/**
* Pause media list
*/
[CCode (cname = "libvlc_media_list_player_pause")]
public void pause ();
/**
* Play media list
*/
[CCode (cname = "libvlc_media_list_player_play")]
public void play ();
/**
* Play the given media item
*
* @param md the media instance
* @return false upon success, true if the item was not found.
*/
[CCode (cname = "libvlc_media_list_player_play_item", simple_generics = true)]
public bool play_item (Media<T> md);
/**
* Play media list item at position index
*
* @param index index in media list to play
* @return false upon success, true if the item was not found.
*/
[CCode (cname = "libvlc_media_list_player_play_item_at_index")]
public bool play_item_at_index (int index);
/**
* Play previous item from media list
*
* @return false upon success, true if there is no previous item
*/
[CCode (cname = "libvlc_media_list_player_previous")]
public bool previous ();
/**
* Stop playing media list
*/
[CCode (cname = "libvlc_media_list_player_stop")]
public void stop ();
}
[CCode (cname = "libvlc_log_t")]
[Compact]
public class Log {
[CCode (cname = "int", has_type_id = false)]
public enum Severity {
[CCode (cname = "0")]
INFO,
[CCode (cname = "1")]
ERR,
[CCode (cname = "2")]
WARN,
[CCode (cname = "3")]
DBG
}
/**
* Optional header
*/
[CCode (cname = "header")]
public string? header;
/**
* Message
*/
[CCode (cname = "message")]
public string message;
/**
* Module name
*/
[CCode (cname = "name")]
public string name;
[CCode (cname = "i_severity")]
public Severity severity;
/**
* sizeof() of message structure, must be filled in by user
*/
[CCode (cname = "sizeof_msg")]
public uint sizeof_msg;
/**
* Module type
*/
[CCode (cname = "type")]
public string type;
}
/**
* Abstract representation of a playable media.
*
* It consists of a media location and various optional meta data.
*/
[CCode (cname = "libvlc_media_t", ref_function = "libvlc_media_retain", unref_function = "libvlc_media_release", cheader_filename = "vlc/libvlc_media.h")]
public class Media<T> {
/**
* Get duration (in ms) of media descriptor object item.
*/
public int64 duration {
[CCode (cname = "libvlc_media_get_duration")]
get;
}
/**
* Get event manager from media descriptor object.
*/
public EventManager event_manager {
[CCode (cname = "libvlc_media_event_manager")]
get;
}
/**
* Parsed status for media descriptor object.
*
* @see EventType.MEDIA_PARSED_CHANGED
*/
public bool is_parsed {
[CCode (cname = "libvlc_media_is_parsed")]
get;
}
/**
* The media resource locator (mrl)
*/
public string mrl {
[CCode (cname = "libvlc_media_get_mrl")]
get;
}
/**
* Current state of media descriptor object.
*/
public State state {
[CCode (cname = "libvlc_media_get_state")]
get;
}
/**
* Data accessed by the host application, VLC.framework uses it as a pointer to
* an native object
*/
public T user_data {
[CCode (cname = "libvlc_media_set_user_data", simple_generics = true)]
set;
[CCode (cname = "libvlc_media_get_user_data", simple_generics = true)]
get;
}
/**
* Add an option to the media.
*
* This option will be used to determine how the media_player will
* read the media. This allows to use VLC's advanced
* reading/streaming options on a per-media basis.
*
* The options are detailed in vlc ''--long-help'', for instance ''--sout-all''
*
* @param options the options (as a string)
*/
[CCode (cname = "libvlc_media_add_option")]
public void add_option (string options);
/**
* Add an option to the media with configurable flags.
*
* This option will be used to determine how the media_player will
* read the media. This allows to use VLC's advanced
* reading/streaming options on a per-media basis.
*
* The options are detailed in vlc --long-help, for instance ''--sout-all''
*
* @param options the options (as a string)
* @param flags the flags for this option
*/
[CCode (cname = "libvlc_media_add_option_flag")]
public void add_option_flag (string options, Option flags = 0);
/**
* Create a Media Player object from a Media
*/
[CCode (cname = "libvlc_media_player_new_from_media")]
public Player<T>? create_player ();
/**
* Duplicate a media descriptor object.
*/
[CCode (cname = "libvlc_media_duplicate", simple_generics = true)]
public Media<T> duplicate ();
/**
* Read the meta of the media.
*
* If the media has not yet been parsed this will return NULL.
*
* This methods automatically calls libvlc_media_parse_async(), so after
* calling it you may receive a {@link EventType.MEDIA_META_CHANGED} event.
* If you prefer a synchronous version ensure that you call
* {@link parse} before.
*
* @see parse
* @see parse_async
*
* @param meta the meta to read
* @return the media's meta
*/
[CCode (cname = "libvlc_media_get_meta")]
public string? get (Meta meta);
/**
* Get the current statistics about the media
: @param p_stats structure that contain the statistics about the media
* @return true if the statistics are available, false otherwise
*/
[CCode (cname = "libvlc_media_get_stats")]
public bool get_stats (out media_stats p_stats);
/**
* Get media descriptor's elementary streams description
*
* Note, you need to play the media ''one'' time with --sout="#description"
* Not doing this will result in an empty array, and doing it more than once
* will duplicate the entries in the array each time. Something like this:
*
* {{{
* var player = media.create_player();
* media.add_option_flag("sout=#description");
* player.play();
* }}}
*
* This is very likely to change in next release, and be done at the parsing
* phase.
*/
public track_info[] get_tracks_info () {
track_info[] info;
info.length = _get_tracks_info (out info);
return info;
}
[CCode (cname = "libvlc_media_get_tracks_info")]
private int _get_tracks_info (out track_info[] info);
/**
* Parse a media.
*
* This fetches (local) meta data and tracks information.
* The method is synchronous.
*
* @see parse_async
* @see get
* @see get_tracks_info
*/
[CCode (cname = "libvlc_media_parse")]
public void parse ();
/**
* Parse a media.
*
* This fetches (local) meta data and tracks information.
* The method is the asynchronous of {@link parse}.
*
* To track when this is over you can listen to {@link EventType.MEDIA_PARSED_CHANGED}
* event. However if the media was already parsed you will not receive this
* event.
*
* @see parse
* @see get
* @see get_tracks_info
*/
[CCode (cname = "libvlc_media_parse_async")]
public void parse_async ();
/**
* Retain a reference to a media descriptor object. Use
* {@link unref} to decrement the reference count of a
* media descriptor object.
*/
[CCode (cname = "libvlc_media_retain")]
public void ref ();
/**
* Save the meta previously set
*
* @return true if the write operation was successfull
*/
[CCode (cname = "libvlc_media_save_meta")]
public bool save_meta ();
/**
* Set the meta of the media (this function will not save the meta, call
* {@link save_meta} in order to save the meta)
*
* @param meta the meta to write
* @param value the media's meta
*/
[CCode (cname = "libvlc_media_set_meta")]
public void set (Meta meta, string value);
/**
* Decrement the reference count of a media descriptor object. If the
* reference count is 0, then this method will release the media descriptor
* object. It will send out an {@link EventType.MEDIA_FREED} event to all
* listeners. If the media descriptor object has been released it should
* not be used again.
*/
[CCode (cname = "libvlc_media_release")]
public void unref ();
}
/**
* Holds multiple {@link Media} descriptors.
*/
[CCode (cname = "libvlc_media_list_t", unref_function = "libvlc_media_list_release", ref_function = "libvlc_media_list_retain", cheader_filename = "vlc/libvlc_media_list.h")]
public class MediaList<T> {
/**
* The event manager from this media list instance.
*
* The event manager is immutable, so you don't have to hold the lock
*/
public EventManager event_manager {
[CCode (cname = "libvlc_media_list_event_manager")]
get;
}
/**
* Is media list playing?
*/
public bool is_playing {
[CCode (cname = "libvlc_media_list_player_is_playing")]
get;
}
/**
* This indicates if this media list is read-only from a user point of view
*/
public bool is_writable {
[CCode (cname = "libvlc_media_list_is_readonly")]
get;
}
/**
* The associated media instance with this media list instance.
*
* The {@link lock} should NOT be held upon entering this function.
*/
public Media<T> media {
[CCode (cname = "libvlc_media_list_set_media", simple_generics = true)]
set;
[CCode (cname = "libvlc_media_list_media", simple_generics = true)]
owned get;
}