* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#include <libvlc_internal.h>
+#include "libvlc_internal.h"
#include <vlc/libvlc.h>
-
-#include <vlc/vout.h>
-#include <vlc/intf.h>
+#include <vlc_input.h>
+#include <vlc_vout.h>
/*
* Remember to release the returned vout_thread_t since it is locked at
* Exported functions
**********************************************************************/
-void libvlc_set_video_drawable( libvlc_instance_t *p_instance,
- libvlc_drawable_t drawable,
- libvlc_exception_t *p_e )
-{
- vlc_value_t value;
- value.i_int = drawable;
-
- var_Set( p_instance->p_libvlc_int, "drawable", value);
-}
-
-
-
void libvlc_set_fullscreen( libvlc_input_t *p_input, int b_fullscreen,
libvlc_exception_t *p_e )
{
libvlc_exception_t *p_e )
{
vout_thread_t *p_vout = GetVout( p_input, p_e );
-
- /* GetVout will raise the exception for us */
- if( !p_vout )
+ if ( libvlc_exception_raised( p_e ) )
{
+ if ( strcmp( "No active video output", libvlc_exception_get_message( p_e ) ) == 0 )
+ {
+ libvlc_exception_clear( p_e );
+ }
return VLC_FALSE;
}
libvlc_exception_t *p_e )
{
vout_thread_t *p_vout = GetVout( p_input, p_e );
+
+ if ( p_vout == NULL)
+ {
+ /// \todo: set exception
+ return 0;
+ }
+
vout_Control( p_vout , VOUT_REPARENT, d);
vlc_object_release( p_vout );
/* global video settings */
void libvlc_video_set_parent( libvlc_instance_t *p_instance, libvlc_drawable_t d,
- libvlc_exception_t *p_e )
+ libvlc_exception_t *p_e )
{
/* set as default for future vout instances */
var_SetInteger(p_instance->p_libvlc_int, "drawable", (int)d);
}
}
+libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *p_instance, libvlc_exception_t *p_e )
+{
+ libvlc_drawable_t result;
+
+ result = var_GetInteger( p_instance->p_libvlc_int, "drawable" );
+
+ return result;
+}
+
+
void libvlc_video_set_size( libvlc_instance_t *p_instance, int width, int height,
libvlc_exception_t *p_e )
{
vlc_object_release( p_vout );
}
+char *libvlc_video_get_crop_geometry( libvlc_input_t *p_input,
+ libvlc_exception_t *p_e )
+{
+ char *psz_geometry = 0;
+ vout_thread_t *p_vout = GetVout( p_input, p_e );
+
+ if( !p_vout )
+ return 0;
+
+ psz_geometry = var_GetString( p_vout, "crop" );
+ vlc_object_release( p_vout );
+ return psz_geometry;
+}
+
+void libvlc_video_set_crop_geometry( libvlc_input_t *p_input,
+ char *psz_geometry, libvlc_exception_t *p_e )
+{
+ vout_thread_t *p_vout = GetVout( p_input, p_e );
+ int i_ret = -1;
+
+ if( !p_vout )
+ return;
+
+ i_ret = var_SetString( p_vout, "crop", psz_geometry );
+ if( i_ret )
+ libvlc_exception_raise( p_e,
+ "Unexpected error while setting crop geometry" );
+
+ vlc_object_release( p_vout );
+}
+
int libvlc_video_destroy( libvlc_input_t *p_input,
libvlc_exception_t *p_e )
{