]> git.sesse.net Git - vlc/blob - bindings/libvlcpp/src/video.cpp
83fed5243b76acbdfebc066d323548baf55a2062
[vlc] / bindings / libvlcpp / src / video.cpp
1 /*****************************************************************************
2  * video.cpp: video part of the media player
3  *****************************************************************************
4  * Copyright (C) 2010 the VideoLAN team
5  * $Id$
6  *
7  * Authors: RĂ©mi Duraffort <ivoire@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #include <cstdlib>
25 #include "video.hpp"
26 #include "exception.hpp"
27
28
29 using namespace libvlc;
30
31 Video::Video()
32 {
33 }
34
35 Video::~Video()
36 {
37     libvlc_media_player_release( m_player );
38 }
39
40 float Video::scale()
41 {
42     return libvlc_video_get_scale( m_player );
43 }
44
45 char *Video::aspectRatio()
46 {
47     return libvlc_video_get_aspect_ratio( m_player );
48 }
49
50 void Video::setAspectRatio( const char *aspect_ratio )
51 {
52     libvlc_video_set_aspect_ratio( m_player, aspect_ratio );
53 }
54
55 int Video::spu()
56 {
57     return libvlc_video_get_spu( m_player );
58 }
59
60 int Video::spuCount()
61 {
62     return libvlc_video_get_spu_count( m_player );
63 }
64
65 void Video::setSpu( int spu )
66 {
67     libvlc_video_set_spu( m_player, spu );
68 }
69
70 void Video::setSubtitleFile( const char *subtitle_file )
71 {
72     libvlc_video_set_subtitle_file( m_player, subtitle_file );
73 }
74
75 char *Video::cropGeometry()
76 {
77     return libvlc_video_get_crop_geometry( m_player );
78 }
79
80 void Video::setCropGeometry( const char *geometry )
81 {
82     libvlc_video_set_crop_geometry( m_player, geometry );
83 }
84
85 int Video::track()
86 {
87     return libvlc_video_get_track( m_player );
88 }
89
90 int Video::trackCount()
91 {
92     return libvlc_video_get_track_count( m_player );
93 }
94
95 void Video::setTrack( int track )
96 {
97     libvlc_video_set_track( m_player, track );
98 }
99
100 int Video::snapshot( int num, const char *filepath, int with, int height )
101 {
102     return libvlc_video_take_snapshot( m_player, num, filepath, with, height );
103 }
104
105 void Video::deinterlace( int enable, const char *mode )
106 {
107     if( enable )
108         libvlc_video_set_deinterlace( m_player, mode );
109     else
110         libvlc_video_set_deinterlace( m_player, NULL );
111 }
112
113 void Video::setMediaPlayer( libvlc_media_player_t *player )
114 {
115     libvlc_media_player_retain( player );
116     m_player = player;
117 }