]> git.sesse.net Git - vlc/commitdiff
* added video height/width getters in libvlc
authorFilippo Carone <littlejohn@videolan.org>
Sun, 4 Jun 2006 19:26:55 +0000 (19:26 +0000)
committerFilippo Carone <littlejohn@videolan.org>
Sun, 4 Jun 2006 19:26:55 +0000 (19:26 +0000)
* libvlc playlist play uses locking

include/vlc/libvlc.h
src/control/playlist.c
src/control/video.c

index a7c0dbe6e0403dc2fc3fd5ca4b897fb629427b95..d3ffa42d21a926a8862a00691dbf676128eb90c0 100644 (file)
@@ -269,8 +269,6 @@ vlc_int64_t libvlc_input_get_length( libvlc_input_t *, libvlc_exception_t *);
 vlc_int64_t libvlc_input_get_time( libvlc_input_t *, libvlc_exception_t *);
 float libvlc_input_get_position( libvlc_input_t *, libvlc_exception_t *);
 vlc_bool_t libvlc_input_will_play( libvlc_input_t *, libvlc_exception_t *);
-    
-
 
 /** @} */
 
@@ -302,8 +300,29 @@ void libvlc_set_fullscreen( libvlc_input_t *, int, libvlc_exception_t * );
  * \return the fullscreen status (boolean)
  */
 int libvlc_get_fullscreen( libvlc_input_t *, libvlc_exception_t * );
+    
+/**
+ * Get current video height
+ * \param p_input the input
+ * \param p_exception an initialized exception
+ * \return the video height
+ */
+int libvlc_video_get_height( libvlc_input_t *, libvlc_exception_t * );
 
+/**
+ * Get current video width
+ * \param p_input the input
+ * \param p_exception an initialized exception
+ * \return the video width
+ */
+int libvlc_video_get_width( libvlc_input_t *, libvlc_exception_t * );
 
+/**
+ * Take a snapshot of the current video window
+ * \param p_input the input
+ * \param psz_filepath the path where to save the screenshot to
+ * \param p_exception an initialized exception
+ */
 void libvlc_video_take_snapshot( libvlc_input_t *, char *, libvlc_exception_t * );
     
 
index dc93eb4ffac9771e380519363cccfd58c88f9124..89d35c151dbd6601135bce61e5c5ca50b34abe83 100644 (file)
@@ -46,7 +46,7 @@ void libvlc_playlist_play( libvlc_instance_t *p_instance, int i_id,
             libvlc_exception_raise( p_exception, "Unable to find item " );
             return;
         }
-        playlist_Control( p_instance->p_playlist, PLAYLIST_VIEWPLAY,
+        playlist_LockControl( p_instance->p_playlist, PLAYLIST_VIEWPLAY,
                           p_instance->p_playlist->status.p_node, p_item );
     }
     else
index 4c924a3053d8082f0a167e225f5487fff1ecfd21..0f09c6ab3ab3bd54c1a2a431b86560f62bac5bdc 100644 (file)
@@ -125,7 +125,7 @@ void libvlc_toggle_fullscreen( libvlc_input_t *p_input,
 }
 
 void
-libvlc_video_take_snapshot( libvlc_input_t *p_input, char *filepath,
+libvlc_video_take_snapshot( libvlc_input_t *p_input, char *psz_filepath,
                        libvlc_exception_t *p_e )
 {
     vout_thread_t *p_vout = GetVout( p_input, p_e );
@@ -148,7 +148,7 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *filepath,
         return NULL;
     }
    
-    snprintf( path, 255, "%s", filepath );
+    snprintf( path, 255, "%s", psz_filepath );
     var_SetString( p_vout, "snapshot-path", path );
     var_SetString( p_vout, "snapshot-format", "png" );
 
@@ -158,3 +158,27 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *filepath,
     return;
     
 }
+
+int libvlc_video_get_height( libvlc_input_t *p_input,
+                             libvlc_exception_t *p_e ) 
+{
+    vout_thread_t *p_vout1 = GetVout( p_input, p_e );
+    if( !p_vout1 )
+        return 0;
+
+    vlc_object_release( p_vout1 );
+
+    return p_vout1->i_window_height;
+}
+
+int libvlc_video_get_width( libvlc_input_t *p_input,
+                            libvlc_exception_t *p_e ) 
+{
+    vout_thread_t *p_vout1 = GetVout( p_input, p_e );
+    if( !p_vout1 )
+        return 0;
+
+    vlc_object_release( p_vout1 );
+
+    return p_vout1->i_window_width;
+}