24 changed files with 0 additions and 3233 deletions
@ -1,4 +0,0 @@ |
|||
Doxyfile |
|||
admin/ |
|||
m4/ |
|||
INSTALL |
|||
File diff suppressed because it is too large
@ -1,8 +0,0 @@ |
|||
ACLOCAL_AMFLAGS = -I m4 |
|||
|
|||
SUBDIRS = src |
|||
|
|||
doc: Doxyfile |
|||
$(DOXYGEN) |
|||
|
|||
.PHONY: doc |
|||
@ -1,37 +0,0 @@ |
|||
#!/bin/sh |
|||
# $Id$ |
|||
# |
|||
# *********************************************************************** |
|||
# * Copyright © 2010 Rémi Duraffort. * |
|||
# * This program is free software; you can redistribute and/or modify * |
|||
# * it under the terms of the GNU General Public License as published * |
|||
# * by the Free Software Foundation; version 2 of the license. * |
|||
# * * |
|||
# * 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, you can get it from: * |
|||
# * http://www.gnu.org/copyleft/gpl.html * |
|||
# *********************************************************************** |
|||
|
|||
set -xe |
|||
|
|||
cd "$(dirname "$0")" |
|||
|
|||
test -f src/libvlc.hpp || { |
|||
echo "You must run this script from your libvlcpp directory.">&2 |
|||
exit 1 |
|||
} |
|||
|
|||
mkdir -p admin m4 |
|||
autoreconf -sfi |
|||
|
|||
set +x |
|||
echo "" |
|||
echo "Type \`./configure' to configure the package for your system" |
|||
echo "(type \`./configure -- help' for help)." |
|||
echo "Then you can use the usual \`make', \`make install', etc." |
|||
|
|||
@ -1,28 +0,0 @@ |
|||
dnl configure.ac - Configure script for libvlcpp |
|||
|
|||
AC_COPYRIGHT([Copyright (C) 2010 Rémi Duraffort]) |
|||
AC_INIT(libvlcpp, 1.0.0, vlc-devel@no-spam@videolan.org) |
|||
AC_PREREQ([2.65]) |
|||
|
|||
AC_CONFIG_SRCDIR([configure.ac]) |
|||
AC_CONFIG_AUX_DIR(admin) |
|||
AC_CONFIG_MACRO_DIR([m4]) |
|||
|
|||
dnl Checks for programs. |
|||
AC_PROG_CXX |
|||
AM_PROG_LIBTOOL |
|||
|
|||
AC_ARG_VAR([CXXFLAGS], [C++ compiler flag]) |
|||
|
|||
dnl Checks for vlc library |
|||
PKG_CHECK_MODULES([libvlc], [libvlc >= 1.1.0]) |
|||
AC_SUBST([libvlc_CFLAGS]) |
|||
AC_SUBST([libvlc_LIBS]) |
|||
|
|||
AC_ARG_VAR([DOXYGEN], [Doxygen command]) |
|||
AC_PATH_PROG([DOXYGEN], [doxygen], [false]) |
|||
|
|||
AM_INIT_AUTOMAKE |
|||
|
|||
AC_CONFIG_FILES([Makefile src/Makefile src/libvlcpp.pc Doxyfile]) |
|||
AC_OUTPUT |
|||
@ -1,23 +0,0 @@ |
|||
lib_LTLIBRARIES = libvlcpp.la |
|||
|
|||
libvlcpp_la_SOURCES = \
|
|||
audio.cpp \
|
|||
audio.hpp \
|
|||
exception.cpp \
|
|||
exception.hpp \
|
|||
libvlc.cpp \
|
|||
libvlc.hpp \
|
|||
media.cpp \
|
|||
media.hpp \
|
|||
media_player.cpp \
|
|||
media_player.hpp \
|
|||
video.cpp \
|
|||
video.hpp |
|||
|
|||
libvlcpp_la_CXXFLAGS = @libvlc_CFLAGS@ |
|||
libvlcpp_la_LDFLAGS = @libvlc_LIBS@ -version-info 1:0:0 |
|||
library_includedir=$(includedir)/libvlcpp |
|||
library_include_HEADERS = exception.hpp libvlc.hpp media.hpp media_player.hpp video.hpp audio.hpp |
|||
|
|||
pkgconfigdir = $(libdir)/pkgconfig |
|||
pkgconfig_DATA = libvlcpp.pc |
|||
@ -1,82 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* audio.cpp: audio part of the media player |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 the VideoLAN team |
|||
* $Id$ |
|||
* |
|||
* Authors: Rémi Duraffort <ivoire@videolan.org> |
|||
* |
|||
* 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. |
|||
*****************************************************************************/ |
|||
|
|||
#include "audio.hpp" |
|||
|
|||
|
|||
using namespace libvlc; |
|||
|
|||
Audio::Audio() |
|||
{ |
|||
} |
|||
|
|||
Audio::~Audio() |
|||
{ |
|||
libvlc_media_player_release( m_player ); |
|||
} |
|||
|
|||
void Audio::toggleMute() |
|||
{ |
|||
libvlc_audio_toggle_mute( m_player ); |
|||
} |
|||
|
|||
int Audio::mute() |
|||
{ |
|||
return libvlc_audio_get_mute( m_player ); |
|||
} |
|||
|
|||
void Audio::setMute( int mute ) |
|||
{ |
|||
libvlc_audio_set_mute( m_player, mute ); |
|||
} |
|||
|
|||
int Audio::volume() |
|||
{ |
|||
return libvlc_audio_get_volume( m_player ); |
|||
} |
|||
|
|||
void Audio::setVolume( int volume ) |
|||
{ |
|||
libvlc_audio_set_volume( m_player, volume ); |
|||
} |
|||
|
|||
int Audio::track() |
|||
{ |
|||
return libvlc_audio_get_track( m_player ); |
|||
} |
|||
|
|||
int Audio::trackCount() |
|||
{ |
|||
return libvlc_audio_get_track_count( m_player ); |
|||
} |
|||
|
|||
void Audio::setTrack( int track ) |
|||
{ |
|||
libvlc_audio_set_track( m_player, track ); |
|||
} |
|||
|
|||
void Audio::setMediaPlayer( libvlc_media_player_t *player ) |
|||
{ |
|||
libvlc_media_player_retain( player ); |
|||
m_player = player; |
|||
} |
|||
@ -1,128 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* audio.hpp: audio part of the media player |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 the VideoLAN team |
|||
* $Id$ |
|||
* |
|||
* Authors: Rémi Duraffort <ivoire@videolan.org> |
|||
* |
|||
* 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. |
|||
*****************************************************************************/ |
|||
|
|||
#ifndef LIBVLCPP_AUDIO_HPP |
|||
#define LIBVLCPP_AUDIO_HPP |
|||
|
|||
#include <vlc/libvlc.h> |
|||
#include <vlc/libvlc_media.h> |
|||
#include <vlc/libvlc_media_player.h> |
|||
|
|||
#include "libvlc.hpp" |
|||
|
|||
namespace libvlc |
|||
{ |
|||
|
|||
class MediaPlayer; |
|||
|
|||
class Audio |
|||
{ |
|||
public: |
|||
/**
|
|||
* Toggle mute status |
|||
*/ |
|||
void toggleMute(); |
|||
|
|||
/**
|
|||
* Get the mute status |
|||
* @return true if the sound is muted |
|||
*/ |
|||
int mute(); |
|||
|
|||
/**
|
|||
* Set the mute status |
|||
* @param mute: true to mute, otherwise unmute |
|||
*/ |
|||
void setMute( int mute ); |
|||
|
|||
/**
|
|||
* Get the current volume |
|||
* @return the current volume |
|||
*/ |
|||
int volume(); |
|||
|
|||
/**
|
|||
* Set the volume |
|||
* @param volume: the new volume |
|||
*/ |
|||
void setVolume( int volume ); |
|||
|
|||
|
|||
/**
|
|||
* Get the current track |
|||
* @return the current audio track |
|||
*/ |
|||
int track(); |
|||
|
|||
/**
|
|||
* Get the number of audio tracks |
|||
* @return the number of audio tracks |
|||
*/ |
|||
int trackCount(); |
|||
|
|||
/**
|
|||
* Set the audio track |
|||
* @param track: the audio track |
|||
*/ |
|||
void setTrack( int track ); |
|||
|
|||
/**
|
|||
* Get the current audio channel |
|||
* @return the current audio channel |
|||
*/ |
|||
int channel(); |
|||
|
|||
/**
|
|||
* Set the audio channel |
|||
* @param channel: the new audio channel |
|||
*/ |
|||
void setChannel( int channel ); |
|||
|
|||
/** trackDescription */ |
|||
|
|||
private: |
|||
/** The media player instance of libvlc */ |
|||
libvlc_media_player_t *m_player; |
|||
|
|||
/**
|
|||
* The constructor is private so only the MediaPlayer can create an instance of this class |
|||
*/ |
|||
Audio(); |
|||
|
|||
/** Destructor only used by the MediaPlayer associated with this class */ |
|||
~Audio(); |
|||
|
|||
/**
|
|||
* Set the media player. This function can only be used by the MediaPlayer class |
|||
* @param player: the media player |
|||
*/ |
|||
void setMediaPlayer( libvlc_media_player_t *player); |
|||
|
|||
/** Friend class */ |
|||
friend class MediaPlayer; |
|||
}; |
|||
|
|||
}; |
|||
|
|||
#endif // LIBVLCPP_AUDIO_HPP
|
|||
|
|||
@ -1,38 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* exception.cpp: Handle exceptions |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 the VideoLAN team |
|||
* $Id$ |
|||
* |
|||
* Authors: Rémi Duraffort <ivoire@videolan.org> |
|||
* |
|||
* 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. |
|||
*****************************************************************************/ |
|||
|
|||
#include "exception.hpp" |
|||
|
|||
using namespace libvlc; |
|||
|
|||
Exception::Exception() |
|||
{ |
|||
libvlc_exception_init( &ex ); |
|||
} |
|||
|
|||
Exception::~Exception() |
|||
{ |
|||
if( libvlc_exception_raised( &ex ) ) |
|||
throw libvlc_errmsg(); |
|||
libvlc_exception_clear( &ex ); |
|||
} |
|||
@ -1,50 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* exception.hpp: handle exceptions |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 the VideoLAN team |
|||
* $Id$ |
|||
* |
|||
* Authors: Rémi Duraffort <ivoire@videolan.org> |
|||
* |
|||
* 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. |
|||
*****************************************************************************/ |
|||
|
|||
#ifndef LIBVLCPP_EXCEPTION_HPP |
|||
#define LIBVLCPP_EXCEPTION_HPP |
|||
|
|||
#include <vlc/libvlc.h> |
|||
|
|||
#include "libvlc.hpp" |
|||
|
|||
namespace libvlc |
|||
{ |
|||
|
|||
class Exception |
|||
{ |
|||
public: |
|||
/** Create the exception */ |
|||
Exception(); |
|||
|
|||
/** Destroy te exception */ |
|||
~Exception(); |
|||
|
|||
/** The exception */ |
|||
libvlc_exception_t ex; |
|||
}; |
|||
|
|||
}; |
|||
|
|||
#endif // LIBVLCPP_EXCEPTION_HPP
|
|||
|
|||
@ -1,53 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* libvlc.cpp: Main libvlc++ class |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 the VideoLAN team |
|||
* $Id$ |
|||
* |
|||
* Authors: Rémi Duraffort <ivoire@videolan.org> |
|||
* |
|||
* 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. |
|||
*****************************************************************************/ |
|||
|
|||
#include "libvlc.hpp" |
|||
|
|||
using namespace libvlc; |
|||
|
|||
libVLC::libVLC( int i_argc, const char *const *argv ) |
|||
{ |
|||
m_instance = libvlc_new( i_argc, argv); |
|||
if(!m_instance) |
|||
throw libvlc_errmsg(); |
|||
} |
|||
|
|||
libVLC::~libVLC() |
|||
{ |
|||
libvlc_release( m_instance ); |
|||
} |
|||
|
|||
const char *libVLC::version() |
|||
{ |
|||
return libvlc_get_version(); |
|||
} |
|||
|
|||
const char *libVLC::compiler() |
|||
{ |
|||
return libvlc_get_compiler(); |
|||
} |
|||
|
|||
const char *libVLC::chanset() |
|||
{ |
|||
return libvlc_get_changeset(); |
|||
} |
|||
@ -1,80 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* libvlc.hpp: Main libvlc++ class |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 the VideoLAN team |
|||
* $Id$ |
|||
* |
|||
* Authors: Rémi Duraffort <ivoire@videolan.org> |
|||
* |
|||
* 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. |
|||
*****************************************************************************/ |
|||
|
|||
#ifndef LIBVLCPP_HPP |
|||
#define LIBVLCPP_HPP |
|||
|
|||
#include <vlc/libvlc.h> |
|||
|
|||
namespace libvlc |
|||
{ |
|||
|
|||
class Media; |
|||
class MediaPlayer; |
|||
|
|||
class libVLC |
|||
{ |
|||
public: |
|||
/**
|
|||
* Contructor |
|||
* @param i_argc: the number of arguments |
|||
* @param argv: arguments given to libvlc |
|||
*/ |
|||
libVLC( int i_argc, const char* const* argv ); |
|||
|
|||
/* Destructor */ |
|||
~libVLC(); |
|||
|
|||
/**
|
|||
* Get the version of libVLC |
|||
* @return the version |
|||
*/ |
|||
const char *version(); |
|||
|
|||
/**
|
|||
* Get the compiler use for this binari |
|||
* @return the compiler used |
|||
*/ |
|||
const char *compiler(); |
|||
|
|||
/**
|
|||
* Get the chanset of libvlc |
|||
* @return thje changeset |
|||
*/ |
|||
const char *chanset(); |
|||
|
|||
private: |
|||
/** The instance of libvlc */ |
|||
libvlc_instance_t *m_instance; |
|||
|
|||
/**
|
|||
* Some friends class to access the instance of libvlc |
|||
*/ |
|||
friend class Media; |
|||
friend class MediaPlayer; |
|||
}; |
|||
|
|||
}; |
|||
|
|||
#endif // LIBVLCPP_HPP
|
|||
|
|||
@ -1,11 +0,0 @@ |
|||
prefix=@prefix@ |
|||
exec_prefix=@exec_prefix@ |
|||
libdir=@libdir@ |
|||
includedir=@includedir@ |
|||
|
|||
Name: libvlcpp |
|||
Description: C++ wrapper around libvlc |
|||
Requires: libvlc >= 1.1.0 |
|||
Version: @VERSION@ |
|||
Cflags: -I${includedir} |
|||
Libs: -L${libdir} -lvlcpp |
|||
@ -1,100 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* media.cpp: Represent a media |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 the VideoLAN team |
|||
* $Id$ |
|||
* |
|||
* Authors: Rémi Duraffort <ivoire@videolan.org> |
|||
* |
|||
* 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. |
|||
*****************************************************************************/ |
|||
|
|||
#include "media.hpp" |
|||
#include "exception.hpp" |
|||
|
|||
using namespace libvlc; |
|||
|
|||
Media::Media( libVLC &libvlcInstance, const char *psz_mrl ) |
|||
{ |
|||
m_media = libvlc_media_new( libvlcInstance.m_instance, psz_mrl ); |
|||
if( !m_media ) |
|||
throw libvlc_errmsg(); |
|||
} |
|||
|
|||
Media::Media( const Media& original ) |
|||
{ |
|||
m_media = libvlc_media_duplicate( original.m_media ); |
|||
} |
|||
|
|||
Media::~Media() |
|||
{ |
|||
libvlc_media_release( m_media ); |
|||
} |
|||
|
|||
void Media::addOption( const char *ppsz_options ) |
|||
{ |
|||
libvlc_media_add_option( m_media, ppsz_options ); |
|||
} |
|||
|
|||
void Media::addOption( const char *ppsz_options, libvlc_media_option_t flag ) |
|||
{ |
|||
libvlc_media_add_option_flag( m_media, ppsz_options, flag ); |
|||
} |
|||
|
|||
int64_t Media::duration() |
|||
{ |
|||
return libvlc_media_get_duration( m_media ); |
|||
} |
|||
|
|||
int Media::isPreparsed() |
|||
{ |
|||
return libvlc_media_is_preparsed( m_media ); |
|||
} |
|||
|
|||
char *Media::mrl() |
|||
{ |
|||
return libvlc_media_get_mrl( m_media ); |
|||
} |
|||
|
|||
char *Media::meta( libvlc_meta_t e_meta ) |
|||
{ |
|||
return libvlc_media_get_meta( m_media, e_meta ); |
|||
} |
|||
|
|||
void Media::setMeta( libvlc_meta_t e_meta, const char *psz_value ) |
|||
{ |
|||
libvlc_media_set_meta( m_media, e_meta, psz_value ); |
|||
} |
|||
|
|||
int Media::saveMeta() |
|||
{ |
|||
return libvlc_media_save_meta( m_media ); |
|||
} |
|||
|
|||
libvlc_state_t Media::state() |
|||
{ |
|||
return libvlc_media_get_state( m_media ); |
|||
} |
|||
|
|||
void Media::setUserData( void *p_user_data ) |
|||
{ |
|||
libvlc_media_set_user_data( m_media, p_user_data ); |
|||
} |
|||
|
|||
void *Media::userData() |
|||
{ |
|||
return libvlc_media_get_user_data( m_media ); |
|||
} |
|||
|
|||
@ -1,149 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* media.hpp: represent a media |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 the VideoLAN team |
|||
* $Id$ |
|||
* |
|||
* Authors: Rémi Duraffort <ivoire@videolan.org> |
|||
* |
|||
* 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. |
|||
*****************************************************************************/ |
|||
|
|||
#ifndef LIBVLCPP_MEDIA_HPP |
|||
#define LIBVLCPP_MEDIA_HPP |
|||
|
|||
#include <vlc/libvlc.h> |
|||
#include <vlc/libvlc_media.h> |
|||
|
|||
#include "libvlc.hpp" |
|||
|
|||
namespace libvlc |
|||
{ |
|||
|
|||
class MediaPlayer; |
|||
|
|||
class Media |
|||
{ |
|||
public: |
|||
/**
|
|||
* Contructor |
|||
* @param libvlcInstance: instance of the libVLC class |
|||
* @param psz_mrl: MRL of the media |
|||
*/ |
|||
Media( libVLC &libvlcInstance, const char *psz_mrl ); |
|||
|
|||
/**
|
|||
* Copy contructor |
|||
* @param original: the instance to copy |
|||
*/ |
|||
Media( const Media& original ); |
|||
|
|||
/** \todo: node contructor */ |
|||
|
|||
/** Destructor */ |
|||
~Media(); |
|||
|
|||
/**
|
|||
* Add an option to the media |
|||
* @param ppsz_options: the options as a string |
|||
*/ |
|||
void addOption( const char *ppsz_options ); |
|||
|
|||
/**
|
|||
* Add an option to the media |
|||
* @param ppsz_options: the options as a string |
|||
* @param flag: the flag for the options |
|||
*/ |
|||
void addOption( const char *ppsz_options, libvlc_media_option_t flag ); |
|||
|
|||
|
|||
/**
|
|||
* Get the duration of the media |
|||
* @return the duration |
|||
*/ |
|||
int64_t duration(); |
|||
|
|||
/**
|
|||
* Get preparsed status of the media |
|||
* @return true if the media has been preparsed, false otherwise |
|||
*/ |
|||
int isPreparsed(); |
|||
|
|||
/**
|
|||
* Get the MRL of the media |
|||
* @return the MRL of the media |
|||
*/ |
|||
char *mrl(); |
|||
|
|||
/**
|
|||
* Get the requiered meta |
|||
* @param e_meta: type of the meta |
|||
* @return the requiered meta |
|||
*/ |
|||
char *meta( libvlc_meta_t e_meta ); |
|||
|
|||
/**
|
|||
* Set the given meta |
|||
* @param e_meta: type of the meta |
|||
* @param psz_value: value of the meta |
|||
*/ |
|||
void setMeta( libvlc_meta_t e_meta, const char *psz_value ); |
|||
|
|||
/**
|
|||
* Save the meta to the file |
|||
* @return true if the operation was successfull |
|||
*/ |
|||
int saveMeta(); |
|||
|
|||
/**
|
|||
* Get the state of the media |
|||
* @return the state of the media |
|||
*/ |
|||
libvlc_state_t state(); |
|||
|
|||
/**
|
|||
* Get some statistics about this media |
|||
* @return the statistics |
|||
*/ |
|||
libvlc_media_stats_t *stats(); |
|||
|
|||
/**\todo: subItems */ |
|||
/**\todo: eventManager */ |
|||
|
|||
/**
|
|||
* Set media descriptor's user data |
|||
* @param p_user_data: pointer to user data |
|||
*/ |
|||
void setUserData( void *p_user_data ); |
|||
|
|||
/**
|
|||
* Retrive user data specified by a call to setUserData |
|||
* @return the user data pointer |
|||
*/ |
|||
void *userData(); |
|||
|
|||
private: |
|||
/** The media */ |
|||
libvlc_media_t *m_media; |
|||
|
|||
/** Friend class that can access the instance */ |
|||
friend class MediaPlayer; |
|||
|
|||
}; |
|||
|
|||
}; |
|||
|
|||
#endif // LIBVLCPP_MEDIA_HPP
|
|||
|
|||
@ -1,259 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* media_player.cpp: Represent a media player |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 the VideoLAN team |
|||
* $Id$ |
|||
* |
|||
* Authors: Rémi Duraffort <ivoire@videolan.org> |
|||
* |
|||
* 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. |
|||
*****************************************************************************/ |
|||
|
|||
#include "media_player.hpp" |
|||
|
|||
using namespace libvlc; |
|||
|
|||
MediaPlayer::MediaPlayer( libVLC &libvlcInstance ) |
|||
{ |
|||
m_player = libvlc_media_player_new( libvlcInstance.m_instance ); |
|||
if( !m_player ) |
|||
throw libvlc_errmsg(); |
|||
m_audio.setMediaPlayer( m_player ); |
|||
m_video.setMediaPlayer( m_player ); |
|||
} |
|||
|
|||
MediaPlayer::MediaPlayer( Media &media ) |
|||
{ |
|||
m_player = libvlc_media_player_new_from_media( media.m_media ); |
|||
if( !m_player ) |
|||
throw libvlc_errmsg(); |
|||
m_audio.setMediaPlayer( m_player ); |
|||
m_video.setMediaPlayer( m_player ); |
|||
} |
|||
|
|||
MediaPlayer::~MediaPlayer() |
|||
{ |
|||
stop(); |
|||
libvlc_media_player_release( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::setMedia( Media &media ) |
|||
{ |
|||
libvlc_media_player_set_media( m_player, media.m_media ); |
|||
} |
|||
|
|||
int MediaPlayer::isPlaying() |
|||
{ |
|||
return libvlc_media_player_is_playing( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::play() |
|||
{ |
|||
libvlc_media_player_play( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::pause() |
|||
{ |
|||
libvlc_media_player_pause( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::stop() |
|||
{ |
|||
libvlc_media_player_stop( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::setNSObject( void *drawable ) |
|||
{ |
|||
libvlc_media_player_set_nsobject( m_player, drawable ); |
|||
} |
|||
|
|||
void* MediaPlayer::nsobject() |
|||
{ |
|||
return libvlc_media_player_get_nsobject( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::setAgl( uint32_t drawable ) |
|||
{ |
|||
libvlc_media_player_set_agl( m_player, drawable ); |
|||
} |
|||
|
|||
uint32_t MediaPlayer::agl() |
|||
{ |
|||
return libvlc_media_player_get_agl( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::setXWindow( uint32_t drawable ) |
|||
{ |
|||
libvlc_media_player_set_xwindow( m_player, drawable ); |
|||
} |
|||
|
|||
uint32_t MediaPlayer::xwindow() |
|||
{ |
|||
return libvlc_media_player_get_xwindow( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::setHwnd( void *drawable ) |
|||
{ |
|||
libvlc_media_player_set_hwnd( m_player, drawable ); |
|||
} |
|||
|
|||
void *MediaPlayer::hwnd() |
|||
{ |
|||
return libvlc_media_player_get_hwnd( m_player ); |
|||
} |
|||
|
|||
int64_t MediaPlayer::lenght() |
|||
{ |
|||
return libvlc_media_player_get_length( m_player ); |
|||
} |
|||
|
|||
int64_t MediaPlayer::time() |
|||
{ |
|||
return libvlc_media_player_get_time( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::setTime( int64_t new_time ) |
|||
{ |
|||
libvlc_media_player_set_time( m_player, new_time ); |
|||
} |
|||
|
|||
float MediaPlayer::position() |
|||
{ |
|||
return libvlc_media_player_get_position( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::setPosition( float position ) |
|||
{ |
|||
libvlc_media_player_set_position( m_player, position ); |
|||
} |
|||
|
|||
int MediaPlayer::chapter() |
|||
{ |
|||
return libvlc_media_player_get_chapter( m_player ); |
|||
} |
|||
|
|||
int MediaPlayer::chapterCount() |
|||
{ |
|||
return libvlc_media_player_get_chapter_count( m_player ); |
|||
} |
|||
|
|||
int MediaPlayer::chapterCount( int title ) |
|||
{ |
|||
return libvlc_media_player_get_chapter_count_for_title( m_player, title ); |
|||
} |
|||
|
|||
void MediaPlayer::setChapter( int title ) |
|||
{ |
|||
libvlc_media_player_set_chapter( m_player, title ); |
|||
} |
|||
|
|||
int MediaPlayer::willPlay() |
|||
{ |
|||
return libvlc_media_player_will_play( m_player ); |
|||
} |
|||
|
|||
int MediaPlayer::title() |
|||
{ |
|||
return libvlc_media_player_get_title( m_player ); |
|||
} |
|||
|
|||
int MediaPlayer::titleCount() |
|||
{ |
|||
return libvlc_media_player_get_title_count( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::setTitle( int title ) |
|||
{ |
|||
libvlc_media_player_set_title( m_player, title ); |
|||
} |
|||
|
|||
void MediaPlayer::previousChapter() |
|||
{ |
|||
libvlc_media_player_previous_chapter( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::nextChapter() |
|||
{ |
|||
libvlc_media_player_next_chapter( m_player ); |
|||
} |
|||
|
|||
float MediaPlayer::rate() |
|||
{ |
|||
return libvlc_media_player_get_rate( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::setRate( float rate ) |
|||
{ |
|||
libvlc_media_player_set_rate( m_player, rate ); |
|||
} |
|||
|
|||
libvlc_state_t MediaPlayer::state() |
|||
{ |
|||
return libvlc_media_player_get_state( m_player ); |
|||
} |
|||
|
|||
float MediaPlayer::fps() |
|||
{ |
|||
return libvlc_media_player_get_fps( m_player ); |
|||
} |
|||
|
|||
int MediaPlayer::hasVout() |
|||
{ |
|||
return libvlc_media_player_has_vout( m_player ); |
|||
} |
|||
|
|||
int MediaPlayer::isSeekable() |
|||
{ |
|||
return libvlc_media_player_is_seekable( m_player ); |
|||
} |
|||
int MediaPlayer::canPause() |
|||
{ |
|||
return libvlc_media_player_can_pause( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::nextFrame() |
|||
{ |
|||
libvlc_media_player_next_frame( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::toggleFullscreen() |
|||
{ |
|||
libvlc_toggle_fullscreen( m_player ); |
|||
} |
|||
|
|||
void MediaPlayer::enableFullscreen() |
|||
{ |
|||
libvlc_set_fullscreen( m_player, 1 ); |
|||
} |
|||
|
|||
void MediaPlayer::disableFullscreen() |
|||
{ |
|||
libvlc_set_fullscreen( m_player, 0 ); |
|||
} |
|||
|
|||
int MediaPlayer::fullscreen() |
|||
{ |
|||
return libvlc_get_fullscreen( m_player ); |
|||
} |
|||
|
|||
Audio &MediaPlayer::audio() |
|||
{ |
|||
return m_audio; |
|||
} |
|||
|
|||
Video &MediaPlayer::video() |
|||
{ |
|||
return m_video; |
|||
} |
|||
@ -1,335 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* media_player.hpp: Media player |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 the VideoLAN team |
|||
* $Id$ |
|||
* |
|||
* Authors: Rémi Duraffort <ivoire@videolan.org> |
|||
* |
|||
* 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. |
|||
*****************************************************************************/ |
|||
|
|||
#ifndef LIBVLCPP_MEDIA_PLAYER_HPP |
|||
#define LIBVLCPP_MEDIA_PLAYER_HPP |
|||
|
|||
#include <vlc/libvlc.h> |
|||
#include <vlc/libvlc_media.h> |
|||
#include <vlc/libvlc_media_player.h> |
|||
|
|||
#include "libvlc.hpp" |
|||
#include "media.hpp" |
|||
#include "audio.hpp" |
|||
#include "video.hpp" |
|||
|
|||
namespace libvlc |
|||
{ |
|||
|
|||
class MediaPlayer |
|||
{ |
|||
public: |
|||
/**
|
|||
* Create a media player without a media associated |
|||
* @param libvlcInstance: instance of the libVLC class |
|||
*/ |
|||
MediaPlayer( libVLC &libvlcInstance ); |
|||
|
|||
/**
|
|||
* Create a media player with a media associated |
|||
* @param media: the associated media (the media can be safely destroy afterward) |
|||
*/ |
|||
MediaPlayer( Media &media ); |
|||
|
|||
/**
|
|||
* Destructor |
|||
*/ |
|||
~MediaPlayer(); |
|||
|
|||
/**
|
|||
* Set the media associated with the player |
|||
* @param media: the media to associated with the player |
|||
*/ |
|||
void setMedia( Media &media ); |
|||
|
|||
/**
|
|||
* Get the media associated with the player |
|||
* @return the media |
|||
*/ |
|||
///@todo media();
|
|||
|
|||
/**
|
|||
* Get the event manager associated to the media player |
|||
* @return the event manager |
|||
*/ |
|||
///@todo eventManager()
|
|||
|
|||
/**
|
|||
* Is the player playing |
|||
* @return true if the player is playing, false overwise |
|||
*/ |
|||
int isPlaying(); |
|||
|
|||
/**
|
|||
* Play |
|||
*/ |
|||
void play(); |
|||
|
|||
/**
|
|||
* Pause |
|||
*/ |
|||
void pause(); |
|||
|
|||
/**
|
|||
* Stop |
|||
*/ |
|||
void stop(); |
|||
|
|||
|
|||
/**
|
|||
* Set the NSView handler where the media player shoud render the video |
|||
* @param drawable: the NSView handler |
|||
*/ |
|||
void setNSObject( void *drawable ); |
|||
|
|||
/**
|
|||
* Get the NSView handler associated with the media player |
|||
* @return the NSView handler |
|||
*/ |
|||
void* nsobject(); |
|||
|
|||
/**
|
|||
* Set the agl handler where the media player shoud render the video |
|||
* @param drawable: the agl handler |
|||
*/ |
|||
void setAgl( uint32_t drawable ); |
|||
|
|||
/**
|
|||
* Get the agl handler associated with the media player |
|||
* @return the agl handler |
|||
*/ |
|||
uint32_t agl(); |
|||
|
|||
/**
|
|||
* Set the X Window drawable where the media player shoud render the video |
|||
* @param drawable: the X Window drawable |
|||
*/ |
|||
void setXWindow( uint32_t drawable ); |
|||
|
|||
/**
|
|||
* Get the X Window drawable associated with the media player |
|||
* @return the X Window drawable |
|||
*/ |
|||
uint32_t xwindow(); |
|||
|
|||
/**
|
|||
* Set the Win32/Win64 API window handle where the media player shoud |
|||
* render the video |
|||
* @param drawable: the windows handle |
|||
*/ |
|||
void setHwnd( void *drawable ); |
|||
|
|||
/**
|
|||
* Get the Win32/Win64 API window handle associated with the media player |
|||
* @return the windows handle |
|||
*/ |
|||
void *hwnd(); |
|||
|
|||
|
|||
/**
|
|||
* Get the movie lenght (in ms) |
|||
* @return the movie length |
|||
*/ |
|||
int64_t lenght(); |
|||
|
|||
/**
|
|||
* Get the current movie time (in ms) |
|||
* @return the current movie time |
|||
*/ |
|||
int64_t time(); |
|||
|
|||
/**
|
|||
* Set the movie time (in ms) |
|||
* @param new_time the movie time (in ms) |
|||
*/ |
|||
void setTime( int64_t new_time ); |
|||
|
|||
/**
|
|||
* Get the movie position (in percent) |
|||
* @return the movie position |
|||
*/ |
|||
float position(); |
|||
|
|||
/**
|
|||
* Set the movie position (in percent) |
|||
* @param position the movie position |
|||
*/ |
|||
void setPosition( float position ); |
|||
|
|||
/**
|
|||
* Get the current movie chapter |
|||
* @return the current chapter |
|||
*/ |
|||
int chapter(); |
|||
|
|||
/**
|
|||
* Get the movie chapter count |
|||
* @return the movie chapter count |
|||
*/ |
|||
int chapterCount(); |
|||
|
|||
/**
|
|||
* Get the number of chapter in the given title |
|||
* @param title: the title |
|||
* @return the number of chapter in title |
|||
*/ |
|||
int chapterCount( int title ); |
|||
|
|||
/**
|
|||
* Set the movie chapter |
|||
* @param chapter: the chapter to play |
|||
*/ |
|||
void setChapter( int chapter ); |
|||
|
|||
/**
|
|||
* Is the player going to play the media (not dead or dying) |
|||
* @return true if the player will play |
|||
*/ |
|||
int willPlay(); |
|||
|
|||
/**
|
|||
* Get the current title |
|||
* @return the title |
|||
*/ |
|||
int title(); |
|||
|
|||
/**
|
|||
* Get the title count |
|||
* @return the number of title |
|||
*/ |
|||
int titleCount(); |
|||
|
|||
/**
|
|||
* Set the title |
|||
* @param title: the title |
|||
*/ |
|||
void setTitle( int title ); |
|||
|
|||
|
|||
/**
|
|||
* Move to the previous chapter |
|||
*/ |
|||
void previousChapter(); |
|||
|
|||
/**
|
|||
* Move to the next chapter |
|||
*/ |
|||
void nextChapter(); |
|||
|
|||
/**
|
|||
* Get the movie play rate |
|||
* @return the play rate |
|||
*/ |
|||
float rate(); |
|||
|
|||
/**
|
|||
* Set the movie rate |
|||
* @param rate: the rate |
|||
*/ |
|||
void setRate( float rate ); |
|||
|
|||
/**
|
|||
* Get the movie state |
|||
* @return the state |
|||
*/ |
|||
libvlc_state_t state(); |
|||
|
|||
/**
|
|||
* Get the movie fps |
|||
* @return the movie fps |
|||
*/ |
|||
float fps(); |
|||
|
|||
|
|||
/**
|
|||
* Does the media player have a video output |
|||
* @return true if the media player has a video output |
|||
*/ |
|||
int hasVout(); |
|||
|
|||
/**
|
|||
* Is the media player able to seek ? |
|||
* @return true if the media player can seek |
|||
*/ |
|||
int isSeekable(); |
|||
|
|||
/**
|
|||
* Can this media player be paused ? |
|||
* @return true if the media player can pause |
|||
*/ |
|||
int canPause(); |
|||
|
|||
/**
|
|||
* Display the next frame |
|||
*/ |
|||
void nextFrame(); |
|||
|
|||
|
|||
/**
|
|||
* Toggle fullscreen status on a non-embedded video output |
|||
*/ |
|||
void toggleFullscreen(); |
|||
|
|||
/**
|
|||
* Enable fullscreen on a non-embedded video output |
|||
*/ |
|||
void enableFullscreen(); |
|||
|
|||
/**
|
|||
* Disable fullscreen on a non-embedded video output |
|||
*/ |
|||
void disableFullscreen(); |
|||
|
|||
/**
|
|||
* Get the fullscreen status |
|||
* @return true if the fullscreen is enable, false overwise |
|||
*/ |
|||
int fullscreen(); |
|||
|
|||
/**
|
|||
* Get the class that handle the Audio |
|||
* @return the instance of Audio associated with this MediaPlayer |
|||
*/ |
|||
Audio &audio(); |
|||
|
|||
/**
|
|||
* Get the class that handle the Video |
|||
* @return the instance of the Video associated with this MediaPlayer |
|||
*/ |
|||
Video &video(); |
|||
|
|||
private: |
|||
/** The media player instance of libvlc */ |
|||
libvlc_media_player_t *m_player; |
|||
|
|||
/** The Audio part of the media player */ |
|||
Audio m_audio; |
|||
|
|||
/** The Video part of the media player */ |
|||
Video m_video; |
|||
}; |
|||
|
|||
}; |
|||
|
|||
#endif // LIBVLCPP_MEDIA_PLAYER_HPP
|
|||
|
|||
@ -1,117 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* video.cpp: video part of the media player |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 the VideoLAN team |
|||
* $Id$ |
|||
* |
|||
* Authors: Rémi Duraffort <ivoire@videolan.org> |
|||
* |
|||
* 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. |
|||
*****************************************************************************/ |
|||
|
|||
#include <cstdlib> |
|||
#include "video.hpp" |
|||
#include "exception.hpp" |
|||
|
|||
|
|||
using namespace libvlc; |
|||
|
|||
Video::Video() |
|||
{ |
|||
} |
|||
|
|||
Video::~Video() |
|||
{ |
|||
libvlc_media_player_release( m_player ); |
|||
} |
|||
|
|||
float Video::scale() |
|||
{ |
|||
return libvlc_video_get_scale( m_player ); |
|||
} |
|||
|
|||
char *Video::aspectRatio() |
|||
{ |
|||
return libvlc_video_get_aspect_ratio( m_player ); |
|||
} |
|||
|
|||
void Video::setAspectRatio( const char *aspect_ratio ) |
|||
{ |
|||
libvlc_video_set_aspect_ratio( m_player, aspect_ratio ); |
|||
} |
|||
|
|||
int Video::spu() |
|||
{ |
|||
return libvlc_video_get_spu( m_player ); |
|||
} |
|||
|
|||
int Video::spuCount() |
|||
{ |
|||
return libvlc_video_get_spu_count( m_player ); |
|||
} |
|||
|
|||
void Video::setSpu( int spu ) |
|||
{ |
|||
libvlc_video_set_spu( m_player, spu ); |
|||
} |
|||
|
|||
void Video::setSubtitleFile( const char *subtitle_file ) |
|||
{ |
|||
libvlc_video_set_subtitle_file( m_player, subtitle_file ); |
|||
} |
|||
|
|||
char *Video::cropGeometry() |
|||
{ |
|||
return libvlc_video_get_crop_geometry( m_player ); |
|||
} |
|||
|
|||
void Video::setCropGeometry( const char *geometry ) |
|||
{ |
|||
libvlc_video_set_crop_geometry( m_player, geometry ); |
|||
} |
|||
|
|||
int Video::track() |
|||
{ |
|||
return libvlc_video_get_track( m_player ); |
|||
} |
|||
|
|||
int Video::trackCount() |
|||
{ |
|||
return libvlc_video_get_track_count( m_player ); |
|||
} |
|||
|
|||
void Video::setTrack( int track ) |
|||
{ |
|||
libvlc_video_set_track( m_player, track ); |
|||
} |
|||
|
|||
int Video::snapshot( int num, const char *filepath, int with, int height ) |
|||
{ |
|||
return libvlc_video_take_snapshot( m_player, num, filepath, with, height ); |
|||
} |
|||
|
|||
void Video::deinterlace( int enable, const char *mode ) |
|||
{ |
|||
if( enable ) |
|||
libvlc_video_set_deinterlace( m_player, mode ); |
|||
else |
|||
libvlc_video_set_deinterlace( m_player, NULL ); |
|||
} |
|||
|
|||
void Video::setMediaPlayer( libvlc_media_player_t *player ) |
|||
{ |
|||
libvlc_media_player_retain( player ); |
|||
m_player = player; |
|||
} |
|||
@ -1,180 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* video.hpp: video part of the media player |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 the VideoLAN team |
|||
* $Id$ |
|||
* |
|||
* Authors: Rémi Duraffort <ivoire@videolan.org> |
|||
* |
|||
* 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. |
|||
*****************************************************************************/ |
|||
|
|||
#ifndef LIBVLCPP_VIDEO_HPP |
|||
#define LIBVLCPP_VIDEO_HPP |
|||
|
|||
#include <vlc/libvlc.h> |
|||
#include <vlc/libvlc_media.h> |
|||
#include <vlc/libvlc_media_player.h> |
|||
|
|||
#include "libvlc.hpp" |
|||
|
|||
namespace libvlc |
|||
{ |
|||
|
|||
class Video |
|||
{ |
|||
public: |
|||
/**
|
|||
* Get the height of the video |
|||
* @return the height of the video |
|||
*/ |
|||
int height(); |
|||
|
|||
/**
|
|||
* Get the width of the video |
|||
* @return the widht of the video |
|||
*/ |
|||
int width(); |
|||
|
|||
/**
|
|||
* Get the current scaling factor of the video |
|||
* @return the current scaling factor or 0 if the video is set to fit to the output |
|||
*/ |
|||
float scale(); |
|||
|
|||
/**
|
|||
* Set the scaling factor |
|||
* @param factor: the new scaling factor |
|||
*/ |
|||
void setScale( float factor ); |
|||
|
|||
/**
|
|||
* Get the current video aspect ratio |
|||
* @return the aspect ratio |
|||
*/ |
|||
char *aspectRatio(); |
|||
|
|||
/**
|
|||
* set the video aspect ratio |
|||
* @param aspect_ratio: the aspect ratio |
|||
*/ |
|||
void setAspectRatio( const char *aspect_ratio ); |
|||
|
|||
/**
|
|||
* Get the current video subtitle |
|||
* @return the video subtitle |
|||
*/ |
|||
int spu(); |
|||
|
|||
/**
|
|||
* Get the number of available video subtitles |
|||
* @return the number of subtitle |
|||
*/ |
|||
int spuCount(); |
|||
|
|||
/**
|
|||
* Set the video subtitle index |
|||
* @param spu: the video subtitle |
|||
*/ |
|||
void setSpu( int spu ); |
|||
|
|||
/** Get informations about the current spu */ |
|||
|
|||
/**
|
|||
* Set the subtitle file |
|||
* @param subtitle_file: the new subtitle file |
|||
*/ |
|||
void setSubtitleFile( const char *subtitle_file ); |
|||
|
|||
/** Get title description */ |
|||
|
|||
/** Get chapter description */ |
|||
|
|||
/**
|
|||
* Get the current crop filter geometry |
|||
* @return the crop geonmetry |
|||
*/ |
|||
char *cropGeometry(); |
|||
|
|||
/**
|
|||
* Set the crop geometry |
|||
* @param geometry: the new crop filter geometry |
|||
*/ |
|||
void setCropGeometry( const char *geometry ); |
|||
|
|||
/**
|
|||
* Get the current video track |
|||
* @return the video track |
|||
*/ |
|||
int track(); |
|||
|
|||
/**
|
|||
* Get the number of video tracks |
|||
* @return the number of video tracks |
|||
*/ |
|||
int trackCount(); |
|||
|
|||
/**
|
|||
* Set the video track |
|||
* @param track: the video track |
|||
*/ |
|||
void setTrack( int track ); |
|||
|
|||
/** get track description */ |
|||
|
|||
/**
|
|||
* Take a snapshot and save it to a file |
|||
* @param num: the video output id (0 for the first/only one) |
|||
* @param filepath: path where to save the file |
|||
* @param widht: widht of the snapshot |
|||
* @param height: height of the snapshot |
|||
* @return 0 on success, -1 if the video output was not found |
|||
*/ |
|||
int snapshot( int num, const char *filepath, int widht, int height ); |
|||
|
|||
/**
|
|||
* Enable or disable deinterlace filter and select the deinterlace filter to use |
|||
* @param enable: true to enable the deinterlace filter |
|||
* @param mode: the deinterlace filter to use |
|||
*/ |
|||
void deinterlace( int enable, const char *mode ); |
|||
|
|||
private: |
|||
/** The media player instance of libvlc */ |
|||
libvlc_media_player_t *m_player; |
|||
|
|||
/**
|
|||
* The constructor is private so only the MediaPlayer can create an |
|||
* instance of this class |
|||
*/ |
|||
Video(); |
|||
|
|||
/** Destructor only used by the MediaPlayer associated with this class */ |
|||
~Video(); |
|||
|
|||
/**
|
|||
* Set the media player. This function can only be used by the MediaPlayer class |
|||
* @param player: the media player |
|||
*/ |
|||
void setMediaPlayer( libvlc_media_player_t *player); |
|||
|
|||
/** Friend class */ |
|||
friend class MediaPlayer; |
|||
}; |
|||
|
|||
}; |
|||
|
|||
#endif // LIBVLCPP_VIDEO_HPP
|
|||
|
|||
Loading…
Reference in new issue