Skip to content

Commit

Permalink
Initial working DLL loading on windows, modified from vlc-rs
Browse files Browse the repository at this point in the history
  • Loading branch information
fschutt committed Jul 30, 2020
0 parents commit 382be60
Show file tree
Hide file tree
Showing 9 changed files with 1,378 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
/target
Cargo.lock
9 changes: 9 additions & 0 deletions Cargo.toml
@@ -0,0 +1,9 @@
[package]
name = "vlc-static"
version = "0.1.0"
authors = ["fschutt <felix.schuett@maps4print.com>"]
edition = "2018"

[dependencies]
libc = "0.2.74"
libloading-mini = "0.1.1"
Binary file added dll/3.0.11/windows/axvlc.dll
Binary file not shown.
Binary file added dll/3.0.11/windows/libvlc.dll
Binary file not shown.
Binary file added dll/3.0.11/windows/libvlccore.dll
Binary file not shown.
5 changes: 5 additions & 0 deletions examples/test.rs
@@ -0,0 +1,5 @@
extern crate vlc_static;

fn main() {
println!("{}", unsafe { vlc_static::sys::libvlc_delay(0) });
}
155 changes: 155 additions & 0 deletions src/enums.rs
@@ -0,0 +1,155 @@
#[repr(C)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub enum LogLevel {
Debug = 0,
Notice = 2,
Warning = 3,
Error = 4,
}

#[repr(C)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub enum Meta {
Title,
Artist,
Genre,
Copyright,
Album,
TrackNumber,
Description,
Rating,
Date,
Setting,
URL,
Language,
NowPlaying,
Publisher,
EncodedBy,
ArtworkURL,
TrackID,
TrackTotal,
Director,
Season,
Episode,
ShowName,
Actors
}

#[repr(C)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub enum State {
NothingSpecial = 0,
Opening,
Buffering,
Playing,
Paused,
Stopped,
Ended,
Error
}

#[repr(C)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub enum TrackType {
Unknown = -1,
Audio = 0,
Video = 1,
Text = 2
}

#[repr(C)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub enum Position {
Disable = -1,
Center,
Left,
Right,
Top,
TopLeft,
TopRight,
Bottom,
BottomLeft,
BottomRight,
}

#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub enum VideoAdjustOption {
Enable = 0,
Contrast,
Brightness,
Hue,
Saturation,
Gamma
}

// #[repr(C)]
// #[derive(Clone, Copy, PartialEq, Eq, Debug)]
// pub enum ParseFlag {
// ParseLocal,
// ParseNetwork,
// FetchLocal,
// FetchNetwork,
// }

#[repr(C)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub enum EventType {
MediaMetaChanged = 0,
MediaSubItemAdded,
MediaDurationChanged,
MediaParsedChanged,
MediaFreed,
MediaStateChanged,
MediaSubItemTreeAdded,

MediaPlayerMediaChanged = 0x100,
MediaPlayerNothingSpecial,
MediaPlayerOpening,
MediaPlayerBuffering,
MediaPlayerPlaying,
MediaPlayerPaused,
MediaPlayerStopped,
MediaPlayerForward,
MediaPlayerBackward,
MediaPlayerEndReached,
MediaPlayerEncounteredError,
MediaPlayerTimeChanged,
MediaPlayerPositionChanged,
MediaPlayerSeekableChanged,
MediaPlayerPausableChanged,
MediaPlayerTitleChanged,
MediaPlayerSnapshotTaken,
MediaPlayerLengthChanged,
MediaPlayerVout,
MediaPlayerScrambledChanged,

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
}
2 changes: 2 additions & 0 deletions src/lib.rs
@@ -0,0 +1,2 @@
pub mod sys;
pub mod enums;

0 comments on commit 382be60

Please sign in to comment.