From 080366288b88911511c18ca5eb3a074bf84be59b Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Duraffort?= Date: Sat, 6 Feb 2010 15:26:24 +0100 Subject: [PATCH] bindings: remove java, phonon and python-ctypes. They moved to a dedicated git. The new repositories are now on git.videolan.org/vlc/bindings/ * java => jvlc.git * phonon => phonon.git * python-ctypes => python.git --- bindings/java/.gitignore | 14 - bindings/java/README | 40 - bindings/java/THANKS | 12 - bindings/java/TODO | 8 - bindings/java/core/pom.xml | 77 -- .../main/java/org/videolan/jvlc/Audio.java | 128 --- .../src/main/java/org/videolan/jvlc/JVLC.java | 179 ---- .../main/java/org/videolan/jvlc/Logger.java | 76 -- .../org/videolan/jvlc/LoggerIterator.java | 92 -- .../java/org/videolan/jvlc/LoggerMessage.java | 103 -- .../videolan/jvlc/LoggerVerbosityLevel.java | 37 - .../org/videolan/jvlc/MediaDescriptor.java | 128 --- .../java/org/videolan/jvlc/MediaList.java | 221 ----- .../org/videolan/jvlc/MediaListPlayer.java | 195 ---- .../java/org/videolan/jvlc/MediaPlayer.java | 234 ----- .../java/org/videolan/jvlc/VLCException.java | 61 -- .../src/main/java/org/videolan/jvlc/VLM.java | 189 ---- .../main/java/org/videolan/jvlc/Video.java | 120 --- .../jvlc/event/MediaPlayerCallback.java | 98 -- .../jvlc/event/MediaPlayerListener.java | 48 - .../org/videolan/jvlc/example/VLCExample.java | 121 --- .../org/videolan/jvlc/internal/LibVlc.java | 805 --------------- .../jvlc/internal/LibVlcEventType.java | 85 -- .../videolan/jvlc/internal/LibVlcImpl.java | 133 --- .../videolan/jvlc/internal/LibVlcState.java | 39 - .../videolan/jvlc/internal/MediaOption.java | 35 - .../java/org/videolan/jvlc/internal/Meta.java | 50 - .../videolan/jvlc/internal/PlaybackMode.java | 36 - .../jvlc/internal/VideoMarqueeIntOption.java | 42 - .../internal/VideoMarqueeStringOption.java | 34 - .../java/core/src/main/resources/.gitignore | 0 .../org/videolan/jvlc/AbstractJVLCTest.java | 113 --- .../test/java/org/videolan/jvlc/JVLCTest.java | 92 -- .../java/org/videolan/jvlc/LoggerTest.java | 69 -- .../videolan/jvlc/MediaDescriptorTest.java | 52 - .../java/org/videolan/jvlc/MediaListTest.java | 130 --- .../test/java/org/videolan/jvlc/VLMTest.java | 213 ---- .../jvlc/internal/AbstractVLCEventTest.java | 41 - .../internal/AbstractVLCInternalTest.java | 143 --- .../jvlc/internal/LibVlcCoreTest.java | 66 -- .../videolan/jvlc/internal/LibVlcLogTest.java | 75 -- .../jvlc/internal/LibVlcMediaEventsTest.java | 61 -- .../internal/LibVlcMediaListEventsTest.java | 100 -- .../internal/LibVlcMediaListPlayerTest.java | 332 ------- .../jvlc/internal/LibVlcMediaListTest.java | 145 --- .../internal/LibVlcMediaPlayerEventsTest.java | 132 --- .../jvlc/internal/LibVlcMediaPlayerTest.java | 125 --- .../jvlc/internal/LibVlcMediaTest.java | 98 -- .../java/core/src/test/resources/log4j.xml | 18 - .../core/src/test/resources/raffa_voice.ogg | Bin 34420 -> 0 bytes bindings/java/core/src/test/resources/sample | 0 bindings/java/extras/convert.py | 87 -- bindings/java/pom.xml | 154 --- bindings/java/samples/client/pom.xml | 51 - .../src/main/java/MultipleVideosSample.java | 91 -- .../client/src/main/java/VlcClient.java | 224 ----- bindings/java/samples/pom.xml | 19 - bindings/phonon/.gitignore | 3 - bindings/phonon/CMakeLists.txt | 263 ----- .../phonon/cmake/modules/FindAutomoc4.cmake | 81 -- .../FindPackageHandleStandardArgs.cmake | 60 -- .../phonon/cmake/modules/FindPhonon.cmake | 77 -- bindings/phonon/cmake/modules/FindVLC.cmake | 55 -- .../cmake/modules/MacroEnsureVersion.cmake | 117 --- .../cmake/modules/MacroLogFeature.cmake | 125 --- .../modules/MacroOptionalFindPackage.cmake | 28 - .../phonon/cmake/modules/PhononMacros.cmake | 206 ---- bindings/phonon/vlc/.gitignore | 4 - bindings/phonon/vlc/AUTHORS | 3 - bindings/phonon/vlc/CMakeLists.txt | 40 - bindings/phonon/vlc/audiooutput.cpp | 117 --- bindings/phonon/vlc/audiooutput.h | 69 -- bindings/phonon/vlc/backend.cpp | 407 -------- bindings/phonon/vlc/backend.h | 90 -- bindings/phonon/vlc/devicemanager.cpp | 173 ---- bindings/phonon/vlc/devicemanager.h | 74 -- bindings/phonon/vlc/effect.cpp | 223 ----- bindings/phonon/vlc/effect.h | 67 -- bindings/phonon/vlc/effectmanager.cpp | 230 ----- bindings/phonon/vlc/effectmanager.h | 101 -- bindings/phonon/vlc/mediacontroller.cpp | 223 ----- bindings/phonon/vlc/mediacontroller.h | 139 --- bindings/phonon/vlc/mediaobject.cpp | 293 ------ bindings/phonon/vlc/mediaobject.h | 127 --- bindings/phonon/vlc/seekstack.cpp | 86 -- bindings/phonon/vlc/seekstack.h | 70 -- bindings/phonon/vlc/sinknode.cpp | 56 -- bindings/phonon/vlc/sinknode.h | 59 -- bindings/phonon/vlc/videowidget.cpp | 239 ----- bindings/phonon/vlc/videowidget.h | 91 -- bindings/phonon/vlc/vlc.desktop | 30 - bindings/phonon/vlc/vlcloader.cpp | 205 ---- bindings/phonon/vlc/vlcloader.h | 84 -- bindings/phonon/vlc/vlcmediacontroller.cpp | 295 ------ bindings/phonon/vlc/vlcmediacontroller.h | 95 -- bindings/phonon/vlc/vlcmediaobject.cpp | 423 -------- bindings/phonon/vlc/vlcmediaobject.h | 156 --- bindings/phonon/vlc/vlcvideowidget.cpp | 66 -- bindings/phonon/vlc/vlcvideowidget.h | 65 -- bindings/phonon/vlc/widgetnopaintevent.cpp | 63 -- bindings/phonon/vlc/widgetnopaintevent.h | 58 -- bindings/python-ctypes/LibVlc-footer.java | 1 - bindings/python-ctypes/LibVlc-header.java | 255 ----- bindings/python-ctypes/Makefile | 19 - bindings/python-ctypes/README | 60 -- bindings/python-ctypes/TODO | 4 - bindings/python-ctypes/boilerplate.java | 26 - bindings/python-ctypes/footer.py | 143 --- bindings/python-ctypes/generate.py | 935 ------------------ bindings/python-ctypes/header.py | 309 ------ bindings/python-ctypes/override.py | 261 ----- bindings/python-ctypes/setup.py | 32 - bindings/python-ctypes/test.py | 160 --- bindings/python-ctypes/vlcwidget.py | 154 --- 114 files changed, 13966 deletions(-) delete mode 100644 bindings/java/.gitignore delete mode 100644 bindings/java/README delete mode 100644 bindings/java/THANKS delete mode 100644 bindings/java/TODO delete mode 100644 bindings/java/core/pom.xml delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/Audio.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/Logger.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/LoggerIterator.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/LoggerMessage.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/LoggerVerbosityLevel.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/MediaDescriptor.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/MediaList.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/VLCException.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/VLM.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/Video.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaPlayerCallback.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaPlayerListener.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/example/VLCExample.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcState.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/internal/MediaOption.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/internal/Meta.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/internal/PlaybackMode.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/internal/VideoMarqueeIntOption.java delete mode 100644 bindings/java/core/src/main/java/org/videolan/jvlc/internal/VideoMarqueeStringOption.java delete mode 100644 bindings/java/core/src/main/resources/.gitignore delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/AbstractJVLCTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/JVLCTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/LoggerTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/MediaDescriptorTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/MediaListTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/VLMTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/internal/AbstractVLCEventTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/internal/AbstractVLCInternalTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcLogTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaEventsTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListEventsTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListPlayerTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerEventsTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java delete mode 100644 bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaTest.java delete mode 100644 bindings/java/core/src/test/resources/log4j.xml delete mode 100644 bindings/java/core/src/test/resources/raffa_voice.ogg delete mode 100644 bindings/java/core/src/test/resources/sample delete mode 100755 bindings/java/extras/convert.py delete mode 100644 bindings/java/pom.xml delete mode 100644 bindings/java/samples/client/pom.xml delete mode 100644 bindings/java/samples/client/src/main/java/MultipleVideosSample.java delete mode 100644 bindings/java/samples/client/src/main/java/VlcClient.java delete mode 100644 bindings/java/samples/pom.xml delete mode 100644 bindings/phonon/.gitignore delete mode 100644 bindings/phonon/CMakeLists.txt delete mode 100644 bindings/phonon/cmake/modules/FindAutomoc4.cmake delete mode 100644 bindings/phonon/cmake/modules/FindPackageHandleStandardArgs.cmake delete mode 100644 bindings/phonon/cmake/modules/FindPhonon.cmake delete mode 100644 bindings/phonon/cmake/modules/FindVLC.cmake delete mode 100644 bindings/phonon/cmake/modules/MacroEnsureVersion.cmake delete mode 100644 bindings/phonon/cmake/modules/MacroLogFeature.cmake delete mode 100644 bindings/phonon/cmake/modules/MacroOptionalFindPackage.cmake delete mode 100644 bindings/phonon/cmake/modules/PhononMacros.cmake delete mode 100644 bindings/phonon/vlc/.gitignore delete mode 100644 bindings/phonon/vlc/AUTHORS delete mode 100644 bindings/phonon/vlc/CMakeLists.txt delete mode 100644 bindings/phonon/vlc/audiooutput.cpp delete mode 100644 bindings/phonon/vlc/audiooutput.h delete mode 100644 bindings/phonon/vlc/backend.cpp delete mode 100644 bindings/phonon/vlc/backend.h delete mode 100644 bindings/phonon/vlc/devicemanager.cpp delete mode 100644 bindings/phonon/vlc/devicemanager.h delete mode 100644 bindings/phonon/vlc/effect.cpp delete mode 100644 bindings/phonon/vlc/effect.h delete mode 100644 bindings/phonon/vlc/effectmanager.cpp delete mode 100644 bindings/phonon/vlc/effectmanager.h delete mode 100644 bindings/phonon/vlc/mediacontroller.cpp delete mode 100644 bindings/phonon/vlc/mediacontroller.h delete mode 100644 bindings/phonon/vlc/mediaobject.cpp delete mode 100644 bindings/phonon/vlc/mediaobject.h delete mode 100644 bindings/phonon/vlc/seekstack.cpp delete mode 100644 bindings/phonon/vlc/seekstack.h delete mode 100644 bindings/phonon/vlc/sinknode.cpp delete mode 100644 bindings/phonon/vlc/sinknode.h delete mode 100644 bindings/phonon/vlc/videowidget.cpp delete mode 100644 bindings/phonon/vlc/videowidget.h delete mode 100644 bindings/phonon/vlc/vlc.desktop delete mode 100644 bindings/phonon/vlc/vlcloader.cpp delete mode 100644 bindings/phonon/vlc/vlcloader.h delete mode 100644 bindings/phonon/vlc/vlcmediacontroller.cpp delete mode 100644 bindings/phonon/vlc/vlcmediacontroller.h delete mode 100644 bindings/phonon/vlc/vlcmediaobject.cpp delete mode 100644 bindings/phonon/vlc/vlcmediaobject.h delete mode 100644 bindings/phonon/vlc/vlcvideowidget.cpp delete mode 100644 bindings/phonon/vlc/vlcvideowidget.h delete mode 100644 bindings/phonon/vlc/widgetnopaintevent.cpp delete mode 100644 bindings/phonon/vlc/widgetnopaintevent.h delete mode 100644 bindings/python-ctypes/LibVlc-footer.java delete mode 100644 bindings/python-ctypes/LibVlc-header.java delete mode 100644 bindings/python-ctypes/Makefile delete mode 100644 bindings/python-ctypes/README delete mode 100644 bindings/python-ctypes/TODO delete mode 100644 bindings/python-ctypes/boilerplate.java delete mode 100644 bindings/python-ctypes/footer.py delete mode 100755 bindings/python-ctypes/generate.py delete mode 100755 bindings/python-ctypes/header.py delete mode 100644 bindings/python-ctypes/override.py delete mode 100644 bindings/python-ctypes/setup.py delete mode 100755 bindings/python-ctypes/test.py delete mode 100755 bindings/python-ctypes/vlcwidget.py diff --git a/bindings/java/.gitignore b/bindings/java/.gitignore deleted file mode 100644 index 97e33547cf..0000000000 --- a/bindings/java/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -.classpath -.project -.settings/* -core/.classpath -core/.project -core/.settings/* -core/target/* -samples/client/.classpath -samples/client/.project -samples/client/.settings/* -samples/client/target/* -samples/target/* -target/* - diff --git a/bindings/java/README b/bindings/java/README deleted file mode 100644 index 231d8d23d4..0000000000 --- a/bindings/java/README +++ /dev/null @@ -1,40 +0,0 @@ - - First of all, this is a *developers* only version - - -How to compile JVLC -------------------- - - JVLC uses maven2 as a project the management tool, take a look at - -http://maven.apache.org - - to download and for general instructions on how to use it. - - To compile the project, run from the bindings/java folder: - -mvn install - - To import the jvlc project into the eclipse IDE: - -mvn eclipse:eclipse - - and then import as an existing Java project. - - -How to run the sample client ----------------------------- - - 1. mvn install (in bindings/java) - - 2. mvn package exec:java (in bindings/java/samples/client) - - -How to create the jvlc site ---------------------------- - - 1. mvn site - - - - Happy playing. diff --git a/bindings/java/THANKS b/bindings/java/THANKS deleted file mode 100644 index 8bf52ae871..0000000000 --- a/bindings/java/THANKS +++ /dev/null @@ -1,12 +0,0 @@ -Thanks to: - -* Adrien Grand - for splitting the maven project into modules - -* Kuldipsingh Pabla - for solaris port and various contributions to the native interface. - for the GenericVideoWidget class - -* Tvrtko Bedekovic - for initial win32 port - diff --git a/bindings/java/TODO b/bindings/java/TODO deleted file mode 100644 index 6afc061e0a..0000000000 --- a/bindings/java/TODO +++ /dev/null @@ -1,8 +0,0 @@ -[general] -* JUnit testing - -[build system] -* Detect SWT to add the SWTVideoWidget - - -Items are ordered by priority, the first having the highest priority diff --git a/bindings/java/core/pom.xml b/bindings/java/core/pom.xml deleted file mode 100644 index dd5e2998f9..0000000000 --- a/bindings/java/core/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - 4.0.0 - - org.videolan - jvlc-parent - 1.0.2-SNAPSHOT - - jvlc-core - jar - JVLC - Core - Java Bindings for VideoLAN - Core - - - GPLv2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - - - - - - maven-assembly-plugin - - - jar-with-dependencies - - - - - - - - net.java.dev.jna - jna - 3.0.9 - - - junit - junit - 4.4 - test - - - org.slf4j - slf4j-log4j12 - 1.5.2 - - - commons-io - commons-io - 1.3.2 - test - - - - Hudson - http://hudson.videolan.org/ - - - - jvlc - JVLC Maven Repository - http://jvlc.ihack.it/maven2 - - false - - - - central - Maven Repository - http://repo1.maven.org/maven2 - - false - - - - diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/Audio.java b/bindings/java/core/src/main/java/org/videolan/jvlc/Audio.java deleted file mode 100644 index b9e52461aa..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/Audio.java +++ /dev/null @@ -1,128 +0,0 @@ -/***************************************************************************** - * Audio.java: VLC Java Bindings, audio methods - ***************************************************************************** - * - * Copyright (C) 1998-2008 the VideoLAN team - * - * Author: Filippo Carone - * - * - * $Id: $ - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 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 - * General Public License for more details. - * - * You should have received a copy of the GNU 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. - * - */ - -package org.videolan.jvlc; - -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - - -public class Audio -{ - - private final JVLC jvlc; - - /** - * Constant for left channel audio - */ - public static final int LEFT_CHANNEL = 3; - - /** - * Constant for right channel audio - */ - public static final int RIGHT_CHANNEL = 4; - - /** - * Constant for reverse channel audio - */ - public static final int REVERSE_CHANNEL = 2; - - /** - * Constant for stereo channel audio - */ - public static final int STEREO_CHANNEL = 1; - - /** - * Constant for dolby channel audio - */ - public final int DOLBY_CHANNEL = 5; - - - public Audio(JVLC jvlc) - { - this.jvlc = jvlc; - } - - public int getTrack(MediaPlayer mediaInstance) - { - libvlc_exception_t exception = new libvlc_exception_t(); - return jvlc.getLibvlc().libvlc_audio_get_track(mediaInstance.getInstance(), exception); - } - - public int getTrackCount(MediaPlayer mediaInstance) - { - libvlc_exception_t exception = new libvlc_exception_t(); - return jvlc.getLibvlc().libvlc_audio_get_track_count(mediaInstance.getInstance(), exception); - } - - public void setTrack(MediaPlayer mediaInstance, int track) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_audio_set_track(mediaInstance.getInstance(), track, exception); - } - - public int getChannel() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return jvlc.getLibvlc().libvlc_audio_get_channel(jvlc.getInstance(), exception); - } - - public void setChannel(int channel) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_audio_set_channel(jvlc.getInstance(), channel, exception); - } - - public boolean getMute() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return jvlc.getLibvlc().libvlc_audio_get_mute(jvlc.getInstance(), exception) == 1 ? true : false; - } - - public void setMute(boolean value) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_audio_set_mute(jvlc.getInstance(), value ? 1 : 0, exception); - } - - public void toggleMute() - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_audio_toggle_mute(jvlc.getInstance(), exception); - } - - public int getVolume() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return jvlc.getLibvlc().libvlc_audio_get_volume(jvlc.getInstance(), exception); - } - - public void setVolume(int volume) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_audio_set_volume(jvlc.getInstance(), volume, exception); - } -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java b/bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java deleted file mode 100644 index 8f0c846cf8..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java +++ /dev/null @@ -1,179 +0,0 @@ -/***************************************************************************** - * JVLC.java: Main Java Class, represents a libvlc_instance_t object - ***************************************************************************** - * - * Copyright (C) 1998-2008 the VideoLAN team - * - * Author: Filippo Carone - * Philippe Morin - * - * Created on 28-feb-2006 - * - * $Id: JVLC.java 20141 2007-05-16 19:31:35Z littlejohn $ - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 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 - * General Public License for more details. - * - * You should have received a copy of the GNU 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. - * - */ - -package org.videolan.jvlc; - -import java.awt.Canvas; - -import org.videolan.jvlc.internal.LibVlc; -import org.videolan.jvlc.internal.LibVlc.LibVlcInstance; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - -public class JVLC -{ - - private final LibVlcInstance instance; - - private final LibVlc libvlc = LibVlc.SYNC_INSTANCE; - - private VLM vlm; - - private Audio audio; - - private volatile boolean released; - - private Canvas canvas; - - public JVLC() - { - this(new String[] {}); - } - - public JVLC(String[] args) - { - instance = createInstance(args); - audio = new Audio(this); - } - - public JVLC(String args) - { - this(args.split(" ")); - } - - /* - * Core methods - */ - private LibVlcInstance createInstance(String[] args) - { - libvlc_exception_t exception = new libvlc_exception_t(); - return libvlc.libvlc_new(args.length, args, exception); - } - - public MediaPlayer play(String media) - { - MediaDescriptor mediaDescriptor = new MediaDescriptor(this, media); - MediaPlayer mediaPlayer = new MediaPlayer(mediaDescriptor); - if (canvas != null) - { - mediaPlayer.setParent(canvas); - } - mediaPlayer.play(); - mediaDescriptor.release(); - return mediaPlayer; - } - - public void setVideoOutput(Canvas canvas) - { - this.canvas = canvas; - } - - public Logger getLogger() - { - return new Logger(this); - } - - public VLM getVLM() - { - if (vlm != null) - { - vlm.release(); - } - this.vlm = new VLM(this); - return vlm; - } - - public LoggerVerbosityLevel getLogVerbosity() - { - int level = libvlc.libvlc_get_log_verbosity(instance); - return LoggerVerbosityLevel.getSeverity(level); - } - - public void setLogVerbosity(LoggerVerbosityLevel level) - { - libvlc.libvlc_set_log_verbosity(instance, level.ordinal()); - } - - - /** - * Returns the _instance. - * @return the _instance - */ - LibVlcInstance getInstance() - { - return instance; - } - - /** - * Returns the libvlc. - * @return the libvlc - */ - LibVlc getLibvlc() - { - return libvlc; - } - - /** - * Releases this instance and the native resources. - */ - public void release() - { - if (released) - { - return; - } - released = true; - if (vlm != null) - { - vlm.release(); - vlm = null; - } - - libvlc.libvlc_release(instance); - } - - /* - * (non-Javadoc) - * @see java.lang.Object#finalize() - */ - @Override - protected void finalize() throws Throwable - { - release(); - super.finalize(); - } - - /** - * @return - */ - public Audio getAudio() - { - return audio; - } - -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/Logger.java b/bindings/java/core/src/main/java/org/videolan/jvlc/Logger.java deleted file mode 100644 index f2bdbd65a5..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/Logger.java +++ /dev/null @@ -1,76 +0,0 @@ -/***************************************************************************** - * Logger.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import java.util.Iterator; - -import org.videolan.jvlc.internal.LibVlc; -import org.videolan.jvlc.internal.LibVlc.LibVlcLog; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - - -public class Logger -{ - LibVlcLog logInstance; - LibVlc libvlc; - - - /** - * @param jvlc The current jvlc instance - */ - public Logger(JVLC jvlc) - { - this.libvlc = jvlc.getLibvlc(); - libvlc_exception_t exception = new libvlc_exception_t(); - this.logInstance = jvlc.getLibvlc().libvlc_log_open(jvlc.getInstance(), exception); - if (exception.b_raised == 1) - { - throw new RuntimeException("Native exception thrown"); - } - } - - public void clear() - { - libvlc.libvlc_log_clear(logInstance); - } - - public void close() - { - libvlc.libvlc_log_close(logInstance); - } - - public int count() - { - return libvlc.libvlc_log_count(logInstance); - } - - public Iterator iterator() - { - return new LoggerIterator(this); - } - - -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/LoggerIterator.java b/bindings/java/core/src/main/java/org/videolan/jvlc/LoggerIterator.java deleted file mode 100644 index 0ed780d3e9..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/LoggerIterator.java +++ /dev/null @@ -1,92 +0,0 @@ -/***************************************************************************** - * LoggerIterator.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import java.util.Iterator; - -import org.videolan.jvlc.internal.LibVlc.LibVlcLogIterator; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; -import org.videolan.jvlc.internal.LibVlc.libvlc_log_message_t; - - -public class LoggerIterator implements Iterator -{ - - private Logger logger; - private LibVlcLogIterator logIterator; - - /** - * @param logInstance - */ - LoggerIterator(Logger logger) - { - this.logger = logger; - libvlc_exception_t exception = new libvlc_exception_t(); - this.logIterator = logger.libvlc.libvlc_log_get_iterator(logger.logInstance, exception); - } - - /** - * {@inheritDoc} - */ - public boolean hasNext() - { - return logger.libvlc.libvlc_log_iterator_has_next(logIterator) != 0; - } - - /** - * {@inheritDoc} - */ - public LoggerMessage next() - { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc_log_message_t message = new libvlc_log_message_t(); - logger.libvlc.libvlc_log_iterator_next(logIterator, message, exception); - LoggerMessage result = new LoggerMessage(message); - return result; - } - - /** - * {@inheritDoc} - * Does not remove the element. - */ - public void remove() - { - // - } - - /** - * {@inheritDoc} - */ - @Override - protected void finalize() throws Throwable - { - logger.libvlc.libvlc_log_iterator_free(logIterator); - super.finalize(); - } - - - -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/LoggerMessage.java b/bindings/java/core/src/main/java/org/videolan/jvlc/LoggerMessage.java deleted file mode 100644 index e55c69dc3e..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/LoggerMessage.java +++ /dev/null @@ -1,103 +0,0 @@ -/***************************************************************************** - * LoggerMessage.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import org.videolan.jvlc.internal.LibVlc.libvlc_log_message_t; - - -public class LoggerMessage -{ - - private LoggerVerbosityLevel severity; - private String header; - private String message; - private String name; - private String type; - - /** - * @param message - */ - LoggerMessage(libvlc_log_message_t message) - { - this.severity = LoggerVerbosityLevel.getSeverity(message.i_severity); - this.header = message.psz_header; - this.message = message.psz_message; - this.name = message.psz_name; - this.type = message.psz_type; - } - - - /** - * Returns the header. - * @return the header - */ - public String getHeader() - { - return header; - } - - - /** - * Returns the message. - * @return the message - */ - public String getMessage() - { - return message; - } - - - /** - * Returns the name. - * @return the name - */ - public String getName() - { - return name; - } - - - /** - * Returns the type. - * @return the type - */ - public String getType() - { - return type; - } - - - - /** - * Returns the severity. - * @return the severity - */ - public LoggerVerbosityLevel getSeverity() - { - return severity; - } - -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/LoggerVerbosityLevel.java b/bindings/java/core/src/main/java/org/videolan/jvlc/LoggerVerbosityLevel.java deleted file mode 100644 index 2fa9f0bf08..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/LoggerVerbosityLevel.java +++ /dev/null @@ -1,37 +0,0 @@ -/***************************************************************************** - * LoggerSeverityEnum.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -public enum LoggerVerbosityLevel { - - INFO, ERROR, WARNING, DEBUG; - - public static LoggerVerbosityLevel getSeverity(int ordinal) - { - return new LoggerVerbosityLevel[]{INFO, ERROR, WARNING, DEBUG }[ordinal]; - } - -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaDescriptor.java b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaDescriptor.java deleted file mode 100644 index e4d99ccada..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaDescriptor.java +++ /dev/null @@ -1,128 +0,0 @@ -/***************************************************************************** - * MediaDescriptor.java: VLC Java Bindings Media Descriptor - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import org.videolan.jvlc.internal.LibVlc; -import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager; -import org.videolan.jvlc.internal.LibVlc.LibVlcMedia; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - - -public class MediaDescriptor -{ - private LibVlcMedia instance; - private LibVlc libvlc; - private LibVlcEventManager eventManager; - private volatile boolean released; - - private MediaPlayer mediaPlayer; - - /** - * @param jvlc The jvlc instance to create the media descriptor for. - * @param media The media string - */ - public MediaDescriptor(JVLC jvlc, String media) - { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc = jvlc.getLibvlc(); - instance = libvlc.libvlc_media_new(jvlc.getInstance(), media, exception); - eventManager = libvlc.libvlc_media_event_manager(instance, exception); - } - - MediaDescriptor(JVLC jvlc, LibVlcMedia instance) - { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc = jvlc.getLibvlc(); - this.instance = instance; - eventManager = libvlc.libvlc_media_event_manager(instance, exception); - } - - public void addOption(String option) - { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc.libvlc_media_add_option(instance, option, exception ); - } - - public String getMrl() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return libvlc.libvlc_media_get_mrl(instance, exception); - } - - public MediaPlayer getMediaPlayer() - { - if (mediaPlayer == null) - { - this.mediaPlayer = new MediaPlayer(this); - } - return this.mediaPlayer; - } - - /** - * {@inheritDoc} - */ - @Override - protected void finalize() throws Throwable - { - release(); - super.finalize(); - } - - - - /** - * Returns the instance. - * @return the instance - */ - LibVlcMedia getInstance() - { - return instance; - } - - /** - * Returns the libvlc. - * @return the libvlc - */ - LibVlc getLibvlc() - { - return libvlc; - } - - /** - * - */ - public void release() - { - if (released) - { - return; - } - released = true; - libvlc.libvlc_media_release(instance); - } - - -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaList.java b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaList.java deleted file mode 100644 index e950deb61f..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaList.java +++ /dev/null @@ -1,221 +0,0 @@ -/***************************************************************************** - * MediaList.java: VLC Java Bindings, MediaList - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import java.util.ArrayList; -import java.util.List; - -import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager; -import org.videolan.jvlc.internal.LibVlc.LibVlcMedia; -import org.videolan.jvlc.internal.LibVlc.LibVlcMediaList; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - - -public class MediaList -{ - - private final JVLC jvlc; - - private final LibVlcMediaList instance; - - private List items = new ArrayList(); - - private LibVlcEventManager eventManager; - - private volatile boolean released; - - public MediaList(JVLC jvlc) - { - this.jvlc = jvlc; - libvlc_exception_t exception = new libvlc_exception_t(); - instance = jvlc.getLibvlc().libvlc_media_list_new(jvlc.getInstance(), exception); - eventManager = jvlc.getLibvlc().libvlc_media_list_event_manager(instance, exception); - } - - /** - * @param mrl The media resource locator to add to the media list. - */ - public void addMedia(String mrl) - { - MediaDescriptor descriptor = new MediaDescriptor(jvlc, mrl); - addMedia(descriptor); - } - - /** - * @param descriptor The media descriptor to add to the media list. - */ - public void addMedia(MediaDescriptor descriptor) - { - if (items.contains(descriptor.getMrl())) - { - return; - } - items.add(descriptor.getMrl()); - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_media_list_add_media(instance, descriptor.getInstance(), exception); - } - - /** - * @return The current number of items in the media list. - */ - public int size() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return jvlc.getLibvlc().libvlc_media_list_count(instance, exception); - } - - /** - * @param descriptor The media descriptor to get the index of. - * @return The index of the media descriptor, or -1 if not found. - */ - public int indexOf(MediaDescriptor descriptor) - { - libvlc_exception_t exception = new libvlc_exception_t(); - return jvlc.getLibvlc().libvlc_media_list_index_of_item(instance, descriptor.getInstance(), exception); - } - - /** - * @param index The index of the media descriptor to get. - * @return The media descriptor at the given index. - * @throws IndexOutOfBoundsException if index is bigger than size() or < 0, or there are no items in the media_list. - */ - public MediaDescriptor getMediaDescriptorAtIndex(int index) - { - libvlc_exception_t exception = new libvlc_exception_t(); - if (size() == 0) - { - throw new IndexOutOfBoundsException(); - } - if (index < 0 || index > size()) - { - throw new IndexOutOfBoundsException(); - } - LibVlcMedia descriptor = jvlc.getLibvlc().libvlc_media_list_item_at_index(instance, index, exception); - return new MediaDescriptor(jvlc, descriptor); - } - - /** - * @param index The index of the media to remove. - * @return True if the media was successfully removed, false otherwise. - */ - public boolean removeMedia(int index) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_media_list_remove_index(instance, index, exception); - if (exception.b_raised == 0) - { - items.remove(index); - return true; - } - return false; - } - - /** - * @param mrl The media descriptor mrl. - */ - public boolean removeMedia(String mrl) - { - int index = items.indexOf(mrl); - if (index == -1) - { - return false; - } - return removeMedia(index); - } - - /** - * @param mediaDescriptor The media descriptor to remove. - */ - public boolean removeMedia(MediaDescriptor mediaDescriptor) - { - String mrl = mediaDescriptor.getMrl(); - int index = items.indexOf(mrl); - if (index == -1) - { - return false; - } - return removeMedia(index); - } - - /** - * Removes all items from the media list. - */ - public void clear() - { - for (int i = 0; i < size(); i++) - { - removeMedia(i); - } - } - - /** - * @param descriptor The media descriptor to insert. - * @param index The index of the inserted media descriptor. - */ - public void insertMediaDescriptor(MediaDescriptor descriptor, int index) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc - .getLibvlc() - .libvlc_media_list_insert_media(instance, descriptor.getInstance(), index, exception); - } - - /** - * {@inheritDoc} - */ - @Override - protected void finalize() throws Throwable - { - release(); - super.finalize(); - } - - /** - * Returns the instance. - * @return the instance - */ - LibVlcMediaList getInstance() - { - return instance; - } - - /** - * - */ - public void release() - { - if (released) - { - return; - } - released = true; - - jvlc.getLibvlc().libvlc_media_list_release(instance); - } - - - -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java deleted file mode 100644 index 032008e455..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java +++ /dev/null @@ -1,195 +0,0 @@ -/***************************************************************************** - * MediaListPlayer.java: VLC Java Bindings, MediaList player - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import org.videolan.jvlc.internal.LibVlc.LibVlcMediaListPlayer; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - - -public class MediaListPlayer -{ - - private final LibVlcMediaListPlayer instance; - - private final JVLC jvlc; - - private volatile boolean released; - - public MediaListPlayer(JVLC jvlc) - { - libvlc_exception_t exception = new libvlc_exception_t(); - this.jvlc = jvlc; - instance = jvlc.getLibvlc().libvlc_media_list_player_new(jvlc.getInstance(), exception); - } - - public void setMediaList(MediaList list) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_media_list_player_set_media_list(instance, list.getInstance(), exception); - } - - public boolean isPlaying() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return jvlc.getLibvlc().libvlc_media_list_player_is_playing(instance, exception) == 1; - } - - - /** - * - */ - public void play() - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_media_list_player_play(instance, exception); - try - { - while (jvlc.getLibvlc().libvlc_media_list_player_is_playing(instance, exception) == 0) - { - Thread.sleep(25); - } - } - catch(InterruptedException e) - { - // - } - } - - public void stop() - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_media_list_player_stop(instance, exception); - } - - public void pause() - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_media_list_player_pause(instance, exception); - } - - public void next() - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_media_list_player_next(instance, exception); - } - - /** - * Plays the given descriptor and returns only when the player has started to play. - * @param descriptor The media descriptor to play - */ - public void playItem(MediaDescriptor descriptor) - { - playItem(descriptor, true); - } - - /** - * @param descriptor The media descriptor to play - * @param synchronous If true it does not return until the player is not playing. - */ - public void playItem(MediaDescriptor descriptor, boolean synchronous) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_media_list_player_play_item(instance, descriptor.getInstance(), exception); - if (!synchronous) - { - return; - } - - try - { - while (jvlc.getLibvlc().libvlc_media_list_player_is_playing(instance, exception) == 0) - { - Thread.sleep(25); - } - } - catch(InterruptedException e) - { - // - } - - } - - /** - * Plays the item at the given index and returns only when the player has started to play. - * @param index The item index to play. - */ - public void playItem(int index) - { - playItem(index, true); - } - - /** - * @param index The item index to play. - * @param synchronous If true it does not return until the player is not playing. - */ - public void playItem(int index, boolean synchronous) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_media_list_player_play_item_at_index(instance, index, exception); - try - { - while (jvlc.getLibvlc().libvlc_media_list_player_is_playing(instance, exception) == 0) - { - Thread.sleep(25); - } - } - catch(InterruptedException e) - { - // - } - } - - public void setMediaInstance(MediaPlayer mediaInstance) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_media_list_player_set_media_player(instance, mediaInstance.getInstance(), exception); - } - - /** - * {@inheritDoc} - */ - @Override - protected void finalize() throws Throwable - { - release(); - super.finalize(); - } - - /** - * - */ - public void release() - { - if (released) - { - return; - } - released = true; - jvlc.getLibvlc().libvlc_media_list_player_release(instance); - - } - -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java deleted file mode 100644 index 58fb41e46d..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java +++ /dev/null @@ -1,234 +0,0 @@ -/***************************************************************************** - * MediaInstance.java: VLC Java Bindings Media Instance - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import java.awt.Canvas; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; - -import org.videolan.jvlc.event.MediaPlayerCallback; -import org.videolan.jvlc.event.MediaPlayerListener; -import org.videolan.jvlc.internal.LibVlc; -import org.videolan.jvlc.internal.LibVlcEventType; -import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager; -import org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - -import com.sun.jna.Native; -import com.sun.jna.Platform; - - -public class MediaPlayer -{ - - private final LibVlcMediaPlayer instance; - - private final LibVlc libvlc; - - private final LibVlcEventManager eventManager; - - private List callbacks = new ArrayList(); - - private MediaDescriptor mediaDescriptor; - - private volatile boolean released; - - MediaPlayer(JVLC jvlc, LibVlcMediaPlayer instance) - { - libvlc_exception_t exception = new libvlc_exception_t(); - this.instance = instance; - libvlc = jvlc.getLibvlc(); - eventManager = libvlc.libvlc_media_player_event_manager(instance, exception); - } - - public MediaPlayer(MediaDescriptor mediaDescriptor) - { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc = mediaDescriptor.getLibvlc(); - instance = libvlc.libvlc_media_player_new_from_media(mediaDescriptor.getInstance(), exception); - eventManager = libvlc.libvlc_media_player_event_manager(instance, exception); - this.mediaDescriptor = mediaDescriptor; - } - - public MediaDescriptor getMediaDescriptor() - { - return mediaDescriptor; - } - - public void play() - { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc.libvlc_media_player_play(instance, exception); - } - - public void stop() - { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc.libvlc_media_player_stop(instance, exception); - } - - public void pause() - { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc.libvlc_media_player_pause(instance, exception); - } - - public long getLength() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return libvlc.libvlc_media_player_get_length(instance, exception); - } - - public long getTime() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return libvlc.libvlc_media_player_get_time(instance, exception); - } - - public void setTime(long time) - { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc.libvlc_media_player_set_time(instance, time, exception); - } - - public float getPosition() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return libvlc.libvlc_media_player_get_position(instance, exception); - } - - public void setPosition(float position) - { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc.libvlc_media_player_set_position(instance, position, exception); - } - - public boolean willPlay() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return (libvlc.libvlc_media_player_will_play(instance, exception) == 1); - } - - public float getRate() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return libvlc.libvlc_media_player_get_rate(instance, exception); - } - - public void setRate(float rate) - { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc.libvlc_media_player_set_rate(instance, rate, exception); - } - - public boolean hasVideoOutput() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return (libvlc.libvlc_media_player_has_vout(instance, exception) == 1); - } - - public float getFPS() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return libvlc.libvlc_media_player_get_fps(instance, exception); - } - - public boolean isPlaying() - { - libvlc_exception_t exception = new libvlc_exception_t(); - return libvlc.libvlc_media_player_is_playing(instance, exception) == 1 ? true : false; - } - - public void addListener(final MediaPlayerListener listener) - { - MediaPlayerCallback callback = new MediaPlayerCallback(this, listener); - libvlc_exception_t exception = new libvlc_exception_t(); - for (LibVlcEventType event : EnumSet.range( - LibVlcEventType.libvlc_MediaPlayerPlaying, - LibVlcEventType.libvlc_MediaPlayerTimeChanged)) - { - libvlc.libvlc_event_attach(eventManager, event.ordinal(), callback, null, exception); - } - callbacks.add(callback); - } - - public void setParent(Canvas canvas) - { - long drawable = Native.getComponentID(canvas); - libvlc_exception_t exception = new libvlc_exception_t(); - if (Platform.isWindows()) - { - libvlc.libvlc_media_player_set_hwnd(instance, drawable, exception); - } - else - { - libvlc.libvlc_media_player_set_xwindow(instance, drawable, exception); - } - } - - /** - * {@inheritDoc} - */ - @Override - protected void finalize() throws Throwable - { - release(); - super.finalize(); - } - - public void release() - { - if (released) - { - return; - } - released = true; - - libvlc_exception_t exception = new libvlc_exception_t(); - for (MediaPlayerCallback callback : callbacks) - { - for (LibVlcEventType event : EnumSet.range( - LibVlcEventType.libvlc_MediaPlayerPlaying, - LibVlcEventType.libvlc_MediaPlayerPositionChanged)) - { - libvlc.libvlc_event_detach(eventManager, event.ordinal(), callback, null, exception); - } - } - libvlc.libvlc_media_player_release(instance); - - } - - /** - * Returns the instance. - * @return the instance - */ - LibVlcMediaPlayer getInstance() - { - return instance; - } - -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/VLCException.java b/bindings/java/core/src/main/java/org/videolan/jvlc/VLCException.java deleted file mode 100644 index b5dae468f3..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/VLCException.java +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************** - * JVLC.java: Main Java Class, represents a libvlc_instance_t object - ***************************************************************************** - * - * Copyright (C) 1998-2006 the VideoLAN team - * - * Author: Philippe Morin - * - * Created on 18-jul-2006 - * - * $Id $ - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 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 - * General Public License for more details. - * - * You should have received a copy of the GNU 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. - * - */ - -package org.videolan.jvlc; - -import java.lang.Exception; - - -public class VLCException extends Exception -{ - - /** - * - */ - private static final long serialVersionUID = -3063632323017889L; - - public VLCException() - { - super(); - } - - public VLCException(String message) - { - super(message); - } - - public VLCException(String message, Throwable cause) - { - super(message, cause); - } - - public VLCException(Throwable cause) - { - super(cause); - } -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/VLM.java b/bindings/java/core/src/main/java/org/videolan/jvlc/VLM.java deleted file mode 100644 index 36cde32bd0..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/VLM.java +++ /dev/null @@ -1,189 +0,0 @@ -/***************************************************************************** - * VLM.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - - -public class VLM -{ - - private JVLC jvlc; - - private volatile boolean released; - - public VLM(JVLC jvlc) - { - this.jvlc = jvlc; - } - - public void addBroadcast(String name, String input, String output, String[] options, boolean enabled, boolean loop) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_add_broadcast( - jvlc.getInstance(), - name, - input, - output, - options == null ? 0 : options.length, - options, - enabled ? 1 : 0, - loop ? 1 : 0, - exception); - } - - public void addVod(String name, String input, String[] options, boolean enabled, String muxer) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_add_vod( - jvlc.getInstance(), - name, - input, - options == null ? 0 : options.length, - options, - enabled ? 1 : 0, - muxer, - exception); - } - - public void deleteMedia(String name) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_del_media(jvlc.getInstance(), name, exception); - } - - public void enableMedia(String name) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_set_enabled(jvlc.getInstance(), name, 1, exception); - } - - public void disableMedia(String name) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_set_enabled(jvlc.getInstance(), name, 0, exception); - } - - public void setMediaOutput(String name, String output) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_set_output(jvlc.getInstance(), name, output, exception); - } - - public void setMediaInput(String name, String input) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_set_input(jvlc.getInstance(), name, input, exception); - } - - public void addMediaInput(String name, String input) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_add_input(jvlc.getInstance(), name, input, exception); - } - - public void setMux(String name, String muxer) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_set_mux(jvlc.getInstance(), name, muxer, exception); - } - - public void setMediaLoop(String media, boolean loop) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_set_loop(jvlc.getInstance(), media, loop ? 1 : 0, exception); - } - - public void changeMedia(String name, String input, String output, String[] options, boolean enabled, boolean loop) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_change_media( - jvlc.getInstance(), - name, - input, - output, - options == null ? 0 : options.length, - options, - enabled ? 1 : 0, - loop ? 1 : 0, - exception); - } - - public void playMedia(String name) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_play_media(jvlc.getInstance(), name, exception); - } - - public void stopMedia(String name) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_stop_media(jvlc.getInstance(), name, exception); - } - - public void pauseMedia(String name) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_pause_media(jvlc.getInstance(), name, exception); - } - - public void seekMedia(String name, float percentage) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_seek_media(jvlc.getInstance(), name, percentage, exception); - } - - public void showMedia(String name) - { - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_show_media(jvlc.getInstance(), name, exception); - } - - /** - * Releases native resources related to VLM. - */ - public void release() - { - if (released) - { - return; - } - released = true; - libvlc_exception_t exception = new libvlc_exception_t(); - jvlc.getLibvlc().libvlc_vlm_release(jvlc.getInstance(), exception); - } - - /** - * {@inheritDoc} - */ - @Override - protected void finalize() throws Throwable - { - release(); - super.finalize(); - } - -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/Video.java b/bindings/java/core/src/main/java/org/videolan/jvlc/Video.java deleted file mode 100644 index 0dec2afd6e..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/Video.java +++ /dev/null @@ -1,120 +0,0 @@ -/***************************************************************************** - * Video.java: JVLC Video Output - ***************************************************************************** - * - * Copyright (C) 1998-2008 the VideoLAN team - * - * Author: Filippo Carone - * Philippe Morin - * - * Created on 28-feb-2006 - * - * $Id: JVLC.java 20141 2007-05-16 19:31:35Z littlejohn $ - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 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 - * General Public License for more details. - * - * You should have received a copy of the GNU 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. - * - */ -package org.videolan.jvlc; - -import java.awt.Dimension; - -import org.videolan.jvlc.internal.LibVlc; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - -public class Video -{ - - private final LibVlc libvlc; - - public Video( JVLC jvlc) { - this.libvlc = jvlc.getLibvlc(); - } - - /** (non-Javadoc) - * @deprecated - * @since - */ - public void destroyVideo(MediaPlayer media) - { - return; - } - - /* (non-Javadoc) - * @see org.videolan.jvlc.VideoIntf#getFullscreen() - */ - public boolean getFullscreen(MediaPlayer media) { - libvlc_exception_t exception = new libvlc_exception_t(); - return libvlc.libvlc_get_fullscreen(media.getInstance(), exception) == 1 ? true : false; - } - - /* (non-Javadoc) - * @see org.videolan.jvlc.VideoIntf#getSnapshot(java.lang.String) - */ - public void getSnapshot(MediaPlayer media, String filepath, int width, int height) { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc.libvlc_video_take_snapshot(media.getInstance(), filepath, width, height, exception); - } - - /* (non-Javadoc) - * @see org.videolan.jvlc.VideoIntf#getVideoHeight() - */ - public int getHeight(MediaPlayer media) { - libvlc_exception_t exception = new libvlc_exception_t(); - return libvlc.libvlc_video_get_height(media.getInstance(), exception); - } - - /* (non-Javadoc) - * @see org.videolan.jvlc.VideoIntf#getVideoWidth() - */ - public int getWidth(MediaPlayer media) { - libvlc_exception_t exception = new libvlc_exception_t(); - return libvlc.libvlc_video_get_width(media.getInstance(), exception); - } - - /** - * @deprecated - */ - public void reparent(MediaPlayer media, java.awt.Canvas canvas) { - } - - /** - * @deprecated - */ - public void setSize(int width, int height) { - } - - public void setFullscreen(MediaPlayer media, boolean fullscreen) { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc.libvlc_set_fullscreen(media.getInstance(), fullscreen? 1 : 0, exception); - } - - public void toggleFullscreen(MediaPlayer media) { - libvlc_exception_t exception = new libvlc_exception_t(); - libvlc.libvlc_toggle_fullscreen(media.getInstance(), exception); - } - - public Dimension getSize(MediaPlayer media) { - return new Dimension (getWidth(media), getHeight(media)); - } - - - /** - * @param d - * @deprecated - */ - public void setSize(Dimension d) { - setSize(d.width, d.height); - } -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaPlayerCallback.java b/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaPlayerCallback.java deleted file mode 100644 index 849950ca46..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaPlayerCallback.java +++ /dev/null @@ -1,98 +0,0 @@ -/***************************************************************************** - * MediaInstancePlayCallback.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.event; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.videolan.jvlc.MediaPlayer; -import org.videolan.jvlc.internal.LibVlc; -import org.videolan.jvlc.internal.LibVlcEventType; -import org.videolan.jvlc.internal.LibVlc.LibVlcCallback; -import org.videolan.jvlc.internal.LibVlc.libvlc_event_t; -import org.videolan.jvlc.internal.LibVlc.media_player_time_changed; - -import com.sun.jna.Pointer; - - -public class MediaPlayerCallback implements LibVlcCallback -{ - - private MediaPlayerListener listener; - private MediaPlayer mediaPlayer; - - /** - * Logger. - */ - private Logger log = LoggerFactory.getLogger(MediaPlayerCallback.class); - - public MediaPlayerCallback(MediaPlayer mediaInstance, MediaPlayerListener listener) - { - this.mediaPlayer = mediaInstance; - this.listener = listener; - } - /** - * {@inheritDoc} - */ - public void callback(libvlc_event_t libvlc_event, Pointer userData) - { - if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPlaying.ordinal()) - { - listener.playing(mediaPlayer); - } - else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPaused.ordinal()) - { - listener.paused(mediaPlayer); - } - else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerEndReached.ordinal()) - { - listener.endReached(mediaPlayer); - } - else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPositionChanged.ordinal()) - { - listener.positionChanged(mediaPlayer); - } - else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerStopped.ordinal()) - { - listener.stopped(mediaPlayer); - } - else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerTimeChanged.ordinal()) - { - libvlc_event.event_type_specific.setType(LibVlc.media_player_time_changed.class); - LibVlc.media_player_time_changed timeChanged = (media_player_time_changed) libvlc_event.event_type_specific - .readField("media_player_time_changed"); - listener.timeChanged(mediaPlayer, timeChanged.new_time); - } - else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerEncounteredError.ordinal()) - { - log.warn("Media player encountered error."); - listener.errorOccurred(mediaPlayer); - } - else - { - log.debug("Unsupported event error. Event id: {}", libvlc_event.type); - } - } -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaPlayerListener.java b/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaPlayerListener.java deleted file mode 100644 index de95b00040..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaPlayerListener.java +++ /dev/null @@ -1,48 +0,0 @@ -/***************************************************************************** - * mediaPlayerPlayListener.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.event; - -import org.videolan.jvlc.MediaPlayer; - - -public interface MediaPlayerListener -{ - - void playing(MediaPlayer mediaPlayer); - - void paused(MediaPlayer mediaPlayer); - - void stopped(MediaPlayer mediaPlayer); - - void endReached(MediaPlayer mediaPlayer); - - void timeChanged(MediaPlayer mediaPlayer, long newTime); - - void positionChanged(MediaPlayer mediaPlayer); - - void errorOccurred(MediaPlayer mediaPlayer); - -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/example/VLCExample.java b/bindings/java/core/src/main/java/org/videolan/jvlc/example/VLCExample.java deleted file mode 100644 index 1c6f7d213a..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/example/VLCExample.java +++ /dev/null @@ -1,121 +0,0 @@ -package org.videolan.jvlc.example; - -import org.videolan.jvlc.Audio; -import org.videolan.jvlc.JVLC; -import org.videolan.jvlc.MediaDescriptor; -import org.videolan.jvlc.MediaPlayer; -import org.videolan.jvlc.Video; -import org.videolan.jvlc.event.MediaPlayerListener; - - -public class VLCExample -{ - - public static void main(String[] args) throws InterruptedException - { - System.out.println("== Starting VLCExample =="); - if (args.length == 0) - { - System.out.print("Creating a JVLC instance without args"); - } - else - { - System.out.println("Creating a JVLC instance with args: "); - for (int i = 0; i < args.length; i++) - { - System.out.println(i + ") " + args[i]); - } - } - JVLC jvlc = new JVLC(args); - System.out.println("... done."); - - MediaDescriptor mediaDescriptor = new MediaDescriptor(jvlc, "/home/carone/apps/a.avi"); - MediaPlayer mediaPlayer = mediaDescriptor.getMediaPlayer(); - - mediaPlayer.addListener(new MediaPlayerListener() - { - - public void endReached(MediaPlayer mediaPlayer) - { - System.out.println("Media instance end reached. MRL: " + mediaPlayer.getMediaDescriptor().getMrl()); - } - - public void paused(MediaPlayer mediaPlayer) - { - System.out.println("Media instance paused. MRL: " + mediaPlayer.getMediaDescriptor().getMrl()); - } - - public void playing(MediaPlayer mediaPlayer) - { - System.out.println("Media instance played. MRL: " + mediaPlayer.getMediaDescriptor().getMrl()); - } - - public void positionChanged(MediaPlayer mediaPlayer) - { - // TODO Auto-generated method stub - } - - public void timeChanged(MediaPlayer mediaPlayer, long newTime) - { - System.out.println("new time: " + newTime); - } - - public void stopped(MediaPlayer mediaPlayer) - { - System.out.println("Media player stopped. MRL: " + mediaPlayer.getMediaDescriptor().getMrl()); - } - - public void errorOccurred(MediaPlayer mediaPlayer) - { - System.out.println("An error has occurred."); - } - }); - mediaPlayer.play(); - - while (!mediaPlayer.hasVideoOutput()) - { - Thread.sleep(100); - } - - Video video = new Video(jvlc); - System.out.print(video.getWidth(mediaPlayer)); - System.out.print("x"); - System.out.println(video.getHeight(mediaPlayer)); - System.out.print("Fullscreen... "); - video.setFullscreen(mediaPlayer, true); - Thread.sleep(3000); - System.out.println("real size."); - video.setFullscreen(mediaPlayer, false); - System.out.print("Taking snapshot... "); - video.getSnapshot(mediaPlayer, System.getProperty("user.dir") + "/snap.png", 0, 0); - System.out.println("taken. (see " + System.getProperty("user.dir") + "/snap.png )"); - Thread.sleep(2000); - System.out.println("Resizing to 300x300"); - video.setSize(300, 300); - - System.out.print("Muting..."); - Audio audio = new Audio(jvlc); - audio.setMute(true); - Thread.sleep(3000); - System.out.println("unmuting."); - audio.setMute(false); - Thread.sleep(3000); - System.out.println("Volume is: " + audio.getVolume()); - System.out.print("Setting volume to 150... "); - audio.setVolume(150); - System.out.println("done"); - System.out.println("== AUDIO INFO =="); - System.out.println("Audio track number: " + audio.getTrack(mediaPlayer)); - System.out.println("Audio channel info: " + audio.getChannel()); - Thread.sleep(3000); - System.out.println("MEDIA PLAYER INFORMATION"); - System.out.println("--------------------------"); - System.out.println("Total length (ms) :\t" + mediaPlayer.getLength()); - System.out.println("Input time (ms) :\t" + mediaPlayer.getTime()); - System.out.println("Input position [0-1]:\t" + mediaPlayer.getPosition()); - System.out.println("Input FPS :\t" + mediaPlayer.getFPS()); - - System.out.println("Everything fine ;)"); - return; - } -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java deleted file mode 100644 index dc34633914..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java +++ /dev/null @@ -1,805 +0,0 @@ -/***************************************************************************** - * VLC Java Bindings JNA Glue - ***************************************************************************** - * Copyright (C) 1998-2009 the VideoLAN team - * - * Authors: Filippo Carone - * VLC bindings generator - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import com.sun.jna.Callback; -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.NativeLong; -import com.sun.jna.Platform; -import com.sun.jna.Pointer; -import com.sun.jna.PointerType; -import com.sun.jna.Structure; -import com.sun.jna.Union; - - -public interface LibVlc extends Library -{ - - LibVlc INSTANCE = (LibVlc) Native.loadLibrary(Platform.isWindows() ? "libvlc" : "vlc", LibVlc.class); - - LibVlc SYNC_INSTANCE = (LibVlc) Native.synchronizedLibrary(INSTANCE); - - public static class libvlc_exception_t extends Structure - { - - public int b_raised; - } - - public static interface LibVlcCallback extends Callback - { - - void callback(libvlc_event_t libvlc_event, Pointer userData); - } - - public static class libvlc_log_message_t extends Structure - { - - public int sizeof_msg; /* sizeof() of message structure, must be filled in by user */ - - public int i_severity; /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */ - - public String psz_type; /* module type */ - - public String psz_name; /* module name */ - - public String psz_header; /* optional header */ - - public String psz_message; /* message */ - } - - public static class libvlc_event_t extends Structure - { - - public int type; - - public Pointer p_obj; - - public event_type_specific event_type_specific; - - } - - public class media_meta_changed extends Structure - { - - // Enum ! - public Pointer meta_type; - } - - public class media_subitem_added extends Structure - { - - public LibVlcMedia new_child; - } - - public class media_duration_changed extends Structure - { - - public NativeLong new_duration; - } - - public class media_preparsed_changed extends Structure - { - - public int new_status; - } - - public class media_freed extends Structure - { - - public LibVlcMedia md; - } - - public class media_state_changed extends Structure - { - - // @todo: check this one - public int new_state; - } - - /* media instance */ - - public class media_player_position_changed extends Structure - { - - public float new_position; - } - - public class media_player_time_changed extends Structure - { - - // @todo: check this one - public long new_time; - } - - public class media_player_title_changed extends Structure - { - - public int new_title; - } - - public class media_player_seekable_changed extends Structure - { - - public NativeLong new_seekable; - } - - public class media_player_pausable_changed extends Structure - { - - public NativeLong new_pausable; - } - - /* media list */ - public class media_list_item_added extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_will_add_item extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_item_deleted extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_will_delete_item extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - /* media list view */ - public class media_list_view_item_added extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_view_will_add_item extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_view_item_deleted extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_view_will_delete_item extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_player_next_item_set extends Structure - { - - public LibVlcMedia item; - } - - public class media_player_snapshot_taken extends Structure - { - - public String psz_filename; - } - - public class media_player_length_changed extends Structure - { - - // @todo: check the type - public long new_length; - } - - public class vlm_media_event extends Structure - { - - public String psz_media_name; - - public String psz_instance_name; - } - - public class event_type_specific extends Union - { - - public media_meta_changed media_meta_changed; - - public media_subitem_added media_subitem_added; - - public media_duration_changed media_duration_changed; - - public media_preparsed_changed media_preparsed_changed; - - public media_freed media_freed; - - public media_state_changed media_state_changed; - - public media_player_position_changed media_player_position_changed; - - public media_player_time_changed media_player_time_changed; - - public media_player_title_changed media_player_title_changed; - - public media_player_seekable_changed media_player_seekable_changed; - - public media_player_pausable_changed media_player_pausable_changed; - - public media_list_item_added media_list_item_added; - - public media_list_will_add_item media_list_will_add_item; - - public media_list_item_deleted media_list_item_deleted; - - public media_list_will_delete_item media_list_will_delete_item; - - public media_list_view_item_added media_list_view_item_added; - - public media_list_view_will_add_item media_list_view_will_add_item; - - public media_list_view_item_deleted media_list_view_item_deleted; - - public media_list_view_will_delete_item media_list_view_will_delete_item; - - public media_list_player_next_item_set media_list_player_next_item_set; - - public media_player_snapshot_taken media_player_snapshot_taken; - - public media_player_length_changed media_player_length_changed; - - public vlm_media_event vlm_media_event; - } - - public class LibVlcLog extends PointerType - { - } - - public class LibVlcMediaListView extends PointerType - { - } - - public class LibVlcTrackDescription extends PointerType - { - } - - public class LibVlcMediaListPlayer extends PointerType - { - } - - public class LibVlcInstance extends PointerType - { - } - - public class LibVlcEventManager extends PointerType - { - } - - public class LibVlcMediaLibrary extends PointerType - { - } - - public class LibVlcMediaList extends PointerType - { - } - - public class LibVlcAudioOutput extends PointerType - { - } - - public class LibVlcMediaPlayer extends PointerType - { - } - - public class LibVlcMedia extends PointerType - { - } - - public class LibVlcMediaDiscoverer extends PointerType - { - } - - public class LibVlcLogIterator extends PointerType - { - } - - void libvlc_exception_init(libvlc_exception_t p_exception); - - void libvlc_exception_clear(libvlc_exception_t p_exception); - - int libvlc_exception_raised(final libvlc_exception_t exception); - - String libvlc_errmsg(); - - void libvlc_clearerr(); - - LibVlcInstance libvlc_new(int argc, String[] argv, libvlc_exception_t p_e); - - void libvlc_release(LibVlcInstance p_instance); - - void libvlc_retain(LibVlcInstance p_instance); - - int libvlc_add_intf(LibVlcInstance p_instance, String name, libvlc_exception_t p_exception); - - void libvlc_wait(LibVlcInstance p_instance); - - String libvlc_get_version(); - - String libvlc_get_compiler(); - - String libvlc_get_changeset(); - - void libvlc_free(Pointer ptr); - - void libvlc_event_attach(LibVlcEventManager p_event_manager, int i_event_type, LibVlcCallback f_callback, - Pointer user_data, libvlc_exception_t p_e); - - void libvlc_event_detach(LibVlcEventManager p_event_manager, int i_event_type, LibVlcCallback f_callback, - Pointer p_user_data, libvlc_exception_t p_e); - - String libvlc_event_type_name(int event_type); - - int libvlc_get_log_verbosity(LibVlcInstance p_instance); - - void libvlc_set_log_verbosity(LibVlcInstance p_instance, int level); - - LibVlcLog libvlc_log_open(LibVlcInstance p_instance, libvlc_exception_t p_e); - - void libvlc_log_close(LibVlcLog p_log); - - int libvlc_log_count(LibVlcLog p_log); - - void libvlc_log_clear(LibVlcLog p_log); - - LibVlcLogIterator libvlc_log_get_iterator(LibVlcLog p_log, libvlc_exception_t p_e); - - void libvlc_log_iterator_free(LibVlcLogIterator p_iter); - - int libvlc_log_iterator_has_next(LibVlcLogIterator p_iter); - - libvlc_log_message_t libvlc_log_iterator_next(LibVlcLogIterator p_iter, libvlc_log_message_t p_buffer, - libvlc_exception_t p_e); - - LibVlcMediaDiscoverer libvlc_media_discoverer_new_from_name(LibVlcInstance p_inst, String psz_name, - libvlc_exception_t p_e); - - void libvlc_media_discoverer_release(LibVlcMediaDiscoverer p_mdis); - - String libvlc_media_discoverer_localized_name(LibVlcMediaDiscoverer p_mdis); - - LibVlcMediaList libvlc_media_discoverer_media_list(LibVlcMediaDiscoverer p_mdis); - - LibVlcEventManager libvlc_media_discoverer_event_manager(LibVlcMediaDiscoverer p_mdis); - - int libvlc_media_discoverer_is_running(LibVlcMediaDiscoverer p_mdis); - - LibVlcMedia libvlc_media_new(LibVlcInstance p_instance, String psz_mrl, libvlc_exception_t p_e); - - LibVlcMedia libvlc_media_new_as_node(LibVlcInstance p_instance, String psz_name, libvlc_exception_t p_e); - - void libvlc_media_add_option(LibVlcMedia p_md, String ppsz_options, libvlc_exception_t p_e); - - void libvlc_media_add_option_flag(LibVlcMedia p_md, String ppsz_options, MediaOption i_flags, libvlc_exception_t p_e); - - void libvlc_media_retain(LibVlcMedia p_meta_desc); - - void libvlc_media_release(LibVlcMedia p_meta_desc); - - String libvlc_media_get_mrl(LibVlcMedia p_md, libvlc_exception_t p_e); - - LibVlcMedia libvlc_media_duplicate(LibVlcMedia p_meta_desc); - - String libvlc_media_get_meta(LibVlcMedia p_meta_desc, Meta e_meta, libvlc_exception_t p_e); - - int libvlc_media_get_state(LibVlcMedia p_meta_desc, libvlc_exception_t p_e); - - LibVlcMediaList libvlc_media_subitems(LibVlcMedia p_md, libvlc_exception_t p_e); - - LibVlcEventManager libvlc_media_event_manager(LibVlcMedia p_md, libvlc_exception_t p_e); - - long libvlc_media_get_duration(LibVlcMedia p_md, libvlc_exception_t p_e); - - int libvlc_media_is_preparsed(LibVlcMedia p_md, libvlc_exception_t p_e); - - void libvlc_media_set_user_data(LibVlcMedia p_md, Pointer p_new_user_data, libvlc_exception_t p_e); - - Pointer libvlc_media_get_user_data(LibVlcMedia p_md, libvlc_exception_t p_e); - - LibVlcMediaLibrary libvlc_media_library_new(LibVlcInstance p_inst, libvlc_exception_t p_e); - - void libvlc_media_library_release(LibVlcMediaLibrary p_mlib); - - void libvlc_media_library_retain(LibVlcMediaLibrary p_mlib); - - void libvlc_media_library_load(LibVlcMediaLibrary p_mlib, libvlc_exception_t p_e); - - void libvlc_media_library_save(LibVlcMediaLibrary p_mlib, libvlc_exception_t p_e); - - LibVlcMediaList libvlc_media_library_media_list(LibVlcMediaLibrary p_mlib, libvlc_exception_t p_e); - - LibVlcMediaList libvlc_media_list_new(LibVlcInstance p_libvlc, libvlc_exception_t p_e); - - void libvlc_media_list_release(LibVlcMediaList p_ml); - - void libvlc_media_list_retain(LibVlcMediaList p_ml); - - void libvlc_media_list_set_media(LibVlcMediaList p_ml, LibVlcMedia p_mi, libvlc_exception_t p_e); - - LibVlcMedia libvlc_media_list_media(LibVlcMediaList p_ml, libvlc_exception_t p_e); - - void libvlc_media_list_add_media(LibVlcMediaList p_ml, LibVlcMedia p_mi, libvlc_exception_t p_e); - - void libvlc_media_list_insert_media(LibVlcMediaList p_ml, LibVlcMedia p_mi, int i_pos, libvlc_exception_t p_e); - - void libvlc_media_list_remove_index(LibVlcMediaList p_ml, int i_pos, libvlc_exception_t p_e); - - int libvlc_media_list_count(LibVlcMediaList p_mlist, libvlc_exception_t p_e); - - LibVlcMedia libvlc_media_list_item_at_index(LibVlcMediaList p_ml, int i_pos, libvlc_exception_t p_e); - - int libvlc_media_list_index_of_item(LibVlcMediaList p_ml, LibVlcMedia p_mi, libvlc_exception_t p_e); - - int libvlc_media_list_is_readonly(LibVlcMediaList p_mlist); - - void libvlc_media_list_lock(LibVlcMediaList p_ml); - - void libvlc_media_list_unlock(LibVlcMediaList p_ml); - - LibVlcMediaListView libvlc_media_list_flat_view(LibVlcMediaList p_ml, libvlc_exception_t p_ex); - - LibVlcMediaListView libvlc_media_list_hierarchical_view(LibVlcMediaList p_ml, libvlc_exception_t p_ex); - - LibVlcMediaListView libvlc_media_list_hierarchical_node_view(LibVlcMediaList p_ml, libvlc_exception_t p_ex); - - LibVlcEventManager libvlc_media_list_event_manager(LibVlcMediaList p_ml, libvlc_exception_t p_ex); - - LibVlcMediaListPlayer libvlc_media_list_player_new(LibVlcInstance p_instance, libvlc_exception_t p_e); - - void libvlc_media_list_player_release(LibVlcMediaListPlayer p_mlp); - - LibVlcEventManager libvlc_media_list_player_event_manager(LibVlcMediaListPlayer p_mlp); - - void libvlc_media_list_player_set_media_player(LibVlcMediaListPlayer p_mlp, LibVlcMediaPlayer p_mi, - libvlc_exception_t p_e); - - void libvlc_media_list_player_set_media_list(LibVlcMediaListPlayer p_mlp, LibVlcMediaList p_mlist, - libvlc_exception_t p_e); - - void libvlc_media_list_player_play(LibVlcMediaListPlayer p_mlp, libvlc_exception_t p_e); - - void libvlc_media_list_player_pause(LibVlcMediaListPlayer p_mlp, libvlc_exception_t p_e); - - int libvlc_media_list_player_is_playing(LibVlcMediaListPlayer p_mlp, libvlc_exception_t p_e); - - int libvlc_media_list_player_get_state(LibVlcMediaListPlayer p_mlp, libvlc_exception_t p_e); - - void libvlc_media_list_player_play_item_at_index(LibVlcMediaListPlayer p_mlp, int i_index, libvlc_exception_t p_e); - - void libvlc_media_list_player_play_item(LibVlcMediaListPlayer p_mlp, LibVlcMedia p_md, libvlc_exception_t p_e); - - void libvlc_media_list_player_stop(LibVlcMediaListPlayer p_mlp, libvlc_exception_t p_e); - - void libvlc_media_list_player_next(LibVlcMediaListPlayer p_mlp, libvlc_exception_t p_e); - - void libvlc_media_list_player_previous(LibVlcMediaListPlayer p_mlp, libvlc_exception_t p_e); - - void libvlc_media_list_player_set_playback_mode(LibVlcMediaListPlayer p_mlp, PlaybackMode e_mode, - libvlc_exception_t p_e); - - void libvlc_media_list_view_retain(LibVlcMediaListView p_mlv); - - void libvlc_media_list_view_release(LibVlcMediaListView p_mlv); - - LibVlcEventManager libvlc_media_list_view_event_manager(LibVlcMediaListView p_mlv); - - int libvlc_media_list_view_count(LibVlcMediaListView p_mlv, libvlc_exception_t p_e); - - LibVlcMedia libvlc_media_list_view_item_at_index(LibVlcMediaListView p_mlv, int i_index, libvlc_exception_t p_e); - - LibVlcMediaListView libvlc_media_list_view_children_at_index(LibVlcMediaListView p_mlv, int index, - libvlc_exception_t p_e); - - LibVlcMediaListView libvlc_media_list_view_children_for_item(LibVlcMediaListView p_mlv, LibVlcMedia p_md, - libvlc_exception_t p_e); - - LibVlcMediaList libvlc_media_list_view_parent_media_list(LibVlcMediaListView p_mlv, libvlc_exception_t p_e); - - LibVlcMediaPlayer libvlc_media_player_new(LibVlcInstance p_libvlc_instance, libvlc_exception_t p_e); - - LibVlcMediaPlayer libvlc_media_player_new_from_media(LibVlcMedia p_md, libvlc_exception_t p_e); - - void libvlc_media_player_release(LibVlcMediaPlayer p_mi); - - void libvlc_media_player_retain(LibVlcMediaPlayer p_mi); - - void libvlc_media_player_set_media(LibVlcMediaPlayer p_mi, LibVlcMedia p_md, libvlc_exception_t p_e); - - LibVlcMedia libvlc_media_player_get_media(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - LibVlcEventManager libvlc_media_player_event_manager(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - int libvlc_media_player_is_playing(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - void libvlc_media_player_play(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - void libvlc_media_player_pause(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - void libvlc_media_player_stop(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - void libvlc_media_player_set_nsobject(LibVlcMediaPlayer p_mi, Pointer drawable, libvlc_exception_t p_e); - - Pointer libvlc_media_player_get_nsobject(LibVlcMediaPlayer p_mi); - - void libvlc_media_player_set_agl(LibVlcMediaPlayer p_mi, long drawable, libvlc_exception_t p_e); - - long libvlc_media_player_get_agl(LibVlcMediaPlayer p_mi); - - void libvlc_media_player_set_xwindow(LibVlcMediaPlayer p_mi, long drawable, libvlc_exception_t p_e); - - long libvlc_media_player_get_xwindow(LibVlcMediaPlayer p_mi); - - void libvlc_media_player_set_hwnd(LibVlcMediaPlayer p_mi, long drawable, libvlc_exception_t p_e); - - Pointer libvlc_media_player_get_hwnd(LibVlcMediaPlayer p_mi); - - long libvlc_media_player_get_length(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - long libvlc_media_player_get_time(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - void libvlc_media_player_set_time(LibVlcMediaPlayer p_mi, long the, libvlc_exception_t p_e); - - float libvlc_media_player_get_position(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - void libvlc_media_player_set_position(LibVlcMediaPlayer p_mi, float f_pos, libvlc_exception_t p_e); - - void libvlc_media_player_set_chapter(LibVlcMediaPlayer p_mi, int i_chapter, libvlc_exception_t p_e); - - int libvlc_media_player_get_chapter(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - int libvlc_media_player_get_chapter_count(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - int libvlc_media_player_will_play(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - int libvlc_media_player_get_chapter_count_for_title(LibVlcMediaPlayer p_mi, int i_title, libvlc_exception_t p_e); - - void libvlc_media_player_set_title(LibVlcMediaPlayer p_mi, int i_title, libvlc_exception_t p_e); - - int libvlc_media_player_get_title(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - int libvlc_media_player_get_title_count(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - void libvlc_media_player_previous_chapter(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - void libvlc_media_player_next_chapter(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - float libvlc_media_player_get_rate(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - void libvlc_media_player_set_rate(LibVlcMediaPlayer p_mi, float movie, libvlc_exception_t p_e); - - int libvlc_media_player_get_state(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - float libvlc_media_player_get_fps(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - int libvlc_media_player_has_vout(LibVlcMediaPlayer p_md, libvlc_exception_t p_e); - - int libvlc_media_player_is_seekable(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - int libvlc_media_player_can_pause(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - void libvlc_media_player_next_frame(LibVlcMediaPlayer p_input, libvlc_exception_t p_e); - - void libvlc_track_description_release(LibVlcTrackDescription p_track_description); - - void libvlc_toggle_fullscreen(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - void libvlc_set_fullscreen(LibVlcMediaPlayer p_mediaplayer, int b_fullscreen, libvlc_exception_t p_e); - - int libvlc_get_fullscreen(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - int libvlc_video_get_height(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - int libvlc_video_get_width(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - float libvlc_video_get_scale(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - void libvlc_video_set_scale(LibVlcMediaPlayer p_mediaplayer, float i_factor, libvlc_exception_t p_e); - - String libvlc_video_get_aspect_ratio(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - void libvlc_video_set_aspect_ratio(LibVlcMediaPlayer p_mediaplayer, String psz_aspect, libvlc_exception_t p_e); - - int libvlc_video_get_spu(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - int libvlc_video_get_spu_count(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - LibVlcTrackDescription libvlc_video_get_spu_description(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - void libvlc_video_set_spu(LibVlcMediaPlayer p_mediaplayer, int i_spu, libvlc_exception_t p_e); - - int libvlc_video_set_subtitle_file(LibVlcMediaPlayer p_mediaplayer, String psz_subtitle, libvlc_exception_t p_e); - - LibVlcTrackDescription libvlc_video_get_title_description(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - LibVlcTrackDescription libvlc_video_get_chapter_description(LibVlcMediaPlayer p_mediaplayer, int i_title, - libvlc_exception_t p_e); - - String libvlc_video_get_crop_geometry(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - void libvlc_video_set_crop_geometry(LibVlcMediaPlayer p_mediaplayer, String psz_geometry, libvlc_exception_t p_e); - - void libvlc_toggle_teletext(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - int libvlc_video_get_teletext(LibVlcMediaPlayer p_mediaplayer, libvlc_exception_t p_e); - - void libvlc_video_set_teletext(LibVlcMediaPlayer p_mediaplayer, int i_page, libvlc_exception_t p_e); - - int libvlc_video_get_track_count(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - LibVlcTrackDescription libvlc_video_get_track_description(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - int libvlc_video_get_track(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - void libvlc_video_set_track(LibVlcMediaPlayer p_mi, int i_track, libvlc_exception_t p_e); - - void libvlc_video_take_snapshot(LibVlcMediaPlayer p_mi, String psz_filepath, int i_width, int i_height, - libvlc_exception_t p_e); - - void libvlc_video_set_deinterlace(LibVlcMediaPlayer p_mi, int b_enable, String psz_mode, libvlc_exception_t p_e); - - int libvlc_video_get_marquee_int(LibVlcMediaPlayer p_mi, VideoMarqueeIntOption option, - libvlc_exception_t p_e); - - String libvlc_video_get_marquee_string(LibVlcMediaPlayer p_mi, VideoMarqueeStringOption option, - libvlc_exception_t p_e); - - void libvlc_video_set_marquee_int(LibVlcMediaPlayer p_mi, VideoMarqueeIntOption option, int i_val, - libvlc_exception_t p_e); - - void libvlc_video_set_marquee_string(LibVlcMediaPlayer p_mi, VideoMarqueeStringOption option, - String psz_text, libvlc_exception_t p_e); - - LibVlcAudioOutput libvlc_audio_output_list_get(LibVlcInstance p_instance, libvlc_exception_t p_e); - - void libvlc_audio_output_list_release(LibVlcAudioOutput p_list); - - int libvlc_audio_output_set(LibVlcInstance p_instance, String psz_name); - - int libvlc_audio_output_device_count(LibVlcInstance p_instance, String psz_audio_output); - - String libvlc_audio_output_device_longname(LibVlcInstance p_instance, String psz_audio_output, int i_device); - - String libvlc_audio_output_device_id(LibVlcInstance p_instance, String psz_audio_output, int i_device); - - void libvlc_audio_output_device_set(LibVlcInstance p_instance, String psz_audio_output, String psz_device_id); - - int libvlc_audio_output_get_device_type(LibVlcInstance p_instance, libvlc_exception_t p_e); - - void libvlc_audio_output_set_device_type(LibVlcInstance p_instance, int device_type, libvlc_exception_t p_e); - - void libvlc_audio_toggle_mute(LibVlcInstance p_instance, libvlc_exception_t p_e); - - int libvlc_audio_get_mute(LibVlcInstance p_instance, libvlc_exception_t p_e); - - void libvlc_audio_set_mute(LibVlcInstance p_instance, int status, libvlc_exception_t p_e); - - int libvlc_audio_get_volume(LibVlcInstance p_instance, libvlc_exception_t p_e); - - void libvlc_audio_set_volume(LibVlcInstance p_instance, int i_volume, libvlc_exception_t p_e); - - int libvlc_audio_get_track_count(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - LibVlcTrackDescription libvlc_audio_get_track_description(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - int libvlc_audio_get_track(LibVlcMediaPlayer p_mi, libvlc_exception_t p_e); - - void libvlc_audio_set_track(LibVlcMediaPlayer p_mi, int i_track, libvlc_exception_t p_e); - - int libvlc_audio_get_channel(LibVlcInstance p_instance, libvlc_exception_t p_e); - - void libvlc_audio_set_channel(LibVlcInstance p_instance, int channel, libvlc_exception_t p_e); - - void libvlc_vlm_release(LibVlcInstance p_instance, libvlc_exception_t p_e); - - void libvlc_vlm_add_broadcast(LibVlcInstance p_instance, String psz_name, String psz_input, String psz_output, - int i_options, String[] ppsz_options, int b_enabled, int b_loop, libvlc_exception_t p_e); - - void libvlc_vlm_add_vod(LibVlcInstance p_instance, String psz_name, String psz_input, int i_options, - String[] ppsz_options, int b_enabled, String psz_mux, libvlc_exception_t p_e); - - void libvlc_vlm_del_media(LibVlcInstance p_instance, String psz_name, libvlc_exception_t p_e); - - void libvlc_vlm_set_enabled(LibVlcInstance p_instance, String psz_name, int b_enabled, libvlc_exception_t p_e); - - void libvlc_vlm_set_output(LibVlcInstance p_instance, String psz_name, String psz_output, libvlc_exception_t p_e); - - void libvlc_vlm_set_input(LibVlcInstance p_instance, String psz_name, String psz_input, libvlc_exception_t p_e); - - void libvlc_vlm_add_input(LibVlcInstance p_instance, String psz_name, String psz_input, libvlc_exception_t p_e); - - void libvlc_vlm_set_loop(LibVlcInstance p_instance, String psz_name, int b_loop, libvlc_exception_t p_e); - - void libvlc_vlm_set_mux(LibVlcInstance p_instance, String psz_name, String psz_mux, libvlc_exception_t p_e); - - void libvlc_vlm_change_media(LibVlcInstance p_instance, String psz_name, String psz_input, String psz_output, - int i_options, String[] ppsz_options, int b_enabled, int b_loop, libvlc_exception_t p_e); - - void libvlc_vlm_play_media(LibVlcInstance p_instance, String psz_name, libvlc_exception_t p_e); - - void libvlc_vlm_stop_media(LibVlcInstance p_instance, String psz_name, libvlc_exception_t p_e); - - void libvlc_vlm_pause_media(LibVlcInstance p_instance, String psz_name, libvlc_exception_t p_e); - - void libvlc_vlm_seek_media(LibVlcInstance p_instance, String psz_name, float f_percentage, libvlc_exception_t p_e); - - String libvlc_vlm_show_media(LibVlcInstance p_instance, String psz_name, libvlc_exception_t p_e); - - float libvlc_vlm_get_media_instance_position(LibVlcInstance p_instance, String psz_name, int i_instance, - libvlc_exception_t p_e); - - int libvlc_vlm_get_media_instance_time(LibVlcInstance p_instance, String psz_name, int i_instance, - libvlc_exception_t p_e); - - int libvlc_vlm_get_media_instance_length(LibVlcInstance p_instance, String psz_name, int i_instance, - libvlc_exception_t p_e); - - int libvlc_vlm_get_media_instance_rate(LibVlcInstance p_instance, String psz_name, int i_instance, - libvlc_exception_t p_e); - - int libvlc_vlm_get_media_instance_title(LibVlcInstance p_instance, String psz_name, int i_instance, - libvlc_exception_t p_e); - - int libvlc_vlm_get_media_instance_chapter(LibVlcInstance p_instance, String psz_name, int i_instance, - libvlc_exception_t p_e); - - int libvlc_vlm_get_media_instance_seekable(LibVlcInstance p_instance, String psz_name, int i_instance, - libvlc_exception_t p_e); - - LibVlcEventManager libvlc_vlm_get_event_manager(LibVlcInstance p_instance, libvlc_exception_t p_exception); - -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java deleted file mode 100644 index 92f381fee5..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java +++ /dev/null @@ -1,85 +0,0 @@ - /***************************************************************************** - * LibVlcEventType.java: VLC Java Bindings event types enum - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - - -public enum LibVlcEventType { - - libvlc_MediaMetaChanged, // 0 - libvlc_MediaSubItemAdded, // 1 - libvlc_MediaDurationChanged, // 2 - libvlc_MediaPreparsedChanged, // 3 - libvlc_MediaFreed, // 4 - libvlc_MediaStateChanged, // 5 - - libvlc_MediaPlayerNothingSpecial, // 6 - libvlc_MediaPlayerOpening, // 7 - libvlc_MediaPlayerBuffering, // 8 - libvlc_MediaPlayerPlaying, // 9 - libvlc_MediaPlayerPaused, // 10 - libvlc_MediaPlayerStopped, // 11 - libvlc_MediaPlayerForward, // 12 - libvlc_MediaPlayerBackward, // 13 - libvlc_MediaPlayerEndReached, // 14 - libvlc_MediaPlayerEncounteredError, // 15 - libvlc_MediaPlayerTimeChanged, // 16 - libvlc_MediaPlayerPositionChanged, // 17 - libvlc_MediaPlayerSeekableChanged, // 18 - libvlc_MediaPlayerPausableChanged, // 19 - - libvlc_MediaListItemAdded, // 20 - libvlc_MediaListWillAddItem, // 21 - libvlc_MediaListItemDeleted, // 22 - libvlc_MediaListWillDeleteItem, // 23 - - libvlc_MediaListViewItemAdded, // 24 - libvlc_MediaListViewWillAddItem, // 25 - libvlc_MediaListViewItemDeleted, // 26 - libvlc_MediaListViewWillDeleteItem, // 27 - - libvlc_MediaListPlayerPlayed, // 28 - libvlc_MediaListPlayerNextItemSet, // 29 - libvlc_MediaListPlayerStopped, // 30 - - libvlc_MediaDiscovererStarted, // 31 - libvlc_MediaDiscovererEnded, // 32 - - libvlc_MediaPlayerTitleChanged, // 33 - libvlc_MediaPlayerSnapshotTaken, // 34 - libvlc_MediaPlayerLengthChanged, // 35 - - libvlc_VlmMediaAdded, // 36 - libvlc_VlmMediaRemoved, // 37 - libvlc_VlmMediaChanged, // 38 - libvlc_VlmMediaInstanceStarted, // 39 - libvlc_VlmMediaInstanceStopped, // 40 - libvlc_VlmMediaInstanceStatusInit, // 41 - libvlc_VlmMediaInstanceStatusOpening, // 42 - libvlc_VlmMediaInstanceStatusPlaying, // 43 - libvlc_VlmMediaInstanceStatusPause, // 44 - libvlc_VlmMediaInstanceStatusEnd, // 45 - libvlc_VlmMediaInstanceStatusError; // 46 -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java deleted file mode 100644 index d89ceb9fff..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java +++ /dev/null @@ -1,133 +0,0 @@ -/***************************************************************************** - * ${file_name}: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2007 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import java.awt.Canvas; - -import javax.swing.JFrame; -import javax.swing.JPanel; - -import org.videolan.jvlc.internal.LibVlc.LibVlcCallback; -import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager; -import org.videolan.jvlc.internal.LibVlc.LibVlcInstance; -import org.videolan.jvlc.internal.LibVlc.LibVlcMedia; -import org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer; -import org.videolan.jvlc.internal.LibVlc.libvlc_event_t; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - -import com.sun.jna.Platform; -import com.sun.jna.Pointer; - - -public class LibVlcImpl -{ - - public static boolean done; - - public static void main(String[] args) throws InterruptedException - { - LibVlc libVlc = LibVlc.SYNC_INSTANCE; - libvlc_exception_t exception = new libvlc_exception_t(); - libVlc.libvlc_exception_init(exception); - - final Object lock = new Object(); - - System.out.println("Starting vlc"); - System.out.println("version: " + libVlc.libvlc_get_version()); - System.out.println("changeset: " + libVlc.libvlc_get_changeset()); - System.out.println("compiler: " + libVlc.libvlc_get_compiler()); - - LibVlcInstance libvlc_instance_t = libVlc.libvlc_new(0, new String[] {"/usr/local/bin/vlc"}, exception); - - LibVlcMedia mediaDescriptor = libVlc - .libvlc_media_new(libvlc_instance_t, "/home/carone/apps/a.avi", exception); - - LibVlcMediaPlayer mediaPlayer = libVlc.libvlc_media_player_new_from_media(mediaDescriptor, exception); - - LibVlcEventManager mediaInstanceEventManager = libVlc.libvlc_media_player_event_manager(mediaPlayer, exception); - - LibVlcCallback played = new LibVlcCallback() - { - - public void callback(libvlc_event_t libvlc_event_t, Pointer pointer) - { - System.out.println("Playing started."); - } - }; - - LibVlcCallback endReached = new LibVlcCallback() - { - - public void callback(libvlc_event_t libvlc_event_t, Pointer pointer) - { - synchronized (lock) - { - System.out.println("Playing finished."); - LibVlcImpl.done = true; - } - } - }; - - libVlc.libvlc_event_attach( - mediaInstanceEventManager, - LibVlcEventType.libvlc_MediaPlayerPlaying.ordinal(), - played, - null, - exception); - - libVlc.libvlc_event_attach( - mediaInstanceEventManager, - LibVlcEventType.libvlc_MediaPlayerEndReached.ordinal(), - endReached, - null, - exception); - - JFrame frame = new JFrame("title"); - frame.setVisible(true); - frame.setLocation(100, 100); - frame.setSize(500, 500); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - - JPanel panel = new JPanel(); - Canvas canvas = new Canvas(); - canvas.setSize(500, 500); - panel.add(canvas); - frame.getContentPane().add(panel); - frame.pack(); - - int drawable = (int) com.sun.jna.Native.getComponentID(canvas); - - if (Platform.isWindows()) - { - libVlc.libvlc_media_player_set_hwnd(mediaPlayer, drawable, exception); - } - else - { - libVlc.libvlc_media_player_set_xwindow(mediaPlayer, drawable, exception); - } - libVlc.libvlc_media_player_play(mediaPlayer, exception); - } -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcState.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcState.java deleted file mode 100644 index 3bcfdc3c90..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcState.java +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - * LibVlcState.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - - -public enum LibVlcState -{ - libvlc_NothingSpecial, // 0 - libvlc_Opening, // 1 - libvlc_Buffering, // 2 - libvlc_Playing, // 3 - libvlc_Paused, // 4 - libvlc_Stopped, // 5 - libvlc_Ended, // 6 - libvlc_Error; // 7 -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/MediaOption.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/MediaOption.java deleted file mode 100644 index 2fc7b41724..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/MediaOption.java +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************** - * VLC Java Bindings JNA Glue - ***************************************************************************** - * Copyright (C) 1998-2009 the VideoLAN team - * - * Authors: Filippo Carone - * VLC bindings generator - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - - -public enum MediaOption -{ - - libvlc_media_option_trusted, // 0x2, - libvlc_media_option_unique, // 0x100, -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/Meta.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/Meta.java deleted file mode 100644 index 72626a2b56..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/Meta.java +++ /dev/null @@ -1,50 +0,0 @@ -/***************************************************************************** - * VLC Java Bindings JNA Glue - ***************************************************************************** - * Copyright (C) 1998-2009 the VideoLAN team - * - * Authors: Filippo Carone - * VLC bindings generator - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - - -public enum Meta -{ - - libvlc_meta_Title, // 0, - libvlc_meta_Artist, // 1, - libvlc_meta_Genre, // 2, - libvlc_meta_Copyright, // 3, - libvlc_meta_Album, // 4, - libvlc_meta_TrackNumber, // 5, - libvlc_meta_Description, // 6, - libvlc_meta_Rating, // 7, - libvlc_meta_Date, // 8, - libvlc_meta_Setting, // 9, - libvlc_meta_URL, // 10, - libvlc_meta_Language, // 11, - libvlc_meta_NowPlaying, // 12, - libvlc_meta_Publisher, // 13, - libvlc_meta_EncodedBy, // 14, - libvlc_meta_ArtworkURL, // 15, - libvlc_meta_TrackID, // 16, -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/PlaybackMode.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/PlaybackMode.java deleted file mode 100644 index deda6073d6..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/PlaybackMode.java +++ /dev/null @@ -1,36 +0,0 @@ -/***************************************************************************** - * VLC Java Bindings JNA Glue - ***************************************************************************** - * Copyright (C) 1998-2009 the VideoLAN team - * - * Authors: Filippo Carone - * VLC bindings generator - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - - -public enum PlaybackMode -{ - - libvlc_playback_mode_default, // 0, - libvlc_playback_mode_loop, // 1, - libvlc_playback_mode_repeat, // 2, -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/VideoMarqueeIntOption.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/VideoMarqueeIntOption.java deleted file mode 100644 index 3952c4c3a2..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/VideoMarqueeIntOption.java +++ /dev/null @@ -1,42 +0,0 @@ -/***************************************************************************** - * VLC Java Bindings JNA Glue - ***************************************************************************** - * Copyright (C) 1998-2009 the VideoLAN team - * - * Authors: Filippo Carone - * VLC bindings generator - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - - -public enum VideoMarqueeIntOption -{ - - libvlc_marquee_Enabled, // 0, - libvlc_marquee_Color, // 1, - libvlc_marquee_Opacity, // 2, - libvlc_marquee_Position, // 3, - libvlc_marquee_Refresh, // 4, - libvlc_marquee_Size, // 5, - libvlc_marquee_Timeout, // 6, - libvlc_marquee_X, // 7, - libvlc_marquee_Y, // 8, -} diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/VideoMarqueeStringOption.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/VideoMarqueeStringOption.java deleted file mode 100644 index cac733a3e7..0000000000 --- a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/VideoMarqueeStringOption.java +++ /dev/null @@ -1,34 +0,0 @@ -/***************************************************************************** - * VLC Java Bindings JNA Glue - ***************************************************************************** - * Copyright (C) 1998-2009 the VideoLAN team - * - * Authors: Filippo Carone - * VLC bindings generator - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - - -public enum VideoMarqueeStringOption -{ - - libvlc_marquee_Text, // 0, -} diff --git a/bindings/java/core/src/main/resources/.gitignore b/bindings/java/core/src/main/resources/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/AbstractJVLCTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/AbstractJVLCTest.java deleted file mode 100644 index 077fe9caf5..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/AbstractJVLCTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/***************************************************************************** - * AbstractJVLCTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import java.io.BufferedOutputStream; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URL; -import java.net.URLConnection; - -import org.apache.commons.io.IOUtils; -import org.junit.After; -import org.junit.Before; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.videolan.jvlc.internal.AbstractVLCInternalTest; - - -public abstract class AbstractJVLCTest -{ - - protected JVLC jvlc; - - protected String mrl; - - private String address = "http://streams.videolan.org/streams-videolan/avi/Hero-Div3.avi"; - - /** - * Logger. - */ - private Logger log = LoggerFactory.getLogger(AbstractVLCInternalTest.class); - - @Before - public void testSetup() - { - jvlc = new JVLC("-vvv --ignore-config --no-media-library -I dummy -A dummy -V dummy --rtsp-host 127.0.0.1:5554"); - jvlc.setLogVerbosity(LoggerVerbosityLevel.DEBUG); - downloadSample(); - } - - @After - public void tearDown() - { - jvlc.release(); - } - - private void downloadSample() - { - OutputStream out = null; - URLConnection conn = null; - InputStream in = null; - URL sampleResource = this.getClass().getResource("/sample.avi"); - if (sampleResource != null) - { - log.debug("Sample file already downloaded"); - mrl = sampleResource.getPath(); - return; - } - try - { - log.info("Downloading sample: {}", address); - String testResoucesPath = this.getClass().getResource("/sample").getPath(); - URL url = new URL(address); - out = new BufferedOutputStream(new FileOutputStream(testResoucesPath + ".avi")); - conn = url.openConnection(); - in = conn.getInputStream(); - byte[] buffer = new byte[1024]; - int numRead; - long numWritten = 0; - while ((numRead = in.read(buffer)) != -1) - { - out.write(buffer, 0, numRead); - numWritten += numRead; - } - log.info("Sample downloaded."); - mrl = testResoucesPath + ".avi"; - } - catch (Exception e) - { - log.error("{}", e); - } - finally - { - IOUtils.closeQuietly(in); - IOUtils.closeQuietly(out); - } - } - -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/JVLCTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/JVLCTest.java deleted file mode 100644 index 0d8f1ed150..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/JVLCTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/***************************************************************************** - * JVLCTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import junit.framework.Assert; - -import org.junit.Test; - - -public class JVLCTest extends AbstractJVLCTest -{ - - String mrl = getClass().getResource("/raffa_voice.ogg").getFile(); - - @Test - public void jvlcNew() - { - JVLC jvlc = new JVLC(); - Assert.assertNotNull(jvlc.getAudio()); - } - - @Test - public void jvlcPlay() - { - MediaPlayer instance = jvlc.play(mrl); - Assert.assertNotNull(instance); - } - - @Test - public void jvlcRelease() - { - JVLC jvlc = new JVLC(); - jvlc.release(); - } - - @Test - public void jvlcMultipleInstances() - { - JVLC[] jvlcInstancesArray = new JVLC[10]; - - for (int i = 0; i < jvlcInstancesArray.length; i++) - { - jvlcInstancesArray[i] = new JVLC(); - } - for (int i = 0; i < jvlcInstancesArray.length; i++) - { - jvlcInstancesArray[i].release(); - } - - } - - @Test - public void twoAudioInstancesTest() throws Exception - { - JVLC instance1 = new JVLC(); - JVLC instance2 = new JVLC(); - - instance1.play(mrl); - instance2.play(mrl); - - Thread.sleep(1000); - - instance1.getAudio().setMute(true); - Assert.assertNotNull(instance2.getAudio()); - Assert.assertTrue(instance1.getAudio().getMute()); - Assert.assertTrue(!instance2.getAudio().getMute()); - - } -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/LoggerTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/LoggerTest.java deleted file mode 100644 index c96165c728..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/LoggerTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/***************************************************************************** - * LoggerTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import java.util.Iterator; - -import junit.framework.Assert; - -import org.junit.Test; - -public class LoggerTest extends AbstractJVLCTest -{ - - @Test - public void testLogDebug() - { - jvlc.setLogVerbosity(LoggerVerbosityLevel.DEBUG); - Logger logger = jvlc.getLogger(); - jvlc.play(mrl); - Assert.assertTrue(logger.count() > 0); - logger.close(); - } - - /** - * Timeout added because of a poor spinlock usage in the native side. - */ - // @Test(timeout = 5000L) - public void testLogError() - { - jvlc.setLogVerbosity(LoggerVerbosityLevel.DEBUG); - Logger logger = jvlc.getLogger(); - logger.clear(); - Assert.assertEquals(0, logger.count()); - - jvlc.play(mrl); - - Iterator loggerIterator = logger.iterator(); - while (loggerIterator.hasNext()) - { - LoggerMessage message = loggerIterator.next(); - Assert.assertNotNull(message.getMessage()); - } - logger.close(); - } - -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/MediaDescriptorTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/MediaDescriptorTest.java deleted file mode 100644 index a8d0b59ca5..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/MediaDescriptorTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/***************************************************************************** - * MediaDescriptorTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import org.junit.Assert; -import org.junit.Test; - - -public class MediaDescriptorTest extends AbstractJVLCTest -{ - - @Test - public void getMrlTest() - { - MediaDescriptor md = new MediaDescriptor(jvlc, mrl); - Assert.assertEquals(mrl, md.getMrl()); - } - - @Test - public void getMediaPlayer() - { - MediaDescriptor md = new MediaDescriptor(jvlc, mrl); - MediaPlayer mp = md.getMediaPlayer(); - Assert.assertNotNull(mp); - MediaPlayer mp2 = md.getMediaPlayer(); - Assert.assertSame(mp, mp2); - } - -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/MediaListTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/MediaListTest.java deleted file mode 100644 index 3bc24ecbaf..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/MediaListTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/***************************************************************************** - * MediaListTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import org.junit.Assert; -import org.junit.Test; - - -public class MediaListTest extends AbstractJVLCTest -{ - - @Test - public void mediaListAddMedia() - { - MediaList mlist = new MediaList(jvlc); - mlist.addMedia(mrl); - Assert.assertEquals(1, mlist.size()); - } - - @Test - public void mediaListAddMedia2() - { - MediaList mlist = new MediaList(jvlc); - mlist.addMedia(mrl); - Assert.assertEquals(1, mlist.size()); - mlist.addMedia(mrl); - Assert.assertEquals(1, mlist.size()); - mlist.addMedia(new MediaDescriptor(jvlc, mrl)); - Assert.assertEquals(1, mlist.size()); - mlist.addMedia("non-existing"); - Assert.assertEquals(2, mlist.size()); - } - - @Test - public void mediaListRemoveMedia() - { - MediaList mlist = new MediaList(jvlc); - mlist.addMedia(mrl); - Assert.assertEquals(1, mlist.size()); - mlist.removeMedia(0); - Assert.assertEquals(0, mlist.size()); - } - - @Test - public void mediaListRemoveMedia2() - { - MediaList mlist = new MediaList(jvlc); - mlist.addMedia(mrl); - Assert.assertEquals(1, mlist.size()); - mlist.removeMedia(0); - Assert.assertEquals(0, mlist.size()); - - mlist.addMedia(mrl); - mlist.removeMedia(0); - Assert.assertEquals(0, mlist.size()); - - mlist.addMedia(new MediaDescriptor(jvlc, mrl)); - mlist.removeMedia(0); - Assert.assertEquals(0, mlist.size()); - - mlist.addMedia(new MediaDescriptor(jvlc, mrl)); - mlist.removeMedia(mrl); - Assert.assertEquals(0, mlist.size()); - - mlist.addMedia(new MediaDescriptor(jvlc, mrl)); - mlist.removeMedia(new MediaDescriptor(jvlc, mrl)); - Assert.assertEquals(0, mlist.size()); - } - - @Test - public void mediaListRemoveNonExistingMedia() - { - MediaList mlist = new MediaList(jvlc); - boolean result = mlist.removeMedia(3); - Assert.assertFalse(result); - } - - @Test - public void mediaListIndexOfNonExistingMediaDescriptor() - { - MediaList mlist = new MediaList(jvlc); - MediaDescriptor md = new MediaDescriptor(jvlc, "dummy"); - int result = mlist.indexOf(md); - Assert.assertEquals(-1, result); - } - - @Test(expected = IndexOutOfBoundsException.class) - public void mediaListGetMediaDesciptorAtInvalidIndex() - { - MediaList mlist = new MediaList(jvlc); - mlist.getMediaDescriptorAtIndex(5); - } - - @Test(expected = IndexOutOfBoundsException.class) - public void mediaListGetMediaDesciptorAtInvalidIndex2() - { - MediaList mlist = new MediaList(jvlc); - mlist.getMediaDescriptorAtIndex(-5); - } - - @Test(expected = IndexOutOfBoundsException.class) - public void mediaListGetMediaDesciptorAtInvalidIndex3() - { - MediaList mlist = new MediaList(jvlc); - mlist.getMediaDescriptorAtIndex(0); - } -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/VLMTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/VLMTest.java deleted file mode 100644 index feb2e05e40..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/VLMTest.java +++ /dev/null @@ -1,213 +0,0 @@ -/***************************************************************************** - * VLMTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc; - -import junit.framework.Assert; - -import org.junit.Test; - - -public class VLMTest extends AbstractJVLCTest -{ - private String mediaName = "test"; - - @Test - public void testVLMInit() - { - VLM vlm = jvlc.getVLM(); - Assert.assertNotNull(vlm); - } - - //@Test - public void testAddBroadcast() - { - VLM vlm = jvlc.getVLM(); - vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false); - } - - //@Test(timeout = 2000L) - public void testAddVod() - { - VLM vlm = jvlc.getVLM(); - vlm.addVod(mediaName, "file://" + mrl, null, true, null); - } - - //@Test - public void testShowBroadcastMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false); - vlm.showMedia(mediaName); - } - - //@Test - public void testShowVodMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addVod(mediaName, "file://" + mrl, null, true, null); - vlm.showMedia(mediaName); - } - - //@Test - public void testDisableBroadcastMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false); - vlm.disableMedia(mediaName); - } - - //@Test - public void testDisableVodMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addVod(mediaName, "file://" + mrl, null, true, null); - vlm.disableMedia(mediaName); - } - - //@Test - public void testPauseBroadcastMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false); - vlm.playMedia(mediaName); - vlm.pauseMedia(mediaName); - vlm.stopMedia(mediaName); - } - - //@Test - public void testPauseVodMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addVod(mediaName, "file://" + mrl, null, true, null); - vlm.playMedia(mediaName); - vlm.pauseMedia(mediaName); - vlm.stopMedia(mediaName); - } - - - //@Test - public void testStopBroadcastMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false); - vlm.playMedia(mediaName); - vlm.stopMedia(mediaName); - } - - //@Test - public void testStopVodMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addVod(mediaName, "file://" + mrl, null, true, null); - vlm.playMedia(mediaName); - vlm.stopMedia(mediaName); - } - - //@Test - public void testSeekBroadcastMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false); - vlm.playMedia(mediaName); - vlm.seekMedia(mediaName, 0.3f); - vlm.stopMedia(mediaName); - } - - //@Test - public void testSeekVodMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addVod(mediaName, "file://" + mrl, null, true, null); - vlm.playMedia(mediaName); - vlm.seekMedia(mediaName, 0.3f); - vlm.stopMedia(mediaName); - } - - //@Test - public void testAddMediaInputToBroadcast() - { - VLM vlm = jvlc.getVLM(); - vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false); - vlm.addMediaInput(mediaName, "file://" + mrl); - } - - //@Test - public void testAddMediaInputToVod() - { - VLM vlm = jvlc.getVLM(); - vlm.addVod(mediaName, "file://" + mrl, null, true, null); - vlm.addMediaInput(mediaName, "file://" + mrl); - } - - //@Test - public void testEnableBroadcastMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addBroadcast(mediaName, "file://" + mrl, "", null, false, false); - vlm.enableMedia(mediaName); - } - - //@Test - public void testEnableVodMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addVod(mediaName, "file://" + mrl, null, true, null); - vlm.enableMedia(mediaName); - } - - //@Test - public void testDeleteBroadcastMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addBroadcast(mediaName, "file://" + mrl, "", null, false, false); - vlm.deleteMedia(mediaName); - } - - //@Test - public void testDeleteVodMedia() - { - VLM vlm = jvlc.getVLM(); - vlm.addVod(mediaName, "file://" + mrl, null, true, null); - vlm.deleteMedia(mediaName); - } - - //@Test - public void testMediaLoop() - { - VLM vlm = jvlc.getVLM(); - vlm.addBroadcast(mediaName, "file://" + mrl, "", null, false, false); - vlm.setMediaLoop(mediaName, true); - } - - //@Test - public void testSetMux() - { - VLM vlm = jvlc.getVLM(); - vlm.addVod(mediaName, "file://" + mrl, null, true, null); - vlm.setMux(mediaName, "ts"); - } - -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/AbstractVLCEventTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/AbstractVLCEventTest.java deleted file mode 100644 index 0a25af7f70..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/AbstractVLCEventTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/***************************************************************************** - * AbstractVLCEventTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import org.junit.After; - - -public abstract class AbstractVLCEventTest extends AbstractVLCInternalTest -{ - protected int eventFired; - - @After - public void cleanupFired() - { - eventFired = 0; - } - -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/AbstractVLCInternalTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/AbstractVLCInternalTest.java deleted file mode 100644 index 6b033ef595..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/AbstractVLCInternalTest.java +++ /dev/null @@ -1,143 +0,0 @@ -/***************************************************************************** - * VLMInternalTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import java.io.BufferedOutputStream; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URL; -import java.net.URLConnection; - -import junit.framework.Assert; - -import org.apache.commons.io.IOUtils; -import org.junit.After; -import org.junit.Before; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.videolan.jvlc.internal.LibVlc.LibVlcInstance; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - - -public abstract class AbstractVLCInternalTest -{ - - protected LibVlc libvlc = LibVlc.SYNC_INSTANCE; - - protected LibVlcInstance libvlcInstance; - - protected String mrl; - - protected libvlc_exception_t exception; - - private String address = "http://streams.videolan.org/streams-videolan/avi/Hero-Div3.avi"; - - /** - * Logger. - */ - private Logger log = LoggerFactory.getLogger(AbstractVLCInternalTest.class); - - @Before - public void testSetup() - { - exception = new libvlc_exception_t(); - String[] args = new String[]{ - "-vvv", - "--ignore-config", - "--reset-plugins-cache", - "--no-media-library", - "-I", - "dummy", - "-A", - "dummy", - "-V", - "dummy" }; - libvlcInstance = libvlc.libvlc_new(args.length, args, exception); - libvlc.libvlc_exception_clear(exception); - - downloadSample(); - } - - @After - public void tearDown() - { - libvlc.libvlc_release(libvlcInstance); - libvlc.libvlc_exception_clear(exception); - } - - protected void catchException(libvlc_exception_t exception) - { - Assert.assertEquals(libvlc.libvlc_errmsg(), 0, libvlc.libvlc_exception_raised(exception)); - } - - private void downloadSample() - { - OutputStream out = null; - URLConnection conn = null; - InputStream in = null; - URL sampleResource = this.getClass().getResource("/sample.avi"); - if (sampleResource != null) - { - log.debug("Sample file already downloaded"); - mrl = sampleResource.getPath(); - return; - } - try - { - log.info("Downloading sample: {}", address); - String testResoucesPath = this.getClass().getResource("/sample").getPath(); - URL url = new URL(address); - out = new BufferedOutputStream(new FileOutputStream(testResoucesPath + ".avi")); - conn = url.openConnection(); - in = conn.getInputStream(); - byte[] buffer = new byte[1024]; - int numRead; - long numWritten = 0; - while ((numRead = in.read(buffer)) != -1) - { - out.write(buffer, 0, numRead); - numWritten += numRead; - } - if (numWritten == 0) - { - throw new RuntimeException("Cannot download sample, please check the url or your internet connection."); - } - log.info("Sample downloaded."); - mrl = testResoucesPath + ".avi"; - } - catch (Exception e) - { - log.error("{}", e); - } - finally - { - IOUtils.closeQuietly(in); - IOUtils.closeQuietly(out); - } - } - -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java deleted file mode 100644 index 8796647bc8..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/***************************************************************************** - * LibVlcCoreTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import org.junit.Assert; -import org.junit.Test; -import org.videolan.jvlc.internal.LibVlc.LibVlcInstance; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - - -public class LibVlcCoreTest -{ - - private LibVlc instance = LibVlc.SYNC_INSTANCE; - - @Test - public void testNew() throws Exception - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcInstance libvlcInstance = instance.libvlc_new(0, new String[] {"-I","dummy","--aout=dummy","--vout=dummy"}, exception); - Assert.assertNotNull(libvlcInstance); - Assert.assertEquals(0, exception.b_raised); - } - - @Test - public void testRelease() throws Exception - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcInstance libvlcInstance = instance.libvlc_new(0, new String[] {}, exception); - instance.libvlc_release(libvlcInstance); - } - - @Test - public void testAddIntf() throws Exception - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcInstance libvlcInstance = instance.libvlc_new(0, new String[] {}, exception); - instance.libvlc_add_intf(libvlcInstance, "dummy", exception); - Assert.assertEquals(0, exception.b_raised); - instance.libvlc_release(libvlcInstance); - } - -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcLogTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcLogTest.java deleted file mode 100644 index b136b0ca64..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcLogTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/***************************************************************************** - * LibVlcLogTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import org.junit.Assert; -import org.junit.Test; -import org.videolan.jvlc.internal.LibVlc.LibVlcLog; -import org.videolan.jvlc.internal.LibVlc.LibVlcLogIterator; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - - -public class LibVlcLogTest extends AbstractVLCInternalTest -{ - - @Test - public void testLogOpen() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcLog libvlcLog = libvlc.libvlc_log_open(libvlcInstance, exception); - Assert.assertNotNull(libvlcLog); - } - - @Test - public void testLogClose() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcLog libvlcLog = libvlc.libvlc_log_open(libvlcInstance, exception); - libvlc.libvlc_log_close(libvlcLog); - Assert.assertEquals(0, exception.b_raised); - } - - //@Test - public void testLogClear() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcLog libvlcLog = libvlc.libvlc_log_open(libvlcInstance, exception); - libvlc.libvlc_log_clear(libvlcLog); - Assert.assertEquals(0, libvlc.libvlc_log_count(libvlcLog)); - } - - //@Test - public void testLogGetIterator() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcLog libvlcLog = libvlc.libvlc_log_open(libvlcInstance, exception); - libvlc.libvlc_log_clear(libvlcLog); - Assert.assertEquals(0, exception.b_raised); - Assert.assertEquals(0, libvlc.libvlc_log_count(libvlcLog)); - LibVlcLogIterator logIterator = libvlc.libvlc_log_get_iterator(libvlcLog, exception); - Assert.assertNotNull(logIterator); - } -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaEventsTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaEventsTest.java deleted file mode 100644 index 1fb78f6701..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaEventsTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************** - * LibVlcMediaEventsTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import junit.framework.Assert; - -import org.junit.Test; -import org.videolan.jvlc.internal.LibVlc.LibVlcCallback; -import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager; -import org.videolan.jvlc.internal.LibVlc.LibVlcMedia; -import org.videolan.jvlc.internal.LibVlc.libvlc_event_t; - -import com.sun.jna.Pointer; - - -public class LibVlcMediaEventsTest extends AbstractVLCEventTest -{ - - @Test - public void mediaFreedTest() - { - LibVlcMedia media = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcEventManager eventManager = libvlc.libvlc_media_event_manager(media, exception); - LibVlcCallback callback = new LibVlc.LibVlcCallback() - { - - public void callback(libvlc_event_t libvlc_event, Pointer userData) - { - Assert.assertEquals(LibVlcEventType.libvlc_MediaFreed.ordinal(), libvlc_event.type); - eventFired = 1; - } - - }; - libvlc.libvlc_event_attach(eventManager, LibVlcEventType.libvlc_MediaFreed.ordinal(), callback, null, exception); - libvlc.libvlc_media_release(media); - Assert.assertEquals(1, eventFired); - } -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListEventsTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListEventsTest.java deleted file mode 100644 index 7339cfb5d5..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListEventsTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/***************************************************************************** - * LibVlcMediaListEventsTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import junit.framework.Assert; - -import org.junit.Test; -import org.videolan.jvlc.internal.LibVlc.LibVlcCallback; -import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager; -import org.videolan.jvlc.internal.LibVlc.LibVlcMedia; -import org.videolan.jvlc.internal.LibVlc.LibVlcMediaList; -import org.videolan.jvlc.internal.LibVlc.libvlc_event_t; - -import com.sun.jna.Pointer; - - -public class LibVlcMediaListEventsTest extends AbstractVLCEventTest -{ - - @Test - public void itemAddedTest() - { - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - LibVlcMedia media = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - - LibVlcEventManager eventManager = libvlc.libvlc_media_list_event_manager(mediaList, exception); - LibVlcCallback callback = new LibVlc.LibVlcCallback() - { - - public void callback(libvlc_event_t libvlc_event, Pointer userData) - { - Assert.assertEquals(LibVlcEventType.libvlc_MediaListItemAdded.ordinal(), libvlc_event.type); - eventFired = 1; - } - }; - - libvlc.libvlc_event_attach( - eventManager, - LibVlcEventType.libvlc_MediaListItemAdded.ordinal(), - callback, - null, - exception); - - libvlc.libvlc_media_list_add_media(mediaList, media, exception); - Assert.assertEquals(1, eventFired); - } - - @Test - public void itemDeletedTest() - { - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - LibVlcMedia media = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - - LibVlcEventManager eventManager = libvlc.libvlc_media_list_event_manager(mediaList, exception); - LibVlcCallback callback = new LibVlc.LibVlcCallback() - { - - public void callback(libvlc_event_t libvlc_event, Pointer userData) - { - Assert.assertEquals(LibVlcEventType.libvlc_MediaListItemDeleted.ordinal(), libvlc_event.type); - eventFired = 1; - } - }; - - libvlc.libvlc_event_attach( - eventManager, - LibVlcEventType.libvlc_MediaListItemDeleted.ordinal(), - callback, - null, - exception); - - libvlc.libvlc_media_list_add_media(mediaList, media, exception); - libvlc.libvlc_media_list_remove_index(mediaList, 0, exception); - Assert.assertEquals(1, eventFired); - } - -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListPlayerTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListPlayerTest.java deleted file mode 100644 index 41ea8c0f2f..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListPlayerTest.java +++ /dev/null @@ -1,332 +0,0 @@ -/***************************************************************************** - * MediaListPlayerTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import junit.framework.Assert; - -import org.junit.After; -import org.junit.Test; -import org.videolan.jvlc.internal.LibVlc.LibVlcMedia; -import org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer; -import org.videolan.jvlc.internal.LibVlc.LibVlcMediaList; -import org.videolan.jvlc.internal.LibVlc.LibVlcMediaListPlayer; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - - -public class LibVlcMediaListPlayerTest extends AbstractVLCInternalTest -{ - - private LibVlcMediaListPlayer current; - - @Test - public void mediaListPlayerNewTest() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - Assert.assertNotNull(mediaListPlayer); - Assert.assertEquals(0, exception.b_raised); - libvlc.libvlc_media_list_player_release(mediaListPlayer); - } - - @Test - public void mediaListPlayerSetMediaListTest() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception); - Assert.assertEquals(0, exception.b_raised); - libvlc.libvlc_media_list_release(mediaList); - libvlc.libvlc_media_list_player_release(mediaListPlayer); - } - - @Test - public void mediaListPlayerSetMediaListTest2() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - LibVlcMedia mediaDescriptor = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - libvlc.libvlc_media_list_add_media(mediaList, mediaDescriptor, exception); - libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception); - Assert.assertEquals(0, exception.b_raised); - libvlc.libvlc_media_list_release(mediaList); - libvlc.libvlc_media_list_player_release(mediaListPlayer); - } - - @Test - public void mediaListPlayerIsNotPlayingTest() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - int result = libvlc.libvlc_media_list_player_is_playing(mediaListPlayer, exception); - Assert.assertEquals(0, result); - Assert.assertEquals(0, exception.b_raised); - libvlc.libvlc_media_list_player_release(mediaListPlayer); - } - - @Test - public void mediaListPlayerPlayNoItemTest() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - libvlc.libvlc_media_list_player_play(mediaListPlayer, exception); - Assert.assertEquals(1, exception.b_raised); - libvlc.libvlc_media_list_player_release(mediaListPlayer); - } - - @Test - public void mediaListPlayerPlay() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - current = mediaListPlayer; - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - LibVlcMedia mediaDescriptor = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - libvlc.libvlc_media_list_add_media(mediaList, mediaDescriptor, exception); - libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception); - libvlc.libvlc_media_list_player_play(mediaListPlayer, exception); - Assert.assertEquals(0, exception.b_raised); - libvlc.libvlc_media_release(mediaDescriptor); - libvlc.libvlc_media_list_release(mediaList); - } - - @Test - public void mediaListPlayerPlayItemAtIndex() throws Exception - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - LibVlcMedia mediaDescriptor = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - libvlc.libvlc_media_list_add_media(mediaList, mediaDescriptor, exception); - libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception); - libvlc.libvlc_media_list_player_play_item_at_index(mediaListPlayer, 0, exception); - while (true) - { - int playing = libvlc.libvlc_media_list_player_is_playing(mediaListPlayer, exception); - if (exception.b_raised == 1) - { - throw new RuntimeException("Native exception thrown"); - } - if (playing == 1) - { - break; - } - Thread.sleep(150); - } - libvlc.libvlc_media_list_player_stop(mediaListPlayer, exception); - while (libvlc.libvlc_media_list_player_get_state(mediaListPlayer, exception) != LibVlcState.libvlc_Ended - .ordinal()) - { - Thread.sleep(100); - } - libvlc.libvlc_media_release(mediaDescriptor); - libvlc.libvlc_media_list_release(mediaList); - libvlc.libvlc_media_list_player_release(mediaListPlayer); - } - - @Test - public void mediaListPlayerPlayItem() throws Exception - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - LibVlcMedia mediaDescriptor = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - libvlc.libvlc_media_list_add_media(mediaList, mediaDescriptor, exception); - libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception); - libvlc.libvlc_media_list_player_play_item(mediaListPlayer, mediaDescriptor, exception); - Assert.assertEquals(0, exception.b_raised); - while (true) - { - int playing = libvlc.libvlc_media_list_player_is_playing(mediaListPlayer, exception); - if (exception.b_raised == 1) - { - throw new RuntimeException("Native exception thrown"); - } - if (playing == 1) - { - break; - } - Thread.sleep(150); - } - Thread.sleep(400); - libvlc.libvlc_media_list_player_stop(mediaListPlayer, exception); - libvlc.libvlc_media_list_release(mediaList); - libvlc.libvlc_media_list_player_release(mediaListPlayer); - } - - @Test - public void mediaListPlayerGetStateEnded() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - int state = libvlc.libvlc_media_list_player_get_state(mediaListPlayer, exception); - Assert.assertEquals(LibVlcState.libvlc_Ended.ordinal(), state); - libvlc.libvlc_media_list_player_release(mediaListPlayer); - } - - @Test - public void mediaLtistPlayerPause() throws Exception - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - LibVlcMedia mediaDescriptor = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - libvlc.libvlc_media_list_add_media(mediaList, mediaDescriptor, exception); - libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception); - libvlc.libvlc_media_list_player_play_item(mediaListPlayer, mediaDescriptor, exception); - while (true) - { - int playing = libvlc.libvlc_media_list_player_is_playing(mediaListPlayer, exception); - if (exception.b_raised == 1) - { - throw new RuntimeException("Native exception thrown"); - } - if (playing == 1) - { - break; - } - Thread.sleep(150); - } - libvlc.libvlc_media_list_player_pause(mediaListPlayer, exception); - - Thread.sleep(500); - - int state = libvlc.libvlc_media_list_player_get_state(mediaListPlayer, exception); - Assert.assertEquals(0, exception.b_raised); - Thread.sleep(200L); - Assert.assertEquals( - "Expected state: " + LibVlcState.libvlc_Paused + ".\n", - LibVlcState.libvlc_Paused.ordinal(), - state); - libvlc.libvlc_media_list_player_stop(mediaListPlayer, exception); - libvlc.libvlc_media_list_release(mediaList); - libvlc.libvlc_media_list_player_release(mediaListPlayer); - } - - @Test - public void mediaListPlayerSetMediaInstance() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception); - libvlc.libvlc_media_list_player_set_media_player(mediaListPlayer, mi, exception); - Assert.assertEquals(0, exception.b_raised); - } - - @Test - public void mediaListPlayerNextNoItems() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - libvlc.libvlc_media_list_player_next(mediaListPlayer, exception); - Assert.assertEquals(1, exception.b_raised); - } - - /** - * fails, see https://trac.videolan.org/vlc/ticket/1535 - */ - // @Test - public void mediaListPlayerNext() throws Exception - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - LibVlcMedia mediaDescriptor = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - libvlc.libvlc_media_list_add_media(mediaList, mediaDescriptor, exception); - libvlc.libvlc_media_list_add_media(mediaList, mediaDescriptor, exception); - libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception); - libvlc.libvlc_media_list_player_play_item_at_index(mediaListPlayer, 0, exception); - Thread.sleep(150); - libvlc.libvlc_media_list_player_next(mediaListPlayer, exception); - Assert.assertEquals(0, exception.b_raised); - libvlc.libvlc_media_list_release(mediaList); - } - - @Test - public void mediaListPlayerIsPlaying() throws Exception - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - LibVlcMedia mediaDescriptor = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - libvlc.libvlc_media_list_add_media(mediaList, mediaDescriptor, exception); - libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception); - libvlc.libvlc_media_list_player_play_item(mediaListPlayer, mediaDescriptor, exception); - - while (true) - { - int playing = libvlc.libvlc_media_list_player_get_state(mediaListPlayer, exception); - Assert.assertEquals(0, exception.b_raised); - if (playing == LibVlcState.libvlc_Playing.ordinal()) - { - break; - } - Thread.sleep(150); - } - - libvlc.libvlc_media_list_player_stop(mediaListPlayer, exception); - while (true) - { - int playing = libvlc.libvlc_media_list_player_is_playing(mediaListPlayer, exception); - Assert.assertEquals(0, exception.b_raised); - if (playing == 0) - { - break; - } - Thread.sleep(150); - } - Assert.assertEquals(LibVlcState.libvlc_Ended.ordinal(), libvlc.libvlc_media_list_player_get_state( - mediaListPlayer, - exception)); - libvlc.libvlc_media_list_release(mediaList); - } - - @Override - @After - public void tearDown() - { - if (current != null) - { - libvlc.libvlc_media_list_player_stop(current, exception); - while (libvlc.libvlc_media_list_player_get_state(current, exception) != LibVlcState.libvlc_Ended.ordinal()) - { - try - { - Thread.sleep(100); - } - catch (InterruptedException e) - { - // - } - } - } - current = null; - super.tearDown(); - } - -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListTest.java deleted file mode 100644 index 8b2aa83860..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaListTest.java +++ /dev/null @@ -1,145 +0,0 @@ -/***************************************************************************** - * LibVlcMediaListTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import junit.framework.Assert; - -import org.junit.Test; -import org.videolan.jvlc.internal.LibVlc.LibVlcMedia; -import org.videolan.jvlc.internal.LibVlc.LibVlcMediaList; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - - -public class LibVlcMediaListTest extends AbstractVLCInternalTest -{ - - @Test - public void mediaListNew() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - Assert.assertNotNull(mediaList); - Assert.assertEquals(0, exception.b_raised); - } - - @Test - public void mediaListAddMediaDescriptor() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - String mrl = this.getClass().getResource("/raffa_voice.ogg").getPath(); - LibVlcMedia libvlc_media = libvlc.libvlc_media_new( - libvlcInstance, - mrl, - exception); - libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception); - Assert.assertEquals(0, exception.b_raised); - } - - @Test - public void mediaListCountTest() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - String mrl = this.getClass().getResource("/raffa_voice.ogg").getPath(); - LibVlcMedia libvlc_media = libvlc.libvlc_media_new( - libvlcInstance, - mrl, - exception); - libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception); - int result = libvlc.libvlc_media_list_count(mediaList, exception); - Assert.assertEquals(1, result); - Assert.assertEquals(0, exception.b_raised); - - libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception); - result = libvlc.libvlc_media_list_count(mediaList, exception); - Assert.assertEquals(2, result); - Assert.assertEquals(0, exception.b_raised); - } - - @Test - public void mediaListEventManagerTest() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - Assert.assertNotNull(libvlc.libvlc_media_list_event_manager(mediaList, exception)); - Assert.assertEquals(0, exception.b_raised); - } - - @Test - public void mediaListIndexOfItemTest() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - String mrl = this.getClass().getResource("/raffa_voice.ogg").getPath(); - LibVlcMedia libvlc_media = libvlc.libvlc_media_new( - libvlcInstance, - mrl, - exception); - libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception); - int index = libvlc.libvlc_media_list_index_of_item(mediaList, libvlc_media, exception); - Assert.assertEquals(0, index); - Assert.assertEquals(0, exception.b_raised); - } - - @Test - public void mediaListRemoveIndexTest() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - String mrl = this.getClass().getResource("/raffa_voice.ogg").getPath(); - LibVlcMedia libvlc_media = libvlc.libvlc_media_new( - libvlcInstance, - mrl, - exception); - libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception); - libvlc.libvlc_media_list_remove_index(mediaList, 0, exception); - Assert.assertEquals(0, exception.b_raised); - } - - @Test - public void mediaListRemoveIndexTest2() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception); - String mrl = this.getClass().getResource("/raffa_voice.ogg").getPath(); - LibVlcMedia libvlc_media = libvlc.libvlc_media_new( - libvlcInstance, - mrl, - exception); - libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception); - libvlc.libvlc_media_list_remove_index(mediaList, 0, exception); - Assert.assertEquals(0, exception.b_raised); - - libvlc_media = libvlc.libvlc_media_new( - libvlcInstance, - mrl, - exception); - libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception); - libvlc.libvlc_media_list_remove_index(mediaList, 0, exception); - } - -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerEventsTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerEventsTest.java deleted file mode 100644 index fa70e9df85..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerEventsTest.java +++ /dev/null @@ -1,132 +0,0 @@ -/***************************************************************************** - * LibVlcMediaPlayerEventsTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import junit.framework.Assert; - -import org.junit.After; -import org.junit.Test; -import org.videolan.jvlc.internal.LibVlc.LibVlcCallback; -import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager; -import org.videolan.jvlc.internal.LibVlc.LibVlcMedia; -import org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer; -import org.videolan.jvlc.internal.LibVlc.libvlc_event_t; - -import com.sun.jna.Pointer; - - -public class LibVlcMediaPlayerEventsTest extends AbstractVLCEventTest -{ - @Test - public void testPlayingEvent() throws Exception - { - LibVlcMedia media = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcMediaPlayer mediaPlayer = libvlc.libvlc_media_player_new_from_media(media, exception); - LibVlcEventManager eventManager = libvlc.libvlc_media_player_event_manager(mediaPlayer, exception); - LibVlcCallback callback = new LibVlc.LibVlcCallback() - { - - public void callback(libvlc_event_t libvlc_event, Pointer userData) - { - Assert.assertEquals(LibVlcEventType.libvlc_MediaPlayerPlaying.ordinal(), libvlc_event.type); - eventFired = 1; - } - }; - - libvlc.libvlc_event_attach( - eventManager, - LibVlcEventType.libvlc_MediaPlayerPlaying.ordinal(), - callback, - null, - exception); - libvlc.libvlc_media_player_play(mediaPlayer, exception); - Thread.sleep(2000L); - Assert.assertEquals(1, eventFired); - } - - @Test - public void testPausedEvent() throws Exception - { - LibVlcMedia media = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcMediaPlayer mediaPlayer = libvlc.libvlc_media_player_new_from_media(media, exception); - LibVlcEventManager eventManager = libvlc.libvlc_media_player_event_manager(mediaPlayer, exception); - LibVlcCallback callback = new LibVlc.LibVlcCallback() - { - - public void callback(libvlc_event_t libvlc_event, Pointer userData) - { - Assert.assertEquals(LibVlcEventType.libvlc_MediaPlayerPaused.ordinal(), libvlc_event.type); - eventFired = 1; - } - }; - - libvlc.libvlc_event_attach( - eventManager, - LibVlcEventType.libvlc_MediaPlayerPaused.ordinal(), - callback, - null, - exception); - - libvlc.libvlc_media_player_play(mediaPlayer, exception); - Thread.sleep(1000L); - libvlc.libvlc_media_player_pause(mediaPlayer, exception); - Thread.sleep(1000L); - - Assert.assertEquals(1, eventFired); - } - - @Test - public void testStoppedEvent() throws Exception - { - LibVlcMedia media = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcMediaPlayer mediaPlayer = libvlc.libvlc_media_player_new_from_media(media, exception); - LibVlcEventManager eventManager = libvlc.libvlc_media_player_event_manager(mediaPlayer, exception); - LibVlcCallback callback = new LibVlc.LibVlcCallback() - { - - public void callback(libvlc_event_t libvlc_event, Pointer userData) - { - Assert.assertEquals(LibVlcEventType.libvlc_MediaPlayerStopped.ordinal(), libvlc_event.type); - eventFired = 1; - } - }; - - libvlc.libvlc_event_attach( - eventManager, - LibVlcEventType.libvlc_MediaPlayerStopped.ordinal(), - callback, - null, - exception); - - libvlc.libvlc_media_player_play(mediaPlayer, exception); - Thread.sleep(1000L); - libvlc.libvlc_media_player_stop(mediaPlayer, exception); - Thread.sleep(1000L); - - Assert.assertEquals(1, eventFired); - } - -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java deleted file mode 100644 index 0f8496e530..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java +++ /dev/null @@ -1,125 +0,0 @@ -/***************************************************************************** - * LibVlcMediaInstanceTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import org.junit.Assert; -import org.junit.Test; -import org.videolan.jvlc.internal.LibVlc.LibVlcMedia; -import org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer; - - -public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest -{ - @Test - public void mediaPlayerNew() - { - LibVlcMediaPlayer instance = libvlc.libvlc_media_player_new(libvlcInstance, exception); - Assert.assertNotNull(instance); - Assert.assertEquals(0, exception.b_raised); - } - - @Test - public void mediaPlayerPlayBad() - { - LibVlcMediaPlayer instance = libvlc.libvlc_media_player_new(libvlcInstance, exception); - libvlc.libvlc_media_player_play(instance, exception); - Assert.assertEquals(1, exception.b_raised); // no associated media descriptor - } - - @Test - public void mediaPlayerPlay() - { - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception); - libvlc.libvlc_media_player_play(mi, exception); - Assert.assertEquals(0, exception.b_raised); - } - - @Test - public void mediaPlayerIsPlaying() throws Exception - { - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception); - Assert.assertEquals(0, libvlc.libvlc_media_player_is_playing(mi, exception)); - libvlc.libvlc_media_player_play(mi, exception); - Assert.assertEquals(0, exception.b_raised); - Thread.sleep(200); - Assert.assertEquals(1, libvlc.libvlc_media_player_is_playing(mi, exception)); - } - - @Test - public void mediaPlayerPauseBad() - { - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception); - libvlc.libvlc_media_player_pause(mi, exception); - Assert.assertEquals(1, exception.b_raised); - } - - @Test - public void mediaPlayerPause() - { - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception); - libvlc.libvlc_media_player_play(mi, exception); - libvlc.libvlc_media_player_pause(mi, exception); - Assert.assertEquals(0, exception.b_raised); - } - - @Test - public void mediaPlayerSetPosition() - { - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception); - libvlc.libvlc_media_player_play(mi, exception); - libvlc.libvlc_media_player_set_position(mi, 0.5f, exception); - Assert.assertEquals(0, exception.b_raised); - float position = libvlc.libvlc_media_player_get_position(mi, exception); - Assert.assertTrue("Position is: " + position, position >= 0.5f); - } - - @Test - public void mediaPlayerStop() - { - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception); - libvlc.libvlc_media_player_stop(mi, exception); - Assert.assertEquals(0, exception.b_raised); - } - - @Test(timeout = 2000L) - public void mediaPlayerStop2() throws Exception - { - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception); - libvlc.libvlc_media_player_play(mi, exception); - Thread.sleep(100); - libvlc.libvlc_media_player_stop(mi, exception); - Thread.sleep(500); - Assert.assertEquals(0, exception.b_raised); - } - -} diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaTest.java deleted file mode 100644 index 591eec95fb..0000000000 --- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/***************************************************************************** - * MediaDescriptorTest.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -package org.videolan.jvlc.internal; - -import junit.framework.Assert; - -import org.junit.Test; -import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager; -import org.videolan.jvlc.internal.LibVlc.LibVlcMedia; -import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t; - - -public class LibVlcMediaTest extends AbstractVLCInternalTest -{ - - @Test - public void testMediaNew() throws Exception - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - Assert.assertNotNull(md); - Assert.assertEquals(0, exception.b_raised); - } - - @Test - public void testMediaGetMrl() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - String mdMrl = libvlc.libvlc_media_get_mrl(md, exception); - Assert.assertEquals(mrl, mdMrl); - } - - @Test - public void testMediaDuplicate() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcMedia md2 = libvlc.libvlc_media_duplicate(md); - Assert.assertNotSame(md.getPointer(), md2.getPointer()); - Assert.assertEquals(libvlc.libvlc_media_get_mrl(md2, exception), libvlc.libvlc_media_get_mrl(md, exception)); - } - - @Test - public void testMediaEventManager() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - LibVlcEventManager evManager = libvlc.libvlc_media_event_manager(md, exception); - Assert.assertEquals(0, exception.b_raised); - Assert.assertNotNull(evManager); - } - - @Test - public void testMediaGetState() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - int state = libvlc.libvlc_media_get_state(md, exception); - Assert.assertEquals(0, exception.b_raised); - Assert.assertEquals(LibVlcState.libvlc_NothingSpecial.ordinal(), state); - } - - @Test - public void testMediaIsPreparsed() - { - libvlc_exception_t exception = new libvlc_exception_t(); - LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception); - int state = libvlc.libvlc_media_is_preparsed(md, exception); - Assert.assertEquals(0, exception.b_raised); - Assert.assertEquals(0, state); - } - - -} diff --git a/bindings/java/core/src/test/resources/log4j.xml b/bindings/java/core/src/test/resources/log4j.xml deleted file mode 100644 index 3a06d4a2de..0000000000 --- a/bindings/java/core/src/test/resources/log4j.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bindings/java/core/src/test/resources/raffa_voice.ogg b/bindings/java/core/src/test/resources/raffa_voice.ogg deleted file mode 100644 index 019f364b792ac8093bceb46407696cd23fd71b32..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 34420 zcmce-by!r<*DyLmcXtUgbV*4gAu)s0&_hT`mvl>mfW(l}F*GP$(nxnp3L-5f0t$-v z;O~9k?|%2W&-dKF?s?9f+2`!N*V(JrUV9%+TU#9v8tA`{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p+!%^h`fozF+a4f_a{M&f?g^3wkY?ZC7ZHY4A6vqwOULXspT~$`Q_Dpx4uj&T zvzGP6H_M@Y4`g5QS{+&&e?t#r3y;gSckezuS{|hJuf=vYKJqwrd5pYHa8!VBX8wm# zc}^6CNsR$8nelFJn}2KZ$lo;l5{}T*{M@~1(nU;|RT*auDW}%$EHT=C=w{JSaC&Bi zo^U$|nxgk)lDa8+xT!2QDKc}}?WJ!trC9C!wJ1D7+gp7Ox*sYGC<@xsZ zcHVBHm=Bs&N!Nh8<&7#E`SDziv_hr6HibF&PG~x5WQtmY5giNi2HCJS;GmhDB~J>Y zI-q=gB_jND0qmM7*Xrd`*As;?b?~(`CB=Lrx0fc#pHt;?_}eEJdq*o?&u@N&XWgf_ zPimS4ze36RB2bq`W0^m4_jhWtwdt3`LT uLEYo6w&E`6#8>mR`WUD8+Enz)IJ_+#@_rvNpYECZ9kdHU4g&oq2K^r`@cGUF diff --git a/bindings/java/core/src/test/resources/sample b/bindings/java/core/src/test/resources/sample deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/bindings/java/extras/convert.py b/bindings/java/extras/convert.py deleted file mode 100755 index 6b753cba8b..0000000000 --- a/bindings/java/extras/convert.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/python -""" -vlc to jna almost-automatized interface converter. - -This program is free software. It comes without any warranty, to -the extent permitted by applicable law. You can redistribute it -and/or modify it under the terms of the Do What The Fuck You Want -To Public License, Version 2, as published by Sam Hocevar. See -http://sam.zoy.org/wtfpl/COPYING for more details. - -""" - -import sys - -file = open('libvlc.h', 'r') - -parameter_parsing = False -prototype_parsing = False - -types_map = [ - ["const ", ""], - ["VLC_PUBLIC_API ", ""], - ["char**", "String[] "], - ["char **" , "String[] "], - ["char*" , "String "], - ["char *" , "String "], - ["libvlc_instance_t *", "LibVlcInstance "], - ["libvlc_exception_t *", "libvlc_exception_t "], - ["libvlc_log_t *", "LibVlcLog "], - ["libvlc_log_iterator_t *", "LibVlcLogIterator "], - ["libvlc_log_message_t *", "libvlc_log_message_t "], - ["unsigned", "int"], -] - -def convert_prototype(proto, parameters): - #print proto - #print parameters - tokens = proto.split(",") - last = tokens.pop().split(")") - res = '' - for i in tokens: - param = parameters.pop(0) - if i.find(param)==-1: - res += i + " " + param + "," - else: - res += i + " ," - if len(parameters): - param = parameters.pop(0) - if last[0].find(param)==-1: - res += last[0] + " " + param + ")" + last[1] - else: - res += last[0] + ")" + last[1] - - for k,v in types_map: - res = res.replace(k,v) - print res - -for line in file.readlines(): - if line.find("/**")!=-1: - parameters = [] - parameter_parsing = True - - if line.find("VLC_PUBLIC_API")!=-1: - if not parameters: - continue - prototype_line = '' - prototype_parsing = True - - if parameter_parsing: - param_index = line.find("\param ") - if not param_index==-1: - parameter = line.split()[2] - parameters.append(parameter) - if line.find("*/")!=-1: - parameter_parsing = False - - if prototype_parsing: - prototype_line += line.strip() - if line.find(");")!=-1: - prototype_parsing = False - convert_prototype(prototype_line, parameters) - parameters = None - continue - - #sys.stdout.write(line) - -# vi:ts=4 diff --git a/bindings/java/pom.xml b/bindings/java/pom.xml deleted file mode 100644 index fef4318682..0000000000 --- a/bindings/java/pom.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - 4.0.0 - org.videolan - jvlc-parent - 1.0.2-SNAPSHOT - pom - JVLC - Java Bindings for VideoLAN - http://jvlc.ihack.it/ - 2005 - - The VideoLAN Team - http://www.videolan.org/ - - - - - GPLv2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - - - - - Trac - http://trac.videolan.org/jvlc - - - - scm:git:git://git.videolan.org/vlc - scm:git:git://git.videolan.org/vlc - HEAD - http://git.videolan.org/gitweb.cgi - - - - - Filippo Carone - littlejohn - - developer - project admin - - +1 - littlejohn[at]videolan[dot]org - - - Philippe Morin - phmo95 - - developer - - phmorin[at]free[dot]fr - - - - - Adrien Grand - jpountz[at]jpountz[dot]net - - - Cristian Maglie - megabug[at]autisici[dot]org - - - - - - - maven-compiler-plugin - - 1.5 - 1.5 - - - - org.apache.maven.plugins - maven-surefire-plugin - - - org.apache.maven.plugins - maven-site-plugin - 2.0-beta-5 - - - scp://jvlc.ihack.it//home/littlejohn/www/ihack.it/jvlc/maven-site/staging/${pom.artifactId}/ - - - - - - - - - - org.apache.maven.plugins - maven-surefire-report-plugin - - - org.apache.maven.plugins - maven-jxr-plugin - - - org.apache.maven.plugins - maven-pmd-plugin - - true - utf-8 - 1.5 - - - - org.codehaus.mojo - cobertura-maven-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - http://java.sun.com/j2se/1.5.0/docs/api/ - - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - - - - - - - core - samples - - - - - jvlc.ihack.it - jvlc repository - scp://jvlc.ihack.it/www/ihack.it/jvlc/maven2 - - - snapshots.jvlc.ihack.it - openmind snapshot repository - scp://jvlc.ihack.it/home/littlejohn/www/ihack.it/jvlc/maven2-snapshots - - - - - diff --git a/bindings/java/samples/client/pom.xml b/bindings/java/samples/client/pom.xml deleted file mode 100644 index b57e3f9b82..0000000000 --- a/bindings/java/samples/client/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - - org.videolan - jvlc-samples - 1.0.2-SNAPSHOT - - org.videolan - jvlc-samples-client - jar - JVLC - Client sample - Java Bindings for VideoLAN - Client sample - 1.0.2-SNAPSHOT - - - - - org.codehaus.mojo - exec-maven-plugin - - - - java - - - - - VlcClient - - - - maven-assembly-plugin - - - jar-with-dependencies - - - - - - - - - org.videolan - jvlc-core - ${project.version} - - - - diff --git a/bindings/java/samples/client/src/main/java/MultipleVideosSample.java b/bindings/java/samples/client/src/main/java/MultipleVideosSample.java deleted file mode 100644 index 1853da8d5b..0000000000 --- a/bindings/java/samples/client/src/main/java/MultipleVideosSample.java +++ /dev/null @@ -1,91 +0,0 @@ -import java.awt.Canvas; -import java.awt.Color; -import java.awt.Frame; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - -import javax.swing.JPanel; - -import org.videolan.jvlc.JVLC; - -/***************************************************************************** - * MultipleVideosSample.java: VLC Java Bindings - ***************************************************************************** - * Copyright (C) 1998-2008 the VideoLAN team - * - * Authors: Filippo Carone - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - -public class MultipleVideosSample -{ - - private static int videosNumber = 6; - private static String filename ="/home/carone/a.avi"; - - public static void main(String[] args) throws Exception - { - Frame frame = new java.awt.Frame(); - frame.setBounds(0, 0, 600, 700); - JPanel jvcc = new JPanel(); - Canvas[] videoCanvasesArray = new Canvas[videosNumber]; - frame.add(jvcc); - - if (args.length > 0) - { - filename = args[0]; - } - - for (int i = 0; i < videosNumber; i++) - { - Canvas jvlcCanvas = new Canvas(); - videoCanvasesArray[i] = jvlcCanvas; - jvlcCanvas.setSize(200, 200); - jvlcCanvas.setBackground(new Color(0x0)); - jvcc.add(jvlcCanvas); - } - - frame.addWindowListener(new WindowAdapter() - { - - @Override - public void windowClosing(WindowEvent ev) - { - System.exit(0); - } - }); - - frame.setVisible(true); - JVLC[] jvlcArray = new JVLC[videosNumber]; - for (int i = 0; i < videosNumber; i++) - { - JVLC jvlc = new JVLC(); - jvlcArray[i] = jvlc; - jvlc.setVideoOutput(videoCanvasesArray[i]); - } - - for (int i = 0; i < videosNumber; i++) - { - jvlcArray[i].play(filename); - jvlcArray[i].setVideoOutput(videoCanvasesArray[i]); - Thread.sleep(500); - } - } - -} diff --git a/bindings/java/samples/client/src/main/java/VlcClient.java b/bindings/java/samples/client/src/main/java/VlcClient.java deleted file mode 100644 index 921c049607..0000000000 --- a/bindings/java/samples/client/src/main/java/VlcClient.java +++ /dev/null @@ -1,224 +0,0 @@ -/***************************************************************************** - * VlcClient.java: Sample Swing player - ***************************************************************************** - * Copyright (C) 1998-2006 the VideoLAN team - * - * Created on 28-feb-2006 - * - * $Id: $ - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - */ - -import java.awt.Canvas; -import java.awt.Frame; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - -import javax.swing.JPanel; - -import org.videolan.jvlc.JVLC; -import org.videolan.jvlc.MediaPlayer; - - -class VLCPlayerFrame extends Frame -{ - - /** - * - */ - private static final long serialVersionUID = -7471950211795850421L; - - public Canvas jvcanvas; - - private MediaPlayer mediaPlayer; - - public VLCPlayerFrame(String[] args) - { - initComponents(args); - } - - private void initComponents(String[] args) - { - - java.awt.GridBagConstraints gridBagConstraints; - - fullScreenButton = new javax.swing.JButton(); - jTextField1 = new javax.swing.JTextField(); - setButton = new javax.swing.JButton(); - pauseButton = new javax.swing.JButton(); - stopButton = new javax.swing.JButton(); - - jvcc = new JPanel(); - jvcanvas = new java.awt.Canvas(); - jvcanvas.setSize(200, 200); - jvcc.add(jvcanvas); - - jvlc = new JVLC(args); - jvlc.setVideoOutput(jvcanvas); - - setLayout(new java.awt.GridBagLayout()); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridwidth = java.awt.GridBagConstraints.CENTER; - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 0; - add(jvcc, gridBagConstraints); - - fullScreenButton.setText("FullScreen"); - fullScreenButton.addActionListener(new java.awt.event.ActionListener() - { - - public void actionPerformed(java.awt.event.ActionEvent evt) - { - fullScreenButtonActionPerformed(evt); - } - }); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - add(fullScreenButton, gridBagConstraints); - - jTextField1.setText("file://a.avi"); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.gridwidth = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - add(jTextField1, gridBagConstraints); - - setButton.setText("Set item"); - setButton.addActionListener(new java.awt.event.ActionListener() - { - - public void actionPerformed(java.awt.event.ActionEvent evt) - { - setButtonActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 1; - gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - add(setButton, gridBagConstraints); - - pauseButton.setText("Play/Pause"); - pauseButton.addActionListener(new java.awt.event.ActionListener() - { - - public void actionPerformed(java.awt.event.ActionEvent evt) - { - pauseButtonActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - add(pauseButton, gridBagConstraints); - - stopButton.setText("Stop"); - stopButton.addActionListener(new java.awt.event.ActionListener() - { - - public void actionPerformed(java.awt.event.ActionEvent evt) - { - stopButtonActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - add(stopButton, gridBagConstraints); - - pack(); - - } - - private void stopButtonActionPerformed(java.awt.event.ActionEvent evt) - { - if (mediaPlayer == null) - { - return; - } - mediaPlayer.stop(); - } - - private void pauseButtonActionPerformed(java.awt.event.ActionEvent evt) - { - if (mediaPlayer == null) - { - return; - } - mediaPlayer.pause(); - } - - private void setButtonActionPerformed(java.awt.event.ActionEvent evt) - { - if (mediaPlayer != null) - { - mediaPlayer.stop(); - mediaPlayer.release(); - jvcanvas = new java.awt.Canvas(); - } - mediaPlayer = jvlc.play(jTextField1.getText()); - } - - private void fullScreenButtonActionPerformed(java.awt.event.ActionEvent evt) - { - // jvlc.fullScreen(); - } - - private javax.swing.JButton setButton; - - private javax.swing.JButton pauseButton; - - private javax.swing.JButton stopButton; - - private javax.swing.JButton fullScreenButton; - - private javax.swing.JTextField jTextField1; - - private JPanel jvcc; - - public JVLC jvlc; - // MediaControlInstance mci; - -} - - -public class VlcClient -{ - - public static void main(String[] args) - { - Frame f = new VLCPlayerFrame(args); - f.setBounds(0, 0, 500, 500); - f.addWindowListener(new WindowAdapter() - { - - @Override - public void windowClosing(WindowEvent ev) - { - System.exit(0); - } - }); - f.setVisible(true); - } -} diff --git a/bindings/java/samples/pom.xml b/bindings/java/samples/pom.xml deleted file mode 100644 index 76784487fe..0000000000 --- a/bindings/java/samples/pom.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - 4.0.0 - - org.videolan - jvlc-parent - 1.0.2-SNAPSHOT - - jvlc-samples - pom - JVLC - Samples - Java Bindings for VideoLAN - Samples - 1.0.2-SNAPSHOT - - - client - - - diff --git a/bindings/phonon/.gitignore b/bindings/phonon/.gitignore deleted file mode 100644 index dc81908f63..0000000000 --- a/bindings/phonon/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.svn -Makefile -CMakeTmp diff --git a/bindings/phonon/CMakeLists.txt b/bindings/phonon/CMakeLists.txt deleted file mode 100644 index 73b5acf5ab..0000000000 --- a/bindings/phonon/CMakeLists.txt +++ /dev/null @@ -1,263 +0,0 @@ -project(Phonon) - -cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR) - -# CMP0002: we have multiple targets with the same name for the unit tests -cmake_policy(SET CMP0002 OLD) - -# enable unit tests -option(PHONON_BUILD_TESTS "Build the tests") -option(PHONON_BUILD_EXAMPLES "Build the examples") - -if (PHONON_BUILD_TESTS) - enable_testing() -endif (PHONON_BUILD_TESTS) - -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") - -include(PhononMacros) - -include(MacroLogFeature) -include(MacroOptionalFindPackage) - -set(QT_MIN_VERSION 4.4.0) -find_package(Qt4 REQUIRED) -if (NOT QT_QTDBUS_FOUND) - message(STATUS "Warning: Phonon won't be compiled with DBus support.") -endif(NOT QT_QTDBUS_FOUND) - -find_package(Automoc4 REQUIRED) -include (CheckCXXCompilerFlag) -include (MacroEnsureVersion) - -find_package(Phonon REQUIRED) -if(PHONON_PULSESUPPORT) - add_definitions(-DPHONON_PULSESUPPORT) -endif(PHONON_PULSESUPPORT) -find_package(VLC REQUIRED) -if (NOT AUTOMOC4_VERSION) - set(AUTOMOC4_VERSION "0.9.83") -endif (NOT AUTOMOC4_VERSION) -macro_ensure_version("0.9.86" "${AUTOMOC4_VERSION}" _automoc4_version_ok) -if (NOT _automoc4_version_ok) - message(FATAL_ERROR "Your version of automoc4 is too old. You have ${AUTOMOC4_VERSION}, you need at least 0.9.86") -endif (NOT _automoc4_version_ok) - -if (CMAKE_COMPILER_IS_GNUCXX) - set (KDE4_ENABLE_EXCEPTIONS -fexceptions) - # Select flags. - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") - set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG") - set(CMAKE_CXX_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline") - set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline") - set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g") - set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG") - set(CMAKE_C_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline") - set(CMAKE_C_FLAGS_DEBUGFULL "-g3 -fno-inline") - set(CMAKE_C_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs") - - if (CMAKE_SYSTEM_NAME MATCHES Linux) - set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") - set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common") - add_definitions (-D_BSD_SOURCE) - endif (CMAKE_SYSTEM_NAME MATCHES Linux) - - # gcc under Windows - if (MINGW) - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols -Wl,--disable-auto-import") - set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--export-all-symbols -Wl,--disable-auto-import") - - # we always link against the release version of QT with mingw - # (even for debug builds). So we need to define QT_NO_DEBUG - # or else QPluginLoader rejects plugins because it thinks - # they're built against the wrong QT. - add_definitions(-DQT_NO_DEBUG) - endif (MINGW) - - check_cxx_compiler_flag(-fPIE HAVE_FPIE_SUPPORT) - if(KDE4_ENABLE_FPIE) - if(HAVE_FPIE_SUPPORT) - set (KDE4_CXX_FPIE_FLAGS "-fPIE") - set (KDE4_PIE_LDFLAGS "-pie") - else(HAVE_FPIE_SUPPORT) - message(STATUS "Your compiler doesn't support PIE flag") - endif(HAVE_FPIE_SUPPORT) - endif(KDE4_ENABLE_FPIE) - - check_cxx_compiler_flag(-Woverloaded-virtual __KDE_HAVE_W_OVERLOADED_VIRTUAL) - if(__KDE_HAVE_W_OVERLOADED_VIRTUAL) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual") - endif(__KDE_HAVE_W_OVERLOADED_VIRTUAL) - - # visibility support - check_cxx_compiler_flag(-fvisibility=hidden __KDE_HAVE_GCC_VISIBILITY) - set( __KDE_HAVE_GCC_VISIBILITY ${__KDE_HAVE_GCC_VISIBILITY} CACHE BOOL "GCC support for hidden visibility") - - # get the gcc version - exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info) - - string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}") - # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the patch level, handle this here: - if (NOT _gcc_version) - string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${_gcc_version_info}") - endif (NOT _gcc_version) - - macro_ensure_version("4.1.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_1) - macro_ensure_version("4.2.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_2) - macro_ensure_version("4.3.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_3) - - # save a little by making local statics not threadsafe - # ### do not enable it for older compilers, see - # ### http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31806 - if (GCC_IS_NEWER_THAN_4_3) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics") - endif (GCC_IS_NEWER_THAN_4_3) - - set(_GCC_COMPILED_WITH_BAD_ALLOCATOR FALSE) - if (GCC_IS_NEWER_THAN_4_1) - exec_program(${CMAKE_C_COMPILER} ARGS -v OUTPUT_VARIABLE _gcc_alloc_info) - string(REGEX MATCH "(--enable-libstdcxx-allocator=mt)" _GCC_COMPILED_WITH_BAD_ALLOCATOR "${_gcc_alloc_info}") - endif (GCC_IS_NEWER_THAN_4_1) - - if (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") - set (KDE4_C_FLAGS "-fvisibility=hidden") - # check that Qt defines Q_DECL_EXPORT as __attribute__ ((visibility("default"))) - # if it doesn't and KDE compiles with hidden default visibiltiy plugins will break - set(_source "#include \n int main()\n {\n #ifdef QT_VISIBILITY_AVAILABLE \n return 0;\n #else \n return 1; \n #endif \n }\n") - set(_source_file ${CMAKE_BINARY_DIR}/CMakeTmp/check_qt_visibility.cpp) - file(WRITE "${_source_file}" "${_source}") - set(_include_dirs "-DINCLUDE_DIRECTORIES:STRING=${QT_INCLUDES}") - - try_run(_run_result _compile_result ${CMAKE_BINARY_DIR} ${_source_file} CMAKE_FLAGS "${_include_dirs}") - - if(NOT _compile_result) - message(FATAL_ERROR "Could not compile simple test program:\n ${_source}") - endif(NOT _compile_result) - if(_run_result) - message(FATAL_ERROR "Qt compiled without support for -fvisibility=hidden. This will break plugins and linking of some applications. Please fix your Qt installation.") - endif(_run_result) - - if (GCC_IS_NEWER_THAN_4_2) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") - endif (GCC_IS_NEWER_THAN_4_2) - else (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR) - set (__KDE_HAVE_GCC_VISIBILITY 0) - endif (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR) - -endif (CMAKE_COMPILER_IS_GNUCXX) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) -set(CMAKE_COLOR_MAKEFILE ON) - -set(PHONON_LIB_MAJOR_VERSION "4") -set(PHONON_LIB_MINOR_VERSION "3") -set(PHONON_LIB_PATCH_VERSION "50") -set(PHONON_LIB_VERSION "${PHONON_LIB_MAJOR_VERSION}.4.0") -set(PHONON_LIB_SOVERSION ${PHONON_LIB_MAJOR_VERSION}) - -add_definitions(${QT_DEFINITIONS}) -remove_definitions(-DQT3_SUPPORT_WARNINGS -DQT3_SUPPORT) -if(MSVC) - add_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS ) -endif(MSVC) - -# for including config.h and for includes like -include_directories(${QT_INCLUDES} ${PHONON_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/includes ${CMAKE_CURRENT_SOURCE_DIR}/phonon ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/phonon) - -macro(_SET_FANCY _var _value _comment) - if (KDESupport_SOURCE_DIR) - # when building inside kdesupport other subprojects write crap into our variables - set(${_var} "${_value}") - else (KDESupport_SOURCE_DIR) - if (NOT DEFINED ${_var}) - set(${_var} "${_value}") - else (NOT DEFINED ${_var}) - set(${_var} "${${_var}}" CACHE PATH "${_comment}") - endif (NOT DEFINED ${_var}) - endif (KDESupport_SOURCE_DIR) -endmacro(_SET_FANCY) - -set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) - -_set_fancy(EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" "Base directory for executables and libraries") -_set_fancy(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" "Base directory for files which go to share/") -_set_fancy(BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)") -_set_fancy(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" "The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})") -_set_fancy(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" "The subdirectory to the header prefix") -_set_fancy(PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/kde4" "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)") -_set_fancy(ICON_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/icons" "The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)") -_set_fancy(SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/services" "The install dir for service (desktop, protocol, ...) files") -_set_fancy(DBUS_INTERFACES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/interfaces" "The dbus interfaces install dir (default: ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)") -_set_fancy(DBUS_SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/services" "The dbus services install dir (default: ${SHARE_INSTALL_PREFIX}/dbus-1/services)") - -set(INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "${BIN_INSTALL_DIR}" - LIBRARY DESTINATION "${LIB_INSTALL_DIR}" - ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" COMPONENT Devel ) - -add_definitions(-DPHONON_LIB_INSTALL_DIR="${LIB_INSTALL_DIR}") -# on the Mac support an extra install directory for application bundles -if(APPLE) - set(INSTALL_TARGETS_DEFAULT_ARGS ${INSTALL_TARGETS_DEFAULT_ARGS} - BUNDLE DESTINATION "${BUNDLE_INSTALL_DIR}" ) - set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined dynamic_lookup") - set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -flat_namespace -undefined dynamic_lookup") -endif(APPLE) - -if (CMAKE_SYSTEM_NAME MATCHES Linux) - if (CMAKE_COMPILER_IS_GNUCXX) - set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") - set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}") - - set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--enable-new-dtags ${CMAKE_SHARED_LINKER_FLAGS}") - set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--enable-new-dtags ${CMAKE_MODULE_LINKER_FLAGS}") - set ( CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-new-dtags ${CMAKE_EXE_LINKER_FLAGS}") - - # we profile... - if(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile) - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") - set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") - endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile) - endif (CMAKE_COMPILER_IS_GNUCXX) - if (CMAKE_C_COMPILER MATCHES "icc") - set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}") - set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}") - endif (CMAKE_C_COMPILER MATCHES "icc") -endif (CMAKE_SYSTEM_NAME MATCHES Linux) - -list(APPEND PHONON_LIBS phonon ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) -if(QT_QTDBUS_FOUND) - list(APPEND PHONON_LIBS phonon ${QT_QTDBUS_LIBRARY}) -endif(QT_QTDBUS_FOUND) - -set(EXECUTABLE_OUTPUT_PATH ${Phonon_BINARY_DIR}/bin) -if (WIN32) - set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH}) -else (WIN32) - set(LIBRARY_OUTPUT_PATH ${Phonon_BINARY_DIR}/lib) -endif (WIN32) - -if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER MATCHES "icc") - set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-check-new -fno-common") -endif (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER MATCHES "icc") - -# Set up RPATH handling, so the libs are found if they are installed to a non-standard location. -# By default cmake builds the targets with full RPATH to everything in the build directory, -# but then removes the RPATH when installing. -# These two options below make it set the RPATH of the installed targets to all -# RPATH directories outside the current CMAKE_BINARY_DIR and also the library -# install directory. Alex -set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) -set(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}" ) - -if(APPLE) - set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR}) -endif(APPLE) - -if (Q_WS_X11) - add_subdirectory(vlc) -endif (Q_WS_X11) - -macro_display_feature_log() diff --git a/bindings/phonon/cmake/modules/FindAutomoc4.cmake b/bindings/phonon/cmake/modules/FindAutomoc4.cmake deleted file mode 100644 index 2b88e09195..0000000000 --- a/bindings/phonon/cmake/modules/FindAutomoc4.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# - Try to find automoc4 -# Once done this will define -# -# AUTOMOC4_FOUND - automoc4 has been found -# AUTOMOC4_EXECUTABLE - the automoc4 tool -# AUTOMOC4_VERSION - the full version of automoc4 -# AUTOMOC4_VERSION_MAJOR, AUTOMOC4_VERSION_MINOR, AUTOMOC4_VERSION_PATCH - AUTOMOC4_VERSION -# broken into its components -# -# It also adds the following macros -# AUTOMOC4( ) -# Use this to run automoc4 on all files contained in the list . -# -# AUTOMOC4_MOC_HEADERS( header1.h header2.h ...) -# Use this to add more header files to be processed with automoc4. -# -# AUTOMOC4_ADD_EXECUTABLE( src1 src2 ...) -# This macro does the same as ADD_EXECUTABLE, but additionally -# adds automoc4 handling for all source files. -# -# AUTOMOC4_ADD_LIBRARY( src1 src2 ...) -# This macro does the same as ADD_LIBRARY, but additionally -# adds automoc4 handling for all source files. - -# Internal helper macro, may change or be removed anytime: -# _ADD_AUTOMOC4_TARGET( ) -# -# Since version 0.9.88: -# The following two macros are only to be used for KDE4 projects -# and do something which makes sure automoc4 works for KDE. Don't -# use them anywhere else. -# _AUTOMOC4_KDE4_PRE_TARGET_HANDLING( ) -# _AUTOMOC4_KDE4_POST_TARGET_HANDLING() - - -# Copyright (c) 2008-2009, Alexander Neundorf, -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - - -# check if we are inside KDESupport and automoc is enabled -if("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") - # when building this project as part of kdesupport - set(AUTOMOC4_CONFIG_FILE "${KDESupport_SOURCE_DIR}/automoc/Automoc4Config.cmake") -else("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") - # when building this project outside kdesupport - - # CMAKE_[SYSTEM_]PREFIX_PATH exists starting with cmake 2.6.0 - file(TO_CMAKE_PATH "$ENV{CMAKE_PREFIX_PATH}" _env_CMAKE_PREFIX_PATH) - file(TO_CMAKE_PATH "$ENV{CMAKE_LIBRARY_PATH}" _env_CMAKE_LIBRARY_PATH) - - find_file(AUTOMOC4_CONFIG_FILE NAMES Automoc4Config.cmake - PATH_SUFFIXES automoc4 lib/automoc4 lib64/automoc4 - PATHS ${_env_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH} ${CMAKE_SYSTEM_PREFIX_PATH} - ${_env_CMAKE_LIBRARY_PATH} ${CMAKE_LIBRARY_PATH} ${CMAKE_SYSTEM_LIBRARY_PATH} - ${CMAKE_INSTALL_PREFIX} - NO_DEFAULT_PATH ) -endif("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") - - -if(AUTOMOC4_CONFIG_FILE) - include(${AUTOMOC4_CONFIG_FILE}) - set(AUTOMOC4_FOUND TRUE) -else(AUTOMOC4_CONFIG_FILE) - set(AUTOMOC4_FOUND FALSE) -endif(AUTOMOC4_CONFIG_FILE) - -if (AUTOMOC4_FOUND) - if (NOT Automoc4_FIND_QUIETLY) - message(STATUS "Found Automoc4: ${AUTOMOC4_EXECUTABLE}") - endif (NOT Automoc4_FIND_QUIETLY) -else (AUTOMOC4_FOUND) - if (Automoc4_FIND_REQUIRED) - message(FATAL_ERROR "Did not find automoc4 (part of kdesupport).") - else (Automoc4_FIND_REQUIRED) - if (NOT Automoc4_FIND_QUIETLY) - message(STATUS "Did not find automoc4 (part of kdesupport).") - endif (NOT Automoc4_FIND_QUIETLY) - endif (Automoc4_FIND_REQUIRED) -endif (AUTOMOC4_FOUND) diff --git a/bindings/phonon/cmake/modules/FindPackageHandleStandardArgs.cmake b/bindings/phonon/cmake/modules/FindPackageHandleStandardArgs.cmake deleted file mode 100644 index 9613b3d6ee..0000000000 --- a/bindings/phonon/cmake/modules/FindPackageHandleStandardArgs.cmake +++ /dev/null @@ -1,60 +0,0 @@ -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... ) -# -# This macro is intended to be used in FindXXX.cmake modules files. -# It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and -# it also sets the _FOUND variable. -# The package is found if all variables listed are TRUE. -# Example: -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) -# -# LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and -# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE. -# If it is not found and REQUIRED was used, it fails with FATAL_ERROR, -# independent whether QUIET was used or not. -# -# If it is found, the location is reported using the VAR1 argument, so -# here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out. -# If the second argument is DEFAULT_MSG, the message in the failure case will -# be "Could NOT find LibXml2", if you don't like this message you can specify -# your own custom failure message there. - -MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) - - IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") - IF (${_NAME}_FIND_REQUIRED) - SET(_FAIL_MESSAGE "Could not find REQUIRED package ${_NAME}") - ELSE (${_NAME}_FIND_REQUIRED) - SET(_FAIL_MESSAGE "Could not find OPTIONAL package ${_NAME}") - ENDIF (${_NAME}_FIND_REQUIRED) - ELSE("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") - SET(_FAIL_MESSAGE "${_FAIL_MSG}") - ENDIF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") - - STRING(TOUPPER ${_NAME} _NAME_UPPER) - - SET(${_NAME_UPPER}_FOUND TRUE) - IF(NOT ${_VAR1}) - SET(${_NAME_UPPER}_FOUND FALSE) - ENDIF(NOT ${_VAR1}) - - FOREACH(_CURRENT_VAR ${ARGN}) - IF(NOT ${_CURRENT_VAR}) - SET(${_NAME_UPPER}_FOUND FALSE) - ENDIF(NOT ${_CURRENT_VAR}) - ENDFOREACH(_CURRENT_VAR) - - IF (${_NAME_UPPER}_FOUND) - IF (NOT ${_NAME}_FIND_QUIETLY) - MESSAGE(STATUS "Found ${_NAME}: ${${_VAR1}}") - ENDIF (NOT ${_NAME}_FIND_QUIETLY) - ELSE (${_NAME_UPPER}_FOUND) - IF (${_NAME}_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE}") - ELSE (${_NAME}_FIND_REQUIRED) - IF (NOT ${_NAME}_FIND_QUIETLY) - MESSAGE(STATUS "${_FAIL_MESSAGE}") - ENDIF (NOT ${_NAME}_FIND_QUIETLY) - ENDIF (${_NAME}_FIND_REQUIRED) - ENDIF (${_NAME_UPPER}_FOUND) -ENDMACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS) diff --git a/bindings/phonon/cmake/modules/FindPhonon.cmake b/bindings/phonon/cmake/modules/FindPhonon.cmake deleted file mode 100644 index 361b3fa4ff..0000000000 --- a/bindings/phonon/cmake/modules/FindPhonon.cmake +++ /dev/null @@ -1,77 +0,0 @@ -# Find libphonon -# Once done this will define -# -# PHONON_FOUND - system has Phonon Library -# PHONON_INCLUDES - the Phonon include directory -# PHONON_LIBS - link these to use Phonon -# PHONON_VERSION - the version of the Phonon Library - -# Copyright (c) 2008, Matthias Kretz -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -macro(_phonon_find_version) - set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h") - if (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h") - set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h") - endif (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h") - file(READ ${_phonon_namespace_header_file} _phonon_header LIMIT 5000 OFFSET 1000) - string(REGEX MATCH "define PHONON_VERSION_STR \"(4\\.[0-9]+\\.[0-9a-z]+)\"" _phonon_version_match "${_phonon_header}") - set(PHONON_VERSION "${CMAKE_MATCH_1}") - message(STATUS "Phonon Version: ${PHONON_VERSION}") -endmacro(_phonon_find_version) - -if(PHONON_FOUND) - # Already found, nothing more to do except figuring out the version - _phonon_find_version() -else(PHONON_FOUND) - if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) - set(PHONON_FIND_QUIETLY TRUE) - endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) - - # As discussed on kde-buildsystem: first look at CMAKE_PREFIX_PATH, then at the suggested PATHS (kde4 install dir) - find_library(PHONON_LIBRARY NAMES phonon PATHS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH) - # then at the default system locations (CMAKE_SYSTEM_PREFIX_PATH, i.e. /usr etc.) - find_library(PHONON_LIBRARY NAMES phonon) - - find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH) - find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h) - - if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) - set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY}) - set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR}) - set(PHONON_FOUND TRUE) - _phonon_find_version() - find_path(PHONON_PULSESUPPORT NAMES phonon/pulsesupport.h PATHS ${PHONON_INCLUDES}) - else(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) - set(PHONON_FOUND FALSE) - endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY) - - if(PHONON_FOUND) - if(NOT PHONON_FIND_QUIETLY) - message(STATUS "Found Phonon: ${PHONON_LIBRARY}") - message(STATUS "Found Phonon Includes: ${PHONON_INCLUDES}") - if(PHONON_PULSESUPPORT) - message(STATUS "Found Phonon PulseAudio Support: Yes") - else(PHONON_PULSESUPPORT) - message(STATUS "Found Phonon PulseAudio Support: No") - endif(PHONON_PULSESUPPORT) - endif(NOT PHONON_FIND_QUIETLY) - else(PHONON_FOUND) - if(Phonon_FIND_REQUIRED) - if(NOT PHONON_INCLUDE_DIR) - message(STATUS "Phonon includes NOT found!") - endif(NOT PHONON_INCLUDE_DIR) - if(NOT PHONON_LIBRARY) - message(STATUS "Phonon library NOT found!") - endif(NOT PHONON_LIBRARY) - message(FATAL_ERROR "Phonon library or includes NOT found!") - else(Phonon_FIND_REQUIRED) - message(STATUS "Unable to find Phonon") - endif(Phonon_FIND_REQUIRED) - endif(PHONON_FOUND) - - - mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY PHONON_INCLUDES) -endif(PHONON_FOUND) diff --git a/bindings/phonon/cmake/modules/FindVLC.cmake b/bindings/phonon/cmake/modules/FindVLC.cmake deleted file mode 100644 index eec5c57092..0000000000 --- a/bindings/phonon/cmake/modules/FindVLC.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# - Try to find VLC library -# Once done this will define -# -# VLC_FOUND - system has VLC -# VLC_INCLUDE_DIR - The VLC include directory -# VLC_LIBRARIES - The libraries needed to use VLC -# VLC_DEFINITIONS - Compiler switches required for using VLC -# -# Copyright (C) 2008, Tanguy Krotoff -# Copyright (C) 2008, Lukas Durfina -# Copyright (c) 2009, Fathi Boudra -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# - -if(VLC_INCLUDE_DIR AND VLC_LIBRARIES) - # in cache already - set(VLC_FIND_QUIETLY TRUE) -endif(VLC_INCLUDE_DIR AND VLC_LIBRARIES) - -# use pkg-config to get the directories and then use these values -# in the FIND_PATH() and FIND_LIBRARY() calls -if(NOT WIN32) - find_package(PkgConfig) - pkg_check_modules(VLC libvlc>=1.0.0) - set(VLC_DEFINITIONS ${VLC_CFLAGS}) - set(VLC_LIBRARIES ${VLC_LDFLAGS}) -endif(NOT WIN32) - -# TODO add argument support to pass version on find_package -include(MacroEnsureVersion) -macro_ensure_version(1.0.0 ${VLC_VERSION} VLC_VERSION_OK) -if(VLC_VERSION_OK) - set(VLC_FOUND TRUE) - message(STATUS "VLC library found") -else(VLC_VERSION_OK) - set(VLC_FOUND FALSE) - message(FATAL_ERROR "VLC library not found") -endif(VLC_VERSION_OK) - -find_path(VLC_INCLUDE_DIR - NAMES vlc.h - PATHS ${VLC_INCLUDE_DIRS} - PATH_SUFFIXES vlc) - -find_library(VLC_LIBRARIES - NAMES vlc - PATHS ${VLC_LIBRARY_DIRS}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(VLC DEFAULT_MSG VLC_INCLUDE_DIR VLC_LIBRARIES) - -# show the VLC_INCLUDE_DIR and VLC_LIBRARIES variables only in the advanced view -mark_as_advanced(VLC_INCLUDE_DIR VLC_LIBRARIES) diff --git a/bindings/phonon/cmake/modules/MacroEnsureVersion.cmake b/bindings/phonon/cmake/modules/MacroEnsureVersion.cmake deleted file mode 100644 index 6797e5b7db..0000000000 --- a/bindings/phonon/cmake/modules/MacroEnsureVersion.cmake +++ /dev/null @@ -1,117 +0,0 @@ -# This file defines the following macros for developers to use in ensuring -# that installed software is of the right version: -# -# MACRO_ENSURE_VERSION - test that a version number is greater than -# or equal to some minimum -# MACRO_ENSURE_VERSION_RANGE - test that a version number is greater than -# or equal to some minimum and less than some -# maximum -# MACRO_ENSURE_VERSION2 - deprecated, do not use in new code -# - -# MACRO_ENSURE_VERSION -# This macro compares version numbers of the form "x.y.z" or "x.y" -# MACRO_ENSURE_VERSION( FOO_MIN_VERSION FOO_VERSION_FOUND FOO_VERSION_OK) -# will set FOO_VERSION_OK to true if FOO_VERSION_FOUND >= FOO_MIN_VERSION -# Leading and trailing text is ok, e.g. -# MACRO_ENSURE_VERSION( "2.5.31" "flex 2.5.4a" VERSION_OK) -# which means 2.5.31 is required and "flex 2.5.4a" is what was found on the system - -# Copyright (c) 2006, David Faure, -# Copyright (c) 2007, Will Stephenson -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -# MACRO_ENSURE_VERSION_RANGE -# This macro ensures that a version number of the form -# "x.y.z" or "x.y" falls within a range defined by -# min_version <= found_version < max_version. -# If this expression holds, FOO_VERSION_OK will be set TRUE -# -# Example: MACRO_ENSURE_VERSION_RANGE3( "0.1.0" ${FOOCODE_VERSION} "0.7.0" FOO_VERSION_OK ) -# -# This macro will break silently if any of x,y,z are greater than 100. -# -# Copyright (c) 2007, Will Stephenson -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -# NORMALIZE_VERSION -# Helper macro to convert version numbers of the form "x.y.z" -# to an integer equal to 10^4 * x + 10^2 * y + z -# -# This macro will break silently if any of x,y,z are greater than 100. -# -# Copyright (c) 2006, David Faure, -# Copyright (c) 2007, Will Stephenson -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -# CHECK_RANGE_INCLUSIVE_LOWER -# Helper macro to check whether x <= y < z -# -# Copyright (c) 2007, Will Stephenson -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - - -MACRO(NORMALIZE_VERSION _requested_version _normalized_version) - STRING(REGEX MATCH "[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" _threePartMatch "${_requested_version}") - if (_threePartMatch) - # parse the parts of the version string - STRING(REGEX REPLACE "[^0-9]*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" _major_vers "${_requested_version}") - STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" _minor_vers "${_requested_version}") - STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" _patch_vers "${_requested_version}") - else (_threePartMatch) - STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+" "\\1" _major_vers "${_requested_version}") - STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)" "\\1" _minor_vers "${_requested_version}") - set(_patch_vers "0") - endif (_threePartMatch) - - # compute an overall version number which can be compared at once - MATH(EXPR ${_normalized_version} "${_major_vers}*10000 + ${_minor_vers}*100 + ${_patch_vers}") -ENDMACRO(NORMALIZE_VERSION) - -MACRO(MACRO_CHECK_RANGE_INCLUSIVE_LOWER _lower_limit _value _upper_limit _ok) - if (${_value} LESS ${_lower_limit}) - set( ${_ok} FALSE ) - elseif (${_value} EQUAL ${_lower_limit}) - set( ${_ok} TRUE ) - elseif (${_value} EQUAL ${_upper_limit}) - set( ${_ok} FALSE ) - elseif (${_value} GREATER ${_upper_limit}) - set( ${_ok} FALSE ) - else (${_value} LESS ${_lower_limit}) - set( ${_ok} TRUE ) - endif (${_value} LESS ${_lower_limit}) -ENDMACRO(MACRO_CHECK_RANGE_INCLUSIVE_LOWER) - -MACRO(MACRO_ENSURE_VERSION requested_version found_version var_too_old) - NORMALIZE_VERSION( ${requested_version} req_vers_num ) - NORMALIZE_VERSION( ${found_version} found_vers_num ) - - if (found_vers_num LESS req_vers_num) - set( ${var_too_old} FALSE ) - else (found_vers_num LESS req_vers_num) - set( ${var_too_old} TRUE ) - endif (found_vers_num LESS req_vers_num) - -ENDMACRO(MACRO_ENSURE_VERSION) - -MACRO(MACRO_ENSURE_VERSION2 requested_version2 found_version2 var_too_old2) - MACRO_ENSURE_VERSION( ${requested_version2} ${found_version2} ${var_too_old2}) -ENDMACRO(MACRO_ENSURE_VERSION2) - -MACRO(MACRO_ENSURE_VERSION_RANGE min_version found_version max_version var_ok) - NORMALIZE_VERSION( ${min_version} req_vers_num ) - NORMALIZE_VERSION( ${found_version} found_vers_num ) - NORMALIZE_VERSION( ${max_version} max_vers_num ) - - MACRO_CHECK_RANGE_INCLUSIVE_LOWER( ${req_vers_num} ${found_vers_num} ${max_vers_num} ${var_ok}) -ENDMACRO(MACRO_ENSURE_VERSION_RANGE) - - diff --git a/bindings/phonon/cmake/modules/MacroLogFeature.cmake b/bindings/phonon/cmake/modules/MacroLogFeature.cmake deleted file mode 100644 index 0cc87078e2..0000000000 --- a/bindings/phonon/cmake/modules/MacroLogFeature.cmake +++ /dev/null @@ -1,125 +0,0 @@ -# This file defines the Feature Logging macros. -# -# MACRO_LOG_FEATURE(VAR FEATURE DESCRIPTION URL [REQUIRED [MIN_VERSION [COMMENTS]]]) -# Logs the information so that it can be displayed at the end -# of the configure run -# VAR : TRUE or FALSE, indicating whether the feature is supported -# FEATURE: name of the feature, e.g. "libjpeg" -# DESCRIPTION: description what this feature provides -# URL: home page -# REQUIRED: TRUE or FALSE, indicating whether the featue is required -# MIN_VERSION: minimum version number. empty string if unneeded -# COMMENTS: More info you may want to provide. empty string if unnecessary -# -# MACRO_DISPLAY_FEATURE_LOG() -# Call this to display the collected results. -# Exits CMake with a FATAL error message if a required feature is missing -# -# Example: -# -# INCLUDE(MacroLogFeature) -# -# FIND_PACKAGE(JPEG) -# MACRO_LOG_FEATURE(JPEG_FOUND "libjpeg" "Support JPEG images" "http://www.ijg.org" TRUE "3.2a" "") -# ... -# MACRO_DISPLAY_FEATURE_LOG() - -# Copyright (c) 2006, Alexander Neundorf, -# Copyright (c) 2006, Allen Winter, -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -IF (NOT _macroLogFeatureAlreadyIncluded) - SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt) - IF (EXISTS ${_file}) - FILE(REMOVE ${_file}) - ENDIF (EXISTS ${_file}) - - SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt) - IF (EXISTS ${_file}) - FILE(REMOVE ${_file}) - ENDIF (EXISTS ${_file}) - - SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt) - IF (EXISTS ${_file}) - FILE(REMOVE ${_file}) - ENDIF (EXISTS ${_file}) - - SET(_macroLogFeatureAlreadyIncluded TRUE) -ENDIF (NOT _macroLogFeatureAlreadyIncluded) - - -MACRO(MACRO_LOG_FEATURE _var _package _description _url ) # _required _minvers _comments) - - SET(_required "${ARGV4}") - SET(_minvers "${ARGV5}") - SET(_comments "${ARGV6}") - - IF (${_var}) - SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/EnabledFeatures.txt) - ELSE (${_var}) - IF (${_required} MATCHES "[Tt][Rr][Uu][Ee]") - SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/MissingRequirements.txt) - ELSE (${_required} MATCHES "[Tt][Rr][Uu][Ee]") - SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/DisabledFeatures.txt) - ENDIF (${_required} MATCHES "[Tt][Rr][Uu][Ee]") - ENDIF (${_var}) - - SET(_logtext "+ ${_package}") - - IF (NOT ${_var}) - IF (${_minvers} MATCHES ".*") - SET(_logtext "${_logtext}, ${_minvers}") - ENDIF (${_minvers} MATCHES ".*") - SET(_logtext "${_logtext}: ${_description} <${_url}>") - IF (${_comments} MATCHES ".*") - SET(_logtext "${_logtext}\n${_comments}") - ENDIF (${_comments} MATCHES ".*") -# SET(_logtext "${_logtext}\n") #double-space missing features? - ENDIF (NOT ${_var}) - FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n") - -ENDMACRO(MACRO_LOG_FEATURE) - - -MACRO(MACRO_DISPLAY_FEATURE_LOG) - - SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt) - IF (EXISTS ${_file}) - FILE(READ ${_file} _requirements) - MESSAGE(STATUS "\n-----------------------------------------------------------------------------\n-- The following REQUIRED packages could NOT be located on your system.\n-- Please install them before continuing this software installation.\n-----------------------------------------------------------------------------\n${_requirements}-----------------------------------------------------------------------------") - FILE(REMOVE ${_file}) - MESSAGE(FATAL_ERROR "Exiting: Missing Requirements") - ENDIF (EXISTS ${_file}) - - SET(_summary "\n") - - SET(_elist 0) - SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt) - IF (EXISTS ${_file}) - SET(_elist 1) - FILE(READ ${_file} _enabled) - FILE(REMOVE ${_file}) - SET(_summary "${_summary}-----------------------------------------------------------------------------\n-- The following external packages were located on your system.\n-- This installation will have the extra features provided by these packages.\n${_enabled}") - ENDIF (EXISTS ${_file}) - - SET(_dlist 0) - SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt) - IF (EXISTS ${_file}) - SET(_dlist 1) - FILE(READ ${_file} _disabled) - FILE(REMOVE ${_file}) - SET(_summary "${_summary}-----------------------------------------------------------------------------\n-- The following OPTIONAL packages could NOT be located on your system.\n-- Consider installing them to enable more features from this software.\n${_disabled}") - ELSE (EXISTS ${_file}) - IF (${_elist}) - SET(_summary "${_summary}Congratulations! All external packages have been found.\n") - ENDIF (${_elist}) - ENDIF (EXISTS ${_file}) - - IF (${_elist} OR ${_dlist}) - SET(_summary "${_summary}-----------------------------------------------------------------------------\n") - ENDIF (${_elist} OR ${_dlist}) - MESSAGE(STATUS "${_summary}") - -ENDMACRO(MACRO_DISPLAY_FEATURE_LOG) diff --git a/bindings/phonon/cmake/modules/MacroOptionalFindPackage.cmake b/bindings/phonon/cmake/modules/MacroOptionalFindPackage.cmake deleted file mode 100644 index 816cdb7e87..0000000000 --- a/bindings/phonon/cmake/modules/MacroOptionalFindPackage.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# - MACRO_OPTIONAL_FIND_PACKAGE() combines FIND_PACKAGE() with an OPTION() -# MACRO_OPTIONAL_FIND_PACKAGE( [QUIT] ) -# This macro is a combination of OPTION() and FIND_PACKAGE(), it -# works like FIND_PACKAGE(), but additionally it automatically creates -# an option name WITH_, which can be disabled via the cmake GUI. -# or via -DWITH_=OFF -# The standard _FOUND variables can be used in the same way -# as when using the normal FIND_PACKAGE() - -# Copyright (c) 2006, Alexander Neundorf, -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - - -MACRO (MACRO_OPTIONAL_FIND_PACKAGE _name ) - OPTION(WITH_${_name} "Search for ${_name} package" ON) - if (WITH_${_name}) - FIND_PACKAGE(${_name} ${ARGN}) - else (WITH_${_name}) - set(${_name}_FOUND) - set(${_name}_INCLUDE_DIR) - set(${_name}_INCLUDES) - set(${_name}_LIBRARY) - set(${_name}_LIBRARIES) - endif (WITH_${_name}) -ENDMACRO (MACRO_OPTIONAL_FIND_PACKAGE) - diff --git a/bindings/phonon/cmake/modules/PhononMacros.cmake b/bindings/phonon/cmake/modules/PhononMacros.cmake deleted file mode 100644 index 2ef05a5f70..0000000000 --- a/bindings/phonon/cmake/modules/PhononMacros.cmake +++ /dev/null @@ -1,206 +0,0 @@ - -# Phonon helper macros: -# -# macro (phonon_add_executable _target) -# macro (PHONON_ADD_UNIT_TEST _test_NAME) -# macro (PHONON_UPDATE_ICONCACHE) -# macro (PHONON_UPDATE_ICONCACHE) -# macro (_PHONON_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME _l10n_SUBDIR) -# macro (PHONON_INSTALL_ICONS _defaultpath ) - -set(_global_add_executable_param) -if (Q_WS_MAC) - set(_global_add_executable_param MACOSX_BUNDLE) -endif (Q_WS_MAC) -if (WIN32) - # no WIN32 here - all executables are command line executables - set(_global_add_executable_param) -endif (WIN32) - -macro(phonon_add_executable _target) - set(_srcs ${ARGN}) - automoc4_add_executable(${_target} ${_global_add_executable_param} ${_srcs}) -endmacro(phonon_add_executable _target) - -macro (PHONON_ADD_UNIT_TEST _test_NAME) - set(_srcList ${ARGN}) - set(_nogui) - list(GET ${_srcList} 0 first_PARAM) - set(_add_executable_param ${_global_add_executable_param}) - if(${first_PARAM} STREQUAL "NOGUI") - set(_nogui "NOGUI") - set(_add_executable_param) - endif(${first_PARAM} STREQUAL "NOGUI") - - if (NOT PHONON_BUILD_TESTS) - set(_add_executable_param ${_add_executable_param} EXCLUDE_FROM_ALL) - endif (NOT PHONON_BUILD_TESTS) - - automoc4_add_executable(${_test_NAME} ${_add_executable_param} ${_srcList}) - - if(NOT PHONON_TEST_OUTPUT) - set(PHONON_TEST_OUTPUT plaintext) - endif(NOT PHONON_TEST_OUTPUT) - set(PHONON_TEST_OUTPUT ${PHONON_TEST_OUTPUT} CACHE STRING "The output to generate when running the QTest unit tests") - - set(using_qtest "") - foreach(_filename ${_srcList}) - if(NOT using_qtest) - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_filename}") - file(READ ${_filename} file_CONTENT) - string(REGEX MATCH "QTEST_(KDE)?MAIN" using_qtest "${file_CONTENT}") - endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_filename}") - endif(NOT using_qtest) - endforeach(_filename) - - set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME}) - if (Q_WS_MAC AND NOT _nogui) - set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME}.app/Contents/MacOS/${_test_NAME}) - else (Q_WS_MAC AND NOT _nogui) - # Use .shell wrapper where available, to use uninstalled libs. - #if (UNIX) - # set(_executable ${_executable}.shell) - #endif (UNIX) - endif (Q_WS_MAC AND NOT _nogui) - - if (using_qtest AND PHONON_TEST_OUTPUT STREQUAL "xml") - add_test( ${_test_NAME} ${_executable} -xml -o ${_test_NAME}.tml) - else (using_qtest AND PHONON_TEST_OUTPUT STREQUAL "xml") - add_test( ${_test_NAME} ${_executable} ) - endif (using_qtest AND PHONON_TEST_OUTPUT STREQUAL "xml") - - if (NOT MSVC_IDE) #not needed for the ide - # if the tests are EXCLUDE_FROM_ALL, add a target "buildtests" to build all tests - if (NOT PHONON_BUILD_TESTS) - get_directory_property(_buildtestsAdded BUILDTESTS_ADDED) - if(NOT _buildtestsAdded) - add_custom_target(buildtests) - set_directory_properties(PROPERTIES BUILDTESTS_ADDED TRUE) - endif(NOT _buildtestsAdded) - add_dependencies(buildtests ${_test_NAME}) - endif (NOT PHONON_BUILD_TESTS) - endif (NOT MSVC_IDE) -endmacro (PHONON_ADD_UNIT_TEST) - -macro (PHONON_UPDATE_ICONCACHE) - # Update mtime of hicolor icon theme dir. - # We don't always have touch command (e.g. on Windows), so instead create - # and delete a temporary file in the theme dir. - install(CODE " - set(DESTDIR_VALUE \"\$ENV{DESTDIR}\") - if (NOT DESTDIR_VALUE) - file(WRITE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\" \"update\") - file(REMOVE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\") - endif (NOT DESTDIR_VALUE) - ") -endmacro (PHONON_UPDATE_ICONCACHE) - -# a "map" of short type names to the directories -# unknown names should give empty results -# KDE 3 compatibility -set(_PHONON_ICON_GROUP_mime "mimetypes") -set(_PHONON_ICON_GROUP_filesys "places") -set(_PHONON_ICON_GROUP_device "devices") -set(_PHONON_ICON_GROUP_app "apps") -set(_PHONON_ICON_GROUP_action "actions") -# KDE 4 / icon naming specification compatibility -set(_PHONON_ICON_GROUP_mimetypes "mimetypes") -set(_PHONON_ICON_GROUP_places "places") -set(_PHONON_ICON_GROUP_devices "devices") -set(_PHONON_ICON_GROUP_apps "apps") -set(_PHONON_ICON_GROUP_actions "actions") -set(_PHONON_ICON_GROUP_categories "categories") -set(_PHONON_ICON_GROUP_status "status") -set(_PHONON_ICON_GROUP_emblems "emblems") -set(_PHONON_ICON_GROUP_emotes "emotes") -set(_PHONON_ICON_GROUP_animations "animations") -set(_PHONON_ICON_GROUP_intl "intl") - -# a "map" of short theme names to the theme directory -set(_PHONON_ICON_THEME_ox "oxygen") -set(_PHONON_ICON_THEME_cr "crystalsvg") -set(_PHONON_ICON_THEME_lo "locolor") -set(_PHONON_ICON_THEME_hi "hicolor") - -macro (_PHONON_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME _l10n_SUBDIR) - - # if the string doesn't match the pattern, the result is the full string, so all three have the same content - if (NOT ${_group} STREQUAL ${_install_NAME} ) - set(_icon_GROUP ${_PHONON_ICON_GROUP_${_group}}) - if(NOT _icon_GROUP) - set(_icon_GROUP "actions") - endif(NOT _icon_GROUP) -# message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name} l10n: ${_l10n_SUBDIR}") - install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/${_l10n_SUBDIR}/ RENAME ${_install_NAME} ) - endif (NOT ${_group} STREQUAL ${_install_NAME} ) - -endmacro (_PHONON_ADD_ICON_INSTALL_RULE) - - -macro (PHONON_INSTALL_ICONS _defaultpath ) - - # the l10n-subdir if language given as second argument (localized icon) - set(_lang ${ARGV1}) - if(_lang) - set(_l10n_SUBDIR l10n/${_lang}) - else(_lang) - set(_l10n_SUBDIR ".") - endif(_lang) - - # first the png icons - file(GLOB _icons *.png) - foreach (_current_ICON ${_icons} ) - # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty - string(REGEX MATCH "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" _dummy "${_current_ICON}") - set(_type "${CMAKE_MATCH_1}") - set(_size "${CMAKE_MATCH_2}") - set(_group "${CMAKE_MATCH_3}") - set(_name "${CMAKE_MATCH_4}") - - set(_theme_GROUP ${_PHONON_ICON_THEME_${_type}}) - if( _theme_GROUP) - _PHONON_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake - ${_defaultpath}/${_theme_GROUP}/${_size}x${_size} - ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR}) - endif( _theme_GROUP) - endforeach (_current_ICON) - - # mng icons - file(GLOB _icons *.mng) - foreach (_current_ICON ${_icons} ) - # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty - string(REGEX MATCH "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.mng)$" _dummy "${_current_ICON}") - set(_type "${CMAKE_MATCH_1}") - set(_size "${CMAKE_MATCH_2}") - set(_group "${CMAKE_MATCH_3}") - set(_name "${CMAKE_MATCH_4}") - - set(_theme_GROUP ${_PHONON_ICON_THEME_${_type}}) - if( _theme_GROUP) - _PHONON_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake - ${_defaultpath}/${_theme_GROUP}/${_size}x${_size} - ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR}) - endif( _theme_GROUP) - endforeach (_current_ICON) - - # and now the svg icons - file(GLOB _icons *.svgz) - foreach (_current_ICON ${_icons} ) - # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty - string(REGEX MATCH "^.*/([a-zA-Z]+)sc\\-([a-z]+)\\-(.+\\.svgz)$" _dummy "${_current_ICON}") - set(_type "${CMAKE_MATCH_1}") - set(_group "${CMAKE_MATCH_2}") - set(_name "${CMAKE_MATCH_3}") - - set(_theme_GROUP ${_PHONON_ICON_THEME_${_type}}) - if( _theme_GROUP) - _PHONON_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake - ${_defaultpath}/${_theme_GROUP}/scalable - ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR}) - endif( _theme_GROUP) - endforeach (_current_ICON) - - phonon_update_iconcache() - -endmacro (PHONON_INSTALL_ICONS) - diff --git a/bindings/phonon/vlc/.gitignore b/bindings/phonon/vlc/.gitignore deleted file mode 100644 index 773218f116..0000000000 --- a/bindings/phonon/vlc/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.svn -Makefile -moc_* -phonon_vlc_* diff --git a/bindings/phonon/vlc/AUTHORS b/bindings/phonon/vlc/AUTHORS deleted file mode 100644 index ea17ee886a..0000000000 --- a/bindings/phonon/vlc/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -Fathi Boudra (current maintainer) -Lukas Durfina -Tanguy Krotoff diff --git a/bindings/phonon/vlc/CMakeLists.txt b/bindings/phonon/vlc/CMakeLists.txt deleted file mode 100644 index 24b986affa..0000000000 --- a/bindings/phonon/vlc/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -project(phonon-vlc) -include_directories(${QT_INCLUDES} - ${VLC_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}) - -add_definitions(-D_PHONON_BACKEND_VERSION_4_2) - -set(phonon_vlc_SRCS - audiooutput.cpp - backend.cpp - devicemanager.cpp - effect.cpp - effectmanager.cpp - mediacontroller.cpp - mediaobject.cpp - seekstack.cpp - sinknode.cpp - videowidget.cpp - vlcloader.cpp - vlcmediacontroller.cpp - vlcmediaobject.cpp - vlcvideowidget.cpp - widgetnopaintevent.cpp) - -automoc4(phonon_vlc phonon_vlc_SRCS) -add_library(phonon_vlc MODULE ${phonon_vlc_SRCS}) - -set_target_properties(phonon_vlc PROPERTIES PREFIX "") -target_link_libraries(phonon_vlc ${PHONON_LIBS} ${VLC_LIBRARIES}) - -if(WIN32) - install(TARGETS phonon_vlc DESTINATION bin/phonon_backend) -else(WIN32) - install(TARGETS phonon_vlc DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/phonon_backend) -endif(WIN32) -install(FILES vlc.desktop DESTINATION ${SERVICES_INSTALL_DIR}/phononbackends) - -if(BUILD_TESTS) - add_subdirectory(tests) -endif(BUILD_TESTS) diff --git a/bindings/phonon/vlc/audiooutput.cpp b/bindings/phonon/vlc/audiooutput.cpp deleted file mode 100644 index 48eefba0e1..0000000000 --- a/bindings/phonon/vlc/audiooutput.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "audiooutput.h" -#include "devicemanager.h" -#include "backend.h" - -#include "mediaobject.h" -#include "vlcmediaobject.h" - -#include "vlcloader.h" - -#ifdef PHONON_PULSESUPPORT -# include -#endif - -namespace Phonon -{ -namespace VLC { - -AudioOutput::AudioOutput(Backend *p_back, QObject * p_parent) - : SinkNode(p_parent), - f_volume(1.0), - i_device(0), - p_backend(p_back) -{ - p_media_object = 0; -} - -AudioOutput::~AudioOutput() -{ -} - -qreal AudioOutput::volume() const -{ - return f_volume; -} - -void AudioOutput::setVolume(qreal volume) -{ - if (vlc_instance) { - libvlc_audio_set_volume(vlc_instance, (int)(f_volume * 100), vlc_exception); - vlcExceptionRaised(); - f_volume = volume; - emit volumeChanged(f_volume); - } -} - -int AudioOutput::outputDevice() const -{ - return i_device; -} - -bool AudioOutput::setOutputDevice(int device) -{ - if (i_device == device) - return true; - -#ifdef PHONON_PULSESUPPORT - if (PulseSupport::getInstance()->isActive()) { - i_device = device; - libvlc_audio_output_set(vlc_instance, "pulse"); - qDebug() << "set aout " << "pulse"; - return true; - } -#endif - - const QList deviceList = p_backend->deviceManager()->audioOutputDevices(); - if (device >= 0 && device < deviceList.size()) { - - i_device = device; - const QByteArray deviceName = deviceList.at(device).vlcId; - libvlc_audio_output_set(vlc_instance, (char *) deviceList.at(device).vlcId.data()); - qDebug() << "set aout " << deviceList.at(device).vlcId.data(); -// if (deviceName == DEFAULT_ID) { -// libvlc_audio_device_set(p_vlc_instance, DEFAULT, vlc_exception); -// vlcExceptionRaised(); -// } else if (deviceName.startsWith(ALSA_ID)) { -// qDebug() << "setting ALSA " << deviceList.at(device).hwId.data(); -// libvlc_audio_device_set(p_vlc_instance, ALSA, vlc_exception); -// vlcExceptionRaised(); -// libvlc_audio_alsa_device_set(p_vlc_instance, -// deviceList.at(device).hwId, -// vlc_exception); -// vlcExceptionRaised(); - } - - return true; -} - -#if (PHONON_VERSION >= PHONON_VERSION_CHECK(4, 2, 0)) -bool AudioOutput::setOutputDevice(const Phonon::AudioOutputDevice & device) -{ - return true; -} -#endif - -} -} // Namespace Phonon::VLC diff --git a/bindings/phonon/vlc/audiooutput.h b/bindings/phonon/vlc/audiooutput.h deleted file mode 100644 index 54b738ae08..0000000000 --- a/bindings/phonon/vlc/audiooutput.h +++ /dev/null @@ -1,69 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef PHONON_VLC_AUDIOOUTPUT_H -#define PHONON_VLC_AUDIOOUTPUT_H - -#include "sinknode.h" - -#include - -namespace Phonon -{ -namespace VLC { -class Backend; - -class AudioOutput : public SinkNode, public AudioOutputInterface -{ - Q_OBJECT - Q_INTERFACES(Phonon::AudioOutputInterface) - -public: - - AudioOutput(Backend *p_back, QObject * p_parent); - ~AudioOutput(); - - qreal volume() const; - void setVolume(qreal volume); - - int outputDevice() const; - bool setOutputDevice(int); -#if (PHONON_VERSION >= PHONON_VERSION_CHECK(4, 2, 0)) - bool setOutputDevice(const AudioOutputDevice & device); -#endif - -signals: - - void volumeChanged(qreal volume); - void audioDeviceFailed(); - -private: - - qreal f_volume; - int i_device; - Backend *p_backend; - -}; - -} -} // Namespace Phonon::VLC - -#endif // PHONON_VLC_AUDIOOUTPUT_H diff --git a/bindings/phonon/vlc/backend.cpp b/bindings/phonon/vlc/backend.cpp deleted file mode 100644 index 7d2e0101c1..0000000000 --- a/bindings/phonon/vlc/backend.cpp +++ /dev/null @@ -1,407 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "backend.h" - -#include "audiooutput.h" -#include "mediaobject.h" -#include "videowidget.h" -#include "devicemanager.h" -#include "effectmanager.h" -#include "effect.h" -#include "sinknode.h" -#include "vlcloader.h" -#include "vlcmediaobject.h" - -#ifdef PHONON_PULSESUPPORT -# include -#endif - -#include -#include -#include - -Q_EXPORT_PLUGIN2(phonon_vlc, Phonon::VLC::Backend) - -namespace Phonon -{ -namespace VLC { - -Backend::Backend(QObject *parent, const QVariantList &) - : QObject(parent) - , m_deviceManager(NULL) - , m_effectManager(NULL) - , m_debugLevel(Debug) -{ -#ifdef PHONON_PULSESUPPORT - // Initialise PulseAudio support - PulseSupport *pulse = PulseSupport::getInstance(); - pulse->enable(); - connect(pulse, SIGNAL(objectDescriptionChanged(ObjectDescriptionType)), SIGNAL(objectDescriptionChanged(ObjectDescriptionType))); -#endif - - bool wasInit = vlcInit(); - - setProperty("identifier", QLatin1String("phonon_vlc")); - setProperty("backendName", QLatin1String("VLC")); - setProperty("backendComment", QLatin1String("VLC plugin for Phonon")); - setProperty("backendVersion", QLatin1String("0.1")); - setProperty("backendWebsite", QLatin1String("http://multimedia.kde.org/")); - - // Check if we should enable debug output - QString debugLevelString = qgetenv("PHONON_VLC_DEBUG"); - int debugLevel = debugLevelString.toInt(); - if (debugLevel > 3) // 3 is maximum - debugLevel = 3; - m_debugLevel = (DebugLevel)debugLevel; - - if (wasInit) { - logMessage(QString("Using VLC version %0").arg(libvlc_get_version())); - } else { - qWarning("Phonon::VLC::vlcInit: Failed to initialize VLC"); - } - - m_deviceManager = new DeviceManager(this); - m_effectManager = new EffectManager(this); -} - -Backend::~Backend() -{ -// vlcRelease(); -} - -QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QList &args) -{ - switch (c) { - case MediaObjectClass: - return new VLCMediaObject(parent); - case VolumeFaderEffectClass: -// return new VolumeFaderEffect(parent); - logMessage("createObject() : VolumeFaderEffect not implemented"); - break; - case AudioOutputClass: { - AudioOutput *ao = new AudioOutput(this, parent); - m_audioOutputs.append(ao); - return ao; - } - case AudioDataOutputClass: -// return new AudioDataOutput(parent); - logMessage("createObject() : AudioDataOutput not implemented"); - break; - case VisualizationClass: -// return new Visualization(parent); - logMessage("createObject() : Visualization not implemented"); - break; - case VideoDataOutputClass: -// return new VideoDataOutput(parent); - logMessage("createObject() : VideoDataOutput not implemented"); - break; - case EffectClass: - return new Effect(m_effectManager, args[0].toInt(), parent); - case VideoWidgetClass: - return new VideoWidget(qobject_cast(parent)); - default: - logMessage("createObject() : Backend object not available"); - } - return 0; -} - -bool Backend::supportsVideo() const -{ - return true; -} - -bool Backend::supportsOSD() const -{ - return true; -} - -bool Backend::supportsFourcc(quint32 fourcc) const -{ - return true; -} - -bool Backend::supportsSubtitles() const -{ - return true; -} - -QStringList Backend::availableMimeTypes() const -{ - if (m_supportedMimeTypes.isEmpty()) { - const_cast(this)->m_supportedMimeTypes - << QLatin1String("application/ogg") - << QLatin1String("application/vnd.rn-realmedia") - << QLatin1String("application/x-annodex") - << QLatin1String("application/x-flash-video") - << QLatin1String("application/x-quicktimeplayer") - << QLatin1String("audio/168sv") - << QLatin1String("audio/8svx") - << QLatin1String("audio/aiff") - << QLatin1String("audio/basic") - << QLatin1String("audio/mp3") - << QLatin1String("audio/mp4") - << QLatin1String("audio/mpeg") - << QLatin1String("audio/mpeg2") - << QLatin1String("audio/mpeg3") - << QLatin1String("audio/vnd.rn-realaudio") - << QLatin1String("audio/wav") - << QLatin1String("audio/x-16sv") - << QLatin1String("audio/x-8svx") - << QLatin1String("audio/x-aiff") - << QLatin1String("audio/x-basic") - << QLatin1String("audio/x-m4a") - << QLatin1String("audio/x-mp3") - << QLatin1String("audio/x-mpeg") - << QLatin1String("audio/x-mpeg2") - << QLatin1String("audio/x-mpeg3") - << QLatin1String("audio/x-mpegurl") - << QLatin1String("audio/x-ms-wma") - << QLatin1String("audio/x-ogg") - << QLatin1String("audio/x-pn-aiff") - << QLatin1String("audio/x-pn-au") - << QLatin1String("audio/x-pn-realaudio-plugin") - << QLatin1String("audio/x-pn-wav") - << QLatin1String("audio/x-pn-windows-acm") - << QLatin1String("audio/x-real-audio") - << QLatin1String("audio/x-realaudio") - << QLatin1String("audio/x-speex+ogg") - << QLatin1String("audio/x-wav") - << QLatin1String("image/ilbm") - << QLatin1String("image/png") - << QLatin1String("image/x-ilbm") - << QLatin1String("image/x-png") - << QLatin1String("video/anim") - << QLatin1String("video/avi") - << QLatin1String("video/mkv") - << QLatin1String("video/mng") - << QLatin1String("video/mp4") - << QLatin1String("video/mpeg") - << QLatin1String("video/mpg") - << QLatin1String("video/msvideo") - << QLatin1String("video/quicktime") - << QLatin1String("video/x-anim") - << QLatin1String("video/x-flic") - << QLatin1String("video/x-mng") - << QLatin1String("video/x-mpeg") - << QLatin1String("video/x-ms-asf") - << QLatin1String("video/x-ms-wmv") - << QLatin1String("video/x-msvideo") - << QLatin1String("video/x-quicktime"); - } - return m_supportedMimeTypes; -} - -QList Backend::objectDescriptionIndexes(ObjectDescriptionType type) const -{ - QList list; - - switch (type) { - case Phonon::AudioOutputDeviceType: { - QList deviceList = deviceManager()->audioOutputDevices(); - for (int dev = 0 ; dev < deviceList.size() ; ++dev) - list.append(deviceList[dev].id); - break; - } - break; - case Phonon::EffectType: { - QList effectList = effectManager()->effects(); - for (int eff = 0; eff < effectList.size(); ++eff) - list.append(eff); - break; - } - break; - default: - break; - } - - return list; -} - -QHash Backend::objectDescriptionProperties(ObjectDescriptionType type, int index) const -{ - QHash ret; - - switch (type) { - case Phonon::AudioOutputDeviceType: { - QList audioDevices = deviceManager()->audioOutputDevices(); - if (index >= 0 && index < audioDevices.size()) { - ret.insert("name", audioDevices[index].vlcId); - ret.insert("description", audioDevices[index].description); - ret.insert("icon", QLatin1String("audio-card")); - } - } - break; - case Phonon::EffectType: { - QList effectList = effectManager()->effects(); - if (index >= 0 && index <= effectList.size()) { - const EffectInfo *effect = effectList[ index ]; - ret.insert("name", effect->name()); - ret.insert("description", effect->description()); - ret.insert("author", effect->author()); - } else { - Q_ASSERT(1); // Since we use list position as ID, this should not happen - } - } - break; - default: - break; - } - - return ret; -} - -bool Backend::startConnectionChange(QSet objects) -{ - foreach(QObject *object, objects) { - logMessage(QString("Object: %0").arg(object->metaObject()->className())); - } - - // There is nothing we can do but hope the connection changes will not take too long - // so that buffers would underrun - // But we should be pretty safe the way xine works by not doing anything here. - return true; -} - -bool Backend::connectNodes(QObject *source, QObject *sink) -{ - logMessage(QString("Backend connected %0 to %1") - .arg(source->metaObject()->className()) - .arg(sink->metaObject()->className())); - - // Example: - // source = Phonon::VLC_MPlayer::MediaObject - // sink = Phonon::VLC_MPlayer::VideoWidget - - // Example: - // source = Phonon::VLC_MPlayer::MediaObject - // sink = Phonon::VLC_MPlayer::AudioOutput - - // Example: - // source = Phonon::VLC_MPlayer::MediaObject - // sink = Phonon::VLC_MPlayer::Effect - - // Example: - // source = Phonon::VLC_MPlayer::Effect - // sink = Phonon::VLC_MPlayer::AudioOutput - - SinkNode *sinkNode = qobject_cast(sink); - if (sinkNode) { - PrivateMediaObject *mediaObject = qobject_cast(source); - if (mediaObject) { - // Connect the SinkNode to a MediaObject - sinkNode->connectToMediaObject(mediaObject); - return true; - } else { - // FIXME try to find a better way... -// Effect *effect = qobject_cast(source); - return true; - } - } - - logMessage(QString("Linking %0 to %1 failed") - .arg(source->metaObject()->className()) - .arg(sink->metaObject()->className()), - Warning); - - return false; -} - -bool Backend::disconnectNodes(QObject *source, QObject *sink) -{ - SinkNode *sinkNode = qobject_cast(sink); - if (sinkNode) { - PrivateMediaObject *mediaObject = qobject_cast(source); - if (mediaObject) { - // Disconnect the SinkNode from a MediaObject - sinkNode->disconnectFromMediaObject(mediaObject); - return true; - } else { - // FIXME try to find a better way... -// Effect *effect = qobject_cast(source); - return true; - } - } - - return false; -} - -bool Backend::endConnectionChange(QSet objects) -{ - foreach(QObject *object, objects) { - logMessage(QString("Object: %0").arg(object->metaObject()->className())); - } - - return true; -} - -DeviceManager* Backend::deviceManager() const -{ - return m_deviceManager; -} - -EffectManager* Backend::effectManager() const -{ - return m_effectManager; -} - -/** - * Return a debuglevel that is determined by the - * PHONON_VLC_DEBUG environment variable. - * - * Warning - important warnings - * Info - general info - * Debug - gives extra info - */ -Backend::DebugLevel Backend::debugLevel() const -{ - return m_debugLevel; -} - -/** - * Print a conditional debug message based on the current debug level - * If obj is provided, classname and objectname will be printed as well - * - * see debugLevel() - */ -void Backend::logMessage(const QString &message, int priority, QObject *obj) const -{ - if (debugLevel() > 0) { - QString output; - if (obj) { - // Strip away namespace from className - QString className(obj->metaObject()->className()); - int nameLength = className.length() - className.lastIndexOf(':') - 1; - className = className.right(nameLength); - output.sprintf("%s %s (%s %p)", message.toLatin1().constData(), - obj->objectName().toLatin1().constData(), - className.toLatin1().constData(), obj); - } else { - output = message; - } - if (priority <= (int)debugLevel()) { - qDebug() << QString("PVLC(%1): %2").arg(priority).arg(output); - } - } -} - -} -} // Namespace Phonon::VLC diff --git a/bindings/phonon/vlc/backend.h b/bindings/phonon/vlc/backend.h deleted file mode 100644 index 00dfe94d27..0000000000 --- a/bindings/phonon/vlc/backend.h +++ /dev/null @@ -1,90 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef Phonon_VLC_BACKEND_H -#define Phonon_VLC_BACKEND_H - -#include "devicemanager.h" -#include "audiooutput.h" - -#include -#include - -#include -#include -#include - -namespace Phonon -{ -namespace VLC { -class AudioOutput; -class EffectManager; - -class Backend : public QObject, public BackendInterface -{ - Q_OBJECT - Q_INTERFACES(Phonon::BackendInterface) - -public: - - enum DebugLevel {NoDebug, Warning, Info, Debug}; - Backend(QObject *parent = 0, const QVariantList & = QVariantList()); - virtual ~Backend(); - - DeviceManager* deviceManager() const; - EffectManager* effectManager() const; - - QObject *createObject(BackendInterface::Class, QObject *parent, const QList &args); - - bool supportsVideo() const; - bool supportsOSD() const; - bool supportsFourcc(quint32 fourcc) const; - bool supportsSubtitles() const; - QStringList availableMimeTypes() const; - - QList objectDescriptionIndexes(ObjectDescriptionType type) const; - QHash objectDescriptionProperties(ObjectDescriptionType type, int index) const; - - bool startConnectionChange(QSet); - bool connectNodes(QObject *, QObject *); - bool disconnectNodes(QObject *, QObject *); - bool endConnectionChange(QSet); - - DebugLevel debugLevel() const; - - void logMessage(const QString &message, int priority = 2, QObject *obj = 0) const; - -Q_SIGNALS: - void objectDescriptionChanged(ObjectDescriptionType); - -private: - mutable QStringList m_supportedMimeTypes; - QList > m_audioOutputs; - - DeviceManager *m_deviceManager; - EffectManager *m_effectManager; - DebugLevel m_debugLevel; -}; - -} -} // namespace Phonon::VLC - -#endif // Phonon_VLC_BACKEND_H diff --git a/bindings/phonon/vlc/devicemanager.cpp b/bindings/phonon/vlc/devicemanager.cpp deleted file mode 100644 index 18db2f7292..0000000000 --- a/bindings/phonon/vlc/devicemanager.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* This file is part of the KDE project. - - Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - - This library 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 or 3 of the License. - - This library 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 library. If not, see . -*/ - -#include "devicemanager.h" -#include "backend.h" -//#include "videowidget.h" -//#include "widgetrenderer.h" -#include "vlcloader.h" - -#ifdef PHONON_PULSESUPPORT -# include -#endif - -/** - * This class manages the list of currently active output devices. - */ - -QT_BEGIN_NAMESPACE - -namespace Phonon -{ -namespace VLC { - -AudioDevice::AudioDevice(DeviceManager *manager, const QByteArray &deviceId, const QByteArray &hw_id) -{ - // Get an id - static int counter = 0; - id = counter++; - // Get name from device - if (vlcId == "default") { - description = "Default audio device"; - } else { - vlcId = deviceId; - description = ""; - } - hwId = hw_id; -} - -DeviceManager::DeviceManager(Backend *parent) - : QObject(parent) - , m_backend(parent) -{ - updateDeviceList(); -} - -DeviceManager::~DeviceManager() -{ - m_audioDeviceList.clear(); -} - -bool DeviceManager::canOpenDevice() const -{ - return true; -} - -/** - * Return a positive device id or -1 if device does not exist. - */ -int DeviceManager::deviceId(const QByteArray &nameId) const -{ - for (int i = 0 ; i < m_audioDeviceList.size() ; ++i) { - if (m_audioDeviceList[i].vlcId == nameId) - return m_audioDeviceList[i].id; - } - return -1; -} - -/** - * Get a human-readable description from a device id. - */ -QByteArray DeviceManager::deviceDescription(int i_id) const -{ - for (int i = 0 ; i < m_audioDeviceList.size() ; ++i) { - if (m_audioDeviceList[i].id == i_id) - return m_audioDeviceList[i].description; - } - return QByteArray(); -} - -/** - * Update the current list of active devices. - */ -void DeviceManager::updateDeviceList() -{ - QList list, list_hw; - list.append("default"); - list_hw.append(""); - - // Get the list of available audio outputs - libvlc_audio_output_t *p_ao_list = libvlc_audio_output_list_get( - vlc_instance, vlc_exception); - vlcExceptionRaised(); - libvlc_audio_output_t *p_start = p_ao_list; - - bool checkpulse = false; -#ifdef PHONON_PULSESUPPORT - PulseSupport *pulse = PulseSupport::getInstance(); - checkpulse = pulse->isActive(); -#endif - bool haspulse = false; - while (p_ao_list) { - if (checkpulse && 0 == strcmp(p_ao_list->psz_name, "pulse")) { - haspulse = true; - break; - } - list.append(p_ao_list->psz_name); - list_hw.append(""); - p_ao_list = p_ao_list->p_next; - } - libvlc_audio_output_list_release(p_start); - - -#ifdef PHONON_PULSESUPPORT - if (haspulse) - return; - pulse->enable(false); -#endif - - for (int i = 0 ; i < list.size() ; ++i) { - QByteArray nameId = list.at(i); - QByteArray hwId = list_hw.at(i); - if (deviceId(nameId) == -1) { - // This is a new device, add it - qDebug() << "add aout " << nameId.data(); - m_audioDeviceList.append(AudioDevice(this, nameId, hwId)); - emit deviceAdded(deviceId(nameId)); - } - } - if (list.size() < m_audioDeviceList.size()) { - // A device was removed - for (int i = m_audioDeviceList.size() - 1 ; i >= 0 ; --i) { - QByteArray currId = m_audioDeviceList[i].vlcId; - bool b_found = false; - for (int k = list.size() - 1 ; k >= 0 ; --k) { - if (currId == list[k]) { - b_found = true; - break; - } - } - if (!b_found) { - emit deviceRemoved(deviceId(currId)); - m_audioDeviceList.removeAt(i); - } - } - } -} - -/** - * Return a list of hardware id. - */ -const QList DeviceManager::audioOutputDevices() const -{ - return m_audioDeviceList; -} - -} -} - -QT_END_NAMESPACE diff --git a/bindings/phonon/vlc/devicemanager.h b/bindings/phonon/vlc/devicemanager.h deleted file mode 100644 index 73a20d673c..0000000000 --- a/bindings/phonon/vlc/devicemanager.h +++ /dev/null @@ -1,74 +0,0 @@ -/* This file is part of the KDE project. - - Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - - This library 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 or 3 of the License. - - This library 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 library. If not, see . -*/ - -#ifndef Phonon_VLC_DEVICEMANAGER_H -#define Phonon_VLC_DEVICEMANAGER_H - -#include - -#include - -QT_BEGIN_NAMESPACE - -namespace Phonon -{ -namespace VLC { - -class Backend; -class DeviceManager; -class AbstractRenderer; -class VideoWidget; - -class AudioDevice -{ -public : - AudioDevice(DeviceManager *s, const QByteArray &deviceId, const QByteArray &hw_id = ""); - int id; - QByteArray vlcId; - QByteArray description; - QByteArray hwId; -}; - -class DeviceManager : public QObject -{ - Q_OBJECT - -public: - DeviceManager(Backend *parent); - virtual ~DeviceManager(); - const QList audioOutputDevices() const; - int deviceId(const QByteArray &vlcId) const; - QByteArray deviceDescription(int id) const; - -signals: - void deviceAdded(int); - void deviceRemoved(int); - -public slots: - void updateDeviceList(); - -private: - bool canOpenDevice() const; - Backend *m_backend; - QList m_audioDeviceList; -}; -} -} // namespace Phonon::VLC - -QT_END_NAMESPACE - -#endif // Phonon_VLC_DEVICEMANAGER_H diff --git a/bindings/phonon/vlc/effect.cpp b/bindings/phonon/vlc/effect.cpp deleted file mode 100644 index f918fe1a76..0000000000 --- a/bindings/phonon/vlc/effect.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "effect.h" - -#include "effectmanager.h" - -#include "mediaobject.h" - -namespace Phonon -{ -namespace VLC { - -Effect::Effect(EffectManager *p_em, int i_effectId, QObject *p_parent) - : SinkNode(p_parent) -{ - p_effectManager = p_em; - QList effects = p_effectManager->effects(); - - if (i_effectId >= 0 && i_effectId < effects.size()) { - i_effect_filter = effects[ i_effectId ]->filter(); - effect_type = effects[ i_effectId ]->type(); - setupEffectParams(); - } else { - // effect ID out of range - Q_ASSERT(0); - } -} - -Effect::~Effect() -{ - parameterList.clear(); -} - -void Effect::connectToMediaObject(PrivateMediaObject *p_media_object) -{ - SinkNode::connectToMediaObject(p_media_object); - - switch (effect_type) { - case EffectInfo::AudioEffect: -// libvlc_audio_filter_add(p_vlc_instance, (libvlc_audio_filter_names_t)i_effect_filter, vlc_exception); -// vlcExceptionRaised(); - break; - case EffectInfo::VideoEffect: -// libvlc_video_filter_add(p_vlc_current_media_player, (libvlc_video_filter_names_t)i_effect_filter, vlc_exception); -// vlcExceptionRaised(); - break; - } -} - -void Effect::disconnectFromMediaObject(PrivateMediaObject *p_media_object) -{ - SinkNode::disconnectFromMediaObject(p_media_object); - - switch (effect_type) { - case EffectInfo::AudioEffect: -// libvlc_audio_filter_remove(p_vlc_instance, (libvlc_audio_filter_names_t)i_effect_filter, vlc_exception); -// vlcExceptionRaised(); - break; - case EffectInfo::VideoEffect: -// libvlc_video_filter_remove(p_vlc_current_media_player, (libvlc_video_filter_names_t)i_effect_filter, vlc_exception); -// vlcExceptionRaised(); - break; - } -} - -void Effect::setupEffectParams() -{ -// libvlc_filter_parameter_list_t *p_list; - switch (effect_type) { - case EffectInfo::AudioEffect: -// p_list = libvlc_audio_filter_get_parameters(p_vlc_instance, (libvlc_audio_filter_names_t)i_effect_filter, vlc_exception ); -// vlcExceptionRaised(); - break; - case EffectInfo::VideoEffect: -// p_list = libvlc_video_filter_get_parameters(p_vlc_instance, (libvlc_video_filter_names_t)i_effect_filter, vlc_exception ); -// vlcExceptionRaised(); - break; - } -// if( !p_list ) -// return; - - int i_index = 0; -// libvlc_filter_parameter_list_t *p_parameter_list = p_list; -// while (p_parameter_list) { -// switch (p_parameter_list->var_type) { -// case LIBVLC_BOOL: { -// const QString description = p_parameter_list->psz_description; -// parameterList.append(Phonon::EffectParameter( -// i_index, -// QString(p_parameter_list->psz_parameter_name), -// Phonon::EffectParameter::ToggledHint, // hints -// QVariant((bool) p_parameter_list->default_value.b_bool), -// QVariant((bool) false), -// QVariant((bool) true), -// QVariantList(), -// description)); -// break; -// } -// case LIBVLC_INT: { -// const QString description = p_parameter_list->psz_description; -// parameterList.append(Phonon::EffectParameter( -// i_index, -// QString(p_parameter_list->psz_parameter_name), -// EffectParameter::IntegerHint, // hints -// QVariant((int) p_parameter_list->default_value.i_int), -// QVariant((int) p_parameter_list->min_value.i_int), -// QVariant((int) p_parameter_list->max_value.i_int), -// QVariantList(), -// description)); -// break; -// } -// case LIBVLC_FLOAT: { -// const QString description = p_parameter_list->psz_description; -// parameterList.append(Phonon::EffectParameter( -// i_index, -// QString(p_parameter_list->psz_parameter_name), -// 0, // hints -// QVariant((double) p_parameter_list->default_value.f_float), -// QVariant((double) p_parameter_list->min_value.f_float), -// QVariant((double) p_parameter_list->max_value.f_float), -// QVariantList(), -// description)); -// break; -// } -// case LIBVLC_STRING: { -// const QString description = p_parameter_list->psz_description; -// parameterList.append(Phonon::EffectParameter( -// i_index, -// QString(p_parameter_list->psz_parameter_name), -// 0, // hints -// QVariant((const char *) p_parameter_list->default_value.psz_string), -// NULL, -// NULL, -// QVariantList(), -// description)); -// break; -// } -// } -// i_index++; -// p_parameter_list = p_parameter_list->p_next; -// } -// libvlc_filter_parameters_release(p_list); -} - -QList Effect::parameters() const -{ - return parameterList; -} - -QVariant Effect::parameterValue(const EffectParameter & param) const -{ - return QVariant(); -} - -void Effect::setParameterValue(const EffectParameter & param, const QVariant & newValue) -{ -// libvlc_value_t value; -// libvlc_var_type_t type; -// switch (param.type()) { -// case QVariant::Bool: -// value.b_bool = newValue.toBool(); -// type = LIBVLC_BOOL; -// break; -// case QVariant::Int: -// value.i_int = newValue.toInt(); -// type = LIBVLC_INT; -// break; -// case QVariant::Double: -// value.f_float = (float) newValue.toDouble(); -// type = LIBVLC_FLOAT; -// break; -// case QVariant::String: -// value.psz_string = newValue.toString().toAscii().data(); -// type = LIBVLC_STRING; -// break; -// default: -// break; -// } -// switch (effect_type) { -// case EffectInfo::AudioEffect: -// libvlc_audio_filter_set_parameter( -// p_vlc_instance, -// // (libvlc_audio_filter_names_t) i_effect_filter, -// param.name().toAscii().data(), -// type, -// value, -// vlc_exception); -// vlcExceptionRaised(); -// break; -// case EffectInfo::VideoEffect: -// libvlc_video_filter_set_parameter( -// p_vlc_current_media_player, -// (libvlc_video_filter_names_t) i_effect_filter, -// param.name().toAscii().data(), -// type, -// value, -// vlc_exception); -// vlcExceptionRaised(); -// break; -// } -} - -} -} // Namespace Phonon::VLC diff --git a/bindings/phonon/vlc/effect.h b/bindings/phonon/vlc/effect.h deleted file mode 100644 index 760aa0a4ec..0000000000 --- a/bindings/phonon/vlc/effect.h +++ /dev/null @@ -1,67 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef PHONON_VLC_EFFECT_H -#define PHONON_VLC_EFFECT_H - -#include "sinknode.h" -#include "effectmanager.h" - -#include -#include - -namespace Phonon -{ -namespace VLC { - -class EffectManager; - - -class Effect : public SinkNode, public EffectInterface -{ - Q_OBJECT - Q_INTERFACES(Phonon::EffectInterface) - -public: - - Effect(EffectManager *p_em, int i_effectId, QObject *p_parent); - ~Effect(); - - void setupEffectParams(); - QList parameters() const; - QVariant parameterValue(const EffectParameter & param) const; - void setParameterValue(const EffectParameter & param, const QVariant & newValue); - - void connectToMediaObject(PrivateMediaObject *p_media_object); - void disconnectFromMediaObject(PrivateMediaObject *p_media_object); - -private: - - EffectManager *p_effectManager; - int i_effect_filter; - EffectInfo::Type effect_type; - QList parameterList; -}; - -} -} // Namespace Phonon::VLC - -#endif // PHONON_VLC_EFFECT_H diff --git a/bindings/phonon/vlc/effectmanager.cpp b/bindings/phonon/vlc/effectmanager.cpp deleted file mode 100644 index e71c21aa7c..0000000000 --- a/bindings/phonon/vlc/effectmanager.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "effectmanager.h" -#include "backend.h" - -namespace Phonon -{ -namespace VLC { - -EffectInfo::EffectInfo(const QString &name, const QString &description, const QString &author, int filter, Type type) - : m_name(name) - , m_description(description) - , m_author(author) - , m_filter(filter) - , m_type(type) {} - -EffectManager::EffectManager(Backend *backend) - : QObject(backend) - , m_backend(backend) -{ -// m_equalizerEnabled = false; - - // Audio effects - equalizer - // Only one of them can be used => last set - // It is clever used with combobox - -// audioEffectList.append(new EffectInfo("(Audio) Equalizer", EQUALIZER, EffectInfo::AudioEffect)); - -// audioEffectList.append(new EffectInfo("(Audio) Headphone spalization", -// HEADPHONE_SPALIZATION, EffectInfo::AudioEffect, -// "This effect gives you the feeling that you are standing in a room " -// "with a complete 7.1 speaker set when using only a headphone, " -// "providing a more realistic sound experience. It should also be " -// "more comfortable and less tiring when listening to music for " -// "long periods of time.\nIt works with any source format from mono " -// "to 7.1.")); - -// audioEffectList.append(new EffectInfo("(Audio) Parametric equalizer", -// PARAMETRIC_EQUALIZER, EffectInfo::AudioEffect)); - -// audioEffectList.append(new EffectInfo("(Audio) Scaletempo", -// SCALETEMPO, EffectInfo::AudioEffect, -// "Scale audio tempo in sync with playback rate")); - -// audioEffectList.append(new EffectInfo("(Audio) Spatializer", -// SPATIALIZER, EffectInfo::AudioEffect)); - -// audioEffectList.append(new EffectInfo("(Audio) Volume normalizer", -// VOLUME_NORMALIZER, EffectInfo::AudioEffect)); - -// audioEffectList.append(new EffectInfo("(Audio) Flat", FLAT, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Classical", CLASSICAL, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Club", CLUB, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Dance", DANCE, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Fullbass", FULLBASS, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Fullbasstreble", FULLBASSTREBLE, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Fulltreble", FULLTREBLE, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Headphones", HEADPHONES, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Large hall", LARGEHALL, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Live", LIVE, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Party", PARTY, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Pop", POP, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Reggae", REGGAE, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Rock", ROCK, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Ska", SKA, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Soft", SOFT, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Softrock", SOFTROCK, EffectInfo::AudioEffect)); -// audioEffectList.append(new EffectInfo("(Audio) Techno", TECHNO, EffectInfo::AudioEffect)); - - // Video effects - // More than one can be used simultaneously - // It is clever used with checkbox - -// videoEffectList.append(new EffectInfo("(Video) Atmo light", ATMOLIGHT, EffectInfo::VideoEffect, -// "AtmoLight Filter - " -// "This module allows to control an so called AtmoLight device " -// "connected to your computer.\n" -// "AtmoLight is the homegrown version of what Philips calls AmbiLight.\n" -// "If you need further information feel free to visit us at\n\n" -// "http://www.vdr-wiki.de/wiki/index.php/Atmo-plugin\n " -// "http://www.vdr-wiki.de/wiki/index.php/AtmoWin\n\n" -// "You can find there detailed descriptions on how to build it for yourself " -// "and where to get the required parts.\n" -// "You can also have a look at pictures and some movies showing such a device " -// "in live action.", -// "André Weber (WeberAndre@gmx.de)")); - -// videoEffectList.append(new EffectInfo("(Video) Bluescreen", BLUESCREEN, EffectInfo::VideoEffect, -// "Bluescreen video filter", "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Color threshold", COLORTHRESHOLD, EffectInfo::VideoEffect, -// "Color threshold filter", "Sigmund Augdal ")); - -// videoEffectList.append(new EffectInfo("(Video) Deinterlace", DEINTERLACE, EffectInfo::VideoEffect, -// "Deinterlacing video filter", "Sam Hocevar ")); - -// videoEffectList.append(new EffectInfo("(Video) Extract", EXTRACT, EffectInfo::VideoEffect, -// "Extract RGB component video filter", -// "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Gaussian blur", GAUSSIAN_BLUR, EffectInfo::VideoEffect, -// "Erase video filter", "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Gradient", GRADIENT, EffectInfo::VideoEffect, -// "Gradient video filter", -// "Samuel Hocevar , " -// "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Grain", GRAIN, EffectInfo::VideoEffect, -// "Grain video filter", "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Invert", INVERT, EffectInfo::VideoEffect, -// "Invert video filter - color inversion", -// "Samuel Hocevar ")); - -// videoEffectList.append(new EffectInfo("(Video) Motion blur", MOTIONBLUR, EffectInfo::VideoEffect, -// "Motion blur filter", -// "Sigmund Augdal Helberg , " -// "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Motion detect", MOTIONDETECT, EffectInfo::VideoEffect, -// "Motion detect video filter", -// "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Noise", NOISE, EffectInfo::VideoEffect, -// "Noise video filter - add noise to image", -// "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Postprocess", POSTPROCESS, EffectInfo::VideoEffect, -// "Video post processing filter", -// "Laurent Aimar , " -// "Gildas Bazin , " -// "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Psychedelic", PSYCHEDELIC, EffectInfo::VideoEffect, -// "Psychedelic video filter", -// "Samuel Hocevar , " -// "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Ripple", RIPPLE, EffectInfo::VideoEffect, -// "Ripple video filter", -// "Samuel Hocevar , " -// "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Rotate", ROTATE, EffectInfo::VideoEffect, -// "Rotate video filter", -// "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Seam carving", SEAM_CARVING, EffectInfo::VideoEffect, -// "Seam Carving for Content-Aware Image Resizing", -// "Antoine Cellerier ")); - -// videoEffectList.append(new EffectInfo("(Video) Sharpen", SHARPEN, EffectInfo::VideoEffect, -// "Sharpen video filter - Augment contrast between contours.", -// "Jérémy DEMEULE , " -// "Jean-Baptiste Kempf ")); - -// videoEffectList.append(new EffectInfo("(Video) Wave", WAVE, EffectInfo::VideoEffect, -// "Wave video filter", -// "Samuel Hocevar , " -// "Antoine Cellerier ")); - - updateEffects(); -} - -EffectManager::~EffectManager() -{ - qDeleteAll(m_audioEffectList); - m_audioEffectList.clear(); - qDeleteAll(m_videoEffectList); - m_videoEffectList.clear(); - qDeleteAll(m_effectList); - m_effectList.clear(); -} - -/** - * Returns a list of available audio effects - */ -const QList EffectManager::audioEffects() const -{ - return m_audioEffectList; -} - -/** - * Returns a list of available video effects - */ -const QList EffectManager::videoEffects() const -{ - return m_videoEffectList; -} - -/** - * Returns a list of available effects - */ -const QList EffectManager::effects() const -{ - return m_effectList; -} - -void EffectManager::updateEffects() -{ - m_effectList.clear(); - m_effectList += m_audioEffectList; - m_effectList += m_videoEffectList; -} - -} -} // namespace Phonon::VLC diff --git a/bindings/phonon/vlc/effectmanager.h b/bindings/phonon/vlc/effectmanager.h deleted file mode 100644 index 4724b38d40..0000000000 --- a/bindings/phonon/vlc/effectmanager.h +++ /dev/null @@ -1,101 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef Phonon_VLC_EFFECTMANAGER_H -#define Phonon_VLC_EFFECTMANAGER_H - -#include -#include - -#include - -namespace Phonon -{ -namespace VLC { -class Backend; -class EffectManager; - -class EffectInfo -{ -public: - - enum Type {AudioEffect, VideoEffect}; - - EffectInfo(const QString &name, - const QString &description, - const QString &author, - int filter, - Type type); - - QString name() const { - return m_name; - } - - QString description() const { - return m_description; - } - - QString author() const { - return m_author; - } - - int filter() const { - return m_filter; - } - - Type type() const { - return m_type; - } - -private: - QString m_name; - QString m_description; - QString m_author; - int m_filter; - Type m_type; -}; - -class EffectManager : public QObject -{ - Q_OBJECT - -public: - EffectManager(Backend *parent); - virtual ~EffectManager(); - - const QList audioEffects() const; - const QList videoEffects() const; - const QList effects() const; - -private: - void updateEffects(); - - Backend *m_backend; - QList m_effectList; - QList m_audioEffectList; - QList m_videoEffectList; - bool m_equalizerEnabled; -}; - -} -} // namespace Phonon::VLC - -#endif // Phonon_VLC_EFFECTMANAGER_H diff --git a/bindings/phonon/vlc/mediacontroller.cpp b/bindings/phonon/vlc/mediacontroller.cpp deleted file mode 100644 index f38909be99..0000000000 --- a/bindings/phonon/vlc/mediacontroller.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "mediacontroller.h" - -namespace Phonon -{ -namespace VLC { - -MediaController::MediaController() -{ - clearMediaController(); -} - -MediaController::~MediaController() -{ -} - -void MediaController::clearMediaController() -{ - current_audio_channel = Phonon::AudioChannelDescription(); - available_audio_channels.clear(); - - current_subtitle = Phonon::SubtitleDescription(); - available_subtitles.clear(); - -// current_chapter = Phonon::ChapterDescription(); -// available_chapters.clear(); - current_chapter = 0; - available_chapters = 0; - -// current_title = Phonon::TitleDescription(); -// available_titles.clear(); - current_title = 0; - available_titles = 0; - - i_current_angle = 0; - i_available_angles = 0; - - b_autoplay_titles = false; -} - -bool MediaController::hasInterface(Interface iface) const -{ - switch (iface) { - case AddonInterface::NavigationInterface: - return true; - break; - case AddonInterface::ChapterInterface: - return true; - break; - case AddonInterface::AngleInterface: - return true; - break; - case AddonInterface::TitleInterface: - return true; - break; - case AddonInterface::SubtitleInterface: - return true; - break; - case AddonInterface::AudioChannelInterface: - return true; - break; - default: - qCritical() << __FUNCTION__ - << "Error: unsupported AddonInterface::Interface" - << iface; - } - - return false; -} - -QVariant MediaController::interfaceCall(Interface iface, int i_command, const QList & arguments) -{ - switch (iface) { - case AddonInterface::ChapterInterface: - switch (static_cast(i_command)) { -// case AddonInterface::availableChapters: -// return QVariant::fromValue(availableChapters()); - case AddonInterface::availableChapters: - return availableChapters(); -// case AddonInterface::currentChapter: -// return QVariant::fromValue(currentChapter()); - case AddonInterface::chapter: - return currentChapter(); -// case AddonInterface::setCurrentChapter: -// if( arguments.isEmpty() || !arguments.first().canConvert()) { -// qCritical() << __FUNCTION__ << "Error: arguments invalid"; -// return false; -// } -// setCurrentChapter(arguments.first().value()); -// return true; - case AddonInterface::setChapter: - if (arguments.isEmpty() || !arguments.first().canConvert(QVariant::Int)) { - qCritical() << __FUNCTION__ << "Error: arguments invalid"; - return false; - } - setCurrentChapter(arguments.first().toInt()); - return true; - default: - qCritical() << __FUNCTION__ - << "Error: unsupported AddonInterface::ChapterInterface command:" - << i_command; - } - break; - case AddonInterface::TitleInterface: - switch (static_cast(i_command)) { -// case AddonInterface::availableTitles: -// return QVariant::fromValue(availableTitles()); - case AddonInterface::availableTitles: - return availableTitles(); -// case AddonInterface::currentTitle: -// return QVariant::fromValue(currentTitle()); - case AddonInterface::title: - return currentTitle(); -// case AddonInterface::setCurrentTitle: -// if( arguments.isEmpty() || !arguments.first().canConvert()) { -// qCritical() << __FUNCTION__ << "Error: arguments invalid"; -// return false; -// } -// setCurrentTitle(arguments.first().value()); -// return true; - case AddonInterface::setTitle: - if (arguments.isEmpty() || !arguments.first().canConvert(QVariant::Int)) { - qCritical() << __FUNCTION__ << "Error: arguments invalid"; - return false; - } - setCurrentTitle(arguments.first().toInt()); - return true; - case AddonInterface::autoplayTitles: - return autoplayTitles(); - case AddonInterface::setAutoplayTitles: - if (arguments.isEmpty() || !arguments.first().canConvert(QVariant::Bool)) { - qCritical() << __FUNCTION__ << "Error: arguments invalid"; - return false; - } - setAutoplayTitles(arguments.first().toBool()); - return true; - default: - qCritical() << __FUNCTION__ - << "Error: unsupported AddonInterface::TitleInterface command:" - << i_command; - } - break; - case AddonInterface::AngleInterface: - switch (static_cast(i_command)) { - case AddonInterface::availableAngles: - case AddonInterface::angle: - case AddonInterface::setAngle: - break; - default: - qCritical() << __FUNCTION__ - << "Error: unsupported AddonInterface::AngleInterface command:" - << i_command; - } - break; - case AddonInterface::SubtitleInterface: - switch (static_cast(i_command)) { - case AddonInterface::availableSubtitles: - return QVariant::fromValue(availableSubtitles()); - case AddonInterface::currentSubtitle: - return QVariant::fromValue(currentSubtitle()); - case AddonInterface::setCurrentSubtitle: - if (arguments.isEmpty() || !arguments.first().canConvert()) { - qCritical() << __FUNCTION__ << "Error: arguments invalid"; - return false; - } - setCurrentSubtitle(arguments.first().value()); - return true; - default: - qCritical() << __FUNCTION__ - << "Error: unsupported AddonInterface::SubtitleInterface command:" - << i_command; - } - break; - case AddonInterface::AudioChannelInterface: - switch (static_cast(i_command)) { - case AddonInterface::availableAudioChannels: - return QVariant::fromValue(availableAudioChannels()); - case AddonInterface::currentAudioChannel: - return QVariant::fromValue(currentAudioChannel()); - case AddonInterface::setCurrentAudioChannel: - if (arguments.isEmpty() || !arguments.first().canConvert()) { - qCritical() << __FUNCTION__ << "Error: arguments invalid"; - return false; - } - setCurrentAudioChannel(arguments.first().value()); - return true; - default: - qCritical() << __FUNCTION__ - << "Error: unsupported AddonInterface::AudioChannelInterface command:" - << i_command; - } - break; - default: - qCritical() << __FUNCTION__ - << "Error: unsupported AddonInterface::Interface:" - << iface; - } - - return QVariant(); -} - -} -} // Namespace Phonon::VLC diff --git a/bindings/phonon/vlc/mediacontroller.h b/bindings/phonon/vlc/mediacontroller.h deleted file mode 100644 index 853e559388..0000000000 --- a/bindings/phonon/vlc/mediacontroller.h +++ /dev/null @@ -1,139 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef PHONON_VLC_MEDIACONTROLLER_H -#define PHONON_VLC_MEDIACONTROLLER_H - -#include -#include - -namespace Phonon -{ -namespace VLC { - -/** - * Interface for AddonInterface. - * - * This class cannot inherit from QObject has MediaObject already inherit from QObject. - * This is a Qt limitation: there is no possibility to inherit virtual Qobject :/ - * See http://doc.trolltech.com/qq/qq15-academic.html - * Phonon implementation got the same problem. - * - * @see VLCMediaController - * @see VLCMediaObject - * @see MediaObject - */ -class MediaController : public AddonInterface -{ -public: - - MediaController(); - virtual ~MediaController(); - - bool hasInterface(Interface iface) const; - - QVariant interfaceCall(Interface iface, int i_command, const QList & arguments = QList()); - - // MediaController signals - virtual void availableSubtitlesChanged() = 0; - virtual void availableAudioChannelsChanged() = 0; - -// virtual void availableChaptersChanged() = 0; -// virtual void availableTitlesChanged() = 0; - virtual void availableChaptersChanged(int) = 0; - virtual void availableTitlesChanged(int) = 0; - - virtual void availableAnglesChanged(int i_available_angles) = 0; - virtual void angleChanged(int i_angle_number) = 0; - virtual void chapterChanged(int i_chapter_number) = 0; - virtual void titleChanged(int i_title_number) = 0; - -protected: - - // AudioChannel - virtual void setCurrentAudioChannel(const Phonon::AudioChannelDescription & audioChannel) = 0; - virtual QList availableAudioChannels() const = 0; - virtual Phonon::AudioChannelDescription currentAudioChannel() const = 0; - - // Subtitle - virtual void setCurrentSubtitle(const Phonon::SubtitleDescription & subtitle) = 0; - virtual QList availableSubtitles() const = 0; - virtual Phonon::SubtitleDescription currentSubtitle() const = 0; - - // Angle - virtual void setCurrentAngle(int i_angle_number) = 0; - virtual int availableAngles() const = 0; - virtual int currentAngle() const = 0; - - // Chapter -// virtual void setCurrentChapter( const Phonon::ChapterDescription & chapter ) = 0; -// virtual QList availableChapters() const = 0; -// virtual Phonon::ChapterDescription currentChapter() const = 0; - virtual void setCurrentChapter(int chapterNumber) = 0; - virtual int availableChapters() const = 0; - virtual int currentChapter() const = 0; - - // Title -// virtual void setCurrentTitle( const Phonon::TitleDescription & title ) = 0; -// virtual QList availableTitles() const = 0; -// virtual Phonon::TitleDescription currentTitle() const = 0; - virtual void setCurrentTitle(int titleNumber) = 0; - virtual int availableTitles() const = 0; - virtual int currentTitle() const = 0; - - virtual void setAutoplayTitles(bool b_autoplay) = 0; - virtual bool autoplayTitles() const = 0; - - /** - * Clear all (i.e availableSubtitles, availableChapters...). - * - * This is used each time we restart the video. - */ - virtual void clearMediaController(); - - Phonon::AudioChannelDescription current_audio_channel; - QList available_audio_channels; - - Phonon::SubtitleDescription current_subtitle; - QList available_subtitles; - -// Phonon::ChapterDescription current_chapter; -// QList available_chapters; - int current_chapter; - int available_chapters; - -// Phonon::TitleDescription current_title; -// QList available_titles; - int current_title; - int available_titles; - - int i_current_angle; - int i_available_angles; - - bool b_autoplay_titles; - -private: -}; - -} -} // Namespace Phonon::VLC - -#endif // PHONON_VLC_MEDIACONTROLLER_H diff --git a/bindings/phonon/vlc/mediaobject.cpp b/bindings/phonon/vlc/mediaobject.cpp deleted file mode 100644 index a8a845bebc..0000000000 --- a/bindings/phonon/vlc/mediaobject.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "mediaobject.h" - -#include "seekstack.h" - -#include -#include -#include - -//Time in milliseconds before sending aboutToFinish() signal -//2 seconds -static const int ABOUT_TO_FINISH_TIME = 2000; - -namespace Phonon -{ -namespace VLC { - -MediaObject::MediaObject(QObject *p_parent) - : QObject(p_parent) -{ - currentState = Phonon::LoadingState; - i_video_widget_id = 0; - b_prefinish_mark_reached_emitted = false; - b_about_to_finish_emitted = false; - i_transition_time = 0; - - // By default, no tick() signal - // FIXME: Not implemented yet - i_tick_interval = 0; - - qRegisterMetaType >("QMultiMap"); - - connect(this, SIGNAL(stateChanged(Phonon::State)), - SLOT(stateChangedInternal(Phonon::State))); - - connect(this, SIGNAL(tickInternal(qint64)), - SLOT(tickInternalSlot(qint64))); -} - -MediaObject::~MediaObject() -{ -} - -void MediaObject::setVideoWidgetId(WId i_widget_id) -{ - i_video_widget_id = i_widget_id; -} - -void MediaObject::play() -{ - qDebug() << __FUNCTION__; - - if (currentState == Phonon::PausedState) { - resume(); - } else { - // Play the file - playInternal(); - } -} - -void MediaObject::seek(qint64 milliseconds) -{ - static SeekStack *p_stack = new SeekStack(this); - - p_stack->pushSeek(milliseconds); - - qint64 currentTime = this->currentTime(); - qint64 totalTime = this->totalTime(); - - if (currentTime < totalTime - i_prefinish_mark) { - b_prefinish_mark_reached_emitted = false; - } - if (currentTime < totalTime - ABOUT_TO_FINISH_TIME) { - b_about_to_finish_emitted = false; - } -} - -void MediaObject::tickInternalSlot(qint64 currentTime) -{ - qint64 totalTime = this->totalTime(); - - if (i_tick_interval > 0) { - // If _tickInternal == 0 means tick() signal is disabled - // Default is _tickInternal = 0 - emit tick(currentTime); - } - - if (currentState == Phonon::PlayingState) { - if (currentTime >= totalTime - i_prefinish_mark) { - if (!b_prefinish_mark_reached_emitted) { - b_prefinish_mark_reached_emitted = true; - emit prefinishMarkReached(totalTime - currentTime); - } - } - if (currentTime >= totalTime - ABOUT_TO_FINISH_TIME) { - if (!b_about_to_finish_emitted) { - // Track is about to finish - b_about_to_finish_emitted = true; - emit aboutToFinish(); - } - } - } -} - -void MediaObject::loadMedia(const QString & filename) -{ - // Default MediaObject state is Phonon::LoadingState - currentState = Phonon::LoadingState; - - // Load the media - loadMediaInternal(filename); -} - -void MediaObject::resume() -{ - pause(); -} - -qint32 MediaObject::tickInterval() const -{ - return i_tick_interval; -} - -void MediaObject::setTickInterval(qint32 tickInterval) -{ - i_tick_interval = tickInterval; -// if (_tickInterval <= 0) { -// _tickTimer->setInterval(50); -// } else { -// _tickTimer->setInterval(_tickInterval); -// } -} - -qint64 MediaObject::currentTime() const -{ - qint64 time = -1; - Phonon::State st = state(); - - switch (st) { - case Phonon::PausedState: - time = currentTimeInternal(); - break; - case Phonon::BufferingState: - time = currentTimeInternal(); - break; - case Phonon::PlayingState: - time = currentTimeInternal(); - break; - case Phonon::StoppedState: - time = 0; - break; - case Phonon::LoadingState: - time = 0; - break; - case Phonon::ErrorState: - time = -1; - break; - default: - qCritical() << __FUNCTION__ << "Error: unsupported Phonon::State:" << st; - } - - return time; -} - -Phonon::State MediaObject::state() const -{ - return currentState; -} - -Phonon::ErrorType MediaObject::errorType() const -{ - return Phonon::NormalError; -} - -MediaSource MediaObject::source() const -{ - return mediaSource; -} - -void MediaObject::setSource(const MediaSource & source) -{ - qDebug() << __FUNCTION__; - - mediaSource = source; - - switch (source.type()) { - case MediaSource::Invalid: - break; - case MediaSource::LocalFile: - loadMedia(mediaSource.fileName()); - break; - case MediaSource::Url: - loadMedia(mediaSource.url().toString()); - break; - case MediaSource::Disc: - switch (source.discType()) { - case Phonon::NoDisc: - qCritical() << __FUNCTION__ - << "Error: the MediaSource::Disc doesn't specify which one (Phonon::NoDisc)"; - return; - case Phonon::Cd: - loadMedia(mediaSource.deviceName()); - break; - case Phonon::Dvd: - loadMedia("dvd://" + mediaSource.deviceName()); - break; - case Phonon::Vcd: - loadMedia(mediaSource.deviceName()); - break; - default: - qCritical() << __FUNCTION__ << "Error: unsupported MediaSource::Disc:" << source.discType(); - break; - } - break; - case MediaSource::Stream: - break; - default: - qCritical() << __FUNCTION__ - << "Error: unsupported MediaSource:" - << source.type(); - break; - } - - emit currentSourceChanged(mediaSource); -} - -void MediaObject::setNextSource(const MediaSource & source) -{ - setSource(source); -} - -qint32 MediaObject::prefinishMark() const -{ - return i_prefinish_mark; -} - -void MediaObject::setPrefinishMark(qint32 msecToEnd) -{ - i_prefinish_mark = msecToEnd; - if (currentTime() < totalTime() - i_prefinish_mark) { - // Not about to finish - b_prefinish_mark_reached_emitted = false; - } -} - -qint32 MediaObject::transitionTime() const -{ - return i_transition_time; -} - -void MediaObject::setTransitionTime(qint32 time) -{ - i_transition_time = time; -} - -void MediaObject::stateChangedInternal(Phonon::State newState) -{ - qDebug() << __FUNCTION__ << "newState:" << newState - << "previousState:" << currentState ; - - if (newState == currentState) { - // State not changed - return; - } - - // State changed - Phonon::State previousState = currentState; - currentState = newState; - emit stateChanged(currentState, previousState); -} - -} -} // Namespace Phonon::VLC diff --git a/bindings/phonon/vlc/mediaobject.h b/bindings/phonon/vlc/mediaobject.h deleted file mode 100644 index 23eca49bf8..0000000000 --- a/bindings/phonon/vlc/mediaobject.h +++ /dev/null @@ -1,127 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef PHONON_VLC_MEDIAOBJECT_H -#define PHONON_VLC_MEDIAOBJECT_H - -#include - -#include -#include - -namespace Phonon -{ -namespace VLC { - -class SeekStack; - -class MediaObject : public QObject, public MediaObjectInterface -{ - Q_OBJECT - friend class SeekStack; - -public: - - MediaObject(QObject *p_parent); - virtual ~MediaObject(); - - /** - * Widget Id where VLC will show the videos. - */ - void setVideoWidgetId(WId i_widget_id); - - void play(); - void seek(qint64 milliseconds); - - qint32 tickInterval() const; - void setTickInterval(qint32 tickInterval); - - qint64 currentTime() const; - Phonon::State state() const; - Phonon::ErrorType errorType() const; - MediaSource source() const; - void setSource(const MediaSource & source); - void setNextSource(const MediaSource & source); - - qint32 prefinishMark() const; - void setPrefinishMark(qint32 msecToEnd); - - qint32 transitionTime() const; - void setTransitionTime(qint32); - -signals: - - void aboutToFinish(); - void bufferStatus( int i_percent_filled ); - void currentSourceChanged( const MediaSource & newSource ); - void finished(); - void hasVideoChanged(bool b_has_video); - void metaDataChanged(const QMultiMap & metaData); - void prefinishMarkReached(qint32 msecToEnd); - void seekableChanged(bool b_is_seekable); - void stateChanged(Phonon::State newState, Phonon::State oldState); - void tick(qint64 time); - void totalTimeChanged(qint64 newTotalTime); - - // Signal from VLCMediaObject - void stateChanged(Phonon::State newState); - - void tickInternal(qint64 time); - -protected: - - virtual void loadMediaInternal(const QString & filename) = 0; - virtual void playInternal() = 0; - virtual void seekInternal(qint64 milliseconds) = 0; - - virtual qint64 currentTimeInternal() const = 0; - - WId i_video_widget_id; - -private slots: - - void stateChangedInternal(Phonon::State newState); - - void tickInternalSlot(qint64 time); - -private: - - void loadMedia(const QString & filename); - - void resume(); - - MediaSource mediaSource; - - Phonon::State currentState; - - qint32 i_prefinish_mark; - bool b_prefinish_mark_reached_emitted; - - bool b_about_to_finish_emitted; - - qint32 i_tick_interval; - qint32 i_transition_time; -}; - -} -} // Namespace Phonon::VLC - -#endif // PHONON_VLC_MEDIAOBJECT_H diff --git a/bindings/phonon/vlc/seekstack.cpp b/bindings/phonon/vlc/seekstack.cpp deleted file mode 100644 index a2eb145bc5..0000000000 --- a/bindings/phonon/vlc/seekstack.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "seekstack.h" - -#include -#include - -namespace Phonon -{ -namespace VLC { - -SeekStack::SeekStack(MediaObject *mediaObject) - : QObject(mediaObject) -{ - p_media_object = mediaObject; - - p_timer = new QTimer(this); - connect(p_timer, SIGNAL(timeout()), - SLOT(popSeek())); - p_timer->setInterval(1000); -} - -SeekStack::~SeekStack() -{ -} - -void SeekStack::pushSeek(qint64 milliseconds) -{ - qDebug() << __FUNCTION__ << "seek:" << milliseconds; - - disconnect(p_media_object, SIGNAL(tickInternal(qint64)), - p_media_object, SLOT(tickInternalSlot(qint64))); - - stack.push(milliseconds); - - if (!p_timer->isActive()) { - p_timer->start(); - popSeek(); - } -} - -void SeekStack::popSeek() -{ - if (stack.isEmpty()) { - p_timer->stop(); - reconnectTickSignal(); - return; - } - - int i_milliseconds = stack.pop(); - stack.clear(); - - qDebug() << __FUNCTION__ << "real seek:" << i_milliseconds; - - p_media_object->seekInternal(i_milliseconds); - - reconnectTickSignal(); -} - -void SeekStack::reconnectTickSignal() -{ - connect(p_media_object, SIGNAL(tickInternal(qint64)), - p_media_object, SLOT(tickInternalSlot(qint64))); -} - -} -} // Namespace Phonon::VLC diff --git a/bindings/phonon/vlc/seekstack.h b/bindings/phonon/vlc/seekstack.h deleted file mode 100644 index 595b41a41d..0000000000 --- a/bindings/phonon/vlc/seekstack.h +++ /dev/null @@ -1,70 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef PHONON_VLC_SEEKSTACK_H -#define PHONON_VLC_SEEKSTACK_H - -#include "mediaobject.h" - -#include -#include - -class QTimer; - -namespace Phonon -{ -namespace VLC { - -/** - * A queue of seek commands. - */ -class SeekStack : public QObject -{ - Q_OBJECT - -public: - - SeekStack(MediaObject *mediaObject); - ~SeekStack(); - - void pushSeek(qint64 milliseconds); - -signals: - -private slots: - - void popSeek(); - - void reconnectTickSignal(); - -private: - - MediaObject *p_media_object; - - QTimer *p_timer; - - QStack stack; -}; - -} -} // Namespace Phonon::VLC - -#endif // PHONON_VLC_SEEKSTACK_H diff --git a/bindings/phonon/vlc/sinknode.cpp b/bindings/phonon/vlc/sinknode.cpp deleted file mode 100644 index dbba04c8e2..0000000000 --- a/bindings/phonon/vlc/sinknode.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "sinknode.h" - -#include "mediaobject.h" - -namespace Phonon -{ -namespace VLC { - -SinkNode::SinkNode(QObject *p_parent) - : QObject(p_parent) -{ - p_media_object = 0; -} - -SinkNode::~SinkNode() -{ -} - -void SinkNode::connectToMediaObject(PrivateMediaObject * mediaObject) -{ - if (p_media_object) - qCritical() << __FUNCTION__ << "p_media_object already connected"; - - p_media_object = mediaObject; -} - -void SinkNode::disconnectFromMediaObject(PrivateMediaObject * mediaObject) -{ - if (p_media_object != mediaObject) - qCritical() << __FUNCTION__ << "SinkNode was not connected to mediaObject"; -} - - -} -} // Namespace Phonon::VLC_MPlayer diff --git a/bindings/phonon/vlc/sinknode.h b/bindings/phonon/vlc/sinknode.h deleted file mode 100644 index 10990e892f..0000000000 --- a/bindings/phonon/vlc/sinknode.h +++ /dev/null @@ -1,59 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef PHONON_VLC_SINKNODE_H -#define PHONON_VLC_SINKNODE_H - -#include -#include - -namespace Phonon -{ -namespace VLC { - -class VLCMediaObject; -typedef VLCMediaObject PrivateMediaObject; - -class SinkNode : public QObject -{ - Q_OBJECT - -public: - - SinkNode(QObject *p_parent); - virtual ~SinkNode(); - - virtual void connectToMediaObject(PrivateMediaObject *mediaObject); - - virtual void disconnectFromMediaObject(PrivateMediaObject *mediaObject); - -protected: - - PrivateMediaObject *p_media_object; - -private: - -}; - -} -} // Namespace Phonon::VLC - -#endif // PHONON_VLC_SINKNODE_H diff --git a/bindings/phonon/vlc/videowidget.cpp b/bindings/phonon/vlc/videowidget.cpp deleted file mode 100644 index 8902112b8d..0000000000 --- a/bindings/phonon/vlc/videowidget.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "videowidget.h" - -#include "mediaobject.h" -#include "vlcmediaobject.h" - -#include "vlcloader.h" - -#include -#include -#include -#include - -namespace Phonon -{ -namespace VLC { - -VideoWidget::VideoWidget(QWidget *p_parent) - : SinkNode(p_parent) -{ - p_video_widget = new Widget(p_parent); - - aspect_ratio = Phonon::VideoWidget::AspectRatioAuto; - scale_mode = Phonon::VideoWidget::FitInView; - - b_filter_adjust_activated = false; - f_brightness = 0.0; - f_contrast = 0.0; - f_hue = 0.0; - f_saturation = 0.0; -} - -VideoWidget::~VideoWidget() -{ -} - -void VideoWidget::connectToMediaObject(PrivateMediaObject *mediaObject) -{ - SinkNode::connectToMediaObject(mediaObject); - - connect(mediaObject, SIGNAL(videoWidgetSizeChanged(int, int)), - SLOT(videoWidgetSizeChanged(int, int))); - - mediaObject->setVideoWidgetId(p_video_widget->winId()); -} - -Phonon::VideoWidget::AspectRatio VideoWidget::aspectRatio() const -{ - return aspect_ratio; -} - -// VLC accepted formats are x:y (4:3, 16:9, etc...) expressing the global image aspect -void VideoWidget::setAspectRatio(Phonon::VideoWidget::AspectRatio aspect) -{ - // finish if no player - if (!vlc_current_media_player) - return; - - aspect_ratio = aspect; - - switch (aspect_ratio) { - case Phonon::VideoWidget::AspectRatioAuto: // Let the decoder find the aspect ratio automatically from the media file (this is the default) -// p_libvlc_video_set_aspect_ratio(p_vlc_current_media_player, "", vlc_exception); - vlcExceptionRaised(); - break; - case Phonon::VideoWidget::AspectRatioWidget: // Fit the video into the widget making the aspect ratio depend solely on the size of the widget - // This way the aspect ratio is freely resizeable by the user -// p_libvlc_video_set_aspect_ratio(p_vlc_current_media_player, "", vlc_exception); - vlcExceptionRaised(); - break; - case Phonon::VideoWidget::AspectRatio4_3: -// p_libvlc_video_set_aspect_ratio(p_vlc_current_media_player, "4:3", vlc_exception); - vlcExceptionRaised(); - break; - case Phonon::VideoWidget::AspectRatio16_9: -// p_libvlc_video_set_aspect_ratio(p_vlc_current_media_player, "16:9", vlc_exception); - vlcExceptionRaised(); - break; - default: - qCritical() << __FUNCTION__ << "error: unsupported AspectRatio:" << (int) aspect_ratio; - } -} - -Phonon::VideoWidget::ScaleMode VideoWidget::scaleMode() const -{ - return scale_mode; -} - -// The ScaleMode enumeration describes how to treat aspect ratio during resizing of video -void VideoWidget::setScaleMode(Phonon::VideoWidget::ScaleMode scale) -{ - scale_mode = scale; - switch (scale_mode) { - case Phonon::VideoWidget::FitInView: // The video will be fitted to fill the view keeping aspect ratio - break; - case Phonon::VideoWidget::ScaleAndCrop: // The video is scaled - break; - default: - qWarning() << __FUNCTION__ << "unknow Phonon::VideoWidget::ScaleMode:" << scale_mode; - } -} - -qreal VideoWidget::brightness() const -{ - return f_brightness; -} - -void VideoWidget::setBrightness(qreal brightness) -{ - f_brightness = brightness; - - // vlc takes brightness in range 0.0 - 2.0 - if (vlc_current_media_player) { - if (!b_filter_adjust_activated) { -// p_libvlc_video_filter_add(p_vlc_current_media_player, ADJUST, vlc_exception); -// vlcExceptionRaised(); - b_filter_adjust_activated = true; - } -// p_libvlc_video_set_brightness(p_vlc_current_media_player, f_brightness + 1.0, vlc_exception); -// vlcExceptionRaised(); - } -} - -qreal VideoWidget::contrast() const -{ - return f_contrast; -} - -void VideoWidget::setContrast(qreal contrast) -{ - f_contrast = contrast; - - // vlc takes contrast in range 0.0 - 2.0 - float f_contrast = contrast; - if (vlc_current_media_player) { - if (!b_filter_adjust_activated) { -// p_libvlc_video_filter_add(p_vlc_current_media_player, ADJUST, vlc_exception); -// vlcExceptionRaised(); - b_filter_adjust_activated = true; - } -// p_libvlc_video_set_contrast(p_vlc_current_media_player, f_contrast + 1.0, vlc_exception); -// vlcExceptionRaised(); - } -} - -qreal VideoWidget::hue() const -{ - return f_hue; -} - -void VideoWidget::setHue(qreal hue) -{ - f_hue = hue; - - // vlc takes hue in range 0 - 360 in integer - int i_hue = (f_hue + 1.0) * 180; - if (vlc_current_media_player) { - if (!b_filter_adjust_activated) { -// p_libvlc_video_filter_add(p_vlc_current_media_player, ADJUST, vlc_exception); -// vlcExceptionRaised(); - b_filter_adjust_activated = true; - } -// p_libvlc_video_set_hue(p_vlc_current_media_player, i_hue, vlc_exception); -// vlcExceptionRaised(); - } - -} - -qreal VideoWidget::saturation() const -{ - return f_saturation; -} - -void VideoWidget::setSaturation(qreal saturation) -{ - f_saturation = saturation; - - // vlc takes brightness in range 0.0 - 3.0 - if (vlc_current_media_player) { - if (!b_filter_adjust_activated) { -// p_libvlc_video_filter_add(p_vlc_current_media_player, ADJUST, vlc_exception); -// vlcExceptionRaised(); - b_filter_adjust_activated = true; - } -// p_libvlc_video_set_saturation(p_vlc_current_media_player, (f_saturation + 1.0) * 1.5, vlc_exception); -// vlcExceptionRaised(); - } -} - -Widget * VideoWidget::widget() -{ - return p_video_widget; -} - -void VideoWidget::videoWidgetSizeChanged(int i_width, int i_height) -{ - qDebug() << __FUNCTION__ << "video width" << i_width << "height:" << i_height; - - // It resizes dynamically the widget and the main window - // Note: I didn't find another way - - QSize videoSize(i_width, i_height); - videoSize.boundedTo(QApplication::desktop()->availableGeometry().size()); - - p_video_widget->hide(); - p_video_widget->setVideoSize(videoSize); -#ifdef Q_OS_WIN - QWidget *p_parent = qobject_cast(this->parent()); - QSize previousSize = p_parent->minimumSize(); - p_parent->setMinimumSize(videoSize); -#endif - p_video_widget->show(); -#ifdef Q_OS_WIN - p_parent->setMinimumSize(previousSize); -#endif -} - -} -} // Namespace Phonon::VLC diff --git a/bindings/phonon/vlc/videowidget.h b/bindings/phonon/vlc/videowidget.h deleted file mode 100644 index 89286c9360..0000000000 --- a/bindings/phonon/vlc/videowidget.h +++ /dev/null @@ -1,91 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef PHONON_VLC_VIDEOWIDGET_H -#define PHONON_VLC_VIDEOWIDGET_H - -#include "sinknode.h" - -#include - -#include "vlcvideowidget.h" -typedef Phonon::VLC::VLCVideoWidget Widget; - - -namespace Phonon -{ -namespace VLC { - - -class VideoWidget : public SinkNode, public VideoWidgetInterface -{ - Q_OBJECT - Q_INTERFACES(Phonon::VideoWidgetInterface) -public: - - VideoWidget(QWidget *p_parent); - ~VideoWidget(); - - void connectToMediaObject(PrivateMediaObject * mediaObject); - - Phonon::VideoWidget::AspectRatio aspectRatio() const; - void setAspectRatio(Phonon::VideoWidget::AspectRatio aspect); - - Phonon::VideoWidget::ScaleMode scaleMode() const; - void setScaleMode(Phonon::VideoWidget::ScaleMode scale); - - qreal brightness() const; - void setBrightness(qreal brightness); - - qreal contrast() const; - void setContrast(qreal contrast); - - qreal hue() const; - void setHue(qreal hue); - - qreal saturation() const; - void setSaturation(qreal saturation); - - Widget * widget(); - -private slots: - - void videoWidgetSizeChanged(int width, int height); - -private: - - Widget *p_video_widget; - - Phonon::VideoWidget::AspectRatio aspect_ratio; - - Phonon::VideoWidget::ScaleMode scale_mode; - - bool b_filter_adjust_activated; - qreal f_brightness; - qreal f_contrast; - qreal f_hue; - qreal f_saturation; -}; - -} -} // Namespace Phonon::VLC - -#endif // PHONON_VLC_VIDEOWIDGET_H diff --git a/bindings/phonon/vlc/vlc.desktop b/bindings/phonon/vlc/vlc.desktop deleted file mode 100644 index e274edb0f0..0000000000 --- a/bindings/phonon/vlc/vlc.desktop +++ /dev/null @@ -1,30 +0,0 @@ -[Desktop Entry] -Type=Service -X-KDE-ServiceTypes=PhononBackend -MimeType=application/x-annodex;video/quicktime;video/x-quicktime;audio/x-m4a;application/x-quicktimeplayer;video/mkv;video/msvideo;video/x-msvideo;video/x-flic;audio/x-aiff;audio/aiff;audio/x-pn-aiff;audio/x-realaudio;audio/basic;audio/x-basic;audio/x-pn-au;audio/x-8svx;audio/8svx;audio/x-16sv;audio/168sv;image/x-ilbm;image/ilbm;video/x-anim;video/anim;image/png;image/x-png;video/mng;video/x-mng;audio/x-ogg;audio/x-speex+ogg;application/ogg;application/ogg;audio/vnd.rn-realaudio;audio/x-pn-realaudio-plugin;audio/x-real-audio;application/vnd.rn-realmedia;video/mpeg;video/x-mpeg;audio/x-wav;audio/wav;audio/x-pn-wav;audio/x-pn-windows-acm;audio/mpeg2;audio/x-mpeg2;audio/mpeg3;audio/x-mpeg3;audio/mpeg;audio/x-mpeg;x-mpegurl;audio/x-mpegurl;audio/mp3;audio/mpeg;video/x-ms-asf;application/x-flash-video; -X-KDE-Library=phonon_vlc -X-KDE-PhononBackendInfo-InterfaceVersion=1 -X-KDE-PhononBackendInfo-Version=0.1 -X-KDE-PhononBackendInfo-Website=http://www.videolan.org/ -Icon=phonon-vlc -InitialPreference=10 - -Name=VLC -Name[x-test]=xxVLCxx - -Comment=Phonon VLC backend -Comment[el]=Σύστημα υποστήριξης Phonon του VLC -Comment[et]=Phononi VLC taustaprogramm -Comment[fr]=Système de gestion VLC pour Phonon -Comment[ga]=Inneall VLC Phonon -Comment[gl]=Infraestrutura de VLC para Phonon -Comment[km]=កម្មវិធី​ខាងក្រោយ​របស់ Phonon VLC -Comment[nb]=Phonon VLC-motor -Comment[nds]=Phonon-Hülpprogramm VLC -Comment[nl]=VLC-backend (Phonon) -Comment[pt]=Infra-estrutura do VLC para o Phonon -Comment[pt_BR]=Infraestrutura Phonon VLC -Comment[sv]=Phonon VLC-gränssnitt -Comment[tr]=Phonon VLC arka ucu -Comment[uk]=Сервер VLC Phonon -Comment[x-test]=xxPhonon VLC backendxx diff --git a/bindings/phonon/vlc/vlcloader.cpp b/bindings/phonon/vlc/vlcloader.cpp deleted file mode 100644 index df3757a32e..0000000000 --- a/bindings/phonon/vlc/vlcloader.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "vlcloader.h" - -#include -#include -#include -#include -#include -#include - -// Global variables -libvlc_instance_t *vlc_instance = 0; -libvlc_exception_t *vlc_exception = new libvlc_exception_t(); -libvlc_media_player_t *vlc_current_media_player = 0; - -namespace Phonon -{ -namespace VLC { - -bool vlcInit() -{ - // Global variables - vlc_instance = 0; - vlc_exception = new libvlc_exception_t(); - - QString path = vlcPath(); - if (!path.isEmpty()) { - QString pluginsPath = QString("--plugin-path=") + QDir::toNativeSeparators(QFileInfo(vlcPath()).dir().path()); -#if defined(Q_OS_UNIX) - pluginsPath.append("/vlc"); -#elif defined(Q_OS_WIN) - pluginsPath.append("\\plugins"); -#endif - QByteArray p = path.toLatin1(); - QByteArray pp = pluginsPath.toLatin1(); - // VLC command line options. See vlc --full-help - const char *vlcArgs[] = { - p.constData(), - pp.constData(), - "--verbose=2", - "--intf=dummy", - "--extraintf=logger", - "--ignore-config", - "--reset-plugins-cache", - "--no-media-library", - "--no-one-instance", - "--no-osd", - "--no-stats", - "--no-video-title-show" - }; - - libvlc_exception_init(vlc_exception); - - // Create and initialize a libvlc instance (it should be done only once) - vlc_instance = libvlc_new(sizeof(vlcArgs) / sizeof(*vlcArgs), - vlcArgs, - vlc_exception); - vlcExceptionRaised(); - - return true; - } else { - return false; - } -} - -void vlcRelease() -{ - libvlc_release(vlc_instance); - vlcExceptionRaised(); - vlcUnload(); -} - -void vlcExceptionRaised() -{ - if (libvlc_exception_raised(vlc_exception)) { - qDebug() << "libvlc exception:" << libvlc_errmsg(); - libvlc_exception_clear(vlc_exception); - } -} - -#if defined(Q_OS_UNIX) -static bool libGreaterThan(const QString &lhs, const QString &rhs) -{ - QStringList lhsparts = lhs.split(QLatin1Char('.')); - QStringList rhsparts = rhs.split(QLatin1Char('.')); - Q_ASSERT(lhsparts.count() > 1 && rhsparts.count() > 1); - - for (int i = 1; i < rhsparts.count(); ++i) { - if (lhsparts.count() <= i) - // left hand side is shorter, so it's less than rhs - return false; - - bool ok = false; - int b = 0; - int a = lhsparts.at(i).toInt(&ok); - if (ok) - b = rhsparts.at(i).toInt(&ok); - if (ok) { - // both toInt succeeded - if (a == b) - continue; - return a > b; - } else { - // compare as strings; - if (lhsparts.at(i) == rhsparts.at(i)) - continue; - return lhsparts.at(i) > rhsparts.at(i); - } - } - - // they compared strictly equally so far - // lhs cannot be less than rhs - return true; -} -#endif - -static QStringList findAllLibVlc() -{ - QStringList paths; -#if defined(Q_OS_UNIX) - paths = QString::fromLatin1(qgetenv("LD_LIBRARY_PATH")) - .split(QLatin1Char(':'), QString::SkipEmptyParts); - paths << QLatin1String(PHONON_LIB_INSTALL_DIR) << QLatin1String("/usr/lib") << QLatin1String("/usr/local/lib"); - - QStringList foundVlcs; - foreach (const QString &path, paths) { - QDir dir = QDir(path); - QStringList entryList = dir.entryList(QStringList() << QLatin1String("libvlc.*"), QDir::Files); - - qSort(entryList.begin(), entryList.end(), libGreaterThan); - foreach (const QString &entry, entryList) - foundVlcs << path + QLatin1Char('/') + entry; - } - - return foundVlcs; -#elif defined(Q_OS_WIN) - // Read VLC version and installation directory from Windows registry - QSettings settings(QSettings::SystemScope, "VideoLAN", "VLC"); - QString vlcVersion = settings.value("Version").toString(); - QString vlcInstallDir = settings.value("InstallDir").toString(); - if (vlcVersion.startsWith("1.0") && !vlcInstallDir.isEmpty()) { - paths << vlcInstallDir + QLatin1Char('\\') + "libvlc.dll"; - return paths; - } else { - return QStringList(); - } -#endif -} - -static QLibrary *vlcLibrary = 0; - -QString vlcPath() -{ - static QString path; - if (!path.isEmpty()) { - return path; - } - - vlcLibrary = new QLibrary(); - QStringList paths = findAllLibVlc(); - foreach(path, paths) { - vlcLibrary->setFileName(path); - - if (vlcLibrary->resolve("libvlc_exception_init")) { - return path; - } else { - qDebug("Cannot resolve the symbol or load VLC library"); - } - qWarning() << vlcLibrary->errorString(); - } - - vlcUnload(); - - return QString(); -} - -void vlcUnload() -{ - vlcLibrary->unload(); - delete vlcLibrary; - vlcLibrary = 0; -} - -} -} // Namespace Phonon::VLC diff --git a/bindings/phonon/vlc/vlcloader.h b/bindings/phonon/vlc/vlcloader.h deleted file mode 100644 index e47175a8c8..0000000000 --- a/bindings/phonon/vlc/vlcloader.h +++ /dev/null @@ -1,84 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef PHONON_VLC_VLC_LOADER_H -#define PHONON_VLC_VLC_LOADER_H - -#include - -class QString; - -/** - * VLC library instance global variable. - */ -extern libvlc_instance_t *vlc_instance; - -/** - * VLC library exception handling global variable. - */ -extern libvlc_exception_t *vlc_exception; - -/** - * VLC library media player global variable. - */ -extern libvlc_media_player_t *vlc_current_media_player; - -namespace Phonon -{ -namespace VLC { - -/** - * Get VLC path. - * - * @return the VLC path - */ -QString vlcPath(); - -/** - * Unload VLC library. - */ -void vlcUnload(); - -/** - * Check for a VLC library exception. - * - * show an error message when an exception has been raised. - */ -void vlcExceptionRaised(); - -/** - * Initialize and launch VLC library. - * - * instance and exception handling global variables are initialized. - * - * @return VLC initialization result - */ -bool vlcInit(); - -/** - * Stop VLC library. - */ -void vlcRelease(); - -} -} // Namespace Phonon::VLC - -#endif // PHONON_VLC_VLC_LOADER_H diff --git a/bindings/phonon/vlc/vlcmediacontroller.cpp b/bindings/phonon/vlc/vlcmediacontroller.cpp deleted file mode 100644 index fea7939e39..0000000000 --- a/bindings/phonon/vlc/vlcmediacontroller.cpp +++ /dev/null @@ -1,295 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "vlcmediacontroller.h" - -#include "vlcloader.h" - -namespace Phonon -{ -namespace VLC { - -VLCMediaController::VLCMediaController() - : MediaController() -{ - p_vlc_media_player = 0; -} - -VLCMediaController::~VLCMediaController() -{ -} - -void VLCMediaController::clearMediaController() -{ - current_audio_channel = Phonon::AudioChannelDescription(); - available_audio_channels.clear(); - - current_subtitle = Phonon::SubtitleDescription(); - available_subtitles.clear(); - - i_current_angle = 0; - i_available_angles = 0; - -// current_chapter = Phonon::ChapterDescription(); -// available_chapters.clear(); - current_chapter = 0; - available_chapters = 0; - -// current_title = Phonon::TitleDescription(); -// available_titles.clear(); - current_title = 0; - available_titles = 0; - - b_autoplay_titles = false; - - emit availableAudioChannelsChanged(); - emit availableSubtitlesChanged(); - emit availableTitlesChanged(0); - emit availableChaptersChanged(0); -} - -// Add audio channel -> in libvlc it is track, it means audio in another language -void VLCMediaController::audioChannelAdded(int id, const QString & lang) -{ - QHash properties; - properties.insert("name", lang); - properties.insert("description", ""); - - available_audio_channels << Phonon::AudioChannelDescription(id, properties); - emit availableAudioChannelsChanged(); -} - -// Add subtitle -void VLCMediaController::subtitleAdded(int id, const QString & lang, const QString & type) -{ - QHash properties; - properties.insert("name", lang); - properties.insert("description", ""); - properties.insert("type", type); - - available_subtitles << Phonon::SubtitleDescription(id, properties); - emit availableSubtitlesChanged(); -} - -// Add title -void VLCMediaController::titleAdded(int id, const QString & name) -{ -// QHash properties; -// properties.insert("name", name); -// properties.insert("description", ""); - -// available_titles << Phonon::TitleDescription(id, properties); - available_titles++; - emit availableTitlesChanged(available_titles); -} - -// Add chapter -void VLCMediaController::chapterAdded(int titleId, const QString & name) -{ -// QHash properties; -// properties.insert("name", name); -// properties.insert("description", ""); - -// available_chapters << Phonon::ChapterDescription(titleId, properties); - available_chapters++; - emit availableChaptersChanged(available_chapters); -} - -// Audio channel - -void VLCMediaController::setCurrentAudioChannel(const Phonon::AudioChannelDescription & audioChannel) -{ - current_audio_channel = audioChannel; - libvlc_audio_set_track(p_vlc_media_player, audioChannel.index(), vlc_exception); - vlcExceptionRaised(); -} - -QList VLCMediaController::availableAudioChannels() const -{ - return available_audio_channels; -} - -Phonon::AudioChannelDescription VLCMediaController::currentAudioChannel() const -{ - return current_audio_channel; -} - -void VLCMediaController::refreshAudioChannels() -{ - current_audio_channel = Phonon::AudioChannelDescription(); - available_audio_channels.clear(); - - libvlc_track_description_t * p_info = libvlc_audio_get_track_description( - p_vlc_media_player, vlc_exception); - vlcExceptionRaised(); - while (p_info) { - audioChannelAdded(p_info->i_id, p_info->psz_name); - p_info = p_info->p_next; - } - libvlc_track_description_release(p_info); -} - -// Subtitle - -void VLCMediaController::setCurrentSubtitle(const Phonon::SubtitleDescription & subtitle) -{ - current_subtitle = subtitle; -// int id = current_subtitle.index(); - QString type = current_subtitle.property("type").toString(); - - if (type == "file") { - QString filename = current_subtitle.property("name").toString(); - if (!filename.isEmpty()) { - libvlc_video_set_subtitle_file(p_vlc_media_player, - filename.toAscii().data(), - vlc_exception); - vlcExceptionRaised(); - - // There is no subtitle event inside libvlc so let's send our own event... - available_subtitles << current_subtitle; - emit availableSubtitlesChanged(); - } - } else { - libvlc_video_set_spu(p_vlc_media_player, subtitle.index(), vlc_exception); - vlcExceptionRaised(); - } -} - -QList VLCMediaController::availableSubtitles() const -{ - return available_subtitles; -} - -Phonon::SubtitleDescription VLCMediaController::currentSubtitle() const -{ - return current_subtitle; -} - -void VLCMediaController::refreshSubtitles() -{ - current_subtitle = Phonon::SubtitleDescription(); - available_subtitles.clear(); - - libvlc_track_description_t *p_info = libvlc_video_get_spu_description( - p_vlc_media_player, vlc_exception); - vlcExceptionRaised(); - while (p_info) { - subtitleAdded(p_info->i_id, p_info->psz_name, ""); - p_info = p_info->p_next; - } - libvlc_track_description_release(p_info); -} - -// Title - -//void VLCMediaController::setCurrentTitle( const Phonon::TitleDescription & title ) -void VLCMediaController::setCurrentTitle(int title) -{ - current_title = title; - -// libvlc_media_player_set_title(p_vlc_media_player, title.index(), vlc_exception); - libvlc_media_player_set_title(p_vlc_media_player, title, vlc_exception); - vlcExceptionRaised(); -} - -//QList VLCMediaController::availableTitles() const -int VLCMediaController::availableTitles() const -{ - return available_titles; -} - -//Phonon::TitleDescription VLCMediaController::currentTitle() const -int VLCMediaController::currentTitle() const -{ - return current_title; -} - -void VLCMediaController::setAutoplayTitles(bool autoplay) -{ - b_autoplay_titles = autoplay; -} - -bool VLCMediaController::autoplayTitles() const -{ - return b_autoplay_titles; -} - -// Chapter - -//void VLCMediaController::setCurrentChapter(const Phonon::ChapterDescription &chapter) -void VLCMediaController::setCurrentChapter(int chapter) -{ - current_chapter = chapter; -// libvlc_media_player_set_chapter(p_vlc_media_player, chapter.index(), vlc_exception); - libvlc_media_player_set_chapter(p_vlc_media_player, chapter, vlc_exception); - vlcExceptionRaised(); -} - -//QList VLCMediaController::availableChapters() const -int VLCMediaController::availableChapters() const -{ - return available_chapters; -} - -//Phonon::ChapterDescription VLCMediaController::currentChapter() const -int VLCMediaController::currentChapter() const -{ - return current_chapter; -} - -// We need to rebuild available chapters when title is changed -void VLCMediaController::refreshChapters(int i_title) -{ -// current_chapter = Phonon::ChapterDescription(); -// available_chapters.clear(); - current_chapter = 0; - available_chapters = 0; - - // Get the description of available chapters for specific title - libvlc_track_description_t *p_info = libvlc_video_get_chapter_description( - p_vlc_media_player, i_title, vlc_exception); - vlcExceptionRaised(); - while (p_info) { - chapterAdded(p_info->i_id, p_info->psz_name); - p_info = p_info->p_next; - } - libvlc_track_description_release(p_info); -} - -// Angle - -void VLCMediaController::setCurrentAngle(int angleNumber) -{ - i_current_angle = angleNumber; -} - -int VLCMediaController::availableAngles() const -{ - return i_available_angles; -} - -int VLCMediaController::currentAngle() const -{ - return i_current_angle; -} - -} -} // Namespace Phonon::VLC diff --git a/bindings/phonon/vlc/vlcmediacontroller.h b/bindings/phonon/vlc/vlcmediacontroller.h deleted file mode 100644 index bc41346c3f..0000000000 --- a/bindings/phonon/vlc/vlcmediacontroller.h +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef PHONON_VLC_VLCMEDIA_CONTROLLER_H -#define PHONON_VLC_VLCMEDIA_CONTROLLER_H - -#include "mediacontroller.h" -#include "vlcloader.h" - -namespace Phonon -{ -namespace VLC { - -/** - * MediaController specific code for VLC. - */ -class VLCMediaController : public MediaController -{ -public: - VLCMediaController(); - virtual ~VLCMediaController(); - - void audioChannelAdded(int id, const QString & lang); - void subtitleAdded(int id, const QString & lang, const QString & type); - void titleAdded(int id, const QString & name); - void chapterAdded(int titleId, const QString & name); - -protected: - virtual void clearMediaController(); - - // AudioChannel - void setCurrentAudioChannel(const Phonon::AudioChannelDescription & audioChannel); - QList availableAudioChannels() const; - Phonon::AudioChannelDescription currentAudioChannel() const; - void refreshAudioChannels(); - - // Subtitle - void setCurrentSubtitle(const Phonon::SubtitleDescription & subtitle); - QList availableSubtitles() const; - Phonon::SubtitleDescription currentSubtitle() const; - void refreshSubtitles(); - - // Angle - void setCurrentAngle(int angleNumber); - int availableAngles() const; - int currentAngle() const; - - // Chapter -// void setCurrentChapter( const Phonon::ChapterDescription & chapter ); -// QList availableChapters() const; -// Phonon::ChapterDescription currentChapter() const; - void setCurrentChapter(int chapterNumber); - int availableChapters() const; - int currentChapter() const; - void refreshChapters(int i_title); - - // Title -// void setCurrentTitle( const Phonon::TitleDescription & title ); -// QList availableTitles() const; -// Phonon::TitleDescription currentTitle() const; - void setCurrentTitle(int titleNumber); - int availableTitles() const; - int currentTitle() const; - - void setAutoplayTitles(bool autoplay); - bool autoplayTitles() const; - - // MediaPlayer - libvlc_media_player_t *p_vlc_media_player; - -private: -}; - -} -} // Namespace Phonon::VLC - -#endif diff --git a/bindings/phonon/vlc/vlcmediaobject.cpp b/bindings/phonon/vlc/vlcmediaobject.cpp deleted file mode 100644 index e5271679fe..0000000000 --- a/bindings/phonon/vlc/vlcmediaobject.cpp +++ /dev/null @@ -1,423 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "vlcmediaobject.h" - -#include "videowidget.h" - -#include "vlcloader.h" - -#include -#include - -namespace Phonon -{ -namespace VLC { - -VLCMediaObject::VLCMediaObject(QObject * parent) - : MediaObject(parent), VLCMediaController() -{ - // Create an empty Media Player object - p_vlc_media_player = libvlc_media_player_new(vlc_instance, vlc_exception); - vlcExceptionRaised(); - p_vlc_media_player_event_manager = 0; - - // Media - p_vlc_media = 0; - p_vlc_media_event_manager = 0; - - // Media Discoverer - p_vlc_media_discoverer = 0; - p_vlc_media_discoverer_event_manager = 0; - - i_total_time = 0; - b_has_video = false; - b_seekable = false; -} - -VLCMediaObject::~VLCMediaObject() -{ - unloadMedia(); - - libvlc_media_player_stop(p_vlc_media_player); // ensure that we are stopped - libvlc_media_player_release(p_vlc_media_player); -} - -void VLCMediaObject::unloadMedia() -{ -// if( p_vlc_media_player ) { -// libvlc_media_player_release(p_vlc_media_player); -// p_vlc_media_player = 0; -// } - - if (p_vlc_media) { - libvlc_media_release(p_vlc_media); - p_vlc_media = 0; - } -} - -void VLCMediaObject::loadMediaInternal(const QString & filename) -{ - qDebug() << __FUNCTION__ << filename; - - // Create a media with the given MRL - p_vlc_media = libvlc_media_new(vlc_instance, filename.toAscii(), vlc_exception); - vlcExceptionRaised(); - - // Set the media that will be used by the media player - libvlc_media_player_set_media(p_vlc_media_player, p_vlc_media); - - // No need to keep the media now -// libvlc_media_release(p_vlc_media); - - // connectToAllVLCEvents() at the end since it needs p_vlc_media_player - connectToAllVLCEvents(); - - b_play_request_reached = false; - - // Get meta data (artist, title, etc...) - updateMetaData(); - - // Update available audio channels/subtitles/angles/chapters/etc... - // i.e everything from MediaController - // There is no audio channel/subtitle/angle/chapter events inside libvlc - // so let's send our own events... - // This will reset the GUI - clearMediaController(); - - // We need to do this, otherwise we never get any events with the real length - libvlc_media_get_duration(p_vlc_media, vlc_exception); - - if (b_play_request_reached) { - // The media is playing, no need to load it - return; - } - - emit stateChanged(Phonon::StoppedState); -} - -void VLCMediaObject::setVLCWidgetId() -{ - // Get our media player to use our window -#if defined(Q_OS_UNIX) - libvlc_media_player_set_xwindow(p_vlc_media_player, i_video_widget_id); -#elif defined(Q_OS_WIN) - libvlc_media_player_set_hwnd(p_vlc_media_player, i_video_widget_id); -#elif defined(Q_OS_MAC) - libvlc_media_player_set_agl(p_vlc_media_player, i_video_widget_id); -#endif -} - -void VLCMediaObject::playInternal() -{ - b_play_request_reached = true; - - // Clear subtitles/chapters/etc... - clearMediaController(); - - vlc_current_media_player = p_vlc_media_player; - - setVLCWidgetId(); - - // Play - libvlc_media_player_play(p_vlc_media_player, vlc_exception); - vlcExceptionRaised(); -} - -void VLCMediaObject::pause() -{ - libvlc_media_player_pause(p_vlc_media_player, vlc_exception); - vlcExceptionRaised(); -} - -void VLCMediaObject::stop() -{ - libvlc_media_player_stop(p_vlc_media_player); -// unloadMedia(); -} - -void VLCMediaObject::seekInternal(qint64 milliseconds) -{ - qDebug() << __FUNCTION__ << milliseconds; - libvlc_media_player_set_time(p_vlc_media_player, milliseconds, vlc_exception); - vlcExceptionRaised(); -} - -QString VLCMediaObject::errorString() const -{ - return libvlc_errmsg(); -} - -bool VLCMediaObject::hasVideo() const -{ - return b_has_video; -} - -bool VLCMediaObject::isSeekable() const -{ - return b_seekable; -} - -void VLCMediaObject::connectToAllVLCEvents() -{ - // Get the event manager from which the media player send event - p_vlc_media_player_event_manager = libvlc_media_player_event_manager(p_vlc_media_player); - libvlc_event_type_t eventsMediaPlayer[] = { - libvlc_MediaPlayerPlaying, - libvlc_MediaPlayerPaused, - libvlc_MediaPlayerEndReached, - libvlc_MediaPlayerStopped, - libvlc_MediaPlayerEncounteredError, - libvlc_MediaPlayerTimeChanged, - libvlc_MediaPlayerTitleChanged, - libvlc_MediaPlayerPositionChanged, - //libvlc_MediaPlayerSeekableChanged, //FIXME: doesn't work anymore? it asserts - libvlc_MediaPlayerPausableChanged, - }; - int i_nbEvents = sizeof(eventsMediaPlayer) / sizeof(*eventsMediaPlayer); - for (int i = 0; i < i_nbEvents; i++) { - libvlc_event_attach(p_vlc_media_player_event_manager, eventsMediaPlayer[i], - libvlc_callback, this); - } - - - // Get event manager from media descriptor object - p_vlc_media_event_manager = libvlc_media_event_manager(p_vlc_media); - libvlc_event_type_t eventsMedia[] = { - libvlc_MediaMetaChanged, - libvlc_MediaSubItemAdded, - libvlc_MediaDurationChanged, - // FIXME libvlc does not know this event -// libvlc_MediaPreparsedChanged, - libvlc_MediaFreed, - libvlc_MediaStateChanged, - }; - i_nbEvents = sizeof(eventsMedia) / sizeof(*eventsMedia); - for (int i = 0; i < i_nbEvents; i++) { - libvlc_event_attach(p_vlc_media_event_manager, eventsMedia[i], libvlc_callback, this); - } - - // Get event manager from media service discoverer object - // FIXME why libvlc_media_discoverer_event_manager() does not take a libvlc_exception_t ? -// p_vlc_media_discoverer_event_manager = libvlc_media_discoverer_event_manager(p_vlc_media_discoverer); -// libvlc_event_type_t eventsMediaDiscoverer[] = { -// libvlc_MediaDiscovererStarted, -// libvlc_MediaDiscovererEnded -// }; -// nbEvents = sizeof(eventsMediaDiscoverer) / sizeof(*eventsMediaDiscoverer); -// for (int i = 0; i < nbEvents; i++) { -// libvlc_event_attach(p_vlc_media_discoverer_event_manager, eventsMediaDiscoverer[i], libvlc_callback, this, vlc_exception); -// } -} - -void VLCMediaObject::libvlc_callback(const libvlc_event_t *p_event, void *p_user_data) -{ - static int i_first_time_media_player_time_changed = 0; - static bool b_media_player_title_changed = false; - - VLCMediaObject *p_vlc_mediaObject = (VLCMediaObject *) p_user_data; - -// qDebug() << (int)pp_vlc_mediaObject << "event:" << libvlc_event_type_name(event->type); - - // Media player events - if (p_event->type == libvlc_MediaPlayerTimeChanged) { - - i_first_time_media_player_time_changed++; - - // FIXME It is ugly. It should be solved by some events in libvlc - if (i_first_time_media_player_time_changed == 15) { - // Update metadata - p_vlc_mediaObject->updateMetaData(); - - // Is this media player seekable - bool b_seekable = libvlc_media_player_is_seekable(p_vlc_mediaObject->p_vlc_media_player, vlc_exception); - vlcExceptionRaised(); - if (b_seekable != p_vlc_mediaObject->b_seekable) { - qDebug() << "libvlc_callback(): isSeekable:" << b_seekable; - p_vlc_mediaObject->b_seekable = b_seekable; - emit p_vlc_mediaObject->seekableChanged(p_vlc_mediaObject->b_seekable); - } - - // Get current video width - int i_width = libvlc_video_get_width(p_vlc_mediaObject->p_vlc_media_player, vlc_exception); - vlcExceptionRaised(); - - // Get current video height - int i_height = libvlc_video_get_height(p_vlc_mediaObject->p_vlc_media_player, vlc_exception); - vlcExceptionRaised(); - emit p_vlc_mediaObject->videoWidgetSizeChanged(i_width, i_height); - - // Does this media player have a video output - bool b_has_video = libvlc_media_player_has_vout(p_vlc_mediaObject->p_vlc_media_player, vlc_exception); - vlcExceptionRaised(); - if (b_has_video != p_vlc_mediaObject->b_has_video) { - p_vlc_mediaObject->b_has_video = b_has_video; - emit p_vlc_mediaObject->hasVideoChanged(p_vlc_mediaObject->b_has_video); - } - - if (b_has_video) { - // Give info about audio tracks - p_vlc_mediaObject->refreshAudioChannels(); - // Give info about subtitle tracks - p_vlc_mediaObject->refreshSubtitles(); - - // Get movie chapter count - // It is not a title/chapter media if there is no chapter - if (libvlc_media_player_get_chapter_count( - p_vlc_mediaObject->p_vlc_media_player, vlc_exception) > 0) { - vlcExceptionRaised(); - // Give info about title - // only first time, no when title changed - if (!b_media_player_title_changed) { - libvlc_track_description_t *p_info = libvlc_video_get_title_description( - p_vlc_mediaObject->p_vlc_media_player, vlc_exception); - vlcExceptionRaised(); - while (p_info) { - p_vlc_mediaObject->titleAdded(p_info->i_id, p_info->psz_name); - p_info = p_info->p_next; - } - libvlc_track_description_release(p_info); - } - - // Give info about chapters for actual title 0 - if (b_media_player_title_changed) - p_vlc_mediaObject->refreshChapters(libvlc_media_player_get_title( - p_vlc_mediaObject->p_vlc_media_player, vlc_exception)); - else - p_vlc_mediaObject->refreshChapters(0); - } - if (b_media_player_title_changed) - b_media_player_title_changed = false; - } - - // Bugfix with Qt mediaplayer example - // Now we are in playing state - emit p_vlc_mediaObject->stateChanged(Phonon::PlayingState); - } - - emit p_vlc_mediaObject->tickInternal(p_vlc_mediaObject->currentTime()); - } - - if (p_event->type == libvlc_MediaPlayerPlaying) { - if (p_vlc_mediaObject->state() != Phonon::LoadingState) { - // Bugfix with Qt mediaplayer example - emit p_vlc_mediaObject->stateChanged(Phonon::PlayingState); - } - } - - if (p_event->type == libvlc_MediaPlayerPaused) { - emit p_vlc_mediaObject->stateChanged(Phonon::PausedState); - } - - if (p_event->type == libvlc_MediaPlayerEndReached) { - i_first_time_media_player_time_changed = 0; - p_vlc_mediaObject->clearMediaController(); - emit p_vlc_mediaObject->stateChanged(Phonon::StoppedState); - emit p_vlc_mediaObject->finished(); - } - - if (p_event->type == libvlc_MediaPlayerStopped) { - i_first_time_media_player_time_changed = 0; - p_vlc_mediaObject->clearMediaController(); - emit p_vlc_mediaObject->stateChanged(Phonon::StoppedState); - } - - if (p_event->type == libvlc_MediaPlayerTitleChanged) { - i_first_time_media_player_time_changed = 0; - b_media_player_title_changed = true; - } - - // Media events - - if (p_event->type == libvlc_MediaDurationChanged) { - // Get duration of media descriptor object item - libvlc_time_t totalTime = libvlc_media_get_duration(p_vlc_mediaObject->p_vlc_media, vlc_exception); - vlcExceptionRaised(); - - if (totalTime != p_vlc_mediaObject->i_total_time) { - p_vlc_mediaObject->i_total_time = totalTime; - emit p_vlc_mediaObject->totalTimeChanged(p_vlc_mediaObject->i_total_time); - } - } - - if (p_event->type == libvlc_MediaMetaChanged) { - } -} - -void VLCMediaObject::updateMetaData() -{ - QMultiMap metaDataMap; - - metaDataMap.insert(QLatin1String("ARTIST"), - QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Artist))); - vlcExceptionRaised(); - metaDataMap.insert(QLatin1String("ALBUM"), - QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Album))); - vlcExceptionRaised(); - metaDataMap.insert(QLatin1String("TITLE"), - QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Title))); - vlcExceptionRaised(); - metaDataMap.insert(QLatin1String("DATE"), - QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Date))); - vlcExceptionRaised(); - metaDataMap.insert(QLatin1String("GENRE"), - QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Genre))); - vlcExceptionRaised(); - metaDataMap.insert(QLatin1String("TRACKNUMBER"), - QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_TrackNumber))); - vlcExceptionRaised(); - metaDataMap.insert(QLatin1String("DESCRIPTION"), - QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_Description))); - vlcExceptionRaised(); - metaDataMap.insert(QLatin1String("COPYRIGHT"), - QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_TrackNumber))); - vlcExceptionRaised(); - metaDataMap.insert(QLatin1String("URL"), - QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_URL))); - vlcExceptionRaised(); - metaDataMap.insert(QLatin1String("ENCODEDBY"), - QString::fromUtf8(libvlc_media_get_meta(p_vlc_media, libvlc_meta_EncodedBy))); - - qDebug() << "updateMetaData(): artist:" - << libvlc_media_get_meta(p_vlc_media, libvlc_meta_Artist); - vlcExceptionRaised(); - qDebug() << "updateMetaData(): title:" - << libvlc_media_get_meta(p_vlc_media, libvlc_meta_Title); - vlcExceptionRaised(); - - emit metaDataChanged(metaDataMap); -} - -qint64 VLCMediaObject::totalTime() const -{ - return i_total_time; -} - -qint64 VLCMediaObject::currentTimeInternal() const -{ - libvlc_time_t time = libvlc_media_player_get_time(p_vlc_media_player, vlc_exception); - vlcExceptionRaised(); - - return time; -} - -} -} // Namespace Phonon::VLC diff --git a/bindings/phonon/vlc/vlcmediaobject.h b/bindings/phonon/vlc/vlcmediaobject.h deleted file mode 100644 index 08dac29ff6..0000000000 --- a/bindings/phonon/vlc/vlcmediaobject.h +++ /dev/null @@ -1,156 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef PHONON_VLC_VLCMEDIAOBJECT_H -#define PHONON_VLC_VLCMEDIAOBJECT_H - -#include "vlcmediacontroller.h" - -#include "mediaobject.h" - -#include -#include - -#include -#include -#include - -namespace Phonon -{ -namespace VLC { - -/** - * VLC MediaObject. - * - * This is the "brain" of the VLC backend. - * VLCMediaObject uses libvlc in order to send commands and receive events from the VLC. - * - * Encapsulates VLC specific code. - * Take care of libvlc events via libvlc_callback() - * - * @see MediaObject - */ -class VLCMediaObject : public MediaObject, public VLCMediaController -{ - Q_OBJECT - Q_INTERFACES(Phonon::MediaObjectInterface Phonon::AddonInterface) - -public: - - VLCMediaObject(QObject * parent); - ~VLCMediaObject(); - - void pause(); - void stop(); - - bool hasVideo() const; - bool isSeekable() const; - - qint64 totalTime() const; - - QString errorString() const; - -signals: - - // MediaController signals - void availableSubtitlesChanged(); - void availableAudioChannelsChanged(); - -// void availableChaptersChanged(); -// void availableTitlesChanged(); - void availableChaptersChanged(int); - void availableTitlesChanged(int); - - void availableAnglesChanged(int availableAngles); - void angleChanged(int angleNumber); - void chapterChanged(int chapterNumber); - void titleChanged(int titleNumber); - - /** - * New widget size computed by VLC. - * - * It should be applied to the widget that contains the VLC video. - */ - void videoWidgetSizeChanged(int i_width, int i_height); - -protected: - - void loadMediaInternal(const QString & filename); - void playInternal(); - void seekInternal(qint64 milliseconds); - - qint64 currentTimeInternal() const; - -private: - - /** - * Connect libvlc_callback() to all vlc events. - * - * @see libvlc_callback() - */ - void connectToAllVLCEvents(); - - /** - * Retrieve meta data of a file (i.e ARTIST, TITLE, ALBUM, etc...). - */ - void updateMetaData(); - - /** - * Libvlc callback. - * - * Receive all vlc events. - * - * Warning: owned by libvlc thread. - * - * @see connectToAllVLCEvents() - * @see libvlc_event_attach() - */ - static void libvlc_callback(const libvlc_event_t *p_event, void *p_user_data); - - void unloadMedia(); - - void setVLCWidgetId(); - - // MediaPlayer -// libvlc_media_player_t * p_vlc_media_player; - libvlc_event_manager_t * p_vlc_media_player_event_manager; - - // Media - libvlc_media_t * p_vlc_media; - libvlc_event_manager_t * p_vlc_media_event_manager; - - // MediaDiscoverer - libvlc_media_discoverer_t * p_vlc_media_discoverer; - libvlc_event_manager_t * p_vlc_media_discoverer_event_manager; - - bool b_play_request_reached; - - qint64 i_total_time; - - bool b_has_video; - - bool b_seekable; -}; - -} -} // Namespace Phonon::VLC - -#endif diff --git a/bindings/phonon/vlc/vlcvideowidget.cpp b/bindings/phonon/vlc/vlcvideowidget.cpp deleted file mode 100644 index e21767ea38..0000000000 --- a/bindings/phonon/vlc/vlcvideowidget.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "vlcvideowidget.h" - -#include -#include - -namespace Phonon -{ -namespace VLC { - -VLCVideoWidget::VLCVideoWidget(QWidget *p_parent) - : WidgetNoPaintEvent(p_parent) -{ - // Set background color - setBackgroundColor(Qt::black); -} - -VLCVideoWidget::~VLCVideoWidget() -{ -} - -void VLCVideoWidget::resizeEvent(QResizeEvent *p_event) -{ - qDebug() << "resizeEvent" << p_event->size(); -} - -void VLCVideoWidget::setAspectRatio(double f_aspect_ratio) -{ -} - -void VLCVideoWidget::setScaleAndCropMode(bool b_scale_and_crop) -{ -} - -void VLCVideoWidget::setVideoSize(const QSize & size) -{ - videoSize = size; -} - -QSize VLCVideoWidget::sizeHint() const -{ - return videoSize; -} - -} -} // Namespace Phonon::VLC diff --git a/bindings/phonon/vlc/vlcvideowidget.h b/bindings/phonon/vlc/vlcvideowidget.h deleted file mode 100644 index d8e9d216a8..0000000000 --- a/bindings/phonon/vlc/vlcvideowidget.h +++ /dev/null @@ -1,65 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef PHONON_VLC_VLCVIDEOWIDGET_H -#define PHONON_VLC_VLCVIDEOWIDGET_H - -#include "widgetnopaintevent.h" - -#include - -class QResizeEvent; - -namespace Phonon -{ -namespace VLC { - -/** - * Widget where to show VLC video. - */ -class VLCVideoWidget : public WidgetNoPaintEvent -{ - Q_OBJECT -public: - - VLCVideoWidget(QWidget *p_parent); - ~VLCVideoWidget(); - - void setVideoSize(const QSize & videoSize); - void setAspectRatio(double f_aspect_ratio); - void setScaleAndCropMode(bool b_scale_and_crop); - - QSize sizeHint() const; - -private: - - void resizeEvent(QResizeEvent *p_event); - - /** - * Original size of the video, needed for sizeHint(). - */ - QSize videoSize; -}; - -} -} // Namespace Phonon::VLC_MPlayer - -#endif // PHONON_VLC_MPLAYER_VLCVIDEOWIDGET_H diff --git a/bindings/phonon/vlc/widgetnopaintevent.cpp b/bindings/phonon/vlc/widgetnopaintevent.cpp deleted file mode 100644 index 4f6931ebfa..0000000000 --- a/bindings/phonon/vlc/widgetnopaintevent.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#include "widgetnopaintevent.h" - -#include - -namespace Phonon -{ -namespace VLC { - -WidgetNoPaintEvent::WidgetNoPaintEvent(QWidget *p_parent) - : QWidget(p_parent) -{ - // When resizing fill with black (backgroundRole color) the rest is done by paintEvent - setAttribute(Qt::WA_OpaquePaintEvent); - - // Disable Qt composition management as MPlayer draws onto the widget directly - setAttribute(Qt::WA_PaintOnScreen); - - // Indicates that the widget has no background, - // i.e. when the widget receives paint events, the background is not automatically repainted. - setAttribute(Qt::WA_NoSystemBackground); - - // Required for dvdnav - setMouseTracking(true); -} - -void WidgetNoPaintEvent::paintEvent(QPaintEvent *p_event) -{ - // FIXME this makes the video flicker - // Make everything backgroundRole color - QPainter painter(this); - painter.eraseRect(rect()); -} - -void WidgetNoPaintEvent::setBackgroundColor(const QColor & color) -{ - QPalette p = palette(); - p.setColor(backgroundRole(), color); - setPalette(p); -} - -} -} // Namespace Phonon::VLC diff --git a/bindings/phonon/vlc/widgetnopaintevent.h b/bindings/phonon/vlc/widgetnopaintevent.h deleted file mode 100644 index 1e876914b0..0000000000 --- a/bindings/phonon/vlc/widgetnopaintevent.h +++ /dev/null @@ -1,58 +0,0 @@ -/***************************************************************************** - * VLC backend for the Phonon library * - * Copyright (C) 2007-2008 Tanguy Krotoff * - * Copyright (C) 2008 Lukas Durfina * - * Copyright (C) 2009 Fathi Boudra * - * * - * 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 3 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 package; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - *****************************************************************************/ - -#ifndef PHONON_VLC_WIDGETNOPAINTEVENT_H -#define PHONON_VLC_WIDGETNOPAINTEVENT_H - -#include - -namespace Phonon -{ -namespace VLC { - -/** - * Utility class: special widget for playing videos. - * - * Does not handle paintEvent() - */ -class WidgetNoPaintEvent : public QWidget -{ - Q_OBJECT -public: - - WidgetNoPaintEvent(QWidget *p_parent); - - /** - * Sets the background color. - * - * I don't know which one is best: 0x020202 or Qt::black... - */ - void setBackgroundColor(const QColor & color); - -private: - - void paintEvent(QPaintEvent *p_event); -}; - -} -} // Namespace Phonon::VLC - -#endif // PHONON_VLC_WIDGETNOPAINTEVENT_H diff --git a/bindings/python-ctypes/LibVlc-footer.java b/bindings/python-ctypes/LibVlc-footer.java deleted file mode 100644 index 5c34318c21..0000000000 --- a/bindings/python-ctypes/LibVlc-footer.java +++ /dev/null @@ -1 +0,0 @@ -} diff --git a/bindings/python-ctypes/LibVlc-header.java b/bindings/python-ctypes/LibVlc-header.java deleted file mode 100644 index 89f3bfed98..0000000000 --- a/bindings/python-ctypes/LibVlc-header.java +++ /dev/null @@ -1,255 +0,0 @@ -package org.videolan.jvlc.internal; - -import com.sun.jna.Callback; -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.NativeLong; -import com.sun.jna.Platform; -import com.sun.jna.Pointer; -import com.sun.jna.PointerType; -import com.sun.jna.Structure; -import com.sun.jna.Union; - - -public interface LibVlc extends Library -{ - LibVlc INSTANCE = (LibVlc) Native.loadLibrary(Platform.isWindows()? "libvlc" : "vlc", LibVlc.class); - - LibVlc SYNC_INSTANCE = (LibVlc) Native.synchronizedLibrary(INSTANCE); - - public static class libvlc_exception_t extends Structure - { - public int b_raised; - } - - public static class libvlc_log_message_t extends Structure - { - - public int sizeof_msg; /* sizeof() of message structure, must be filled in by user */ - - public int i_severity; /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */ - - public String psz_type; /* module type */ - - public String psz_name; /* module name */ - - public String psz_header; /* optional header */ - - public String psz_message; /* message */ - } - - public static class libvlc_event_t extends Structure - { - - public int type; - - public Pointer p_obj; - - public event_type_specific event_type_specific; - - } - - public class media_meta_changed extends Structure - { - // Enum ! - public Pointer meta_type; - } - - public class media_subitem_added extends Structure - { - - public LibVlcMedia new_child; - } - - public class media_duration_changed extends Structure - { - - public NativeLong new_duration; - } - - public class media_preparsed_changed extends Structure - { - - public int new_status; - } - - public class media_freed extends Structure - { - - public LibVlcMedia md; - } - - public class media_state_changed extends Structure - { - - // @todo: check this one - public int new_state; - } - - /* media instance */ - - public class media_player_position_changed extends Structure - { - - public float new_position; - } - - public class media_player_time_changed extends Structure - { - - // @todo: check this one - public long new_time; - } - - public class media_player_title_changed extends Structure - { - public int new_title; - } - - public class media_player_seekable_changed extends Structure - { - public NativeLong new_seekable; - } - - public class media_player_pausable_changed extends Structure - { - public NativeLong new_pausable; - } - - /* media list */ - public class media_list_item_added extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_will_add_item extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_item_deleted extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_will_delete_item extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - /* media list view */ - public class media_list_view_item_added extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_view_will_add_item extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_view_item_deleted extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_view_will_delete_item extends Structure - { - - public LibVlcMedia item; - - public int index; - } - - public class media_list_player_next_item_set extends Structure - { - public LibVlcMedia item; - } - - public class media_player_snapshot_taken extends Structure - { - public String psz_filename; - } - - public class media_player_length_changed extends Structure - { - // @todo: check the type - public long new_length; - } - - public class vlm_media_event extends Structure - { - public String psz_media_name; - public String psz_instance_name; - } - - public class event_type_specific extends Union - { - - public media_meta_changed media_meta_changed; - - public media_subitem_added media_subitem_added; - - public media_duration_changed media_duration_changed; - - public media_preparsed_changed media_preparsed_changed; - - public media_freed media_freed; - - public media_state_changed media_state_changed; - - public media_player_position_changed media_player_position_changed; - - public media_player_time_changed media_player_time_changed; - - public media_player_title_changed media_player_title_changed; - - public media_player_seekable_changed media_player_seekable_changed; - - public media_player_pausable_changed media_player_pausable_changed; - - public media_list_item_added media_list_item_added; - - public media_list_will_add_item media_list_will_add_item; - - public media_list_item_deleted media_list_item_deleted; - - public media_list_will_delete_item media_list_will_delete_item; - - public media_list_view_item_added media_list_view_item_added; - - public media_list_view_will_add_item media_list_view_will_add_item; - - public media_list_view_item_deleted media_list_view_item_deleted; - - public media_list_view_will_delete_item media_list_view_will_delete_item; - - public media_list_player_next_item_set media_list_player_next_item_set; - - public media_player_snapshot_taken media_player_snapshot_taken; - - public media_player_length_changed media_player_length_changed; - - public vlm_media_event vlm_media_event; - } diff --git a/bindings/python-ctypes/Makefile b/bindings/python-ctypes/Makefile deleted file mode 100644 index d18f1c91aa..0000000000 --- a/bindings/python-ctypes/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -MODULE_NAME=vlc.py - -all: $(MODULE_NAME) - -$(MODULE_NAME): generate.py header.py footer.py override.py ../../include/vlc/*.h - python generate.py ../../include/vlc/*.h > $@ - -doc: $(MODULE_NAME) - -epydoc -v -o doc $< - -test: $(MODULE_NAME) - python test.py - -check: $(MODULE_NAME) - -pyflakes $< - -pylint $< - -clean: - -$(RM) $(MODULE_NAME) diff --git a/bindings/python-ctypes/README b/bindings/python-ctypes/README deleted file mode 100644 index 49f47d2b7a..0000000000 --- a/bindings/python-ctypes/README +++ /dev/null @@ -1,60 +0,0 @@ -* Python ctypes-based and java bindings - -The bindings use ctypes to directly call the libvlc dynamic lib, and -the code is generated from the include files defining the public API. - -** Building - -To generate the vlc.py module and its documentation, use -make - -Documentation building needs epydoc. - -** Layout - -The module offers two ways of accessing the API - a raw access to all -exported methods, and more convenient wrapper classes : - -- Raw access: methods are available as attributes of the vlc - module. Use their docstring (any introspective shell like ipython is - your friends) to explore them. - -- Wrapper classes: most major structures of the libvlc API (Instance, - Media, MediaPlayer, etc) are wrapped as classes, with shorter method - names. - -** Using the module - -On win32, the simplest way is to put the vlc.py file in the same -directory as the libvlc.dll file (standard location: -c:\Program Files\VideoLAN\VLC ). - - -- Using raw access: - ->>> import vlc ->>> vlc.libvlc_get_version() -'1.0.0 Goldeneye' ->>> e=vlc.VLCException() ->>> i=vlc.libvlc_new(0, [], e) ->>> i - ->>> vlc.libvlc_audio_get_volume(i,e) -50 - -- Using wrapper classes: - ->>> import vlc ->>> i=vlc.Instance('--no-audio', '--fullscreen') ->>> i.audio_get_volume() -50 ->>> m=i.media_new('/tmp/foo.avi') ->>> m.get_mrl() -'/tmp/foo.avi' ->>> p=i.media_player_new(m) ->>> p.play() - -or shorter: ->>> import vlc ->>> p=vlc.MediaPlayer('/tmp/foo.avi') ->>> p.play() diff --git a/bindings/python-ctypes/TODO b/bindings/python-ctypes/TODO deleted file mode 100644 index 07ddd07999..0000000000 --- a/bindings/python-ctypes/TODO +++ /dev/null @@ -1,4 +0,0 @@ -* Investigate memory management - -* Support multiple VLC versions: define a front-end module which will - load the appropriate versionned module from a subdirectory. diff --git a/bindings/python-ctypes/boilerplate.java b/bindings/python-ctypes/boilerplate.java deleted file mode 100644 index d2836afd09..0000000000 --- a/bindings/python-ctypes/boilerplate.java +++ /dev/null @@ -1,26 +0,0 @@ -/***************************************************************************** - * VLC Java Bindings JNA Glue - ***************************************************************************** - * Copyright (C) 1998-2009 the VideoLAN team - * - * Authors: Filippo Carone - * VLC bindings generator - * - * - * $Id $ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ - diff --git a/bindings/python-ctypes/footer.py b/bindings/python-ctypes/footer.py deleted file mode 100644 index e95f36f2c0..0000000000 --- a/bindings/python-ctypes/footer.py +++ /dev/null @@ -1,143 +0,0 @@ -### Start of footer.py ### - -class MediaEvent(ctypes.Structure): - _fields_ = [ - ('media_name', ctypes.c_char_p), - ('instance_name', ctypes.c_char_p), - ] - -class EventUnion(ctypes.Union): - _fields_ = [ - ('meta_type', ctypes.c_uint), - ('new_child', ctypes.c_uint), - ('new_duration', ctypes.c_longlong), - ('new_status', ctypes.c_int), - ('media', ctypes.c_void_p), - ('new_state', ctypes.c_uint), - # Media instance - ('new_position', ctypes.c_float), - ('new_time', ctypes.c_longlong), - ('new_title', ctypes.c_int), - ('new_seekable', ctypes.c_longlong), - ('new_pausable', ctypes.c_longlong), - # FIXME: Skipped MediaList and MediaListView... - ('filename', ctypes.c_char_p), - ('new_length', ctypes.c_longlong), - ('media_event', MediaEvent), - ] - -class Event(ctypes.Structure): - _fields_ = [ - ('type', EventType), - ('object', ctypes.c_void_p), - ('u', EventUnion), - ] - -# Decorator for callback methods -callbackmethod=ctypes.CFUNCTYPE(None, Event, ctypes.c_void_p) - -# Example callback method -@callbackmethod -def debug_callback(event, data): - print "Debug callback method" - print "Event:", event.type - print "Data", data - -if __name__ == '__main__': - try: - from msvcrt import getch - except ImportError: - def getch(): - import tty - import termios - fd=sys.stdin.fileno() - old_settings=termios.tcgetattr(fd) - try: - tty.setraw(fd) - ch=sys.stdin.read(1) - finally: - termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) - return ch - - @callbackmethod - def end_callback(event, data): - print "End of stream" - sys.exit(0) - - if sys.argv[1:]: - instance=Instance() - media=instance.media_new(sys.argv[1]) - player=instance.media_player_new() - player.set_media(media) - player.play() - - event_manager=player.event_manager() - event_manager.event_attach(EventType.MediaPlayerEndReached, end_callback, None) - - def print_info(): - """Print information about the media.""" - media=player.get_media() - print "State:", player.get_state() - print "Media:", media.get_mrl() - try: - print "Current time:", player.get_time(), "/", media.get_duration() - print "Position:", player.get_position() - print "FPS:", player.get_fps() - print "Rate:", player.get_rate() - print "Video size: (%d, %d)" % (player.video_get_width(), player.video_get_height()) - except Exception: - pass - - def forward(): - """Go forward 1s""" - player.set_time(player.get_time() + 1000) - - def one_frame_forward(): - """Go forward one frame""" - player.set_time(player.get_time() + long(1000 / (player.get_fps() or 25))) - - def one_frame_backward(): - """Go backward one frame""" - player.set_time(player.get_time() - long(1000 / (player.get_fps() or 25))) - - def backward(): - """Go backward 1s""" - player.set_time(player.get_time() - 1000) - - def print_help(): - """Print help - """ - print "Commands:" - for k, m in keybindings.iteritems(): - print " %s: %s" % (k, (m.__doc__ or m.__name__).splitlines()[0]) - print " 1-9: go to the given fraction of the movie" - - def quit_app(): - """Exit.""" - sys.exit(0) - - keybindings={ - 'f': player.toggle_fullscreen, - ' ': player.pause, - '+': forward, - '-': backward, - '.': one_frame_forward, - ',': one_frame_backward, - '?': print_help, - 'i': print_info, - 'q': quit_app, - } - - print "Press q to quit, ? to get help." - while True: - k=getch() - o=ord(k) - method=keybindings.get(k, None) - if method is not None: - method() - elif o >= 49 and o <= 57: - # Numeric value. Jump to a fraction of the movie. - v=0.1*(o-48) - player.set_position(v) - - diff --git a/bindings/python-ctypes/generate.py b/bindings/python-ctypes/generate.py deleted file mode 100755 index 1564323acd..0000000000 --- a/bindings/python-ctypes/generate.py +++ /dev/null @@ -1,935 +0,0 @@ -#! /usr/bin/python -debug=False - -# -# Code generator for python ctypes bindings for VLC -# Copyright (C) 2009 the VideoLAN team -# $Id: $ -# -# Authors: Olivier Aubert -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 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 General Public License for more details. -# -# You should have received a copy of the GNU 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. -# - -"""This module parses VLC public API include files and generates -corresponding python/ctypes code. Moreover, it generates class -wrappers for most methods. -""" - -import sys -import os -import re -import time -import operator -import itertools -from optparse import OptionParser - -# DefaultDict from ASPN python cookbook -import copy -class DefaultDict(dict): - """Dictionary with a default value for unknown keys.""" - def __init__(self, default=None, **items): - dict.__init__(self, **items) - self.default = default - - def __getitem__(self, key): - if key in self: - return self.get(key) - else: - ## Need copy in case self.default is something like [] - return self.setdefault(key, copy.deepcopy(self.default)) - - def __copy__(self): - return DefaultDict(self.default, **self) - -# Methods not decorated/not referenced -blacklist=[ - "libvlc_exception_raise", - "libvlc_exception_raised", - "libvlc_exception_get_message", - "libvlc_get_vlc_instance", - - "libvlc_media_list_view_index_of_item", - "libvlc_media_list_view_insert_at_index", - "libvlc_media_list_view_remove_at_index", - "libvlc_media_list_view_add_item", - - # In svn but not in current 1.0.0. - #"libvlc_media_add_option_flag", - #'libvlc_video_set_deinterlace', - #'libvlc_video_get_marquee_int', - #'libvlc_video_get_marquee_string', - #'libvlc_video_set_marquee_int', - #'libvlc_video_set_marquee_string', - #'libvlc_vlm_get_event_manager', - #"libvlc_media_list_player_event_manager", - #'libvlc_media_player_next_frame', - - 'mediacontrol_PlaylistSeq__free', - ] - -# Precompiled regexps -api_re=re.compile('VLC_PUBLIC_API\s+(\S+\s+.+?)\s*\(\s*(.+?)\s*\)') -param_re=re.compile('\s*(const\s*|unsigned\s*|struct\s*)?(\S+\s*\**)\s+(.+)') -paramlist_re=re.compile('\s*,\s*') -comment_re=re.compile('\\param\s+(\S+)') -python_param_re=re.compile('(@param\s+\S+)(.+)') -forward_re=re.compile('.+\(\s*(.+?)\s*\)(\s*\S+)') -enum_re=re.compile('typedef\s+(enum)\s*(\S+\s*)?\{\s*(.+)\s*\}\s*(\S+);') -special_enum_re=re.compile('^(enum)\s*(\S+\s*)?\{\s*(.+)\s*\};') -event_def_re=re.compile('^DEF\(\s*(\w+)\s*\)') - -# Definition of parameter passing mode for types. This should not be -# hardcoded this way, but works alright ATM. -parameter_passing=DefaultDict(default=1) -parameter_passing['libvlc_exception_t*']=3 - -class Parser(object): - def __init__(self, list_of_files): - self.methods=[] - self.enums=[] - - for name in list_of_files: - self.enums.extend(self.parse_typedef(name)) - self.methods.extend(self.parse_include(name)) - - def parse_param(self, s): - """Parse a C parameter expression. - - It is used to parse both the type/name for methods, and type/name - for their parameters. - - It returns a tuple (type, name). - """ - s=s.strip() - s=s.replace('const', '') - if 'VLC_FORWARD' in s: - m=forward_re.match(s) - s=m.group(1)+m.group(2) - m=param_re.search(s) - if m: - const, typ, name=m.groups() - while name.startswith('*'): - typ += '*' - name=name[1:] - if name == 'const*': - # K&R definition: const char * const* - name='' - typ=typ.replace(' ', '') - return typ, name - else: - # K&R definition: only type - return s.replace(' ', ''), '' - - def parse_typedef(self, name): - """Parse include file for typedef expressions. - - This generates a tuple for each typedef: - (type, name, value_list, comment) - with type == 'enum' (for the moment) and value_list being a list of (name, value) - Note that values are string, since this is intended for code generation. - """ - event_names=[] - - f=open(name, 'r') - accumulator='' - for l in f: - # Note: lstrip() should not be necessary, but there is 1 badly - # formatted comment in vlc1.0.0 includes - if l.lstrip().startswith('/**'): - comment='' - continue - elif l.startswith(' * '): - comment = comment + l[3:] - continue - - l=l.strip() - if l.startswith('/*') or l.endswith('*/'): - continue - - if (l.startswith('typedef enum') or l.startswith('enum')) and not l.endswith(';'): - # Multiline definition. Accumulate until end of definition - accumulator=l - continue - elif accumulator: - accumulator=" ".join( (accumulator, l) ) - if l.endswith(';'): - # End of definition - l=accumulator - accumulator='' - - m=enum_re.match(l) - if m: - values=[] - (typ, dummy, data, name)=m.groups() - for i, l in enumerate(paramlist_re.split(data)): - l=l.strip() - if l.startswith('/*'): - continue - if '=' in l: - # A value was specified. Use it. - values.append(re.split('\s*=\s*', l)) - else: - if l: - values.append( (l, str(i)) ) - comment=comment.replace('@{', '').replace('@see', 'See').replace('\ingroup', '') - yield (typ, name.strip(), values, comment) - comment='' - continue - - # Special case, used only for libvlc_events.h - # (version after 96a96f60bb0d1f2506e68b356897ceca6f6b586d) - m=event_def_re.match(l) - if m: - # Event definition. - event_names.append('libvlc_'+m.group(1)) - continue - - # Special case, used only for libvlc_events.h - m=special_enum_re.match(l) - if m: - (typ, name, data)=m.groups() - if event_names: - # event_names were defined through DEF macro - # (see 96a96f60bb0d1f2506e68b356897ceca6f6b586d) - values=list( (n, str(i)) for i, n in enumerate(event_names)) - else: - # Before 96a96f60bb0d1f2506e68b356897ceca6f6b586d - values=[] - for i, l in enumerate(paramlist_re.split(data)): - l=l.strip() - if l.startswith('/*') or l.startswith('#'): - continue - if '=' in l: - # A value was specified. Use it. - values.append(re.split('\s*=\s*', l)) - else: - if l: - values.append( (l, str(i)) ) - comment=comment.replace('@{', '').replace('@see', 'See').replace('\ingroup', '') - yield (typ, name.strip(), values, comment) - comment='' - continue - - def parse_include(self, name): - """Parse include file. - - This generates a tuple for each function: - (return_type, method_name, parameter_list, comment) - with parameter_list being a list of tuples (parameter_type, parameter_name). - """ - f=open(name, 'r') - accumulator='' - comment='' - for l in f: - # Note: lstrip() should not be necessary, but there is 1 badly - # formatted comment in vlc1.0.0 includes - if l.lstrip().startswith('/**'): - comment='' - continue - elif l.startswith(' * '): - comment = comment + l[3:] - continue - - l=l.strip() - - if accumulator: - accumulator=" ".join( (accumulator, l) ) - if l.endswith(');'): - # End of definition - l=accumulator - accumulator='' - elif l.startswith('VLC_PUBLIC_API') and not l.endswith(');'): - # Multiline definition. Accumulate until end of definition - accumulator=l - continue - - m=api_re.match(l) - if m: - (ret, param)=m.groups() - - rtype, method=self.parse_param(ret) - - params=[] - for p in paramlist_re.split(param): - params.append( self.parse_param(p) ) - - if len(params) == 1 and params[0][0] == 'void': - # Empty parameter list - params=[] - - if list(p for p in params if not p[1]): - # Empty parameter names. Have to poke into comment. - names=comment_re.findall(comment) - if len(names) < len(params): - # Bad description: all parameters are not specified. - # Generate default parameter names - badnames=[ "param%d" % i for i in xrange(len(params)) ] - # Put in the existing ones - for (i, p) in enumerate(names): - badnames[i]=names[i] - names=badnames - print "### Error ###" - print "### Cannot get parameter names from comment for %s: %s" % (method, comment.replace("\n", ' ')) - # Note: this was previously - # raise Exception("Cannot get parameter names from comment for %s: %s" % (method, comment)) - # but it prevented code generation for a minor detail (some bad descriptions). - params=[ (p[0], names[i]) for (i, p) in enumerate(params) ] - - # Transform Doxygen syntax into epydoc syntax - comment=comment.replace('\\param', '@param').replace('\\return', '@return') - - if debug: - print '********************' - print l - print '-------->' - print "%s (%s)" % (method, rtype) - for typ, name in params: - print " %s (%s)" % (name, typ) - print '********************' - yield (rtype, - method, - params, - comment) - comment='' - - def dump_methods(self): - print "** Defined functions **" - for (rtype, name, params, comment) in self.methods: - print "%(name)s (%(rtype)s):" % locals() - for t, n in params: - print " %(n)s (%(t)s)" % locals() - - def dump_enums(self): - print "** Defined enums **" - for (typ, name, values, comment) in self.enums: - print "%(name)s (%(typ)s):" % locals() - for k, v in values: - print " %(k)s=%(v)s" % locals() - -class PythonGenerator(object): - # C-type to ctypes/python type conversion. - # Note that enum types conversions are generated (cf convert_enum_names) - type2class={ - 'libvlc_exception_t*': 'ctypes.POINTER(VLCException)', - - 'libvlc_media_player_t*': 'MediaPlayer', - 'libvlc_instance_t*': 'Instance', - 'libvlc_media_t*': 'Media', - 'libvlc_log_t*': 'Log', - 'libvlc_log_iterator_t*': 'LogIterator', - 'libvlc_log_message_t*': 'ctypes.POINTER(LogMessage)', - 'libvlc_event_type_t': 'ctypes.c_uint', - 'libvlc_event_manager_t*': 'EventManager', - 'libvlc_media_discoverer_t*': 'MediaDiscoverer', - 'libvlc_media_library_t*': 'MediaLibrary', - 'libvlc_media_list_t*': 'MediaList', - 'libvlc_media_list_player_t*': 'MediaListPlayer', - 'libvlc_media_list_view_t*': 'MediaListView', - 'libvlc_track_description_t*': 'TrackDescription', - 'libvlc_audio_output_t*': 'AudioOutput', - 'libvlc_media_stats_t*': 'ctypes.POINTER(MediaStats)', - 'libvlc_media_es_t**': 'ctypes.POINTER(ctypes.POINTER(MediaES))', - - 'mediacontrol_Instance*': 'MediaControl', - 'mediacontrol_Exception*': 'MediaControlException', - 'mediacontrol_RGBPicture*': 'ctypes.POINTER(RGBPicture)', - 'mediacontrol_PlaylistSeq*': 'MediaControlPlaylistSeq', - 'mediacontrol_Position*': 'ctypes.POINTER(MediaControlPosition)', - 'mediacontrol_StreamInformation*': 'ctypes.POINTER(MediaControlStreamInformation)', - 'WINDOWHANDLE': 'ctypes.c_ulong', - - 'void': 'None', - 'void*': 'ctypes.c_void_p', - 'short': 'ctypes.c_short', - 'char*': 'ctypes.c_char_p', - 'char**': 'ListPOINTER(ctypes.c_char_p)', - 'uint32_t': 'ctypes.c_uint', - 'float': 'ctypes.c_float', - 'unsigned': 'ctypes.c_uint', - 'int': 'ctypes.c_int', - '...': 'FIXMEva_list', - 'libvlc_callback_t': 'ctypes.c_void_p', - 'libvlc_time_t': 'ctypes.c_longlong', - } - - # Defined python classes, i.e. classes for which we want to generate - # class wrappers around libvlc functions - defined_classes=( - 'MediaPlayer', - 'Instance', - 'Media', - 'Log', - 'LogIterator', - 'EventManager', - 'MediaDiscoverer', - 'MediaLibrary', - 'MediaList', - 'MediaListPlayer', - 'MediaListView', - 'TrackDescription', - 'AudioOutput', - 'MediaControl', - ) - - def __init__(self, parser=None): - self.parser=parser - - # Generate python names for enums - self.type2class.update(self.convert_enum_names(parser.enums)) - self.check_types() - - # Definition of prefixes that we can strip from method names when - # wrapping them into class methods - self.prefixes=dict( (v, k[:-2]) - for (k, v) in self.type2class.iteritems() - if v in self.defined_classes ) - self.prefixes['MediaControl']='mediacontrol_' - - def save(self, filename=None): - if filename is None or filename == '-': - self.fd=sys.stdout - else: - self.fd=open(filename, 'w') - - self.insert_code('header.py') - wrapped_methods=self.generate_wrappers(self.parser.methods) - for l in self.parser.methods: - self.output_ctypes(*l) - self.insert_code('footer.py') - - all_methods=set( t[1] for t in self.parser.methods ) - not_wrapped=all_methods.difference(wrapped_methods) - self.output("# Not wrapped methods:") - for m in not_wrapped: - self.output("# ", m) - - if self.fd != sys.stdout: - self.fd.close() - - def output(self, *p): - self.fd.write(" ".join(p)) - self.fd.write("\n") - - def check_types(self): - """Make sure that all types are properly translated. - - This method must be called *after* convert_enum_names, since - the latter populates type2class with converted enum names. - """ - for (rt, met, params, c) in self.parser.methods: - for typ, name in params: - if not typ in self.type2class: - raise Exception("No conversion for %s (from %s:%s)" % (typ, met, name)) - - def insert_code(self, filename): - """Generate header/footer code. - """ - f=open(filename, 'r') - for l in f: - if l.startswith('build_date'): - self.output('build_date="%s"' % time.ctime()) - elif l.startswith('# GENERATED_ENUMS'): - self.generate_enums(self.parser.enums) - else: - self.output(l.rstrip()) - - f.close() - - def convert_enum_names(self, enums): - res={} - for (typ, name, values, comment) in enums: - if typ != 'enum': - raise Exception('This method only handles enums') - pyname=re.findall('(libvlc|mediacontrol)_(.+?)(_t)?$', name)[0][1] - if '_' in pyname: - pyname=pyname.title().replace('_', '') - elif not pyname[0].isupper(): - pyname=pyname.capitalize() - res[name]=pyname - return res - - def generate_enums(self, enums): - for (typ, name, values, comment) in enums: - if typ != 'enum': - raise Exception('This method only handles enums') - pyname=self.type2class[name] - - self.output("class %s(ctypes.c_ulong):" % pyname) - self.output(' """%s\n """' % comment) - - conv={} - # Convert symbol names - for k, v in values: - n=k.split('_')[-1] - if len(n) == 1: - # Single character. Some symbols use 1_1, 5_1, etc. - n="_".join( k.split('_')[-2:] ) - if re.match('^[0-9]', n): - # Cannot start an identifier with a number - n='_'+n - conv[k]=n - - self.output(" _names={") - for k, v in values: - self.output(" %s: '%s'," % (v, conv[k])) - self.output(" }") - - self.output(""" - def __repr__(self): - return ".".join((self.__class__.__module__, self.__class__.__name__, self._names[self.value])) - - def __eq__(self, other): - return ( (isinstance(other, ctypes.c_ulong) and self.value == other.value) - or (isinstance(other, (int, long)) and self.value == other ) ) - - def __ne__(self, other): - return not self.__eq__(other) - """) - for k, v in values: - self.output("%(class)s.%(attribute)s=%(class)s(%(value)s)" % { - 'class': pyname, - 'attribute': conv[k], - 'value': v - }) - self.output("") - - def output_ctypes(self, rtype, method, params, comment): - """Output ctypes decorator for the given method. - """ - if method in blacklist: - # FIXME - return - - self.output("""if hasattr(dll, '%s'):""" % method) - if params: - self.output(" prototype=ctypes.CFUNCTYPE(%s, %s)" % (self.type2class.get(rtype, 'FIXME_%s' % rtype), - ", ".join( self.type2class[p[0]] for p in params ))) - else: - self.output(" prototype=ctypes.CFUNCTYPE(%s)" % self.type2class.get(rtype, 'FIXME_%s' % rtype)) - - - if not params: - flags=' paramflags= tuple()' - elif len(params) == 1: - flags=" paramflags=( (%d, ), )" % parameter_passing[params[0][0]] - else: - flags=" paramflags=%s" % ", ".join( '(%d,)' % parameter_passing[p[0]] for p in params ) - self.output(flags) - self.output(' %s = prototype( ("%s", dll), paramflags )' % (method, method)) - if '3' in flags: - # A VLCException is present. Process it. - self.output(" %s.errcheck = check_vlc_exception" % method) - self.output(' %s.__doc__ = """%s"""' % (method, comment)) - self.output() - - def parse_override(self, name): - """Parse override definitions file. - - It is possible to override methods definitions in classes. - - It returns a tuple - (code, overriden_methods, docstring) - """ - code={} - - data=[] - current=None - f=open(name, 'r') - for l in f: - m=re.match('class (\S+):', l) - if m: - # Dump old data - if current is not None: - code[current]="".join(data) - current=m.group(1) - data=[] - continue - data.append(l) - code[current]="".join(data) - f.close() - - docstring={} - for k, v in code.iteritems(): - if v.lstrip().startswith('"""'): - # Starting comment. Use it as docstring. - dummy, docstring[k], code[k]=v.split('"""', 2) - - # Not robust wrt. internal methods, but this works for the moment. - overridden_methods=dict( (k, re.findall('^\s+def\s+(\w+)', v, re.MULTILINE)) for (k, v) in code.iteritems() ) - - return code, overridden_methods, docstring - - def fix_python_comment(self, c): - """Fix comment by removing first and last parameters (self and exception) - """ - data=c.replace('@{', '').replace('@see', 'See').splitlines() - body=itertools.takewhile(lambda l: not '@param' in l and not '@return' in l, data) - param=[ python_param_re.sub('\\1:\\2', l) for l in itertools.ifilter(lambda l: '@param' in l, data) ] - ret=[ l.replace('@return', '@return:') for l in itertools.ifilter(lambda l: '@return' in l, data) ] - - if len(param) >= 2: - param=param[1:-1] - elif len(param) == 1: - param=[] - - return "\n".join(itertools.chain(body, param, ret)) - - def generate_wrappers(self, methods): - """Generate class wrappers for all appropriate methods. - - @return: the set of wrapped method names - """ - ret=set() - # Sort methods against the element they apply to. - elements=sorted( ( (self.type2class.get(params[0][0]), rt, met, params, c) - for (rt, met, params, c) in methods - if params and self.type2class.get(params[0][0], '_') in self.defined_classes - ), - key=operator.itemgetter(0)) - - overrides, overriden_methods, docstring=self.parse_override('override.py') - - for classname, el in itertools.groupby(elements, key=operator.itemgetter(0)): - self.output("""class %(name)s(object):""" % {'name': classname}) - if classname in docstring: - self.output(' """%s\n """' % docstring[classname]) - - if not 'def __new__' in overrides.get(classname, ''): - self.output(""" - def __new__(cls, pointer=None): - '''Internal method used for instanciating wrappers from ctypes. - ''' - if pointer is None: - raise Exception("Internal method. Surely this class cannot be instanciated by itself.") - if pointer == 0: - return None - else: - o=object.__new__(cls) - o._as_parameter_=ctypes.c_void_p(pointer) - return o -""") - - self.output(""" - @staticmethod - def from_param(arg): - '''(INTERNAL) ctypes parameter conversion method. - ''' - return arg._as_parameter_ -""") - - if classname in overrides: - self.output(overrides[classname]) - - prefix=self.prefixes.get(classname, '') - - for cl, rtype, method, params, comment in el: - if method in blacklist: - continue - # Strip prefix - name=method.replace(prefix, '').replace('libvlc_', '') - ret.add(method) - if name in overriden_methods.get(cl, []): - # Method already defined in override.py - continue - - if params: - params[0]=(params[0][0], 'self') - if params and params[-1][0] in ('libvlc_exception_t*', 'mediacontrol_Exception*'): - args=", ".join( p[1] for p in params[:-1] ) - else: - args=", ".join( p[1] for p in params ) - - self.output(" if hasattr(dll, '%s'):" % method) - self.output(" def %s(%s):" % (name, args)) - self.output(' """%s\n """' % self.fix_python_comment(comment)) - if params and params[-1][0] == 'libvlc_exception_t*': - # Exception handling - self.output(" e=VLCException()") - self.output(" return %s(%s, e)" % (method, args)) - elif params and params[-1][0] == 'mediacontrol_Exception*': - # Exception handling - self.output(" e=MediaControlException()") - self.output(" return %s(%s, e)" % (method, args)) - else: - self.output(" return %s(%s)" % (method, args)) - self.output() - - # Check for standard methods - if name == 'count': - # There is a count method. Generate a __len__ one. - if params and params[-1][0] == 'libvlc_exception_t*': - self.output(""" def __len__(self): - e=VLCException() - return %s(self, e) -""" % method) - else: - # No exception - self.output(""" def __len__(self): - return %s(self) -""" % method) - elif name.endswith('item_at_index'): - # Indexable (and thus iterable)" - self.output(""" def __getitem__(self, i): - e=VLCException() - return %s(self, i, e) - - def __iter__(self): - e=VLCException() - for i in xrange(len(self)): - yield self[i] -""" % method) - return ret - -class JavaGenerator(object): - # C-type to java/jna type conversion. - # Note that enum types conversions are generated (cf convert_enum_names) - type2class={ - 'libvlc_exception_t*': 'libvlc_exception_t', - 'libvlc_media_player_t*': 'LibVlcMediaPlayer', - 'libvlc_instance_t*': 'LibVlcInstance', - 'libvlc_media_t*': 'LibVlcMedia', - 'libvlc_log_t*': 'LibVlcLog', - 'libvlc_log_iterator_t*': 'LibVlcLogIterator', - 'libvlc_log_message_t*': 'libvlc_log_message_t', - 'libvlc_event_type_t': 'int', - 'libvlc_event_manager_t*': 'LibVlcEventManager', - 'libvlc_media_discoverer_t*': 'LibVlcMediaDiscoverer', - 'libvlc_media_library_t*': 'LibVlcMediaLibrary', - 'libvlc_media_list_t*': 'LibVlcMediaList', - 'libvlc_media_list_player_t*': 'LibVlcMediaListPlayer', - 'libvlc_media_list_view_t*': 'LibVlcMediaListView', - 'libvlc_media_stats_t*': 'LibVlcMediaStats', - - 'libvlc_track_description_t*': 'LibVlcTrackDescription', - 'libvlc_audio_output_t*': 'LibVlcAudioOutput', - - 'void': 'void', - 'void*': 'Pointer', - 'short': 'short', - 'char*': 'String', - 'char**': 'String[]', - 'uint32_t': 'uint32', - 'float': 'float', - 'unsigned': 'int', - 'int': 'int', - '...': 'FIXMEva_list', - 'libvlc_callback_t': 'LibVlcCallback', - 'libvlc_time_t': 'long', - - 'mediacontrol_RGBPicture*': 'Pointer', - 'mediacontrol_PlaylistSeq*': 'Pointer', - 'mediacontrol_StreamInformation*': 'Pointer', - } - - def __init__(self, parser=None): - self.parser=parser - - # Blacklist all mediacontrol methods - for (rt, met, params, c) in self.parser.methods: - if met.startswith('mediacontrol'): - blacklist.append(met) - # Generate Java names for enums - self.type2class.update(self.convert_enum_names(parser.enums)) - self.check_types() - - def save(self, dirname=None): - if dirname is None or dirname == '-': - dirname='internal' - if not os.path.isdir(dirname): - os.mkdir(dirname) - - print "Generating java code in %s/" % dirname - - # Generate enum files - self.generate_enums(dirname, self.parser.enums) - - # Generate LibVlc.java code - self.generate_libvlc(dirname) - - def output(self, fd, *p): - fd.write(" ".join(p)) - fd.write("\n") - - def check_types(self): - """Make sure that all types are properly translated. - - This method must be called *after* convert_enum_names, since - the latter populates type2class with converted enum names. - """ - for (rt, met, params, c) in self.parser.methods: - if met in blacklist: - continue - for typ, name in params: - if not typ in self.type2class: - raise Exception("No conversion for %s (from %s:%s)" % (typ, met, name)) - - def convert_enum_names(self, enums): - """Convert enum names into Java names. - """ - res={} - for (typ, name, values, comment) in enums: - if typ != 'enum': - raise Exception('This method only handles enums') - pyname=re.findall('(libvlc|mediacontrol)_(.+?)(_t)?$', name)[0][1] - if '_' in pyname: - pyname=pyname.title().replace('_', '') - elif not pyname[0].isupper(): - pyname=pyname.capitalize() - res[name]=pyname - return res - - def insert_code(self, fd, filename): - """Generate header/footer code. - """ - f=open(filename, 'r') - for l in f: - if l.startswith('build_date'): - self.output(fd, 'build_date="%s";' % time.ctime()) - else: - self.output(fd, l.rstrip()) - f.close() - - def generate_header(self, fd): - """Generate LibVlc header. - """ - for (c_type, jna_type) in self.type2class.iteritems(): - if c_type.endswith('*') and jna_type.startswith('LibVlc'): - self.output(fd, ''' public class %s extends PointerType - { - } -''' % jna_type) - - def generate_libvlc(self, dirname): - """Generate LibVlc.java JNA glue code. - """ - filename=os.path.join(dirname, 'LibVlc.java') - fd=open(filename, 'w') - - self.insert_code(fd, 'boilerplate.java') - self.insert_code(fd, 'LibVlc-header.java') - #wrapped_methods=self.generate_wrappers(self.parser.methods) - self.generate_header(fd) - for (rtype, method, params, comment) in self.parser.methods: - if method in blacklist: - # FIXME - continue - self.output(fd, "%s %s(%s);\n" % (self.type2class.get(rtype, 'FIXME_%s' % rtype), - method, - ", ".join( ("%s %s" % (self.type2class[p[0]], - p[1])) for p in params ))) - self.insert_code(fd, 'LibVlc-footer.java') - fd.close() - - def generate_enums(self, dirname, enums): - """Generate JNA glue code for enums - """ - for (typ, name, values, comment) in enums: - if typ != 'enum': - raise Exception('This method only handles enums') - javaname=self.type2class[name] - - filename=javaname+".java" - - fd=open(os.path.join(dirname, filename), 'w') - - self.insert_code(fd, 'boilerplate.java') - self.output(fd, """package org.videolan.jvlc.internal; - - -public enum %s -{ -""" % javaname) - # FIXME: write comment - - for k, v in values: - self.output(fd, " %s (%s)," % (k, v)) - self.output(fd, ""); - self.output(fd, " private final int _value;"); - self.output(fd, " %s(int value) { this._value = value; }" % javaname); - self.output(fd, " public int value() { return this._value; }"); - self.output(fd, "}") - fd.close() - - def fix_python_comment(self, c): - """Fix comment by removing first and last parameters (self and exception) - """ - data=c.replace('@{', '').replace('@see', 'See').splitlines() - body=itertools.takewhile(lambda l: not '@param' in l and not '@return' in l, data) - param=[ python_param_re.sub('\\1:\\2', l) for l in itertools.ifilter(lambda l: '@param' in l, data) ] - ret=[ l.replace('@return', '@return:') for l in itertools.ifilter(lambda l: '@return' in l, data) ] - - if len(param) >= 2: - param=param[1:-1] - elif len(param) == 1: - param=[] - - return "\n".join(itertools.chain(body, param, ret)) - -def process(output, list_of_includes): - p=Parser(list_of_includes) - g=PythonGenerator(p) - g.save(output) - -if __name__ == '__main__': - opt=OptionParser(usage="""Parse VLC include files and generate bindings code. -%prog [options] include_file.h [...]""") - - opt.add_option("-d", "--debug", dest="debug", action="store_true", - default=False, - help="Debug mode") - - opt.add_option("-c", "--check", dest="check", action="store_true", - default=False, - help="Check mode") - - opt.add_option("-j", "--java", dest="java", action="store_true", - default=False, - help="Generate java bindings (default is python)") - - opt.add_option("-o", "--output", dest="output", action="store", - type="str", default="-", - help="Output filename(python)/dirname(java)") - - (options, args) = opt.parse_args() - - if not args: - opt.print_help() - sys.exit(1) - - p=Parser(args) - if options.check: - # Various consistency checks. - for (rt, name, params, comment) in p.methods: - if not comment.strip(): - print "No comment for %s" % name - continue - names=comment_re.findall(comment) - if len(names) != len(params): - print "Docstring comment parameters mismatch for %s" % name - - if options.debug: - p.dump_methods() - p.dump_enums() - - if options.check or options.debug: - sys.exit(0) - - if options.java: - g=JavaGenerator(p) - else: - g=PythonGenerator(p) - - g.save(options.output) diff --git a/bindings/python-ctypes/header.py b/bindings/python-ctypes/header.py deleted file mode 100755 index 12e8e4d46b..0000000000 --- a/bindings/python-ctypes/header.py +++ /dev/null @@ -1,309 +0,0 @@ -#! /usr/bin/python - -# -# Python ctypes bindings for VLC -# Copyright (C) 2009 the VideoLAN team -# $Id: $ -# -# Authors: Olivier Aubert -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 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 General Public License for more details. -# -# You should have received a copy of the GNU 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. -# - -"""This module provides bindings for the -U{libvlc} and -U{MediaControl} APIs. - -You can find documentation at U{http://www.advene.org/download/python-ctypes/}. - -Basically, the most important class is L{Instance}, which is used to -create a libvlc Instance. From this instance, you can then create -L{MediaPlayer} and L{MediaListPlayer} instances. -""" - -import logging -import ctypes -import sys - -build_date="This will be replaced by the build date" - -# Used for win32 and MacOS X -detected_plugin_path=None - -if sys.platform == 'linux2': - dll=ctypes.CDLL('libvlc.so') -elif sys.platform == 'win32': - import ctypes.util - import os - detected_plugin_path=None - path=ctypes.util.find_library('libvlc.dll') - if path is None: - # Try to use registry settings - import _winreg - detected_plugin_path_found = None - subkey, name = 'Software\\VideoLAN\\VLC','InstallDir' - for hkey in _winreg.HKEY_LOCAL_MACHINE, _winreg.HKEY_CURRENT_USER: - try: - reg = _winreg.OpenKey(hkey, subkey) - detected_plugin_path_found, type_id = _winreg.QueryValueEx(reg, name) - _winreg.CloseKey(reg) - break - except _winreg.error: - pass - if detected_plugin_path_found: - detected_plugin_path = detected_plugin_path_found - else: - # Try a standard location. - p='c:\\Program Files\\VideoLAN\\VLC\\libvlc.dll' - if os.path.exists(p): - detected_plugin_path=os.path.dirname(p) - os.chdir(detected_plugin_path) - # If chdir failed, this will not work and raise an exception - path='libvlc.dll' - else: - detected_plugin_path=os.path.dirname(path) - dll=ctypes.CDLL(path) -elif sys.platform == 'darwin': - # FIXME: should find a means to configure path - d='/Applications/VLC.app' - import os - if os.path.exists(d): - dll=ctypes.CDLL(d+'/Contents/MacOS/lib/libvlc.2.dylib') - detected_plugin_path=d+'/Contents/MacOS/modules' - else: - # Hope some default path is set... - dll=ctypes.CDLL('libvlc.2.dylib') - -# -# Generated enum types. -# - -# GENERATED_ENUMS - -# -# End of generated enum types. -# - -class ListPOINTER(object): - '''Just like a POINTER but accept a list of ctype as an argument. - ''' - def __init__(self, etype): - self.etype = etype - - def from_param(self, param): - if isinstance(param, (list, tuple)): - return (self.etype * len(param))(*param) - -class LibVLCException(Exception): - """Python exception raised by libvlc methods. - """ - pass - -# From libvlc_structures.h - -# This is version-dependent, depending on the presence of libvlc_errmsg - -if hasattr(dll, 'libvlc_errmsg'): - # New-style message passing - class VLCException(ctypes.Structure): - """libvlc exception. - """ - _fields_= [ - ('raised', ctypes.c_int), - ] - - @property - def message(self): - return dll.libvlc_errmsg() - - def init(self): - libvlc_exception_init(self) - - def clear(self): - libvlc_exception_clear(self) -else: - # Old-style exceptions - class VLCException(ctypes.Structure): - """libvlc exception. - """ - _fields_= [ - ('raised', ctypes.c_int), - ('code', ctypes.c_int), - ('message', ctypes.c_char_p), - ] - def init(self): - libvlc_exception_init(self) - - def clear(self): - libvlc_exception_clear(self) - -class MediaStats(ctypes.Structure): - _fields_= [ - ('read_bytes', ctypes.c_int ), - ('input_bitrate', ctypes.c_float), - ('demux_read_bytes', ctypes.c_int ), - ('demux_bitrate', ctypes.c_float), - ('demux_corrupted', ctypes.c_int ), - ('demux_discontinuity', ctypes.c_int ), - ('decoded_video', ctypes.c_int ), - ('decoded_audio', ctypes.c_int ), - ('displayed_pictures', ctypes.c_int ), - ('lost_pictures', ctypes.c_int ), - ('played_abuffers', ctypes.c_int ), - ('lost_abuffers', ctypes.c_int ), - ('sent_packets', ctypes.c_int ), - ('sent_bytes', ctypes.c_int ), - ('send_bitrate', ctypes.c_float), - ] - - def __str__(self): - return "MediaStats\n%s" % "\n".join( "%s:\t%s" % (n, getattr(self, n)) for n in self._fields_ ) - -class MediaES(ctypes.Structure): - _fields_= [ - ('codec' , ctypes.c_uint32), - ('type' , EsType), - ('profile' , ctypes.c_int), - ('level' , ctypes.c_int), - ('channels', ctypes.c_uint), - ('rate' , ctypes.c_uint), - ('height' , ctypes.c_uint), - ('width' , ctypes.c_uint), - ] - - def __str__(self): - return "MediaES \n%s" % "\n".join( "%s:\t%s" % (n, getattr(self, n)) for n in self._fields_ ) - -class PlaylistItem(ctypes.Structure): - _fields_= [ - ('id', ctypes.c_int), - ('uri', ctypes.c_char_p), - ('name', ctypes.c_char_p), - ] - - def __str__(self): - return "PlaylistItem #%d %s (%uri)" % (self.id, self.name, self.uri) - -class LogMessage(ctypes.Structure): - _fields_= [ - ('size', ctypes.c_uint), - ('severity', ctypes.c_int), - ('type', ctypes.c_char_p), - ('name', ctypes.c_char_p), - ('header', ctypes.c_char_p), - ('message', ctypes.c_char_p), - ] - - def __init__(self): - super(LogMessage, self).__init__() - self.size=ctypes.sizeof(self) - - def __str__(self): - return "vlc.LogMessage(%d:%s): %s" % (self.severity, self.type, self.message) - -class MediaControlPosition(ctypes.Structure): - _fields_= [ - ('origin', PositionOrigin), - ('key', PositionKey), - ('value', ctypes.c_longlong), - ] - - def __init__(self, value=0, origin=None, key=None): - # We override the __init__ method so that instanciating the - # class with an int as parameter will create the appropriate - # default position (absolute position, media time, with the - # int as value). - super(MediaControlPosition, self).__init__() - self.value=value - if origin is None: - origin=PositionOrigin.AbsolutePosition - if key is None: - key=PositionKey.MediaTime - self.origin=origin - self.key=key - - def __str__(self): - return "MediaControlPosition %ld (%s, %s)" % ( - self.value, - str(self.origin), - str(self.key) - ) - - @staticmethod - def from_param(arg): - if isinstance(arg, (int, long)): - return MediaControlPosition(arg) - else: - return arg - -class MediaControlException(ctypes.Structure): - _fields_= [ - ('code', ctypes.c_int), - ('message', ctypes.c_char_p), - ] - def init(self): - mediacontrol_exception_init(self) - - def clear(self): - mediacontrol_exception_free(self) - -class MediaControlStreamInformation(ctypes.Structure): - _fields_= [ - ('status', PlayerStatus), - ('url', ctypes.c_char_p), - ('position', ctypes.c_longlong), - ('length', ctypes.c_longlong), - ] - - def __str__(self): - return "%s (%s) : %ld / %ld" % (self.url or "", - str(self.status), - self.position, - self.length) - -class RGBPicture(ctypes.Structure): - _fields_= [ - ('width', ctypes.c_int), - ('height', ctypes.c_int), - ('type', ctypes.c_uint32), - ('date', ctypes.c_ulonglong), - ('size', ctypes.c_int), - ('data_pointer', ctypes.c_void_p), - ] - - @property - def data(self): - return ctypes.string_at(self.data_pointer, self.size) - - def __str__(self): - return "RGBPicture (%d, %d) - %ld ms - %d bytes" % (self.width, self.height, self.date, self.size) - - def free(self): - mediacontrol_RGBPicture__free(self) - -def check_vlc_exception(result, func, args): - """Error checking method for functions using an exception in/out parameter. - """ - ex=args[-1] - if not isinstance(ex, (VLCException, MediaControlException)): - logging.warn("python-vlc: error when processing function %s. Please report this as a bug to vlc-devel@videolan.org" % str(func)) - return result - # Take into account both VLCException and MediacontrolException: - c=getattr(ex, 'raised', getattr(ex, 'code', 0)) - if c: - raise LibVLCException(ex.message) - return result - -### End of header.py ### diff --git a/bindings/python-ctypes/override.py b/bindings/python-ctypes/override.py deleted file mode 100644 index 8cf379e013..0000000000 --- a/bindings/python-ctypes/override.py +++ /dev/null @@ -1,261 +0,0 @@ -class Instance: - """Create a new Instance instance. - - It may take as parameter either: - - a string - - a list of strings as first parameters - - the parameters given as the constructor parameters (must be strings) - - a MediaControl instance - """ - def __new__(cls, *p): - if p and p[0] == 0: - return None - elif p and isinstance(p[0], (int, long)): - # instance creation from ctypes - o=object.__new__(cls) - o._as_parameter_=ctypes.c_void_p(p[0]) - return o - elif len(p) == 1 and isinstance(p[0], basestring): - # Only 1 string parameter: should be a parameter line - p=p[0].split(' ') - elif len(p) == 1 and isinstance(p[0], (tuple, list)): - p=p[0] - - if p and isinstance(p[0], MediaControl): - return p[0].get_instance() - else: - if not p and detected_plugin_path is not None: - # No parameters passed. Under win32 and MacOS, specify - # the detected_plugin_path if present. - p=[ 'vlc', '--plugin-path='+ detected_plugin_path ] - e=VLCException() - return libvlc_new(len(p), p, e) - - def media_player_new(self, uri=None): - """Create a new Media Player object. - - @param uri: an optional URI to play in the player. - """ - e=VLCException() - p=libvlc_media_player_new(self, e) - if uri: - p.set_media(self.media_new(uri)) - p._instance=self - return p - - def media_list_player_new(self): - """Create an empty Media Player object - """ - e=VLCException() - p=libvlc_media_list_player_new(self, e) - p._instance=self - return p - - def media_new(self, mrl, *options): - """Create an empty Media Player object - - Options can be specified as supplementary string parameters, e.g. - m=i.media_new('foo.avi', 'sub-filter=marq{marquee=Hello}', 'vout-filter=invert') - """ - e=VLCException() - m=libvlc_media_new(self, mrl, e) - for o in options: - libvlc_media_add_option(m, o, e) - return m - -class MediaControl: - """Create a new MediaControl instance - - It may take as parameter either: - - a string - - a list of strings as first parameters - - the parameters given as the constructor parameters (must be strings) - - a vlc.Instance - """ - def __new__(cls, *p): - if p and p[0] == 0: - return None - elif p and isinstance(p[0], (int, long)): - # instance creation from ctypes - o=object.__new__(cls) - o._as_parameter_=ctypes.c_void_p(p[0]) - return o - elif len(p) == 1 and isinstance(p[0], basestring): - # Only 1 string parameter: should be a parameter line - p=p[0].split(' ') - elif len(p) == 1 and isinstance(p[0], (tuple, list)): - p=p[0] - - if p and isinstance(p[0], Instance): - e=MediaControlException() - return mediacontrol_new_from_instance(p[0], e) - else: - if not p and detected_plugin_path is not None: - # No parameters passed. Under win32 and MacOS, specify - # the detected_plugin_path if present. - p=[ 'vlc', '--plugin-path='+ detected_plugin_path ] - e=MediaControlException() - return mediacontrol_new(len(p), p, e) - - def get_media_position(self, origin=PositionOrigin.AbsolutePosition, key=PositionKey.MediaTime): - e=MediaControlException() - p=mediacontrol_get_media_position(self, origin, key, e) - if p: - return p.contents - else: - return None - - def set_media_position(self, pos): - """Set the media position. - - @param pos: a MediaControlPosition or an integer (in ms) - """ - if not isinstance(pos, MediaControlPosition): - pos=MediaControlPosition(long(pos)) - e=MediaControlException() - mediacontrol_set_media_position(self, pos, e) - - def start(self, pos=0): - """Start the player at the given position. - - @param pos: a MediaControlPosition or an integer (in ms) - """ - if not isinstance(pos, MediaControlPosition): - pos=MediaControlPosition(long(pos)) - e=MediaControlException() - mediacontrol_start(self, pos, e) - - def snapshot(self, pos=0): - """Take a snapshot. - - Note: the position parameter is not properly implemented. For - the moment, the only valid position is the 0-relative position - (i.e. the current position). - - @param pos: a MediaControlPosition or an integer (in ms) - """ - if not isinstance(pos, MediaControlPosition): - pos=MediaControlPosition(long(pos)) - e=MediaControlException() - p=mediacontrol_snapshot(self, pos, e) - if p: - snap=p.contents - # FIXME: there is a bug in the current mediacontrol_snapshot - # implementation, which sets an incorrect date. - # Workaround here: - snap.date=self.get_media_position().value - return snap - else: - return None - - def display_text(self, message='', begin=0, end=1000): - """Display a caption between begin and end positions. - - @param message: the caption to display - @param begin: the begin position - @param end: the end position - """ - if not isinstance(begin, MediaControlPosition): - begin=self.value2position(begin) - if not isinstance(end, MediaControlPosition): - end=self.value2position(end) - e=MediaControlException() - mediacontrol_display_text(self, message, begin, end, e) - - def get_stream_information(self, key=PositionKey.MediaTime): - """Return information about the stream. - """ - e=MediaControlException() - return mediacontrol_get_stream_information(self, key, e).contents - -class Media: - def add_options(self, *list_of_options): - """Add a list of options to the media. - - Options must be written without the double-dash, e.g.: - m.add_options('sub-filter=marq@test{marquee=Hello}', 'video-filter=invert') - - Note that you also can directly pass these options in the Instance.media_new method: - m=instance.media_new( 'foo.avi', 'sub-filter=marq@test{marquee=Hello}', 'video-filter=invert') - """ - for o in list_of_options: - self.add_option(o) - -class MediaPlayer: - """Create a new MediaPlayer instance. - - It may take as parameter either: - - a string (media URI). In this case, a vlc.Instance will be created. - - a vlc.Instance - """ - def __new__(cls, *p): - if p and p[0] == 0: - return None - elif p and isinstance(p[0], (int, long)): - # instance creation from ctypes - o=object.__new__(cls) - o._as_parameter_=ctypes.c_void_p(p[0]) - return o - - if p and isinstance(p[0], Instance): - return p[0].media_player_new() - else: - i=Instance() - o=i.media_player_new() - if p: - o.set_media(i.media_new(p[0])) - return o - - def get_instance(self): - """Return the associated vlc.Instance. - """ - return self._instance - -class MediaListPlayer: - """Create a new MediaPlayer instance. - - It may take as parameter either: - - a vlc.Instance - - nothing - """ - def __new__(cls, *p): - if p and p[0] == 0: - return None - elif p and isinstance(p[0], (int, long)): - # instance creation from ctypes - o=object.__new__(cls) - o._as_parameter_=ctypes.c_void_p(p[0]) - return o - elif len(p) == 1 and isinstance(p[0], (tuple, list)): - p=p[0] - - if p and isinstance(p[0], Instance): - return p[0].media_list_player_new() - else: - i=Instance() - o=i.media_list_player_new() - return o - - def get_instance(self): - """Return the associated vlc.Instance. - """ - return self._instance - -class LogIterator: - def __iter__(self): - return self - - def next(self): - if not self.has_next(): - raise StopIteration - buf=LogMessage() - e=VLCException() - ret=libvlc_log_iterator_next(self, buf, e) - return ret.contents - -class Log: - def __iter__(self): - return self.get_iterator() - - def dump(self): - return [ str(m) for m in self ] diff --git a/bindings/python-ctypes/setup.py b/bindings/python-ctypes/setup.py deleted file mode 100644 index 0f04516d34..0000000000 --- a/bindings/python-ctypes/setup.py +++ /dev/null @@ -1,32 +0,0 @@ -from distutils.core import setup -import sys -import os -import generate - -vlc_include_path = os.path.join("..","..","include","vlc") -if not os.path.exists(vlc_include_path): - raise Exception("This script should be run from a VLC tree.") - -files = [ os.path.join(vlc_include_path, filename) - for filename in os.listdir(vlc_include_path) ] - -generate.process('vlc.py', files) - -setup(name='python-vlc', - version = '1.1.0', - author='Olivier Aubert', - author_email='olivier.aubert@liris.cnrs.fr', - url='http://wiki.videolan.org/PythonBinding', - py_modules=['vlc'], - keywords = [ 'vlc', 'video' ], - license = "GPL", - description = "VLC bindings for python.", - long_description = """VLC bindings for python. - -This module provides ctypes-based bindings for the native libvlc API -(see http://wiki.videolan.org/ExternalAPI) and the MediaControl API -(see http://wiki.videolan.org/PythonBinding) of the VLC video player. - -It is automatically generated from the include files. -""" - ) diff --git a/bindings/python-ctypes/test.py b/bindings/python-ctypes/test.py deleted file mode 100755 index 7675fedc1b..0000000000 --- a/bindings/python-ctypes/test.py +++ /dev/null @@ -1,160 +0,0 @@ -#! /usr/bin/python - -# -# Code generator for python ctypes bindings for VLC -# Copyright (C) 2009 the VideoLAN team -# $Id: $ -# -# Authors: Olivier Aubert -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 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 General Public License for more details. -# -# You should have received a copy of the GNU 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. -# - -"""Unittest module. -""" - -import unittest -import vlc - -class TestVLCAPI(unittest.TestCase): - #def setUp(self): - # self.seq = range(10) - #self.assert_(element in self.seq) - - # We check enum definitions against hardcoded values. In case of - # failure, check that the reason is not a change in the .h - # definitions. - def test_enum_event_type(self): - self.assertEqual(vlc.EventType.MediaStateChanged.value, 5) - - def test_enum_meta(self): - self.assertEqual(vlc.Meta.Description.value, 6) - - def test_enum_state(self): - self.assertEqual(vlc.State.Playing.value, 3) - - def test_enum_media_option(self): - self.assertEqual(vlc.MediaOption.unique.value, 256) - - def test_enum_playback_mode(self): - self.assertEqual(vlc.PlaybackMode.repeat.value, 2) - - def test_enum_marquee_int_option(self): - self.assertEqual(vlc.VideoMarqueeIntOption.Size.value, 5) - - def test_enum_output_device_type(self): - self.assertEqual(vlc.AudioOutputDeviceTypes._2F2R.value, 4) - - def test_enum_output_channel(self): - self.assertEqual(vlc.AudioOutputChannel.Dolbys.value, 5) - - def test_enum_position_origin(self): - self.assertEqual(vlc.PositionOrigin.ModuloPosition.value, 2) - - def test_enum_position_key(self): - self.assertEqual(vlc.PositionKey.MediaTime.value, 2) - - def test_enum_player_status(self): - self.assertEqual(vlc.PlayerStatus.StopStatus.value, 5) - - # Basic MediaControl tests - def test_mediacontrol_creation(self): - mc=vlc.MediaControl() - self.assert_(mc) - - def test_mediacontrol_initial_mrl(self): - mc=vlc.MediaControl() - self.assertEqual(mc.get_mrl(), '') - - def test_mediacontrol_set_mrl(self): - mrl='/tmp/foo.avi' - mc=vlc.MediaControl() - mc.set_mrl(mrl) - self.assertEqual(mc.get_mrl(), mrl) - - def test_mediacontrol_position(self): - p=vlc.MediaControlPosition(value=2, - origin=vlc.PositionOrigin.RelativePosition, - key=vlc.PositionKey.MediaTime) - self.assertEqual(p.value, 2) - - def test_mediacontrol_position_shortcut(self): - p=vlc.MediaControlPosition(2) - self.assertEqual(p.value, 2) - self.assertEqual(p.key, vlc.PositionKey.MediaTime) - self.assertEqual(p.origin, vlc.PositionOrigin.AbsolutePosition) - - def test_mediacontrol_get_media_position(self): - mc=vlc.MediaControl() - p=mc.get_media_position() - self.assertEqual(p.value, -1) - - def test_mediacontrol_get_stream_information(self): - mc=vlc.MediaControl() - s=mc.get_stream_information() - self.assertEqual(s.position, 0) - self.assertEqual(s.length, 0) - - # Basic libvlc tests - def test_instance_creation(self): - i=vlc.Instance() - self.assert_(i) - - def test_libvlc_media(self): - mrl='/tmp/foo.avi' - i=vlc.Instance() - m=i.media_new(mrl) - self.assertEqual(m.get_mrl(), mrl) - - def test_libvlc_player(self): - mrl='/tmp/foo.avi' - i=vlc.Instance() - p=i.media_player_new(mrl) - self.assertEqual(p.get_media().get_mrl(), mrl) - - def test_libvlc_player_state(self): - mrl='/tmp/foo.avi' - i=vlc.Instance() - p=i.media_player_new(mrl) - self.assertEqual(p.get_state(), vlc.State.Ended) - - def test_libvlc_logger(self): - i=vlc.Instance() - l=i.log_open() - l.clear() - self.assertEqual(l.count(), 0) - l.close() - - def test_libvlc_logger_clear(self): - i=vlc.Instance() - l=i.log_open() - l.clear() - self.assertEqual(l.count(), 0) - l.close() - - def test_libvlc_logger(self): - i=vlc.Instance() - i.set_log_verbosity(3) - l=i.log_open() - # This should generate a log message - i.add_intf('dummy') - self.assertNotEqual(l.count(), 0) - for m in l: - # Ensure that messages can be read. - self.assertNotEqual(len(m.message), 0) - l.close() - -if __name__ == '__main__': - unittest.main() diff --git a/bindings/python-ctypes/vlcwidget.py b/bindings/python-ctypes/vlcwidget.py deleted file mode 100755 index 2c607c55ac..0000000000 --- a/bindings/python-ctypes/vlcwidget.py +++ /dev/null @@ -1,154 +0,0 @@ -#! /usr/bin/python - -"""VLC Widget classes. - -This module provides two helper classes, to ease the embedding of a -VLC component inside a pygtk application. - -VLCWidget is a simple VLC widget. - -DecoratedVLCWidget provides simple player controls. - -$Id$ -""" - -import gtk -import sys -import vlc - -from gettext import gettext as _ - -# Create a single vlc.Instance() to be share by (possible) multiple players. -instance=vlc.Instance() - -class VLCWidget(gtk.DrawingArea): - """Simple VLC widget. - - Its player can be controlled through the 'player' attribute, which - is a vlc.MediaPlayer() instance. - """ - def __init__(self, *p): - gtk.DrawingArea.__init__(self) - self.player=instance.media_player_new() - def handle_embed(*args): - if sys.platform == 'win32': - self.player.set_hwnd(self.window.handle) - else: - self.player.set_xwindow(self.window.xid) - return True - self.connect("map-event", handle_embed) - self.set_size_request(320, 200) - -class DecoratedVLCWidget(gtk.VBox): - """Decorated VLC widget. - - VLC widget decorated with a player control toolbar. - - Its player can be controlled through the 'player' attribute, which - is a MediaControl instance. - """ - def __init__(self, *p): - gtk.VBox.__init__(self) - self._vlc_widget=VLCWidget(*p) - self.player=self._vlc_widget.player - self.pack_start(self._vlc_widget, expand=True) - self._toolbar = self.get_player_control_toolbar() - self.pack_start(self._toolbar, expand=False) - - def get_player_control_toolbar(self): - """Return a player control toolbar - """ - tb=gtk.Toolbar() - tb.set_style(gtk.TOOLBAR_ICONS) - - tb_list = ( - (_("Play"), _("Play"), gtk.STOCK_MEDIA_PLAY, lambda b: self.player.play()), - (_("Pause"), _("Pause"), gtk.STOCK_MEDIA_PAUSE, lambda b: self.player.pause()), - (_("Stop"), _("Stop"), gtk.STOCK_MEDIA_STOP, lambda b: self.player.stop()), - (_("Quit"), _("Quit"), gtk.STOCK_QUIT, lambda b: gtk.main_quit()), - ) - - for text, tooltip, stock, callback in tb_list: - b=gtk.ToolButton(stock) - b.connect("clicked", callback) - tb.insert(b, -1) - tb.show_all() - return tb - -class VideoPlayer: - """Example simple video player. - """ - def __init__(self): - self.vlc = DecoratedVLCWidget() - - def main(self, fname): - self.vlc.player.set_media(instance.media_new(fname)) - self.popup() - gtk.main() - - def popup(self): - w=gtk.Window() - w.add(self.vlc) - w.show_all() - w.connect("destroy", gtk.main_quit) - return w - -class MultiVideoPlayer: - """Example multi-video player. - - It plays multiple files side-by-side, with per-view and global controls. - """ - def main(self, filenames): - # Build main window - window=gtk.Window() - mainbox=gtk.VBox() - videos=gtk.HBox() - - window.add(mainbox) - mainbox.add(videos) - - # Create VLC widgets - for fname in filenames: - v=DecoratedVLCWidget() - v.player.set_media(instance.media_new(fname)) - videos.add(v) - - # Create global toolbar - tb=gtk.Toolbar() - tb.set_style(gtk.TOOLBAR_ICONS) - - def execute(b, methodname): - """Execute the given method on all VLC widgets. - """ - for v in videos.get_children(): - getattr(v.player, methodname)() - return True - - for text, tooltip, stock, callback, arg in ( - (_("Play"), _("Play"), gtk.STOCK_MEDIA_PLAY, execute, "play"), - (_("Pause"), _("Pause"), gtk.STOCK_MEDIA_PAUSE, execute, "pause"), - (_("Stop"), _("Stop"), gtk.STOCK_MEDIA_STOP, execute, "stop"), - (_("Quit"), _("Quit"), gtk.STOCK_QUIT, lambda b, d: gtk.main_quit(), None), - ): - b=gtk.ToolButton(stock) - b.connect("clicked", callback, arg) - tb.insert(b, -1) - - mainbox.pack_start(tb, expand=False) - - window.show_all() - window.connect("destroy", gtk.main_quit) - gtk.main() - -if __name__ == '__main__': - if not sys.argv[1:]: - print "You must provide at least 1 movie filename" - sys.exit(1) - if len(sys.argv[1:]) == 1: - # Only 1 file. Simple interface - p=VideoPlayer() - p.main(sys.argv[1]) - else: - # Multiple files. - p=MultiVideoPlayer() - p.main(sys.argv[1:]) -- 2.39.2