Changeset e0003bec24b8241621d4bb6ce0fe5160835d84d0
- Timestamp:
- 02/14/06 22:41:23 (2 years ago)
- git-parent:
- Files:
-
- Makefile.am (modified) (1 diff)
- bindings/STATUS (deleted)
- include/libvlc_internal.h (modified) (1 diff)
- include/vlc/libvlc.h (modified) (6 diffs)
- include/vlc_symbols.h (modified) (4 diffs)
- include/vlc_vlm.h (modified) (1 diff)
- src/control/core.c (modified) (3 diffs)
- src/misc/vlm.c (modified) (2 diffs)
- test/native/libvlc.c (modified) (4 diffs)
- test/pyunit.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Makefile.am
r2f6ad03 re0003be 476 476 src/control/core.c \ 477 477 src/control/playlist.c \ 478 src/control/vlm.c \ 478 479 src/control/input.c \ 479 480 src/control/video.c \ include/libvlc_internal.h
r473fef1 re0003be 36 36 vlc_t *p_vlc; 37 37 playlist_t *p_playlist; 38 vlm_t *p_vlm; 38 39 int i_vlc_id; 39 40 }; include/vlc/libvlc.h
r2f6ad03 re0003be 74 74 * \param psz_message the exception message 75 75 */ 76 void libvlc_exception_raise( libvlc_exception_t *p_exception, char *psz_ message);76 void libvlc_exception_raise( libvlc_exception_t *p_exception, char *psz_format, ... ); 77 77 78 78 /** … … 147 147 148 148 /** 149 * Pause a running playlist, resume if it was stopped 150 * \param p_instance the instance to pause 151 * \param p_exception an initialized exception 152 */ 153 void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * ); 154 155 /** 156 * Checks if the playlist is running 157 * \param p_instance the instance 158 * \param p_exception an initialized exception 159 * \return 0 if the playlist is stopped or paused, 1 if it is running 160 */ 161 int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * ); 162 163 /** 164 * Get the number of items in the playlist 165 * \param p_instance the instance 166 * \param p_exception an initialized exception 167 * \return the number of items 168 */ 169 int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * ); 170 171 172 173 174 175 /** 149 176 * Stop playing 150 177 * \param p_instance the instance to stop … … 154 181 155 182 /** 156 * Remove all playlist ites 183 * Go to next playlist item (starts playback if it was stopped) 184 * \param p_instance the instance to use 185 * \param p_exception an initialized exception 186 */ 187 void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * ); 188 189 /** 190 * Go to previous playlist item (starts playback if it was stopped) 191 * \param p_instance the instance to use 192 * \param p_exception an initialized exception 193 */ 194 void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * ); 195 196 /** 197 * Remove all playlist items 157 198 * \param p_instance the instance 158 199 * \param p_exception an initialized exception … … 200 241 201 242 202 203 243 typedef struct libvlc_input_t libvlc_input_t; 204 244 205 ///\todo document me 245 /* Get the input that is currently being played by the playlist 246 * \param p_instance the instance to use 247 * \param p_exception an initialized excecption 248 * \return an input object 249 */ 206 250 libvlc_input_t *libvlc_playlist_get_input( libvlc_instance_t *, 207 251 libvlc_exception_t * ); … … 231 275 232 276 277 /** @} */ 278 279 /** defgroup libvlc_video Video 280 * \ingroup libvlc 281 * LibVLC Video handling 282 * @{ 283 */ 284 285 /** 286 * Toggle fullscreen status on video output 287 * \param p_input the input 288 * \param p_exception an initialized exception 289 */ 233 290 void libvlc_toggle_fullscreen( libvlc_input_t *, libvlc_exception_t * ); 234 291 292 /** 293 * Enable or disable fullscreen on a video output 294 * \param p_input the input 295 * \param b_fullscreen boolean for fullscreen status 296 * \param p_exception an initialized exception 297 */ 298 void libvlc_set_fullscreen( libvlc_input_t *, int, libvlc_exception_t * ); 299 300 /** 301 * Get current fullscreen status 302 * \param p_input the input 303 * \param p_exception an initialized exception 304 * \return the fullscreen status (boolean) 305 */ 306 int libvlc_get_fullscreen( libvlc_input_t *, libvlc_exception_t * ); 307 308 /** @} 309 * defgroup libvlc_vlm VLM 310 * \ingroup libvlc 311 * LibVLC VLM handling 312 * @{ 313 */ 314 315 316 /** 317 * Add a broadcast, with one input 318 * \param p_instance the instance 319 * \param psz_name the name of the new broadcast 320 * \param psz_input the input MRL 321 * \param psz_output the output MRL (the parameter to the "sout" variable) 322 * \param i_options number of additional options 323 * \param ppsz_options additional options 324 * \param b_enabled boolean for enabling the new broadcast 325 * \param b_loop Should this broadcast be played in loop ? 326 * \param p_exception an initialized exception 327 */ 328 void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* , 329 int, char **, int, int, libvlc_exception_t * ); 330 331 /** 332 * Delete a media (vod or broadcast) 333 * \param p_instance the instance 334 * \param psz_name the media to delete 335 * \param p_exception an initialized exception 336 */ 337 void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * ); 338 339 /** 340 * Enable or disable a media (vod or broadcast) 341 * \param p_instance the instance 342 * \param psz_name the media to work on 343 * \param b_enabled the new status 344 * \param p_exception an initialized exception 345 */ 346 void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int, 347 libvlc_exception_t *); 348 349 /** 350 * Edit the parameters of a media. This will delete all existing inputs and 351 * add the specified one. 352 * \param p_instance the instance 353 * \param psz_name the name of the new broadcast 354 * \param psz_input the input MRL 355 * \param psz_output the output MRL (the parameter to the "sout" variable) 356 * \param i_options number of additional options 357 * \param ppsz_options additional options 358 * \param b_enabled boolean for enabling the new broadcast 359 * \param b_loop Should this broadcast be played in loop ? 360 * \param p_exception an initialized exception 361 */ 362 void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* , 363 int, char **, int, int, libvlc_exception_t * ); 364 235 365 236 366 /** @} */ 237 238 239 367 240 368 # ifdef __cplusplus … … 242 370 # endif 243 371 244 #endif /* <vlc/ vlc_control.h> */372 #endif /* <vlc/libvlc.h> */ include/vlc_symbols.h
r491a077 re0003be 363 363 char * mstrtime (char *psz_buffer, mtime_t date); 364 364 void aout_FormatPrepare (audio_sample_format_t * p_format); 365 vlm_media_t* vlm_MediaSearch (vlm_t *, const char *); 365 366 void spu_DisplaySubpicture (spu_t *, subpicture_t *); 366 367 int intf_RunThread (intf_thread_t *); … … 940 941 char * (*FromLocaleDup_inner) (const char *); 941 942 int (*utf8_mkdir_inner) (const char *filename); 943 vlm_media_t* (*vlm_MediaSearch_inner) (vlm_t *, const char *); 942 944 }; 943 945 # if defined (__PLUGIN__) … … 1394 1396 # define FromLocaleDup (p_symbols)->FromLocaleDup_inner 1395 1397 # define utf8_mkdir (p_symbols)->utf8_mkdir_inner 1398 # define vlm_MediaSearch (p_symbols)->vlm_MediaSearch_inner 1396 1399 # elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__) 1397 1400 /****************************************************************** … … 1851 1854 ((p_symbols)->FromLocaleDup_inner) = FromLocaleDup; \ 1852 1855 ((p_symbols)->utf8_mkdir_inner) = utf8_mkdir; \ 1856 ((p_symbols)->vlm_MediaSearch_inner) = vlm_MediaSearch; \ 1853 1857 (p_symbols)->net_ConvertIPv4_deprecated = NULL; \ 1854 1858 (p_symbols)->__stats_CounterGet_deprecated = NULL; \ include/vlc_vlm.h
r2cb472d re0003be 140 140 VLC_EXPORT( int, vlm_MediaSetup, ( vlm_t *, vlm_media_t *, const char *, const char * ) ); 141 141 VLC_EXPORT( int, vlm_MediaControl, ( vlm_t *, vlm_media_t *, const char *, const char *, const char * ) ); 142 VLC_EXPORT( vlm_media_t* , vlm_MediaSearch,( vlm_t *, const char *) ); 142 143 VLC_EXPORT( vlm_schedule_t *, vlm_ScheduleNew, ( vlm_t *, const char * ) ); 143 144 VLC_EXPORT( void, vlm_ScheduleDelete, ( vlm_t *, vlm_schedule_t *, const char * ) ); src/control/core.c
r711b5da re0003be 21 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 22 *****************************************************************************/ 23 23 #include <stdarg.h> 24 24 #include <libvlc_internal.h> 25 25 #include <vlc/libvlc.h> … … 59 59 60 60 inline void libvlc_exception_raise( libvlc_exception_t *p_exception, 61 char *psz_ message)61 char *psz_format, ... ) 62 62 { 63 va_list args; 64 char *psz_message; 65 va_start( args, psz_message ); 66 vasprintf( &psz_message, psz_format, args ); 67 va_end( args ); 68 63 69 if( p_exception == NULL ) return; 64 70 p_exception->b_raised = 1; … … 98 104 p_new->p_playlist = (playlist_t *)vlc_object_find( p_new->p_vlc, 99 105 VLC_OBJECT_PLAYLIST, FIND_CHILD ); 106 p_new->p_vlm = NULL; 100 107 101 108 if( !p_new->p_playlist ) src/misc/vlm.c
r1c35288 re0003be 55 55 static vlm_message_t *vlm_Help( vlm_t *, char * ); 56 56 57 static vlm_media_t *vlm_MediaSearch ( vlm_t *, const char * );58 57 static vlm_media_instance_t *vlm_MediaInstanceSearch( vlm_t *, vlm_media_t *, const char * ); 59 58 … … 819 818 } 820 819 821 staticvlm_media_t *vlm_MediaSearch( vlm_t *vlm, const char *psz_name )820 vlm_media_t *vlm_MediaSearch( vlm_t *vlm, const char *psz_name ) 822 821 { 823 822 int i; test/native/libvlc.c
rd0802e7 re0003be 56 56 57 57 p_instance = libvlc_new( 2, argv, &exception ); 58 ASSERT_ EXCEPTION;58 ASSERT_NOEXCEPTION; 59 59 60 60 /* Initial status */ … … 66 66 67 67 i_playing = libvlc_playlist_isplaying( p_instance, &exception ); 68 ASSERT_ EXCEPTION;68 ASSERT_NOEXCEPTION; 69 69 ASSERT( i_playing == 0, "Playlist shouldn't be running" ); 70 70 i_items = libvlc_playlist_items_count( p_instance, &exception ); 71 ASSERT_ EXCEPTION;71 ASSERT_NOEXCEPTION; 72 72 ASSERT( i_items == 0, "Playlist should be empty" ); 73 73 … … 75 75 libvlc_exception_clear( &exception ); 76 76 i_id = libvlc_playlist_add( p_instance, "test" , NULL , &exception ); 77 ASSERT_ EXCEPTION;77 ASSERT_NOEXCEPTION; 78 78 ASSERT( i_id > 0 , "Returned identifier is <= 0" ); 79 79 i_items = libvlc_playlist_items_count( p_instance, &exception ); 80 ASSERT_ EXCEPTION;80 ASSERT_NOEXCEPTION; 81 81 ASSERT( i_items == 1, "Playlist should have 1 item" ); 82 82 i_playing = libvlc_playlist_isplaying( p_instance, &exception ); 83 ASSERT_ EXCEPTION;83 ASSERT_NOEXCEPTION; 84 84 ASSERT( i_playing == 0, "Playlist shouldn't be running" ); 85 85 … … 90 90 } 91 91 92 static PyObject *vlm_test( PyObject *self, PyObject *args ) 93 { 94 libvlc_instance_t *p_instance; 95 char *argv[] = { "vlc", "--quiet" }; 96 libvlc_exception_t exception; 97 libvlc_exception_init( &exception ); 98 99 libvlc_vlm_set_enabled( p_instance, "test", 1, &exception ); 100 ASSERT_EXCEPTION; 101 libvlc_exception_clear( &exception ); 102 103 Py_INCREF( Py_None ); 104 return Py_None; 105 } 106 92 107 static PyMethodDef native_libvlc_test_methods[] = { 93 108 DEF_METHOD( create_destroy, "Create and destroy" ) 94 109 DEF_METHOD( exception_test, "Test Exception handling" ) 95 110 DEF_METHOD( playlist_test, "Test Playlist interaction" ) 111 DEF_METHOD( vlm_test, "Test VLM" ) 96 112 { NULL, NULL, 0, NULL } 97 113 }; test/pyunit.h
r661a6c1 re0003be 7 7 } 8 8 9 #define ASSERT_ EXCEPTION if( libvlc_exception_raised( &exception ) ) { \9 #define ASSERT_NOEXCEPTION if( libvlc_exception_raised( &exception ) ) { \ 10 10 if( libvlc_exception_get_message( &exception ) ) PyErr_SetString( PyExc_AssertionError, libvlc_exception_get_message( &exception ) ); \ 11 11 else PyErr_SetString( PyExc_AssertionError, "Exception raised" ); return NULL; } 12 12 13 #define ASSERT_EXCEPTION if( !libvlc_exception_raised( &exception ) ) { \ 14 if( libvlc_exception_get_message( &exception ) ) PyErr_SetString( PyExc_AssertionError, libvlc_exception_get_message( &exception ) ); \ 15 else PyErr_SetString( PyExc_AssertionError, "Exception not raised" ); return NULL; } 16 17 18 13 19 #define DEF_METHOD( method, desc ) { #method, method, METH_VARARGS, desc},
