]> git.sesse.net Git - vlc/blob - bindings/libvlcpp/src/video.cpp
97b2d67c6770fcf6d8bb7d0b1a9c6b57dda08e16
[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 "video.hpp"
25 #include "exception.hpp"
26
27
28 using namespace libvlc;
29
30 Video::Video( libvlc_media_player_t *player )
31 {
32     m_player = player;
33     libvlc_media_player_retain( m_player );
34 }
35
36 Video::~Video()
37 {
38     libvlc_media_player_release( m_player );
39 }
40
41 float Video::scale()
42 {
43     Exception ex;
44     return libvlc_video_get_scale( m_player, &ex.ex );
45 }
46
47 char *Video::aspectRatio()
48 {
49     Exception ex;
50     return libvlc_video_get_aspect_ratio( m_player, &ex.ex );
51 }
52
53 void Video::setAspectRatio( const char *aspect_ratio )
54 {
55     Exception ex;
56     libvlc_video_set_aspect_ratio( m_player, aspect_ratio, &ex.ex );
57 }
58
59 int Video::spu()
60 {
61     Exception ex;
62     return libvlc_video_get_spu( m_player, &ex.ex );
63 }
64
65 int Video::spuCount()
66 {
67     Exception ex;
68     return libvlc_video_get_spu_count( m_player, &ex.ex );
69 }
70
71 void Video::setSpu( int spu )
72 {
73     Exception ex;
74     libvlc_video_set_spu( m_player, spu, &ex.ex );
75 }
76
77 void Video::setSubtitleFile( const char *subtitle_file )
78 {
79     Exception ex;
80     libvlc_video_set_subtitle_file( m_player, subtitle_file, &ex.ex );
81 }
82
83 char *Video::cropGeometry()
84 {
85     Exception ex;
86     return libvlc_video_get_crop_geometry( m_player, &ex.ex );
87 }
88
89 void Video::setCropGeometry( const char *geometry )
90 {
91     Exception ex;
92     libvlc_video_set_crop_geometry( m_player, geometry, &ex.ex );
93 }
94
95 int Video::track()
96 {
97     Exception ex;
98     return libvlc_video_get_track( m_player, &ex.ex );
99 }
100
101 int Video::trackCount()
102 {
103     Exception ex;
104     return libvlc_video_get_track_count( m_player, &ex.ex );
105 }
106
107 void Video::setTrack( int track )
108 {
109     Exception ex;
110     libvlc_video_set_track( m_player, track, &ex.ex );
111 }
112
113 void Video::snapshot( const char *filepath, int with, int height )
114 {
115     Exception ex;
116     libvlc_video_take_snapshot( m_player, filepath, with, height, &ex.ex );
117 }
118
119 void Video::deinterlace( int enable, const char *mode )
120 {
121     Exception ex;
122     libvlc_video_set_deinterlace( m_player, enable, mode, &ex.ex );
123 }