4
janvier
2013
libvlc.vapi : utiliser Vlc avec Vala
janvier
2013
Un article de Rachel
1 Commentaire
voici la version finale du fichier vapi de Vlc. Il manque malheureusement des fonctions, dû au fait que Vala n’aime pas trop travailler avec les flux de données ( un buffer de type uint8* par exemple)
[CCode(cheader_filename = "vlc/vlc.h")]
namespace LibVlc
{
//due to many temporary variables created by Vala, this section generates invalid pointers
[CCode(cname = "libvlc_errmsg")]
public static string errmsg();
[CCode(cname = "libvlc_clearerr")]
public static void clearerr();
[CCode(cname = "libvlc_vprinterr")]
public static string vprinterr(string format, va_list args);
[CCode(cname = "libvlc_printerr")]
public static string printerr(string format, ...);
[CCode(cname = "libvlc_get_version")]
public static string get_version();
[CCode(cname = "libvlc_get_compiler")]
public static string get_compiler();
[CCode(cname = "libvlc_get_changeset")]
public static string get_changeset();
//end of section
public delegate void vlc_callback(Event evt, void *ptr);
public delegate void log_callback(void *data, int level, string format, va_list args);
[CCode(cname = "struct libvlc_log_subscriber", cprefix = "libvlc_log_", unref_function = "libvlc_log_unsubscribe")]
public class LogSubscriber{
[CCode (has_construct_function = false)]
public LogSubscriber();
public void subscribe(log_callback cb, void *data);
}
[CCode(cprefix = "libvlc_event_", cname = "struct libvlc_event_manager_t")]
public class EventManager{
public int attach(EventType type, vlc_callback cb, void *data);
public void detach(EventType type, vlc_callback cb, void *data);
[CCode(cname = "libvlc_event_type_name")]
public static string type_name(EventType type);
}
[CCode(cname = "enum libvlc_event_e",cprefix = "libvlc_")]
public enum EventType{
MediaMetaChanged=0,
MediaSubItemAdded,
MediaDurationChanged,
MediaParsedChanged,
MediaFreed,
MediaStateChanged,
MediaPlayerMediaChanged=0x100,
MediaPlayerNothingSpecial,
MediaPlayerOpening,
MediaPlayerBuffering,
MediaPlayerPlaying,
MediaPlayerPaused,
MediaPlayerStopped,
MediaPlayerForward,
MediaPlayerBackward,
MediaPlayerEndReached,
MediaPlayerEncounteredError,
MediaPlayerTimeChanged,
MediaPlayerPositionChanged,
MediaPlayerSeekableChanged,
MediaPlayerPausableChanged,
MediaPlayerTitleChanged,
MediaPlayerSnapshotTaken,
MediaPlayerLengthChanged,
MediaPlayerVout,
MediaListItemAdded=0x200,
MediaListWillAddItem,
MediaListItemDeleted,
MediaListWillDeleteItem,
MediaListViewItemAdded=0x300,
MediaListViewWillAddItem,
MediaListViewItemDeleted,
MediaListViewWillDeleteItem,
MediaListPlayerPlayed=0x400,
MediaListPlayerNextItemSet,
MediaListPlayerStopped,
MediaDiscovererStarted=0x500,
MediaDiscovererEnded,
VlmMediaAdded=0x600,
VlmMediaRemoved,
VlmMediaChanged,
VlmMediaInstanceStarted,
VlmMediaInstanceStopped,
VlmMediaInstanceStatusInit,
VlmMediaInstanceStatusOpening,
VlmMediaInstanceStatusPlaying,
VlmMediaInstanceStatusPause,
VlmMediaInstanceStatusEnd,
VlmMediaInstanceStatusError
}
public struct Event
{
public EventType type;
public void *sender;
public _union union;
}
public struct _union{
public _MediaMetaChanged MediaMetaChanged;
public _MediaSubitemAdded MediaSubitemAdded;
public _MediaDurationChanged MediaDurationChanged;
public _MediaParsedChanged MediaParsedChanged;
public _MediaFreed MediaFreed;
public _MediaStateChanged MediaStateChanged;
public _MediaPlayerBuffering MediaPlayerBuffering;
public _MediaPlayerPositionChanged MediaPlayerPositionChanged;
public _MediaPlayerTimeChanged MediaPlayerTimeChanged;
public _MediaPlayerTitleChanged MediaPlayerTitleChanged;
public _MediaPlayerSeekableChanged MediaPlayerSeekableChanged;
public _MediaPlayerPausableChanged MediaPlayerPausableChanged;
public _MediaPlayerVout MediaPlayerVout;
public _MediaListItemDeleted MediaListItemDeleted;
public _MediaListItemAdded MediaListItemAdded;
public _MediaListAddItem MediaListAddItem;
public _MediaListWillDeleteItem MediaListWillDeleteItem;
public _MediaListPlayerNextItemSet MediaListPlayerNextItemSet;
public _MediaPlayerSnapshotTaken MediaPlayerSnapshotTaken;
public _MediaPlayerLengthChanged MediaPlayerLengthChanged;
public _VlmMediaEvent VlmMediaEvent;
public _MediaPlayerMediaChanged MediaPlayerMediaChanged;
}
public struct _MediaMetaChanged{public TagType type;}
public struct _MediaSubitemAdded{public Media child;}
public struct _MediaDurationChanged{public long duration;}
public struct _MediaParsedChanged{public int status;}
public struct _MediaFreed{public Media media;}
public struct _MediaStateChanged{public State new_state;}
public struct _MediaPlayerBuffering{public float cache;}
public struct _MediaPlayerPositionChanged{public float position;}
public struct _MediaPlayerTimeChanged{public long time;}
public struct _MediaPlayerTitleChanged{public int title;}
public struct _MediaPlayerSeekableChanged{public int seekable;}
public struct _MediaPlayerPausableChanged{public int pausable;}
public struct _MediaPlayerVout{public int count;}
public struct _MediaListItemDeleted{
public Media media;
public int index;
}
public struct _MediaListItemAdded{
public Media item;
public int index;
}
public struct _MediaListAddItem{
public Media item;
public int index;
}
public struct _MediaListWillDeleteItem{
public Media item;
public int index;
}
public struct _MediaListPlayerNextItemSet{
public Media media;}
public struct _MediaPlayerSnapshotTaken{
string filename;
}
public struct _MediaPlayerLengthChanged{
public long length;
}
public struct _VlmMediaEvent{
public string media_name;
public string instance_name;
}
public struct _MediaPlayerMediaChanged{
public Media new_media;
}
[CCode(cname = "enum libvlc_state_t",cprefix = "libvlc_")]
public enum State{
NothingSpecial=0,
Opening,
Buffering,
Playing,
Paused,
Stopped,
Ended,
Error
}
[CCode(cname = "enum libvlc_meta_t", cprefix = "libvlc_meta_")]
public enum TagType{
Title,
Artist,
Genre,
Copyright,
Album,
TrackNumber,
Description,
Rating,
Date,
Setting,
URL,
Language,
NowPlaying,
Publisher,
EncodedBy,
ArtworkURL,
TrackID
}
[CCode(cname = "libvlc_instance_t", ref_function = "libvlc_retain", unref_function = "libvlc_release", cprefix = "libvlc_")]
public class Instance{
public static long clock();
[CCode(cname = "libvlc_new")]
public Instance(int argc, char **argv);
public int add_intf(string name);
public void wait();
public void set_user_agent(string name, string http);
public ModuleDescription audio_filter_list_get();
public ModuleDescription video_filter_list_get();
public AudioOutput audio_output_list_get();
public AudioOutputDevice audio_output_device_list_get(string name);
}
[CCode(cname = "struct libvlc_media_t",ref_function = "libvlc_media_retain", unref_function = "libvlc_media_release", cprefix = "libvlc_media_")]
public class Media{
[CCode(cname = "libvlc_media_new_location")]
public Media.location(Instance i, string location);
[CCode(cname = "libvlc_media_new_path")]
public Media.path(Instance i, string path);
public string get_mrl();
public Media duplicate();
public string get_meta(TagType type);
public void set_meta(TagType type, string value);
public int save_meta();
public int get_stats(out MediaStats stats);
public long get_duration();
public void parse();
public void parse_async();
public int is_parsed();
public EventManager event_manager();
public void set_user_data(void *user_data);
public void *get_user_data();
public void *user_data{get; set;}
public string meta{get; set;}
}
[CCode(cname = "libvlc_media_player_t", ref_function = "libvlc_media_player_retain", unref_function = "libvlc_media_player_release", cprefix = "libvlc_media_player_")]
public class MediaPlayer{
[CCode(cname = "libvlc_media_player_new")]
public MediaPlayer(Instance i);
[CCode(cname = "libvlc_media_player_new_from_media")]
public MediaPlayer.from_media(Media m);
public void set_media(Media m);
public Media get_media();
public int is_playing();
public int play();
public void set_pause(int do_pause);
public void pause();
public void stop();
[CCode(cname = "libvlc_video_set_callbacks")]
public void set_callbacks(VideoLockFunc l, VideoUnlockFunc u, VideoDisplayFunc d, void *opaque);
[CCode(cname = "libvlc_video_set_format")]
public void set_videoformat(string chroma, uint width, uint height, uint pitch);
[CCode(cname = "libvlc_video_set_format_callbacks")]
public void set_format_callbacks(VideoFormatFunc format, VideoCleanupFunc cleanup);
public void set_xwindow(uint drawable);
public uint get_xwindow();
public long get_length();
public long get_time();
public void set_time(long time);
public float get_position();
public void set_position(float pos);
public void set_chapter(int chapter);
public int get_chapter();
public int get_chapter_count();
public int will_play();
public int get_chapter_count_for_title();
public int get_title();
public void set_title(int title);
public int get_title_count();
public void previous_chapter();
public void next_chapter();
public float get_rate();
public void set_rate(float rate);
public State get_state();
public float get_fps();
public uint has_vout();
public int is_seekable();
public int can_pause();
public void next_frame();
[CCode(cname = "libvlc_set_fullscreen")]
public void set_fullscreen(int f);
[CCode(cname = "libvlc_get_fullscreen")]
public int get_fullscreen();
[CCode(cname = "libvlc_video_get_size")]
public int get_video_size(uint index, out uint x, out uint y);
[CCode(cname = "libvlc_video_get_cursor")]
public int get_cursor_position(uint index, out uint px, out uint py);
[CCode(cname = "libvlc_video_get_scale")]
public float get_videoscale();
[CCode(cname = "libvlc_video_set_scale")]
public void set_videoscale(float scale);
public void navigate(NavigateMode mode);
[CCode(cname = "libvlc_video_get_aspect_ratio")]
public string get_aspect_ratio();
[CCode(cname = "libvlc_video_set_aspect_ratio")]
public void set_aspect_ratio(string ratio);
[CCode(cname = "libvlc_video_get_spu")]
public int get_current_subtitle();
[CCode(cname = "libvlc_video_get_spu_count")]
public int get_subtitles_count();
[CCode(cname = "libvlc_video_get_spu_description")]
public TrackDescription get_subtitles_description();
[CCode(cname = "libvlc_video_set_spu")]
public int set_current_subtitle(uint sub);
[CCode(cname = "libvlc_video_set_subtitle_file")]
public int set_subtitles_file(string file);
[CCode(cname = "libvlc_video_get_spu_delay")]
public long get_subtitle_delay();
[CCode(cname = "libvlc_video_set_spu_delay")]
public int set_subtitle_delay(long delay);
[CCode(cname = "libvlc_video_get_title_description")]
public TrackDescription get_title_description();
[CCode(cname = "libvlc_video_get_chapter_description")]
public TrackDescription get_chapter_description();
[CCode(cname = "libvlc_video_get_crop_geometry")]
public string get_crop_geometry();
[CCode(cname = "libvlc_video_set_crop_geometry")]
public void set_crop_geometry(string crop);
[CCode(cname = "libvlc_video_get_track_count")]
public int get_videotrack_count();
[CCode(cname = "libvlc_video_get_track_description")]
public TrackDescription get_track_description();
[CCode(cname = "libvlc_video_get_track")]
public int get_videotrack();
[CCode(cname = "libvlc_video_set_track")]
public int set_videotrack(int track);
[CCode(cname = "libvlc_video_take_snapshot")]
public int snapshot(uint video_index,string filepath,uint width, uint height);
public EventManager event_manager();
public int videotrack {get; set;}
public string crop_geometry {get; set;}
public long subtitle_delay {get; set;}
public string aspect_ratio {get; set;}
public float videoscale {get; set;}
public float rate {get; set;}
public int title {get; set;}
public int chapter {get; set;}
public float position {get; set;}
public long time {get; set;}
public uint xwindow {get; set;}
public Media media {get; set;}
}
[CCode(cname = "struct libvlc_track_description_t",ref_function = "", unref_function = "")]
public class TrackDescription{
public int i_id;
public string psz_name;
public TrackDescription p_next;
[CCode(cname = "libvlc_track_description_list_release")]
public void release();
}
[CCode(cname = "struct libvlc_audio_output_t",ref_function = "", unref_function = "")]
public class AudioOutput
{
public string psz_name;
public string psz_description;
public AudioOutput p_next;
[CCode(cname = "libvlc_audio_output_list_release")]
public void release();
}
public class AudioOutputDevice{
public AudioOutputDevice p_next;
public string psz_device;
public string psz_description;
[CCode(cname = "libvlc_audio_output_device_list_release")]
public void release();
}
[CCode(cname = "struct libvlc_module_description_t", ref_function = "", unref_function = "")]
public class ModuleDescription{
public string psz_name;
public string psz_shortname;
public string psz_longname;
public string psz_help;
public ModuleDescription p_next;
[CCode(cname = "libvlc_module_description_list_release")]
public void release();
}
[CCode(cprefix = "libvlc_media_list_", cname = "struct libvlc_media_list_t", unref_function = "libvlc_media_list_release", ref_function = "libvlc_media_list_retain")]
public class MediaList{
[CCode(cname = "libvlc_media_list_new")]
public MediaList(Instance i);
public void set_media(Media m);
[CCode(cname = "libvlc_media_list_media")]
public Media get_media();
public int add_media(Media m);
public int insert_media(Media m, int position);
public int remove_index(int index);
public int count();
public Media item_at_index(int index);
public int index_of_item(Media m);
public int is_readonly();
public void lock();
public void unlock();
public Media media {get; set;}
public EventManager event_manager();
}
[CCode(cprefix = "libvlc_media_library_", cname = "struct libvlc_media_library_t", ref_function = "libvlc_media_library_retain", unref_function = "libvlc_media_library_release")]
public class MediaLibrary{
[CCode(cname = "libvlc_media_library_new")]
public MediaLibrary(Instance i){}
public int load();
public MediaList list();
}
[CCode(cprefix = "libvlc_media_discoverer_", cname = "struct libvlc_media_discoverer_t", unref_function = "libvlc_media_discoverer_release")]
public class MediaDiscoverer{
[CCode(cname = "libvlc_media_discoverer_new_from_name")]
public MediaDiscoverer(Instance i, string name);
public string localized_name();
public MediaList media_list();
public int is_running();
public EventManager event_manager();
}
[CCode(cprefix = "libvlc_media_list_player_", cname = "struct libvlc_media_list_player_t", unref_function = "libvlc_media_list_player_release", ref_function = "libvlc_media_list_player_retain")]
public class MediaListPlayer{
[CCode(cname = "libvlc_media_list_player_new")]
public MediaListPlayer(Instance i);
public void set_media_player(MediaPlayer player);
public void set_media_list(MediaList list);
public void play();
public void pause();
public int is_playing();
public State get_state();
public int play_item_at_index(int index);
public int play_item(Media media);
public void stop();
public void next();
public void previous();
public void set_playback_mode(PlaybackMode mode);
public EventManager event_manager();
}
[CCode(cname = "int")]
public enum PlaybackMode{
Default,
Loop,
Repeat
}
[CCode(cname = "uint")]
public enum NavigateMode{
Activate,
Up,
Down,
Left,
Right
}
public delegate void VideoLockFunc(void *opaque, void **planes);
public delegate void VideoUnlockFunc(void *opaque, void *picture, void **planes);
public delegate void VideoDisplayFunc(void *opaque, void *picture);
public delegate uint VideoFormatFunc(void **opaque, string chroma,
uint *width, uint *height,
uint *pitches,
uint *lines);
public delegate void VideoCleanupFunc(void *opaque);
public delegate void AudioPlayFunc(void *data, void *samples, uint count, long pts);
public delegate void AudioPauseFunc(void *data, long pts);
public struct MediaStats{
public int i_read_bytes;
public float f_input_bitrate;
public int i_demux_read_bytes;
public float f_demux_bitrate;
public int i_demux_corrupted;
public int i_demux_discontinuity;
public int i_decoded_video;
public int i_decoded_audio;
public int i_displayed_pictures;
public int i_lost_pictures;
public int i_played_abuffers;
public int i_lost_abuffers;
public int i_sent_packets;
public int i_sent_bytes;
public float f_send_bitrate;
}
[CCode(cprefix = "libvlc_vlm_", unref_function = "libvlc_vlm_release")]
public class Vlm
{
public static int add_broadcast(Instance instance, string name, string input, string output,
int number_options, string options, int enabled, int loop);
public static int add_vod(Instance instance, string name, string input,
int number_options, string options,int enabled, string muxer);
public static int del_media(Instance instance, string media_name);
public static int set_enabled(Instance instance, string media_name, int enabled);
public static int set_input(Instance instance, string name, string input);
public static int set_output(Instance instance, string name, string output);
public static int add_input(Instance instance, string name, string input);
public static int set_loop(Instance instance, string name, int loop);
public static int set_mux(Instance instance, string name, string muxer);
public static int change_media(Instance instance, string name, string input, string output,
int number_options, string options, int enabled, int loop);
public static int play_media(Instance instance, string name);
public static int stop_media(Instance instance, string name);
public static int pause_media(Instance instance, string name);
public static int seek_media(Instance instance, string name, float percentage);
public static string show_media(Instance instance, string name);
public static float get_media_instance_position(Instance instance, string name, int instance_id);
public static int get_media_instance_time(Instance instance, string name, int instance_id);
public static int get_media_instance_length(Instance instance, string name, int instance_id);
public static int get_media_instance_rate(Instance instance, string name, int instance_id);
public static int get_media_instance_title(Instance instance, string name, int instance_id);
public static int get_media_instance_chapter(Instance instance, string name, int instance_id);
public static int get_media_instance_seekable(Instance instance, string name, int instance_id);
public static EventManager event_manager(Instance instance);
}
}
namespace LibVlc
{
//due to many temporary variables created by Vala, this section generates invalid pointers
[CCode(cname = "libvlc_errmsg")]
public static string errmsg();
[CCode(cname = "libvlc_clearerr")]
public static void clearerr();
[CCode(cname = "libvlc_vprinterr")]
public static string vprinterr(string format, va_list args);
[CCode(cname = "libvlc_printerr")]
public static string printerr(string format, ...);
[CCode(cname = "libvlc_get_version")]
public static string get_version();
[CCode(cname = "libvlc_get_compiler")]
public static string get_compiler();
[CCode(cname = "libvlc_get_changeset")]
public static string get_changeset();
//end of section
public delegate void vlc_callback(Event evt, void *ptr);
public delegate void log_callback(void *data, int level, string format, va_list args);
[CCode(cname = "struct libvlc_log_subscriber", cprefix = "libvlc_log_", unref_function = "libvlc_log_unsubscribe")]
public class LogSubscriber{
[CCode (has_construct_function = false)]
public LogSubscriber();
public void subscribe(log_callback cb, void *data);
}
[CCode(cprefix = "libvlc_event_", cname = "struct libvlc_event_manager_t")]
public class EventManager{
public int attach(EventType type, vlc_callback cb, void *data);
public void detach(EventType type, vlc_callback cb, void *data);
[CCode(cname = "libvlc_event_type_name")]
public static string type_name(EventType type);
}
[CCode(cname = "enum libvlc_event_e",cprefix = "libvlc_")]
public enum EventType{
MediaMetaChanged=0,
MediaSubItemAdded,
MediaDurationChanged,
MediaParsedChanged,
MediaFreed,
MediaStateChanged,
MediaPlayerMediaChanged=0x100,
MediaPlayerNothingSpecial,
MediaPlayerOpening,
MediaPlayerBuffering,
MediaPlayerPlaying,
MediaPlayerPaused,
MediaPlayerStopped,
MediaPlayerForward,
MediaPlayerBackward,
MediaPlayerEndReached,
MediaPlayerEncounteredError,
MediaPlayerTimeChanged,
MediaPlayerPositionChanged,
MediaPlayerSeekableChanged,
MediaPlayerPausableChanged,
MediaPlayerTitleChanged,
MediaPlayerSnapshotTaken,
MediaPlayerLengthChanged,
MediaPlayerVout,
MediaListItemAdded=0x200,
MediaListWillAddItem,
MediaListItemDeleted,
MediaListWillDeleteItem,
MediaListViewItemAdded=0x300,
MediaListViewWillAddItem,
MediaListViewItemDeleted,
MediaListViewWillDeleteItem,
MediaListPlayerPlayed=0x400,
MediaListPlayerNextItemSet,
MediaListPlayerStopped,
MediaDiscovererStarted=0x500,
MediaDiscovererEnded,
VlmMediaAdded=0x600,
VlmMediaRemoved,
VlmMediaChanged,
VlmMediaInstanceStarted,
VlmMediaInstanceStopped,
VlmMediaInstanceStatusInit,
VlmMediaInstanceStatusOpening,
VlmMediaInstanceStatusPlaying,
VlmMediaInstanceStatusPause,
VlmMediaInstanceStatusEnd,
VlmMediaInstanceStatusError
}
public struct Event
{
public EventType type;
public void *sender;
public _union union;
}
public struct _union{
public _MediaMetaChanged MediaMetaChanged;
public _MediaSubitemAdded MediaSubitemAdded;
public _MediaDurationChanged MediaDurationChanged;
public _MediaParsedChanged MediaParsedChanged;
public _MediaFreed MediaFreed;
public _MediaStateChanged MediaStateChanged;
public _MediaPlayerBuffering MediaPlayerBuffering;
public _MediaPlayerPositionChanged MediaPlayerPositionChanged;
public _MediaPlayerTimeChanged MediaPlayerTimeChanged;
public _MediaPlayerTitleChanged MediaPlayerTitleChanged;
public _MediaPlayerSeekableChanged MediaPlayerSeekableChanged;
public _MediaPlayerPausableChanged MediaPlayerPausableChanged;
public _MediaPlayerVout MediaPlayerVout;
public _MediaListItemDeleted MediaListItemDeleted;
public _MediaListItemAdded MediaListItemAdded;
public _MediaListAddItem MediaListAddItem;
public _MediaListWillDeleteItem MediaListWillDeleteItem;
public _MediaListPlayerNextItemSet MediaListPlayerNextItemSet;
public _MediaPlayerSnapshotTaken MediaPlayerSnapshotTaken;
public _MediaPlayerLengthChanged MediaPlayerLengthChanged;
public _VlmMediaEvent VlmMediaEvent;
public _MediaPlayerMediaChanged MediaPlayerMediaChanged;
}
public struct _MediaMetaChanged{public TagType type;}
public struct _MediaSubitemAdded{public Media child;}
public struct _MediaDurationChanged{public long duration;}
public struct _MediaParsedChanged{public int status;}
public struct _MediaFreed{public Media media;}
public struct _MediaStateChanged{public State new_state;}
public struct _MediaPlayerBuffering{public float cache;}
public struct _MediaPlayerPositionChanged{public float position;}
public struct _MediaPlayerTimeChanged{public long time;}
public struct _MediaPlayerTitleChanged{public int title;}
public struct _MediaPlayerSeekableChanged{public int seekable;}
public struct _MediaPlayerPausableChanged{public int pausable;}
public struct _MediaPlayerVout{public int count;}
public struct _MediaListItemDeleted{
public Media media;
public int index;
}
public struct _MediaListItemAdded{
public Media item;
public int index;
}
public struct _MediaListAddItem{
public Media item;
public int index;
}
public struct _MediaListWillDeleteItem{
public Media item;
public int index;
}
public struct _MediaListPlayerNextItemSet{
public Media media;}
public struct _MediaPlayerSnapshotTaken{
string filename;
}
public struct _MediaPlayerLengthChanged{
public long length;
}
public struct _VlmMediaEvent{
public string media_name;
public string instance_name;
}
public struct _MediaPlayerMediaChanged{
public Media new_media;
}
[CCode(cname = "enum libvlc_state_t",cprefix = "libvlc_")]
public enum State{
NothingSpecial=0,
Opening,
Buffering,
Playing,
Paused,
Stopped,
Ended,
Error
}
[CCode(cname = "enum libvlc_meta_t", cprefix = "libvlc_meta_")]
public enum TagType{
Title,
Artist,
Genre,
Copyright,
Album,
TrackNumber,
Description,
Rating,
Date,
Setting,
URL,
Language,
NowPlaying,
Publisher,
EncodedBy,
ArtworkURL,
TrackID
}
[CCode(cname = "libvlc_instance_t", ref_function = "libvlc_retain", unref_function = "libvlc_release", cprefix = "libvlc_")]
public class Instance{
public static long clock();
[CCode(cname = "libvlc_new")]
public Instance(int argc, char **argv);
public int add_intf(string name);
public void wait();
public void set_user_agent(string name, string http);
public ModuleDescription audio_filter_list_get();
public ModuleDescription video_filter_list_get();
public AudioOutput audio_output_list_get();
public AudioOutputDevice audio_output_device_list_get(string name);
}
[CCode(cname = "struct libvlc_media_t",ref_function = "libvlc_media_retain", unref_function = "libvlc_media_release", cprefix = "libvlc_media_")]
public class Media{
[CCode(cname = "libvlc_media_new_location")]
public Media.location(Instance i, string location);
[CCode(cname = "libvlc_media_new_path")]
public Media.path(Instance i, string path);
public string get_mrl();
public Media duplicate();
public string get_meta(TagType type);
public void set_meta(TagType type, string value);
public int save_meta();
public int get_stats(out MediaStats stats);
public long get_duration();
public void parse();
public void parse_async();
public int is_parsed();
public EventManager event_manager();
public void set_user_data(void *user_data);
public void *get_user_data();
public void *user_data{get; set;}
public string meta{get; set;}
}
[CCode(cname = "libvlc_media_player_t", ref_function = "libvlc_media_player_retain", unref_function = "libvlc_media_player_release", cprefix = "libvlc_media_player_")]
public class MediaPlayer{
[CCode(cname = "libvlc_media_player_new")]
public MediaPlayer(Instance i);
[CCode(cname = "libvlc_media_player_new_from_media")]
public MediaPlayer.from_media(Media m);
public void set_media(Media m);
public Media get_media();
public int is_playing();
public int play();
public void set_pause(int do_pause);
public void pause();
public void stop();
[CCode(cname = "libvlc_video_set_callbacks")]
public void set_callbacks(VideoLockFunc l, VideoUnlockFunc u, VideoDisplayFunc d, void *opaque);
[CCode(cname = "libvlc_video_set_format")]
public void set_videoformat(string chroma, uint width, uint height, uint pitch);
[CCode(cname = "libvlc_video_set_format_callbacks")]
public void set_format_callbacks(VideoFormatFunc format, VideoCleanupFunc cleanup);
public void set_xwindow(uint drawable);
public uint get_xwindow();
public long get_length();
public long get_time();
public void set_time(long time);
public float get_position();
public void set_position(float pos);
public void set_chapter(int chapter);
public int get_chapter();
public int get_chapter_count();
public int will_play();
public int get_chapter_count_for_title();
public int get_title();
public void set_title(int title);
public int get_title_count();
public void previous_chapter();
public void next_chapter();
public float get_rate();
public void set_rate(float rate);
public State get_state();
public float get_fps();
public uint has_vout();
public int is_seekable();
public int can_pause();
public void next_frame();
[CCode(cname = "libvlc_set_fullscreen")]
public void set_fullscreen(int f);
[CCode(cname = "libvlc_get_fullscreen")]
public int get_fullscreen();
[CCode(cname = "libvlc_video_get_size")]
public int get_video_size(uint index, out uint x, out uint y);
[CCode(cname = "libvlc_video_get_cursor")]
public int get_cursor_position(uint index, out uint px, out uint py);
[CCode(cname = "libvlc_video_get_scale")]
public float get_videoscale();
[CCode(cname = "libvlc_video_set_scale")]
public void set_videoscale(float scale);
public void navigate(NavigateMode mode);
[CCode(cname = "libvlc_video_get_aspect_ratio")]
public string get_aspect_ratio();
[CCode(cname = "libvlc_video_set_aspect_ratio")]
public void set_aspect_ratio(string ratio);
[CCode(cname = "libvlc_video_get_spu")]
public int get_current_subtitle();
[CCode(cname = "libvlc_video_get_spu_count")]
public int get_subtitles_count();
[CCode(cname = "libvlc_video_get_spu_description")]
public TrackDescription get_subtitles_description();
[CCode(cname = "libvlc_video_set_spu")]
public int set_current_subtitle(uint sub);
[CCode(cname = "libvlc_video_set_subtitle_file")]
public int set_subtitles_file(string file);
[CCode(cname = "libvlc_video_get_spu_delay")]
public long get_subtitle_delay();
[CCode(cname = "libvlc_video_set_spu_delay")]
public int set_subtitle_delay(long delay);
[CCode(cname = "libvlc_video_get_title_description")]
public TrackDescription get_title_description();
[CCode(cname = "libvlc_video_get_chapter_description")]
public TrackDescription get_chapter_description();
[CCode(cname = "libvlc_video_get_crop_geometry")]
public string get_crop_geometry();
[CCode(cname = "libvlc_video_set_crop_geometry")]
public void set_crop_geometry(string crop);
[CCode(cname = "libvlc_video_get_track_count")]
public int get_videotrack_count();
[CCode(cname = "libvlc_video_get_track_description")]
public TrackDescription get_track_description();
[CCode(cname = "libvlc_video_get_track")]
public int get_videotrack();
[CCode(cname = "libvlc_video_set_track")]
public int set_videotrack(int track);
[CCode(cname = "libvlc_video_take_snapshot")]
public int snapshot(uint video_index,string filepath,uint width, uint height);
public EventManager event_manager();
public int videotrack {get; set;}
public string crop_geometry {get; set;}
public long subtitle_delay {get; set;}
public string aspect_ratio {get; set;}
public float videoscale {get; set;}
public float rate {get; set;}
public int title {get; set;}
public int chapter {get; set;}
public float position {get; set;}
public long time {get; set;}
public uint xwindow {get; set;}
public Media media {get; set;}
}
[CCode(cname = "struct libvlc_track_description_t",ref_function = "", unref_function = "")]
public class TrackDescription{
public int i_id;
public string psz_name;
public TrackDescription p_next;
[CCode(cname = "libvlc_track_description_list_release")]
public void release();
}
[CCode(cname = "struct libvlc_audio_output_t",ref_function = "", unref_function = "")]
public class AudioOutput
{
public string psz_name;
public string psz_description;
public AudioOutput p_next;
[CCode(cname = "libvlc_audio_output_list_release")]
public void release();
}
public class AudioOutputDevice{
public AudioOutputDevice p_next;
public string psz_device;
public string psz_description;
[CCode(cname = "libvlc_audio_output_device_list_release")]
public void release();
}
[CCode(cname = "struct libvlc_module_description_t", ref_function = "", unref_function = "")]
public class ModuleDescription{
public string psz_name;
public string psz_shortname;
public string psz_longname;
public string psz_help;
public ModuleDescription p_next;
[CCode(cname = "libvlc_module_description_list_release")]
public void release();
}
[CCode(cprefix = "libvlc_media_list_", cname = "struct libvlc_media_list_t", unref_function = "libvlc_media_list_release", ref_function = "libvlc_media_list_retain")]
public class MediaList{
[CCode(cname = "libvlc_media_list_new")]
public MediaList(Instance i);
public void set_media(Media m);
[CCode(cname = "libvlc_media_list_media")]
public Media get_media();
public int add_media(Media m);
public int insert_media(Media m, int position);
public int remove_index(int index);
public int count();
public Media item_at_index(int index);
public int index_of_item(Media m);
public int is_readonly();
public void lock();
public void unlock();
public Media media {get; set;}
public EventManager event_manager();
}
[CCode(cprefix = "libvlc_media_library_", cname = "struct libvlc_media_library_t", ref_function = "libvlc_media_library_retain", unref_function = "libvlc_media_library_release")]
public class MediaLibrary{
[CCode(cname = "libvlc_media_library_new")]
public MediaLibrary(Instance i){}
public int load();
public MediaList list();
}
[CCode(cprefix = "libvlc_media_discoverer_", cname = "struct libvlc_media_discoverer_t", unref_function = "libvlc_media_discoverer_release")]
public class MediaDiscoverer{
[CCode(cname = "libvlc_media_discoverer_new_from_name")]
public MediaDiscoverer(Instance i, string name);
public string localized_name();
public MediaList media_list();
public int is_running();
public EventManager event_manager();
}
[CCode(cprefix = "libvlc_media_list_player_", cname = "struct libvlc_media_list_player_t", unref_function = "libvlc_media_list_player_release", ref_function = "libvlc_media_list_player_retain")]
public class MediaListPlayer{
[CCode(cname = "libvlc_media_list_player_new")]
public MediaListPlayer(Instance i);
public void set_media_player(MediaPlayer player);
public void set_media_list(MediaList list);
public void play();
public void pause();
public int is_playing();
public State get_state();
public int play_item_at_index(int index);
public int play_item(Media media);
public void stop();
public void next();
public void previous();
public void set_playback_mode(PlaybackMode mode);
public EventManager event_manager();
}
[CCode(cname = "int")]
public enum PlaybackMode{
Default,
Loop,
Repeat
}
[CCode(cname = "uint")]
public enum NavigateMode{
Activate,
Up,
Down,
Left,
Right
}
public delegate void VideoLockFunc(void *opaque, void **planes);
public delegate void VideoUnlockFunc(void *opaque, void *picture, void **planes);
public delegate void VideoDisplayFunc(void *opaque, void *picture);
public delegate uint VideoFormatFunc(void **opaque, string chroma,
uint *width, uint *height,
uint *pitches,
uint *lines);
public delegate void VideoCleanupFunc(void *opaque);
public delegate void AudioPlayFunc(void *data, void *samples, uint count, long pts);
public delegate void AudioPauseFunc(void *data, long pts);
public struct MediaStats{
public int i_read_bytes;
public float f_input_bitrate;
public int i_demux_read_bytes;
public float f_demux_bitrate;
public int i_demux_corrupted;
public int i_demux_discontinuity;
public int i_decoded_video;
public int i_decoded_audio;
public int i_displayed_pictures;
public int i_lost_pictures;
public int i_played_abuffers;
public int i_lost_abuffers;
public int i_sent_packets;
public int i_sent_bytes;
public float f_send_bitrate;
}
[CCode(cprefix = "libvlc_vlm_", unref_function = "libvlc_vlm_release")]
public class Vlm
{
public static int add_broadcast(Instance instance, string name, string input, string output,
int number_options, string options, int enabled, int loop);
public static int add_vod(Instance instance, string name, string input,
int number_options, string options,int enabled, string muxer);
public static int del_media(Instance instance, string media_name);
public static int set_enabled(Instance instance, string media_name, int enabled);
public static int set_input(Instance instance, string name, string input);
public static int set_output(Instance instance, string name, string output);
public static int add_input(Instance instance, string name, string input);
public static int set_loop(Instance instance, string name, int loop);
public static int set_mux(Instance instance, string name, string muxer);
public static int change_media(Instance instance, string name, string input, string output,
int number_options, string options, int enabled, int loop);
public static int play_media(Instance instance, string name);
public static int stop_media(Instance instance, string name);
public static int pause_media(Instance instance, string name);
public static int seek_media(Instance instance, string name, float percentage);
public static string show_media(Instance instance, string name);
public static float get_media_instance_position(Instance instance, string name, int instance_id);
public static int get_media_instance_time(Instance instance, string name, int instance_id);
public static int get_media_instance_length(Instance instance, string name, int instance_id);
public static int get_media_instance_rate(Instance instance, string name, int instance_id);
public static int get_media_instance_title(Instance instance, string name, int instance_id);
public static int get_media_instance_chapter(Instance instance, string name, int instance_id);
public static int get_media_instance_seekable(Instance instance, string name, int instance_id);
public static EventManager event_manager(Instance instance);
}
}
[…] Vlc n’était pas en cause, car fonctionnant correctement avec vala (voir article précédent ici). j’ai donc cherché à comprendre pourquoi Mono poserait problème, jusqu’a tombé par […]