| | 165 | static PyObject * |
|---|
| | 166 | vlcInput_audio_get_track( PyObject *self, PyObject *args ) |
|---|
| | 167 | { |
|---|
| | 168 | libvlc_exception_t ex; |
|---|
| | 169 | int i_ret; |
|---|
| | 170 | |
|---|
| | 171 | LIBVLC_TRY; |
|---|
| | 172 | i_ret = libvlc_audio_get_track( LIBVLC_INPUT->p_input, &ex ); |
|---|
| | 173 | LIBVLC_EXCEPT; |
|---|
| | 174 | return Py_BuildValue( "i", i_ret ); |
|---|
| | 175 | } |
|---|
| | 176 | |
|---|
| | 177 | static PyObject * |
|---|
| | 178 | vlcInput_audio_set_track( PyObject *self, PyObject *args ) |
|---|
| | 179 | { |
|---|
| | 180 | libvlc_exception_t ex; |
|---|
| | 181 | int i_track; |
|---|
| | 182 | |
|---|
| | 183 | if( !PyArg_ParseTuple( args, "i", &i_track ) ) |
|---|
| | 184 | return NULL; |
|---|
| | 185 | |
|---|
| | 186 | LIBVLC_TRY; |
|---|
| | 187 | libvlc_audio_set_track( LIBVLC_INPUT->p_input, i_track, &ex ); |
|---|
| | 188 | LIBVLC_EXCEPT; |
|---|
| | 189 | Py_INCREF( Py_None ); |
|---|
| | 190 | return Py_None; |
|---|
| | 191 | } |
|---|
| | 192 | |
|---|
| | 193 | static PyObject * |
|---|
| | 194 | vlcInput_toggle_fullscreen( PyObject *self, PyObject *args ) |
|---|
| | 195 | { |
|---|
| | 196 | libvlc_exception_t ex; |
|---|
| | 197 | |
|---|
| | 198 | LIBVLC_TRY; |
|---|
| | 199 | libvlc_toggle_fullscreen( LIBVLC_INPUT->p_input, &ex); |
|---|
| | 200 | LIBVLC_EXCEPT; |
|---|
| | 201 | Py_INCREF( Py_None ); |
|---|
| | 202 | return Py_None; |
|---|
| | 203 | } |
|---|
| | 204 | |
|---|
| | 205 | static PyObject * |
|---|
| | 206 | vlcInput_set_fullscreen( PyObject *self, PyObject *args ) |
|---|
| | 207 | { |
|---|
| | 208 | libvlc_exception_t ex; |
|---|
| | 209 | int i_fullscreen; |
|---|
| | 210 | |
|---|
| | 211 | if( !PyArg_ParseTuple( args, "i", &i_fullscreen ) ) |
|---|
| | 212 | return NULL; |
|---|
| | 213 | |
|---|
| | 214 | LIBVLC_TRY; |
|---|
| | 215 | libvlc_set_fullscreen( LIBVLC_INPUT->p_input, i_fullscreen, &ex); |
|---|
| | 216 | LIBVLC_EXCEPT; |
|---|
| | 217 | Py_INCREF( Py_None ); |
|---|
| | 218 | return Py_None; |
|---|
| | 219 | } |
|---|
| | 220 | |
|---|
| | 221 | static PyObject * |
|---|
| | 222 | vlcInput_get_fullscreen( PyObject *self, PyObject *args ) |
|---|
| | 223 | { |
|---|
| | 224 | libvlc_exception_t ex; |
|---|
| | 225 | int i_ret; |
|---|
| | 226 | |
|---|
| | 227 | LIBVLC_TRY; |
|---|
| | 228 | i_ret = libvlc_get_fullscreen( LIBVLC_INPUT->p_input, &ex); |
|---|
| | 229 | LIBVLC_EXCEPT; |
|---|
| | 230 | return Py_BuildValue( "i", i_ret ); |
|---|
| | 231 | } |
|---|
| | 232 | |
|---|
| | 233 | static PyObject * |
|---|
| | 234 | vlcInput_get_height( PyObject *self, PyObject *args ) |
|---|
| | 235 | { |
|---|
| | 236 | libvlc_exception_t ex; |
|---|
| | 237 | int i_ret; |
|---|
| | 238 | |
|---|
| | 239 | LIBVLC_TRY; |
|---|
| | 240 | i_ret = libvlc_video_get_height( LIBVLC_INPUT->p_input, &ex); |
|---|
| | 241 | LIBVLC_EXCEPT; |
|---|
| | 242 | return Py_BuildValue( "i", i_ret ); |
|---|
| | 243 | } |
|---|
| | 244 | |
|---|
| | 245 | static PyObject * |
|---|
| | 246 | vlcInput_get_width( PyObject *self, PyObject *args ) |
|---|
| | 247 | { |
|---|
| | 248 | libvlc_exception_t ex; |
|---|
| | 249 | int i_ret; |
|---|
| | 250 | |
|---|
| | 251 | LIBVLC_TRY; |
|---|
| | 252 | i_ret = libvlc_video_get_width( LIBVLC_INPUT->p_input, &ex); |
|---|
| | 253 | LIBVLC_EXCEPT; |
|---|
| | 254 | return Py_BuildValue( "i", i_ret ); |
|---|
| | 255 | } |
|---|
| | 256 | |
|---|
| | 257 | static PyObject * |
|---|
| | 258 | vlcInput_get_aspect_ratio( PyObject *self, PyObject *args ) |
|---|
| | 259 | { |
|---|
| | 260 | libvlc_exception_t ex; |
|---|
| | 261 | char* psz_ret; |
|---|
| | 262 | PyObject* o_ret; |
|---|
| | 263 | |
|---|
| | 264 | LIBVLC_TRY; |
|---|
| | 265 | psz_ret = libvlc_video_get_aspect_ratio( LIBVLC_INPUT->p_input, &ex); |
|---|
| | 266 | LIBVLC_EXCEPT; |
|---|
| | 267 | o_ret=Py_BuildValue( "s", psz_ret ); |
|---|
| | 268 | free( psz_ret ); |
|---|
| | 269 | return o_ret; |
|---|
| | 270 | } |
|---|
| | 271 | |
|---|
| | 272 | static PyObject * |
|---|
| | 273 | vlcInput_set_aspect_ratio( PyObject *self, PyObject *args ) |
|---|
| | 274 | { |
|---|
| | 275 | libvlc_exception_t ex; |
|---|
| | 276 | char* psz_ratio; |
|---|
| | 277 | |
|---|
| | 278 | if( !PyArg_ParseTuple( args, "s", &psz_ratio ) ) |
|---|
| | 279 | return NULL; |
|---|
| | 280 | |
|---|
| | 281 | LIBVLC_TRY; |
|---|
| | 282 | libvlc_video_set_aspect_ratio( LIBVLC_INPUT->p_input, psz_ratio, &ex); |
|---|
| | 283 | LIBVLC_EXCEPT; |
|---|
| | 284 | free( psz_ratio ); |
|---|
| | 285 | Py_INCREF( Py_None ); |
|---|
| | 286 | return Py_None; |
|---|
| | 287 | } |
|---|
| | 288 | |
|---|
| | 289 | static PyObject * |
|---|
| | 290 | vlcInput_video_take_snapshot( PyObject *self, PyObject *args ) |
|---|
| | 291 | { |
|---|
| | 292 | libvlc_exception_t ex; |
|---|
| | 293 | char* psz_filename; |
|---|
| | 294 | |
|---|
| | 295 | if( !PyArg_ParseTuple( args, "s", &psz_filename ) ) |
|---|
| | 296 | return NULL; |
|---|
| | 297 | |
|---|
| | 298 | LIBVLC_TRY; |
|---|
| | 299 | libvlc_video_take_snapshot( LIBVLC_INPUT->p_input, psz_filename, &ex); |
|---|
| | 300 | LIBVLC_EXCEPT; |
|---|
| | 301 | Py_INCREF( Py_None ); |
|---|
| | 302 | return Py_None; |
|---|
| | 303 | } |
|---|
| | 304 | |
|---|
| | 305 | static PyObject * |
|---|
| | 306 | vlcInput_video_resize( PyObject *self, PyObject *args ) |
|---|
| | 307 | { |
|---|
| | 308 | libvlc_exception_t ex; |
|---|
| | 309 | int i_width; |
|---|
| | 310 | int i_height; |
|---|
| | 311 | |
|---|
| | 312 | if( !PyArg_ParseTuple( args, "ii", &i_width, &i_height ) ) |
|---|
| | 313 | return NULL; |
|---|
| | 314 | |
|---|
| | 315 | LIBVLC_TRY; |
|---|
| | 316 | libvlc_video_resize( LIBVLC_INPUT->p_input, i_width, i_height, &ex); |
|---|
| | 317 | LIBVLC_EXCEPT; |
|---|
| | 318 | Py_INCREF( Py_None ); |
|---|
| | 319 | return Py_None; |
|---|
| | 320 | } |
|---|
| | 321 | |
|---|
| | 322 | static PyObject * |
|---|
| | 323 | vlcInput_video_reparent( PyObject *self, PyObject *args ) |
|---|
| | 324 | { |
|---|
| | 325 | libvlc_exception_t ex; |
|---|
| | 326 | WINDOWHANDLE i_visual; |
|---|
| | 327 | int i_ret; |
|---|
| | 328 | |
|---|
| | 329 | if( !PyArg_ParseTuple( args, "i", &i_visual ) ) |
|---|
| | 330 | return NULL; |
|---|
| | 331 | |
|---|
| | 332 | LIBVLC_TRY; |
|---|
| | 333 | i_ret = libvlc_video_reparent( LIBVLC_INPUT->p_input, i_visual, &ex); |
|---|
| | 334 | LIBVLC_EXCEPT; |
|---|
| | 335 | return Py_BuildValue( "i", i_ret ); |
|---|
| | 336 | } |
|---|
| | 337 | |
|---|
| | 362 | { "audio_get_track", vlcInput_audio_get_track, METH_VARARGS, |
|---|
| | 363 | "audio_get_track() -> int Get current audio track" }, |
|---|
| | 364 | { "audio_set_track", vlcInput_audio_set_track, METH_VARARGS, |
|---|
| | 365 | "audio_set_track(int) Set current audio track" }, |
|---|
| | 366 | { "toggle_fullscreen", vlcInput_toggle_fullscreen, METH_VARARGS, |
|---|
| | 367 | "toggle_fullscreen() Toggle fullscreen status on video output" }, |
|---|
| | 368 | { "set_fullscreen", vlcInput_set_fullscreen, METH_VARARGS, |
|---|
| | 369 | "set_fullscreen(bool) Enable or disable fullscreen on a video output" }, |
|---|
| | 370 | { "get_fullscreen", vlcInput_get_fullscreen, METH_VARARGS, |
|---|
| | 371 | "get_fullscreen() -> bool Get current fullscreen status" }, |
|---|
| | 372 | { "get_height", vlcInput_get_height, METH_VARARGS, |
|---|
| | 373 | "get_height() -> int Get current video height" }, |
|---|
| | 374 | { "get_width", vlcInput_get_width, METH_VARARGS, |
|---|
| | 375 | "get_width() -> int Get current video width" }, |
|---|
| | 376 | { "get_aspect_ratio", vlcInput_get_aspect_ratio, METH_VARARGS, |
|---|
| | 377 | "get_aspect_ratio() -> str Get current video aspect ratio" }, |
|---|
| | 378 | { "set_aspect_ratio", vlcInput_set_aspect_ratio, METH_VARARGS, |
|---|
| | 379 | "set_aspect_ratio(str) Set new video aspect ratio" }, |
|---|
| | 380 | { "video_take_snapshot", vlcInput_video_take_snapshot, METH_VARARGS, |
|---|
| | 381 | "video_take_snapshot(filename=str) Take a snapshot of the current video window" }, |
|---|
| | 382 | { "video_resize", vlcInput_video_resize, METH_VARARGS, |
|---|
| | 383 | "video_resize(width=int, height=int) Resize the current video output window" }, |
|---|
| | 384 | { "video_reparent", vlcInput_video_reparent, METH_VARARGS, |
|---|
| | 385 | "video_reparent(visual=int) change the parent for the current video output" }, |
|---|
| | 386 | |
|---|