Skip to content

Commit

Permalink
vlc retrocompat (v3 & v4)
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane committed Dec 15, 2022
1 parent 6eea0ca commit 520a6b9
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 1,518 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/Darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
fetch-depth: 0

- name: Install deps
env:
VLC_PLUGIN_PATH: /Applications/VLC.app/Contents/MacOS/lib
run: |
brew install sdl2 && \
brew install --cask VLC
# source vendor/ci/macport-ci install && \
# sudo port install VLC && port contents VLC && \
# sudo ln -s /Applications/MacPorts/VLC.app/Contents/MacOS/include/vlc /usr/local/include/ && \
# sudo ln -s /Applications/MacPorts/VLC.app/Contents/MacOS/lib/* /usr/local/lib/
brew install --cask VLC && \
sudo ln -s /Applications/VLC.app/Contents/MacOS/include/vlc /usr/local/include/ && \
sudo ln -s /Applications/VLC.app/Contents/MacOS/lib/* /usr/local/lib/
- name: Install zig
uses: goto-bus-stop/setup-zig@v2
Expand Down
5 changes: 4 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ fn make_example(b: *std.build.Builder, mode: std.builtin.Mode, target: std.zig.C
}

if (target.isDarwin()) {
example.linkFramework("Sparkle");
example.linkFramework("Foundation");
example.linkFramework("Cocoa");
example.linkFramework("IOKit");
// example.linkFramework("Sparkle");
example.linkSystemLibrary("vlc");
} else if (target.isWindows()) {
example.linkSystemLibraryName("vlc");
Expand Down
6 changes: 3 additions & 3 deletions examples/cli_player.zig
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ pub fn main() !void {
}

// create a media play playing environment
mp = vlc.media_player_new_from_media(m);
mp = vlc.media_player_new_from_media(inst, m);

// no need to keep the media now
defer vlc.media_release(m);
defer vlc.media_release(inst, m);

// play the media_player
if (vlc.media_player_play(mp) < 0) @panic("Cannot be played!");

vlc.sleep(40);

// stop playing
vlc.media_player_stop(mp);
vlc.media_player_stop(inst, mp);

// free the media_player
defer vlc.media_player_release(mp);
Expand Down
Loading

0 comments on commit 520a6b9

Please sign in to comment.