Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
df1a14da
Commit
df1a14da
authored
Jan 26, 2010
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlcpp: add some functions for Video.
parent
f81a7e47
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
346 additions
and
5 deletions
+346
-5
bindings/libvlcpp/src/Makefile.am
bindings/libvlcpp/src/Makefile.am
+4
-2
bindings/libvlcpp/src/media_player.cpp
bindings/libvlcpp/src/media_player.cpp
+24
-0
bindings/libvlcpp/src/media_player.hpp
bindings/libvlcpp/src/media_player.hpp
+26
-3
bindings/libvlcpp/src/video.cpp
bindings/libvlcpp/src/video.cpp
+123
-0
bindings/libvlcpp/src/video.hpp
bindings/libvlcpp/src/video.hpp
+169
-0
No files found.
bindings/libvlcpp/src/Makefile.am
View file @
df1a14da
...
...
@@ -8,12 +8,14 @@ libvlcpp_la_SOURCES = \
media.cpp
\
media.hpp
\
media_player.cpp
\
media_player.hpp
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
library_include_HEADERS
=
exception.hpp libvlc.hpp media.hpp media_player.hpp
video.hpp
pkgconfigdir
=
$(libdir)
/pkgconfig
pkgconfig_DATA
=
libvlcpp.pc
bindings/libvlcpp/src/media_player.cpp
View file @
df1a14da
...
...
@@ -245,3 +245,27 @@ void MediaPlayer::nextFrame()
Exception
ex
;
libvlc_media_player_next_frame
(
m_player
,
&
ex
.
ex
);
}
void
MediaPlayer
::
toggleFullscreen
()
{
Exception
ex
;
libvlc_toggle_fullscreen
(
m_player
,
&
ex
.
ex
);
}
void
MediaPlayer
::
enableFullscreen
()
{
Exception
ex
;
libvlc_set_fullscreen
(
m_player
,
1
,
&
ex
.
ex
);
}
void
MediaPlayer
::
disableFullscreen
()
{
Exception
ex
;
libvlc_set_fullscreen
(
m_player
,
0
,
&
ex
.
ex
);
}
int
MediaPlayer
::
fullscreen
()
{
Exception
ex
;
return
libvlc_get_fullscreen
(
m_player
,
&
ex
.
ex
);
}
bindings/libvlcpp/src/media_player.hpp
View file @
df1a14da
...
...
@@ -158,7 +158,7 @@ public:
/**
* Set the movie time (in ms)
* @param the movie time (in ms)
* @param
new_time
the movie time (in ms)
*/
void
setTime
(
int64_t
new_time
);
...
...
@@ -170,7 +170,7 @@ public:
/**
* Set the movie position (in percent)
* @param the movie position
* @param
position
the movie position
*/
void
setPosition
(
float
position
);
...
...
@@ -282,7 +282,30 @@ public:
*/
void
nextFrame
();
protected:
/**
* 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
();
private:
/** The media player instance of libvlc */
libvlc_media_player_t
*
m_player
;
};
...
...
bindings/libvlcpp/src/video.cpp
0 → 100644
View file @
df1a14da
/*****************************************************************************
* video.cpp: video part of an 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 "video.hpp"
#include "exception.hpp"
using
namespace
libvlc
;
Video
::
Video
(
libvlc_media_player_t
*
player
)
{
m_player
=
player
;
libvlc_media_player_retain
(
m_player
);
}
Video
::~
Video
()
{
libvlc_media_player_release
(
m_player
);
}
float
Video
::
scale
()
{
Exception
ex
;
return
libvlc_video_get_scale
(
m_player
,
&
ex
.
ex
);
}
char
*
Video
::
aspectRatio
()
{
Exception
ex
;
return
libvlc_video_get_aspect_ratio
(
m_player
,
&
ex
.
ex
);
}
void
Video
::
setAspectRatio
(
const
char
*
aspect_ratio
)
{
Exception
ex
;
libvlc_video_set_aspect_ratio
(
m_player
,
aspect_ratio
,
&
ex
.
ex
);
}
int
Video
::
spu
()
{
Exception
ex
;
return
libvlc_video_get_spu
(
m_player
,
&
ex
.
ex
);
}
int
Video
::
spuCount
()
{
Exception
ex
;
return
libvlc_video_get_spu_count
(
m_player
,
&
ex
.
ex
);
}
void
Video
::
setSpu
(
int
spu
)
{
Exception
ex
;
libvlc_video_set_spu
(
m_player
,
spu
,
&
ex
.
ex
);
}
void
Video
::
setSubtitleFile
(
const
char
*
subtitle_file
)
{
Exception
ex
;
libvlc_video_set_subtitle_file
(
m_player
,
subtitle_file
,
&
ex
.
ex
);
}
char
*
Video
::
cropGeometry
()
{
Exception
ex
;
return
libvlc_video_get_crop_geometry
(
m_player
,
&
ex
.
ex
);
}
void
Video
::
setCropGeometry
(
const
char
*
geometry
)
{
Exception
ex
;
libvlc_video_set_crop_geometry
(
m_player
,
geometry
,
&
ex
.
ex
);
}
int
Video
::
track
()
{
Exception
ex
;
return
libvlc_video_get_track
(
m_player
,
&
ex
.
ex
);
}
int
Video
::
trackCount
()
{
Exception
ex
;
return
libvlc_video_get_track_count
(
m_player
,
&
ex
.
ex
);
}
void
Video
::
setTrack
(
int
track
)
{
Exception
ex
;
libvlc_video_set_track
(
m_player
,
track
,
&
ex
.
ex
);
}
void
Video
::
snapshot
(
const
char
*
filepath
,
int
with
,
int
height
)
{
Exception
ex
;
libvlc_video_take_snapshot
(
m_player
,
filepath
,
with
,
height
,
&
ex
.
ex
);
}
void
Video
::
deinterlace
(
int
enable
,
const
char
*
mode
)
{
Exception
ex
;
libvlc_video_set_deinterlace
(
m_player
,
enable
,
mode
,
&
ex
.
ex
);
}
bindings/libvlcpp/src/video.hpp
0 → 100644
View file @
df1a14da
/*****************************************************************************
* video.hpp: video part of an 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:
/**
* Constructor
* @param player: the player handling the video
*/
Video
(
libvlc_media_player_t
*
player
);
/** Destructor */
~
Video
();
/**
* 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 filepath: path where to save the file
* @param widht: widht of the snapshot
* @param height: height of the snapshot
*/
void
snapshot
(
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
;
};
};
#endif // LIBVLCPP_VIDEO_HPP
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment