-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support of VLC 2.2.x and 3.0.x
- Loading branch information
Showing
10 changed files
with
594 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Pause Click plugin for VLC | ||
This plugin allows you to pause/play a video by clicking on the video image. | ||
|
||
## Supported versions of VLC | ||
Tested to work on VLC 2.1.5, so supposedly should work on 2.1.x. | ||
|
||
## Install | ||
|
||
### Windows | ||
To be added soon. | ||
|
||
### Debian | ||
Get required libraries and tools: | ||
```bash | ||
sudo apt-get install build-essential pkg-config libvlccore-dev | ||
``` | ||
|
||
Build and install: | ||
```bash | ||
make | ||
sudo make install | ||
``` | ||
|
||
## Usage | ||
1. Restart VLC after installing the plugin | ||
2. Go into advanced preferences: Tools -> Preferences -> Show settings -> All | ||
3. Enable/Disable the plugin with a checkbox: (in advanced preferences) Video -> Filters -> Pause/Play video on mouse click | ||
4. Restart VLC | ||
5. Play a video | ||
6. Click on video picture to pause/play the video |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Object files | ||
*.o | ||
*.ko | ||
*.obj | ||
*.elf | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
*.la | ||
*.lo | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
*.i*86 | ||
*.x86_64 | ||
*.hex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
PREFIX = /usr | ||
LD = ld | ||
CC = cc | ||
INSTALL = install | ||
CFLAGS = -g -O2 -Wall -Wextra | ||
LDFLAGS = | ||
VLC_PLUGIN_CFLAGS := $(shell pkg-config --cflags vlc-plugin) | ||
VLC_PLUGIN_LIBS := $(shell pkg-config --libs vlc-plugin) | ||
|
||
libdir = $(PREFIX)/lib | ||
plugindir = $(libdir)/vlc/plugins | ||
|
||
override CC += -std=gnu99 | ||
override CPPFLAGS += -DPIC -I. -Isrc | ||
override CFLAGS += -fPIC | ||
override LDFLAGS += -Wl,-no-undefined,-z,defs | ||
|
||
override CPPFLAGS += -DMODULE_STRING=\"pause_click\" | ||
override CFLAGS += $(VLC_PLUGIN_CFLAGS) | ||
override LDFLAGS += $(VLC_PLUGIN_LIBS) | ||
|
||
TARGETS = libpause_click_plugin.so | ||
|
||
all: libpause_click_plugin.so | ||
|
||
install: all | ||
mkdir -p -- $(DESTDIR)$(plugindir)/video_filter | ||
$(INSTALL) --mode 0755 libpause_click_plugin.so $(DESTDIR)$(plugindir)/video_filter | ||
|
||
install-strip: | ||
$(MAKE) install INSTALL="$(INSTALL) -s" | ||
|
||
uninstall: | ||
rm -f $(plugindir)/video_filter/libpause_click_plugin.so | ||
|
||
clean: | ||
rm -f -- libpause_click_plugin.so pause_click.o | ||
|
||
mostlyclean: clean | ||
|
||
SOURCES = pause_click.c | ||
|
||
$(SOURCES:%.c=%.o): %: pause_click.c | ||
|
||
libpause_click_plugin.so: $(SOURCES:%.c=%.o) | ||
$(CC) $(LDFLAGS) -shared -o $@ $^ | ||
|
||
.PHONY: all install install-strip uninstall clean mostlyclean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Pause Click plugin for VLC | ||
This plugin allows you to pause/play a video by clicking on the video image. | ||
|
||
## Supported versions of VLC | ||
Tested to work on VLC 2.2.0 and 3.0.0, so supposedly should work on 2.2.x and 3.0.x versions. | ||
|
||
## Install | ||
|
||
### Windows | ||
To be added soon. | ||
|
||
### Debian | ||
Get required libraries and tools: | ||
```bash | ||
sudo apt-get install build-essential pkg-config libvlccore-dev | ||
``` | ||
|
||
Build and install: | ||
```bash | ||
make | ||
sudo make install | ||
``` | ||
|
||
Note: because of API change in VLC 2.2.0 this build requires `vlc_interface.h`, which is not present in libvlccore-dev package since it's not considered to be a public header by VLC build system. `vlc_interface.h` that is present here is from the current master branch of VLC (3.0.0). It's highly unlikely, but if the plugin doesn't work, you might need to get `vlc_interface.h` appropriate for your VLC version out of the VLC source tree. | ||
|
||
## Usage | ||
1. Restart VLC after installing the plugin | ||
2. Go into advanced preferences: Tools -> Preferences -> Show settings -> All | ||
3. Enable/Disable the plugin with a checkbox: (in advanced preferences) Video -> Filters -> Pause/Play video on mouse click | ||
4. Enable/Disable the plugin with a checkbox: (in advanced preferences) Interface -> Control Interfaces -> Pause/Play video on mouse click | ||
5. Restart VLC | ||
6. Play a video | ||
7. Click on video picture to pause/play the video |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/***************************************************************************** | ||
* pause_click.c : A filter that allows to pause/play a video by a mouse click | ||
***************************************************************************** | ||
* Copyright (C) 2014 Maxim Biro | ||
* | ||
* Authors: Maxim Biro <nurupo.contributions@gmail.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 2.1 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. | ||
*****************************************************************************/ | ||
|
||
#ifdef HAVE_CONFIG_H | ||
# include "config.h" | ||
#else | ||
# define N_(str) (str) | ||
#endif | ||
|
||
#include <vlc_common.h> | ||
#include <vlc_filter.h> | ||
#include <vlc_interface.h> | ||
#include <vlc_mouse.h> | ||
#include <vlc_playlist.h> | ||
#include <vlc_plugin.h> | ||
|
||
int OpenFilter(vlc_object_t *); | ||
int OpenInterface(vlc_object_t *); | ||
|
||
intf_thread_t *p_intf = NULL; | ||
|
||
vlc_module_begin() | ||
set_description("Pause/Play video on mouse click") | ||
set_shortname("Pause-on-click") | ||
set_capability("video filter2", 0) | ||
set_category(CAT_VIDEO) | ||
set_subcategory(SUBCAT_VIDEO_VFILTER) | ||
set_callbacks(OpenFilter, NULL) | ||
add_submodule() | ||
set_capability("interface", 0) | ||
set_category(CAT_INTERFACE) | ||
set_subcategory(SUBCAT_INTERFACE_CONTROL) | ||
set_callbacks(OpenInterface, NULL) | ||
vlc_module_end() | ||
|
||
int mouse(filter_t *p_filter, vlc_mouse_t *p_mouse_out, const vlc_mouse_t *p_mouse_old, const vlc_mouse_t *p_mouse_new) | ||
{ | ||
if (p_intf != NULL && vlc_mouse_HasPressed(p_mouse_old, p_mouse_new, MOUSE_BUTTON_LEFT)) { | ||
playlist_t* p_playlist = pl_Get(p_intf); | ||
playlist_Control(p_playlist, (playlist_Status(p_playlist) == PLAYLIST_RUNNING ? PLAYLIST_PAUSE : PLAYLIST_PLAY), 0); | ||
} | ||
|
||
// don't propagate any mouse change | ||
return VLC_EGENERIC; | ||
} | ||
|
||
picture_t *filter(filter_t *p_filter, picture_t *p_pic_in) | ||
{ | ||
// don't alter picture | ||
return p_pic_in; | ||
} | ||
|
||
int OpenFilter(vlc_object_t *p_this) | ||
{ | ||
filter_t *p_filter = (filter_t *)p_this; | ||
|
||
p_filter->pf_video_filter = filter; | ||
p_filter->pf_video_mouse = mouse; | ||
|
||
return VLC_SUCCESS; | ||
} | ||
|
||
int OpenInterface(vlc_object_t *p_this) | ||
{ | ||
p_intf = (intf_thread_t*) p_this; | ||
|
||
return VLC_SUCCESS; | ||
} |
Oops, something went wrong.