]> git.sesse.net Git - vlc/blobdiff - include/vlc/libvlc.h
libvlc: add support for setting/getting the video scale
[vlc] / include / vlc / libvlc.h
index a3a40e7980e66855908906c2d6b30d80041f290f..0e14b5f5756c6304ac54cabbf7dd4a5a82a40807 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * libvlc.h:  libvlc external API
  *****************************************************************************
- * Copyright (C) 1998-2005 the VideoLAN team
+ * Copyright (C) 1998-2009 the VideoLAN team
  * $Id$
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
@@ -555,6 +555,22 @@ VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_
  */
 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
 
+/**
+ * Set the agl handler where the media player should render its video output.
+ *
+ * \param p_mi the Media Player
+ * \param drawable the agl handler
+ * \param p_e an initialized exception pointer
+ */
+VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable, libvlc_exception_t *p_e );
+
+/**
+ * Get the agl handler previously set with libvlc_media_player_set_agl().
+ *
+ * \return the agl handler or 0 if none where set
+ */
+VLC_PUBLIC_API uint32_t libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
+       
 /**
  * Set the agl handler where the media player should render its video output.
  *
@@ -870,6 +886,31 @@ VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exce
  */
 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
 
+/**
+ * Get the current video scaling factor.
+ * See also libvlc_video_set_scale().
+ *
+ * \param p_mediaplayer the media player
+ * \return the currently configured zoom factor, or 0. if the video is set
+ * to fit to the output window/drawable automatically.
+ */
+VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t *,
+                                             libvlc_exception_t *p_e );
+
+/**
+ * Set the video scaling factor. That is the ratio of the number of pixels on
+ * screen to the number of pixels in the original decoded video in each
+ * dimension. Zero is a special value; it will adjust the video to the output
+ * window/drawable (in windowed mode) or the entire screen.
+ *
+ * Note that not all video outputs support scaling.
+ *
+ * \param p_mediaplayer the media player
+ * \param i_factor the scaling factor, or zero
+ */
+VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *, float,
+                                            libvlc_exception_t *p_e );
+
 /**
  * Get current video aspect ratio.
  *
@@ -1043,18 +1084,18 @@ VLC_PUBLIC_API void libvlc_video_set_track( libvlc_media_player_t *, int, libvlc
  * If i_width AND i_height is 0, original size is used.
  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
  *
- * \param p_mediaplayer the media player
+ * \param p_mi media player instance
  * \param psz_filepath the path where to save the screenshot to
  * \param i_width the snapshot's width
  * \param i_height the snapshot's height
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, const char *,unsigned int, unsigned int, libvlc_exception_t * );
 
 /**
  * Resize the current video output window.
  *
- * \param p_instance libvlc instance
+ * \param p_mi media player instance
  * \param width new width for video output window
  * \param height new height for video output window
  * \param p_e an initialized exception pointer
@@ -1065,7 +1106,7 @@ VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libv
 /**
  * Tell windowless video output to redraw rectangular area (MacOS X only).
  *
- * \param p_instance libvlc instance
+ * \param p_mi media player instance
  * \param area coordinates within video drawable
  * \param p_e an initialized exception pointer
  */
@@ -1090,11 +1131,12 @@ VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc
  * This setting will be used as default for all video outputs.
  *
  * \param p_instance libvlc instance
+ * \param p_mi media player instance
  * \param view coordinates within video drawable
  * \param clip coordinates within video drawable
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, libvlc_media_player_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
 
 /** @} video */