]> git.sesse.net Git - vlc/blob - bindings/libvlcpp/src/video.hpp
Use standard ASCII for ^H, ^I, ^M and escape
[vlc] / bindings / libvlcpp / src / video.hpp
1 /*****************************************************************************
2  * video.hpp: 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 #ifndef LIBVLCPP_VIDEO_HPP
25 #define LIBVLCPP_VIDEO_HPP
26
27 #include <vlc/libvlc.h>
28 #include <vlc/libvlc_media.h>
29 #include <vlc/libvlc_media_player.h>
30
31 #include "libvlc.hpp"
32
33 namespace libvlc
34 {
35
36 class Video
37 {
38 public:
39     /**
40      * Get the height of the video
41      * @return the height of the video
42      */
43     int height();
44
45     /**
46      * Get the width of the video
47      * @return the widht of the video
48      */
49     int width();
50
51     /**
52      * Get the current scaling factor of the video
53      * @return the current scaling factor or 0 if the video is set to fit to the output
54      */
55     float scale();
56
57     /**
58      * Set the scaling factor
59      * @param factor: the new scaling factor
60      */
61     void setScale( float factor );
62
63     /**
64      * Get the current video aspect ratio
65      * @return the aspect ratio
66      */
67     char *aspectRatio();
68
69     /**
70      * set the video aspect ratio
71      * @param aspect_ratio: the aspect ratio
72      */
73     void setAspectRatio( const char *aspect_ratio );
74
75     /**
76      * Get the current video subtitle
77      * @return the video subtitle
78      */
79     int spu();
80
81     /**
82      * Get the number of available video subtitles
83      * @return the number of subtitle
84      */
85     int spuCount();
86
87     /**
88      * Set the video subtitle index
89      * @param spu: the video subtitle
90      */
91     void setSpu( int spu );
92
93     /** Get informations about the current spu */
94
95     /**
96      * Set the subtitle file
97      * @param subtitle_file: the new subtitle file
98      */
99     void setSubtitleFile( const char *subtitle_file );
100
101     /** Get title description */
102
103     /** Get chapter description */
104
105     /**
106      * Get the current crop filter geometry
107      * @return the crop geonmetry
108      */
109     char *cropGeometry();
110
111     /**
112      * Set the crop geometry
113      * @param geometry: the new crop filter geometry
114      */
115     void setCropGeometry( const char *geometry );
116
117     /**
118      * Get the current video track
119      * @return the video track
120      */
121     int track();
122
123     /**
124      * Get the number of video tracks
125      * @return the number of video tracks
126      */
127     int trackCount();
128
129     /**
130      * Set the video track
131      * @param track: the video track
132      */
133     void setTrack( int track );
134
135     /** get track description */
136
137     /**
138      * Take a snapshot and save it to a file
139      * @param num: the video output id (0 for the first/only one)
140      * @param filepath: path where to save the file
141      * @param widht: widht of the snapshot
142      * @param height: height of the snapshot
143      * @return 0 on success, -1 if the video output was not found
144      */
145     int snapshot( int num, const char *filepath, int widht, int height );
146
147     /**
148      * Enable or disable deinterlace filter and select the deinterlace filter to use
149      * @param enable: true to enable the deinterlace filter
150      * @param mode: the deinterlace filter to use
151      */
152     void deinterlace( int enable, const char *mode );
153
154 private:
155     /** The media player instance of libvlc */
156     libvlc_media_player_t *m_player;
157
158     /**
159      * The constructor is private so only the MediaPlayer can create an
160      * instance of this class
161      */
162     Video();
163
164     /** Destructor only used by the MediaPlayer associated with this class */
165     ~Video();
166
167     /**
168      * Set the media player. This function can only be used by the MediaPlayer class
169      * @param player: the media player
170      */
171     void setMediaPlayer( libvlc_media_player_t *player);
172
173     /** Friend class */
174     friend class MediaPlayer;
175 };
176
177 };
178
179 #endif // LIBVLCPP_VIDEO_HPP
180