Repository navigation
Expand file tree
/
Copy pathPasLibVlcUnit.pas
More file actions
12382 lines (10774 loc) · 360 KB
/
Copy pathPasLibVlcUnit.pas
File metadata and controls
12382 lines (10774 loc) · 360 KB
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
(*
*******************************************************************************
* PasLibVlcUnit.pas - pascal interface for VideoLAN libvlc 3.0.20
*
* See copyright notice below.
*
* Last modified: 2024.01.15
*
* author: Robert Jędrzejczyk
* e-mail: robert@prog.olsztyn.pl
* www: http://prog.olsztyn.pl/paslibvlc
*
* See PasLibVlcUnit.txt for change log
*
*******************************************************************************
*
* Copyright (c) 2024 Robert Jędrzejczyk
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*******************************************************************************
*
* libvlc is part of project VideoLAN
*
* Copyright (c) 1996-2024 VideoLAN Team
*
* For more information about VideoLAN
*
* please visit http://www.videolan.org/
*
*)
{$I .\compiler.inc}
unit PasLibVlcUnit;
interface
uses
{$IFDEF UNIX}Unix,{$ENDIF}
{$IFDEF FPC}dynlibs, LCLType,{$ENDIF}
{$IFDEF MSWINDOWS}Windows, Registry,{$ENDIF}
{$IFDEF LCLCARBON}CarbonPrivate, CarbonDef,{$ENDIF}
{$IFDEF LCLGTK2}Gtk2, {$IFDEF LINUX}Gdk2x,{$ENDIF}{$ENDIF}
{$IFDEF LCLQT}Qt4, QtWidgets,{$ENDIF}
{$IFDEF LCLQT5}Qt5, QtWidgets,{$ENDIF}
{$IFDEF LINUX}FMX.Dialogs, Posix.Unistd,{$ENDIF}
{$IFDEF MACOS}FMX.Dialogs,Posix.Unistd,{$ENDIF}
SysUtils, {$IFDEF HAS_SYNCOBJS}SyncObjs,{$ENDIF} Classes, Math;
{$IFDEF HAS_EXCEPTION_MASK}
const
VLC_EXCEPTION_MASK_ALL = [exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision];
VLC_EXCEPTION_MASK_MIN = [exPrecision, exInvalidOp];
{$ENDIF}
LibVlc = 'LibVlc.dll';
LibVlcCore = 'LibVlcCore.dll';
var
VLCLibraryPath : string = '';
const
VLC_VERSION_BIN_010000 = $010000;
VLC_VERSION_BIN_010100 = $010100;
VLC_VERSION_BIN_010101 = $010101;
VLC_VERSION_BIN_010105 = $010105;
VLC_VERSION_BIN_020000 = $020000;
VLC_VERSION_BIN_020100 = $020100;
VLC_VERSION_BIN_020200 = $020200;
VLC_VERSION_BIN_030000 = $030000;
VLC_VERSION_BIN_040000 = $040000;
(**
* Real path to libvlc.dll
*)
var
libvlc_dynamic_dll_path : string;
(**
* Real library file name
*)
var
libvlc_dynamic_dll_file : string;
(**
* Current library version
*)
var
libvlc_dynamic_dll_vlc_version_str : string;
var
libvlc_dynamic_dll_vlc_version_bin : LongWord;
{$IFDEF MSWINDOWS}
(**
* Current file version
*)
var
libvlc_dynamic_dll_file_version_str : string;
var
libvlc_dynamic_dll_file_version_bin : LongWord;
(**
* Current product version
*)
var
libvlc_dynamic_dll_product_version_str : string;
var
libvlc_dynamic_dll_product_version_bin : LongWord;
{$ENDIF}
(**
* Last error message generated by LibVlc_Init() procedure
*)
var
libvlc_dynamic_dll_error: string;
(**
* help read version nunber from string returned by
*
*)
function read_dec_number(var ptr : PAnsiChar) : LongWord; overload;
function read_dec_number(var ptr : PWideChar) : LongWord; overload;
(**
* help set function pointers to NIL
*
*)
procedure libvlc_reset_function_pointers(force : boolean = FALSE);
(**
* Dynamic loading libvlc.dll
* Must be called before use any libvlc function
*)
procedure libvlc_dynamic_dll_init();
procedure libvlc_dynamic_dll_init_with_path(vlc_install_path: string);
(**
* Release libvlc.dll
*)
procedure libvlc_dynamic_dll_done();
{$IFNDEF HAS_PATH_DELIM}
const
PathDelim = '\';
{$ENDIF}
{$IFNDEF HAS_PPANSICHAR}
type
PPAnsiChar = ^PAnsiChar;
{$ENDIF}
type
TPasLibVlcWinHandle = {$IFDEF MACOS}Pointer{$ELSE}{$IFDEF FPC}{$IFNDEF WINDOWS}LCLType.{$ENDIF}{$ENDIF}THandle{$ENDIF};
TPasLibVlcLibHandle = {$IFDEF FPC}dynlibs.TLibHandle{$ELSE}THandle{$ENDIF};
TPaslibVlcFileHandle = {$IFDEF DELPHI_XE_UP}System.THandle{$ELSE}THandle{$ENDIF};
(*
*******************************************************************************
* type s and structures used in libvlc
*******************************************************************************
*)
type
{$IFDEF CPUX64}
libvlc_size_t = UInt64;
libvlc_ssize_t = Int64;
{$ELSE}
libvlc_size_t = LongWord;
libvlc_ssize_t = LongInt;
{$ENDIF}
type
libvlc_instance_t_ptr = type Pointer;
libvlc_log_t_ptr = type Pointer;
libvlc_log_iterator_t_ptr = type Pointer;
libvlc_media_t_ptr = type Pointer;
libvlc_media_player_t_ptr = type Pointer;
libvlc_media_list_t_ptr = type Pointer;
libvlc_media_list_player_t_ptr = type Pointer;
libvlc_media_library_t_ptr = type Pointer;
libvlc_media_discoverer_t_ptr = type Pointer;
libvlc_event_manager_t_ptr = type Pointer;
libvlc_renderer_item_t_ptr = type Pointer;
libvlc_dialog_id_ptr = type Pointer;
libvlc_renderer_discoverer_t_ptr = type Pointer;
type
libvlc_time_t_ptr = ^libvlc_time_t;
libvlc_time_t = Int64;
{$IFDEF USE_VLC_DEPRECATED_API}
type
libvlc_log_message_t_ptr = ^libvlc_log_message_t;
libvlc_log_message_t = record
i_severity : Integer; // 0=INFO, 1=ERR, 2=WARN, 3=DBG
psz_type : PAnsiChar; // module type
psz_name : PAnsiChar; // module name
psz_header : PAnsiChar; // optional header
psz_message : PAnsiChar; // message
end;
{$ENDIF}
type
libvlc_meta_t = (
libvlc_meta_Title,
libvlc_meta_Artist,
libvlc_meta_Genre,
libvlc_meta_Copyright,
libvlc_meta_Album,
libvlc_meta_TrackNumber,
libvlc_meta_Description,
libvlc_meta_Rating,
libvlc_meta_Date,
libvlc_meta_Setting,
libvlc_meta_URL,
libvlc_meta_Language,
libvlc_meta_NowPlaying,
libvlc_meta_Publisher,
libvlc_meta_EncodedBy,
libvlc_meta_ArtworkURL,
libvlc_meta_TrackID,
// from VLC 2.2.0
libvlc_meta_TrackTotal,
libvlc_meta_Director,
libvlc_meta_Season,
libvlc_meta_Episode,
libvlc_meta_ShowName,
libvlc_meta_Actors,
// from VLC 3.0.0
libvlc_meta_AlbumArtist,
libvlc_meta_DiscNumber,
libvlc_meta_DiscTotal
// Add new meta types HERE
);
type
libvlc_state_t = (
libvlc_NothingSpecial, // 0,
libvlc_Opening, // 1,
// Deprecated value. Check the
// libvlc_MediaPlayerBuffering event to know the
// buffering state of a libvlc_media_player
libvlc_Buffering, // 2,
libvlc_Playing, // 3,
libvlc_Paused, // 4,
libvlc_Stopped, // 5,
libvlc_Ended, // 6,
libvlc_Error // 7
);
const
libvlc_media_option_trusted = $0002;
libvlc_media_option_unique = $0100;
{$IFDEF HAS_ENUM_ORDINALITY}
type
libvlc_track_type_t = (
libvlc_track_unknown = -1,
libvlc_track_audio = 0,
libvlc_track_video = 1,
libvlc_track_text = 2
);
{$ELSE}
type
libvlc_track_type_t = -1..2;
const
libvlc_track_unknown = -1;
libvlc_track_audio = 0;
libvlc_track_video = 1;
libvlc_track_text = 2;
{$ENDIF}
type
libvlc_media_stats_t_ptr = ^libvlc_media_stats_t;
libvlc_media_stats_t = record
// Input
i_read_bytes : Integer;
f_input_bitrate : Single; // Float
// Demux
i_demux_read_bytes : Integer;
f_demux_bitrate : Single;
i_demux_corrupted : Integer;
i_demux_discontinuity : Integer;
// Decoders
i_decoded_video : Integer;
i_decoded_audio : Integer;
// Video Output
i_displayed_pictures : Integer;
i_lost_pictures : Integer;
// Audio output
i_played_abuffers : Integer;
i_lost_abuffers : Integer;
// Stream output
i_sent_packets : Integer;
i_sent_bytes : Integer;
f_send_bitrate : Single;
end;
type
libvlc_media_track_info_audio_t = record
i_channels : LongWord;
i_rate : LongWord
end;
type
libvlc_media_track_info_video_t = record
i_height : LongWord;
i_width : LongWord;
end;
type
libvlc_media_track_info_t_ptr = ^libvlc_media_track_info_t;
libvlc_media_track_info_t = record
// Codec fourcc
i_codec : LongWord;
i_id : Integer;
i_type : libvlc_track_type_t;
// Codec specific
i_profile : Integer;
i_level : Integer;
case Byte of
0: (audio : libvlc_media_track_info_audio_t);
1: (video : libvlc_media_track_info_video_t);
end;
type
libvlc_audio_track_t_ptr = ^libvlc_audio_track_t;
libvlc_audio_track_t = record
i_channels : LongWord;
i_rate : LongWord;
end;
type
libvlc_video_orient_t = (
libvlc_video_orient_top_left, // Normal. Top line represents top, left column left.
libvlc_video_orient_top_right, // Flipped horizontally
libvlc_video_orient_bottom_left, // Flipped vertically
libvlc_video_orient_bottom_right, // Rotated 180 degrees
libvlc_video_orient_left_top, // Transposed
libvlc_video_orient_left_bottom, // Rotated 90 degrees clock:wise (or 270 anti-clockwise)
libvlc_video_orient_right_top, // Rotated 90 degrees anti-clockwise
libvlc_video_orient_right_bottom // Anti-transposed
);
{$IFDEF HAS_ENUM_ORDINALITY}
type
libvlc_video_projection_t = (
libvlc_video_projection_rectangular,
libvlc_video_projection_equirectangular, // 360 spherical
libvlc_video_projection_cubemap_layout_standard = $100
);
{$ELSE}
type
libvlc_video_projection_t = 0..$100;
const
libvlc_video_projection_rectangular = 0;
libvlc_video_projection_equirectangular = 1; // 360 spherical
libvlc_video_projection_cubemap_layout_standard = $100;
{$ENDIF}
(**
* Viewpoint
*
* allocate using libvlc_video_new_viewpoint()
*)
type
libvlc_video_viewpoint_t_ptr = ^libvlc_video_viewpoint_t;
libvlc_video_viewpoint_t = record
f_yaw : Single; // view point yaw in degrees -180 - +180
f_pitch : Single; // view point pitch in degrees -90 - +90
f_roll : Single; // view point roll in degrees -180 - +180
f_field_of_view : Single; // field of view in degrees 0 - +180 (default 80)
end;
type
libvlc_video_track_t_ptr = ^libvlc_video_track_t;
libvlc_video_track_t = record
i_height : LongWord;
i_width : LongWord;
i_sar_num : LongWord;
i_sar_den : LongWord;
i_frame_rate_num : LongWord;
i_frame_rate_den : LongWord;
// from VLC 3.0.0
i_orientation : libvlc_video_orient_t;
i_projection : libvlc_video_projection_t;
pose : libvlc_video_viewpoint_t; // Initial view point
end;
type
libvlc_subtitle_track_t_ptr = ^libvlc_subtitle_track_t;
libvlc_subtitle_track_t = record
psz_encoding : PAnsiChar;
end;
type
libvlc_media_track_union_t = record
case Byte of
0: (audio : libvlc_audio_track_t_ptr);
1: (video : libvlc_video_track_t_ptr);
2: (subtitle : libvlc_subtitle_track_t_ptr);
end;
type
libvlc_media_track_t_ptr = ^libvlc_media_track_t;
libvlc_media_track_t = record
// Codec fourcc
i_codec : LongWord;
i_original_fourcc : LongWord;
i_id : Integer;
i_type : libvlc_track_type_t;
// Codec specific
i_profile : Integer;
i_level : Integer;
// union
u : libvlc_media_track_union_t;
i_bitrate : LongWord;
psz_language : PAnsiChar;
psz_description : PAnsiChar;
end;
(**
* Media type
*
* see libvlc_media_get_type
*)
type
libvlc_media_type_t = (
libvlc_media_type_unknown,
libvlc_media_type_file,
libvlc_media_type_directory,
libvlc_media_type_disc,
libvlc_media_type_stream,
libvlc_media_type_playlist
);
(**
* Parse flags used by libvlc_media_parse_with_options()
*
* see libvlc_media_parse_with_options
*)
type
libvlc_media_parse_flag_t = LongWord;
const
libvlc_media_parse_local = $00; // Parse media if it's a local file
libvlc_media_parse_network = $01; // Parse media even if it's a network file
libvlc_media_fetch_local = $02; // Fetch meta and covert art using local resources
libvlc_media_fetch_network = $04; // Fetch meta and covert art using network resources
(**
* Interact with the user (via libvlc_dialog_cbs) when preparsing this item
* (and not its sub items). Set this flag in order to receive a callback
* when the input is asking for credentials.
*)
libvlc_media_do_interact = $08;
(**
* Parse status used sent by libvlc_media_parse_with_options() or returned by
* libvlc_media_get_parsed_status()
*
* see libvlc_media_parse_with_options
* see libvlc_media_get_parsed_status
*)
{$IFDEF HAS_ENUM_ORDINALITY}
type
libvlc_media_parsed_status_t = (
libvlc_media_parsed_status_skipped = 1,
libvlc_media_parsed_status_failed,
libvlc_media_parsed_status_timeout,
libvlc_media_parsed_status_done
);
{$ELSE}
type
libvlc_media_parsed_status_t = 1..4;
const
libvlc_media_parsed_status_skipped = 1;
libvlc_media_parsed_status_failed = 2;
libvlc_media_parsed_status_timeout = 3;
libvlc_media_parsed_status_done = 4;
{$ENDIF}
(**
* Type of a media slave: subtitle or audio.
*)
type
libvlc_media_slave_type_t = (
libvlc_media_slave_type_subtitle,
libvlc_media_slave_type_audio
);
(**
* A slave of a libvlc_media_t
* see libvlc_media_slaves_get
*)
type
libvlc_media_slave_t = record
psz_uri : PAnsiChar;
i_type : libvlc_media_slave_type_t;
i_priority : LongWord;
end;
type
libvlc_media_slave_t_list_ptr = ^libvlc_media_slave_t_list;
libvlc_media_slave_t_list = array of libvlc_media_slave_t;
(**
* Callback prototype to open a custom bitstream input media.
*
* The same media item can be opened multiple times. Each time, this callback
* is invoked. It should allocate and initialize any instance-specific
* resources, then store them in *datap. The instance resources can be freed
* in the @ref libvlc_media_close_cb callback.
*
* param opaque private pointer as passed to libvlc_media_new_callbacks()
* param datap storage space for a private data pointer [OUT]
* param sizep byte length of the bitstream or UINT64_MAX if unknown [OUT]
*
* For convenience, *datap is initially NULL and *sizep is initially 0.
*
* return 0 on success, non-zero on error. In case of failure, the other
* callbacks will not be invoked and any value stored in *datap and *sizep is
* discarded.
*)
type
libvlc_media_open_cb_t = function(
opaque : Pointer;
var datap : Pointer;
var sizep : Int64
) : Integer; cdecl;
(**
* Callback prototype to read data from a custom bitstream input media.
*
* param datap - structure initialized by open_cb
* param buf - start address of the buffer to read data into
* param len - bytes length of the buffer
*
* return strictly positive number of bytes read, 0 on end-of-stream,
* or -1 on non-recoverable error
*
* note If no data is immediately available, then the callback should sleep.
*
* The application is responsible for avoiding deadlock situations.
* In particular, the callback should return an error if playback is stopped;
* if it does not return, then libvlc_media_player_stop() will never return.
*)
type
libvlc_media_read_cb_t = function(
datap : Pointer;
buf : Pointer;
len : libvlc_size_t
) : libvlc_ssize_t; cdecl;
(**
* Callback prototype to seek a custom bitstream input media.
*
* param datap - structure initialized by open_cb
* param offset absolute byte offset to seek to
* return 0 on success, -1 on error.
*)
type
libvlc_media_seek_cb_t = function(
datap : Pointer;
offset : Int64
) : Integer; cdecl;
(**
* Callback prototype to close a custom bitstream input media.
*
* param param datap - structure initialized by open_cb
* close_cb must destroy it
*)
type
libvlc_media_close_cb_t = procedure(
datap : Pointer
); cdecl;
type
libvlc_media_track_list_t_ptr = ^libvlc_media_track_list_t;
libvlc_media_track_list_t = array of libvlc_media_track_t_ptr;
(**
* Description for video, audio tracks and subtitles. It contains
* id, name (description string) and pointer to next record.
*)
type
libvlc_track_description_t_ptr = ^libvlc_track_description_t;
libvlc_track_description_t = record
i_id : Integer;
psz_name : PAnsiChar;
p_next : libvlc_track_description_t_ptr;
end;
(**
* Description for titles
*)
const
libvlc_title_menu = $01;
libvlc_title_interactive = $02;
type
libvlc_title_description_t_ptr = ^libvlc_title_description_t;
libvlc_title_description_t = record
i_duration : Int64; // duration in milliseconds
psz_name : PAnsiChar; // title name
i_flags : LongWord; // info if item was recognized as a menu, interactive or plain content by the demuxer
end;
(**
* Description for chapters
*)
type
libvlc_chapter_description_t_ptr = ^libvlc_chapter_description_t;
libvlc_chapter_description_t = record
i_time_offset : Int64; // time-offset of the chapter in milliseconds
i_duration : Int64; // duration of the chapter in milliseconds
psz_name : PAnsiChar; // chapter name
end;
(**
* Description for audio output. It contains
* name, description and pointer to next record.
*)
type
libvlc_audio_output_t_ptr = ^libvlc_audio_output_t;
libvlc_audio_output_t = record
psz_name : PAnsiChar;
psz_description : PAnsiChar;
p_next : libvlc_audio_output_t_ptr;
end;
(**
* Description for audio output device.
*)
type
libvlc_audio_output_device_t_ptr = ^libvlc_audio_output_device_t;
libvlc_audio_output_device_t = record
p_next : libvlc_audio_output_device_t_ptr; // Next entry in list
psz_device : PAnsiChar; // Device identifier string
psz_description : PAnsiChar; // User-friendly device description
// More fields may be added here in later versions
end;
type
libvlc_equalizer_t_ptr = Pointer;
unsigned_t = LongWord;
(**
* Rectangle type for video geometry
*)
type
libvlc_rectangle_t_ptr = ^libvlc_rectangle_t;
libvlc_rectangle_t = record
top : Integer;
left : Integer;
bottom : Integer;
right : Integer;
end;
type
libvlc_opacity_t = 0..255;
const
libvlc_opacity_None = 0;
libvlc_opacity_Medium = 128;
libvlc_opacity_Full = 255;
(**
* Marq options definition
*)
type
libvlc_video_marquee_option_t = (
libvlc_marquee_Enable, // 0,
libvlc_marquee_Text, // 1,
libvlc_marquee_Color, // 2,
libvlc_marquee_Opacity, // 3,
libvlc_marquee_Position, // 4,
libvlc_marquee_Refresh, // 5,
libvlc_marquee_Size, // 6,
libvlc_marquee_Timeout, // 7,
libvlc_marquee_X, // 8,
libvlc_marquee_Y // 9
);
// The color of the text 0xRRGGBB (in native endian)
const
libvlc_video_marquee_color_Default = $00FFFFFF;
libvlc_video_marquee_color_Black = $00000000;
libvlc_video_marquee_color_Gray = $00808080;
libvlc_video_marquee_color_Silver = $00C0C0C0;
libvlc_video_marquee_color_White = $00FFFFFF;
// RR GG BB
libvlc_video_marquee_color_Maroon = $80 or ($00 shl 8) or ($00 shl 16);
libvlc_video_marquee_color_Red = $FF or ($00 shl 8) or ($00 shl 16);
libvlc_video_marquee_color_Fuchsia = $FF or ($00 shl 8) or ($FF shl 16);
libvlc_video_marquee_color_Yellow = $FF or ($FF shl 8) or ($00 shl 16);
libvlc_video_marquee_color_Olive = $80 or ($80 shl 8) or ($00 shl 16);
libvlc_video_marquee_color_Green = $00 or ($80 shl 8) or ($00 shl 16);
libvlc_video_marquee_color_Teal = $00 or ($80 shl 8) or ($80 shl 16);
libvlc_video_marquee_color_Lime = $00 or ($FF shl 8) or ($00 shl 16);
libvlc_video_marquee_color_Purple = $80 or ($00 shl 8) or ($80 shl 16);
libvlc_video_marquee_color_Navy = $00 or ($00 shl 8) or ($80 shl 16);
libvlc_video_marquee_color_Blue = $00 or ($00 shl 8) or ($FF shl 16);
libvlc_video_marquee_color_Aqua = $00 or ($FF shl 8) or ($FF shl 16);
type
libvlc_video_marquee_color_t = libvlc_video_marquee_color_Black..libvlc_video_marquee_color_White;
const
libvlc_video_marquee_default_font_size = 12;
type
libvlc_video_logo_option_t = (
libvlc_logo_Enable, // 0,
libvlc_logo_File, // 1,
libvlc_logo_X, // 2,
libvlc_logo_Y, // 3,
libvlc_logo_Delay, // 4,
libvlc_logo_Repeat, // 5,
libvlc_logo_Opacity, // 6,
libvlc_logo_Position // 7
);
(**
* Audio device types
*)
{$IFDEF HAS_ENUM_ORDINALITY}
type
libvlc_audio_output_device_types_t = (
libvlc_AudioOutputDevice_Error = -1,
libvlc_AudioOutputDevice_Mono = 1,
libvlc_AudioOutputDevice_Stereo = 2,
libvlc_AudioOutputDevice_2F2R = 4,
libvlc_AudioOutputDevice_3F2R = 5,
libvlc_AudioOutputDevice_5_1 = 6,
libvlc_AudioOutputDevice_6_1 = 7,
libvlc_AudioOutputDevice_7_1 = 8,
libvlc_AudioOutputDevice_SPDIF = 10);
{$ELSE}
type
libvlc_audio_output_device_types_t = -1..10;
const
libvlc_AudioOutputDevice_Error = -1;
libvlc_AudioOutputDevice_Mono = 1;
libvlc_AudioOutputDevice_Stereo = 2;
libvlc_AudioOutputDevice_2F2R = 4;
libvlc_AudioOutputDevice_3F2R = 5;
libvlc_AudioOutputDevice_5_1 = 6;
libvlc_AudioOutputDevice_6_1 = 7;
libvlc_AudioOutputDevice_7_1 = 8;
libvlc_AudioOutputDevice_SPDIF = 10;
{$ENDIF}
{$IFDEF HAS_ENUM_ORDINALITY}
type
libvlc_audio_output_channel_t = (
libvlc_AudioChannel_Error = -1,
libvlc_AudioChannel_NotAvail = 0,
libvlc_AudioChannel_Stereo = 1,
libvlc_AudioChannel_RStereo = 2,
libvlc_AudioChannel_Left = 3,
libvlc_AudioChannel_Right = 4,
libvlc_AudioChannel_Dolbys = 5
);
{$ELSE}
type
libvlc_audio_output_channel_t = -1..5;
const
libvlc_AudioChannel_Error = -1;
libvlc_AudioChannel_Stereo = 1;
libvlc_AudioChannel_RStereo = 2;
libvlc_AudioChannel_Left = 3;
libvlc_AudioChannel_Right = 4;
libvlc_AudioChannel_Dolbys = 5;
{$ENDIF}
type
libvlc_playback_mode_t = (
libvlc_playback_mode_default,
libvlc_playback_mode_loop,
libvlc_playback_mode_repeat
);
(**
* Navigation mode
*)
type
libvlc_navigate_mode_t = (
libvlc_navigate_activate,
libvlc_navigate_up,
libvlc_navigate_down,
libvlc_navigate_left,
libvlc_navigate_right,
libvlc_navigate_popup // VLC 3.0.0
);
(**
* Enumeration of values used to set position (e.g. of video title).
*)
{$IFDEF HAS_ENUM_ORDINALITY}
type
libvlc_position_t = (
libvlc_position_disable = -1,
libvlc_position_center = 0,
libvlc_position_left = 1,
libvlc_position_right = 2,
libvlc_position_top = 4,
libvlc_position_top_left = 5,
libvlc_position_top_right = 6,
libvlc_position_bottom = 8,
libvlc_position_bottom_left = 9,
libvlc_position_bottom_right = 10
);
{$ELSE}
const
libvlc_position_disable = -1;
libvlc_position_center = 0;
libvlc_position_left = 1;
libvlc_position_right = 2;
libvlc_position_top = 4;
libvlc_position_top_left = 5;
libvlc_position_top_right = 6;
libvlc_position_bottom = 8;
libvlc_position_bottom_left = 9;
libvlc_position_bottom_right = 10;
type
libvlc_position_t = libvlc_position_disable..libvlc_position_bottom_right;
{$ENDIF}
(**
* Enumeration of teletext keys than can be passed via
* libvlc_video_set_teletext()
*)
{$IFDEF HAS_ENUM_ORDINALITY}
type
libvlc_teletext_key_t = (
libvlc_teletext_key_blue = Byte(AnsiChar('b')) shl 16,
libvlc_teletext_key_green = Byte(AnsiChar('g')) shl 16,
libvlc_teletext_key_index = Byte(AnsiChar('i')) shl 16,
libvlc_teletext_key_red = Byte(AnsiChar('r')) shl 16,
libvlc_teletext_key_yellow = Byte(AnsiChar('y')) shl 16
);
{$ELSE}
const
libvlc_teletext_key_red = Byte(AnsiChar('r')) shl 16;
libvlc_teletext_key_green = Byte(AnsiChar('g')) shl 16;
libvlc_teletext_key_yellow = Byte(AnsiChar('y')) shl 16;
libvlc_teletext_key_blue = Byte(AnsiChar('b')) shl 16;
libvlc_teletext_key_index = Byte(AnsiChar('i')) shl 16;
{$ENDIF}
(*
******************************************************************************
* libvlc_event.h
*******************************************************************************
*)
{$IFDEF HAS_ENUM_ORDINALITY}
type
libvlc_event_type_t = (
(* Append new event types at the end of a category.
* Do not remove, insert or re-order any entry.
* Keep this in sync with src/control/event.c:libvlc_event_type_name(). *)
libvlc_MediaMetaChanged = 0,
libvlc_MediaSubItemAdded,
libvlc_MediaDurationChanged,
libvlc_MediaParsedChanged,
libvlc_MediaFreed,
libvlc_MediaStateChanged,
libvlc_MediaSubItemTreeAdded,
libvlc_MediaPlayerMediaChanged = $100,
libvlc_MediaPlayerNothingSpecial,
libvlc_MediaPlayerOpening,
libvlc_MediaPlayerBuffering,
libvlc_MediaPlayerPlaying,
libvlc_MediaPlayerPaused,
libvlc_MediaPlayerStopped,
libvlc_MediaPlayerForward,
libvlc_MediaPlayerBackward,
libvlc_MediaPlayerEndReached,
libvlc_MediaPlayerEncounteredError,
libvlc_MediaPlayerTimeChanged,
libvlc_MediaPlayerPositionChanged,
libvlc_MediaPlayerSeekableChanged,
libvlc_MediaPlayerPausableChanged,
libvlc_MediaPlayerTitleChanged,
libvlc_MediaPlayerSnapshotTaken,
libvlc_MediaPlayerLengthChanged,
libvlc_MediaPlayerVout,
libvlc_MediaPlayerScrambledChanged,
libvlc_MediaPlayerESAdded, // VLC 3.0.0
libvlc_MediaPlayerESDeleted, // VLC 3.0.0
libvlc_MediaPlayerESSelected, // VLC 3.0.0
libvlc_MediaPlayerCorked,
libvlc_MediaPlayerUncorked,
libvlc_MediaPlayerMuted,
libvlc_MediaPlayerUnmuted,
libvlc_MediaPlayerAudioVolume,
libvlc_MediaPlayerAudioDevice, // VLC 3.0.0
libvlc_MediaPlayerChapterChanged, // VLC 3.0.0
libvlc_MediaListItemAdded = $200,
libvlc_MediaListWillAddItem,
libvlc_MediaListItemDeleted,
libvlc_MediaListWillDeleteItem,
libvlc_MediaListEndReached,
libvlc_MediaListViewItemAdded = $300,
libvlc_MediaListViewWillAddItem,
libvlc_MediaListViewItemDeleted,
libvlc_MediaListViewWillDeleteItem,
libvlc_MediaListPlayerPlayed = $400,
libvlc_MediaListPlayerNextItemSet,
libvlc_MediaListPlayerStopped,
// deprecated
// it will be triggered only when calling libvlc_media_discoverer_start()
libvlc_MediaDiscovererStarted = $500,
// deprecated
// it will be triggered only when calling libvlc_media_discoverer_stop()
libvlc_MediaDiscovererEnded,
libvlc_RendererDiscovererItemAdded, // VLC 3.0.0
libvlc_RendererDiscovererItemDeleted, // VLC 3.0.0
libvlc_VlmMediaAdded = $600,
libvlc_VlmMediaRemoved,
libvlc_VlmMediaChanged,
libvlc_VlmMediaInstanceStarted,
libvlc_VlmMediaInstanceStopped,
libvlc_VlmMediaInstanceStatusInit,
libvlc_VlmMediaInstanceStatusOpening,
libvlc_VlmMediaInstanceStatusPlaying,
libvlc_VlmMediaInstanceStatusPause,
libvlc_VlmMediaInstanceStatusEnd,
libvlc_VlmMediaInstanceStatusError
);
{$ELSE}
type
libvlc_event_type_t = type Integer;
const
libvlc_MediaMetaChanged = 0;
libvlc_MediaSubItemAdded = 1;
libvlc_MediaDurationChanged = 2;
libvlc_MediaParsedChanged = 3;
libvlc_MediaFreed = 4;
libvlc_MediaStateChanged = 5;
libvlc_MediaSubItemTreeAdded = 6;
libvlc_MediaPlayerMediaChanged = $100;
libvlc_MediaPlayerNothingSpecial = $101;
libvlc_MediaPlayerOpening = $102;
libvlc_MediaPlayerBuffering = $103;
libvlc_MediaPlayerPlaying = $104;
libvlc_MediaPlayerPaused = $105;
libvlc_MediaPlayerStopped = $106;