| 288 | | /* We add all info about this stream */ |
|---|
| 289 | | p_cat = input_InfoCategory( p_input, _("Asf") ); |
|---|
| 290 | | playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_input, |
|---|
| 291 | | VLC_OBJECT_PLAYLIST, FIND_PARENT); |
|---|
| 292 | | if( p_playlist ) |
|---|
| 293 | | { |
|---|
| 294 | | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| 295 | | p_item = playlist_ItemGetByPos( p_playlist, -1 ); |
|---|
| 296 | | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 297 | | } |
|---|
| 298 | | if( p_item ) |
|---|
| 299 | | { |
|---|
| 300 | | vlc_mutex_lock( &p_item->lock ); |
|---|
| 301 | | } |
|---|
| 302 | | |
|---|
| 303 | | if( p_sys->i_length > 0 ) |
|---|
| 304 | | { |
|---|
| 305 | | int64_t i_second = p_sys->i_length / (int64_t)1000000; |
|---|
| 306 | | |
|---|
| 307 | | input_AddInfo( p_cat, _("Length"), "%d:%d:%d", |
|---|
| 308 | | (int)(i_second / 36000), |
|---|
| 309 | | (int)(( i_second / 60 ) % 60), |
|---|
| 310 | | (int)(i_second % 60) ); |
|---|
| 311 | | if( p_item ) |
|---|
| 312 | | { |
|---|
| 313 | | playlist_ItemAddInfo( p_item, _("Asf"), _("Length"), |
|---|
| 314 | | "%d:%d:%d", |
|---|
| 315 | | (int)(i_second / 36000), |
|---|
| 316 | | (int)(( i_second / 60 ) % 60), |
|---|
| 317 | | (int)(i_second % 60) ); |
|---|
| 318 | | } |
|---|
| 319 | | } |
|---|
| 320 | | input_AddInfo( p_cat, _("Number of streams"), "%d" , p_sys->i_streams ); |
|---|
| 321 | | if( p_item ) |
|---|
| 322 | | { |
|---|
| 323 | | playlist_ItemAddInfo( p_item, _("Asf"),_("Number of streams"),"%d", |
|---|
| 324 | | p_sys->i_streams ); |
|---|
| 325 | | } |
|---|
| | 288 | /* Create meta informations */ |
|---|
| | 289 | p_sys->meta = vlc_meta_New(); |
|---|
| 330 | | if( *p_cd->psz_title ) |
|---|
| 331 | | { |
|---|
| 332 | | input_AddInfo( p_cat, _("Title"), p_cd->psz_title ); |
|---|
| 333 | | if( p_item ) |
|---|
| 334 | | { |
|---|
| 335 | | playlist_ItemAddInfo( p_item, _("Asf"),_("Title"), |
|---|
| 336 | | p_cd->psz_title ); |
|---|
| 337 | | playlist_ItemSetName( p_item, p_cd->psz_title ); |
|---|
| 338 | | } |
|---|
| 339 | | } |
|---|
| 340 | | if( p_cd->psz_author ) |
|---|
| 341 | | { |
|---|
| 342 | | input_AddInfo( p_cat, _("Author"), p_cd->psz_author ); |
|---|
| 343 | | if( p_item ) |
|---|
| 344 | | { |
|---|
| 345 | | playlist_ItemAddInfo( p_item, _("Asf"),_("Author"), |
|---|
| 346 | | p_cd->psz_author ); |
|---|
| 347 | | playlist_ItemAddInfo( p_item, _("General"),_("Author"), |
|---|
| 348 | | p_cd->psz_author ); |
|---|
| 349 | | } |
|---|
| 350 | | } |
|---|
| 351 | | if( p_cd->psz_copyright ) |
|---|
| 352 | | { |
|---|
| 353 | | input_AddInfo( p_cat, _("Copyright"), p_cd->psz_copyright ); |
|---|
| 354 | | if( p_item ) |
|---|
| 355 | | { |
|---|
| 356 | | playlist_ItemAddInfo( p_item, _("Asf"), _("Copyright"), |
|---|
| 357 | | p_cd->psz_copyright ); |
|---|
| 358 | | } |
|---|
| 359 | | } |
|---|
| 360 | | if( *p_cd->psz_description ) |
|---|
| 361 | | { |
|---|
| 362 | | input_AddInfo( p_cat, _("Description"), p_cd->psz_description ); |
|---|
| 363 | | if( p_item ) |
|---|
| 364 | | { |
|---|
| 365 | | playlist_ItemAddInfo( p_item, _("Asf"), _("Description"), |
|---|
| 366 | | p_cd->psz_description ); |
|---|
| 367 | | } |
|---|
| 368 | | } |
|---|
| 369 | | if( *p_cd->psz_rating ) |
|---|
| 370 | | { |
|---|
| 371 | | input_AddInfo( p_cat, _("Rating"), p_cd->psz_rating ); |
|---|
| 372 | | if( p_item ) |
|---|
| 373 | | { |
|---|
| 374 | | playlist_ItemAddInfo( p_item, _("Asf"), _("Rating"), |
|---|
| 375 | | p_cd->psz_rating ); |
|---|
| 376 | | } |
|---|
| 377 | | } |
|---|
| 378 | | } |
|---|
| 379 | | |
|---|
| 380 | | /* FIXME to port to new way */ |
|---|
| | 294 | if( p_cd->psz_title && *p_cd->psz_title ) |
|---|
| | 295 | { |
|---|
| | 296 | vlc_meta_Add( p_sys->meta, VLC_META_TITLE, p_cd->psz_title ); |
|---|
| | 297 | } |
|---|
| | 298 | if( p_cd->psz_author && *p_cd->psz_author ) |
|---|
| | 299 | { |
|---|
| | 300 | vlc_meta_Add( p_sys->meta, VLC_META_AUTHOR, p_cd->psz_author ); |
|---|
| | 301 | } |
|---|
| | 302 | if( p_cd->psz_copyright && *p_cd->psz_copyright ) |
|---|
| | 303 | { |
|---|
| | 304 | vlc_meta_Add( p_sys->meta, VLC_META_COPYRIGHT, p_cd->psz_copyright ); |
|---|
| | 305 | } |
|---|
| | 306 | if( p_cd->psz_description && *p_cd->psz_description ) |
|---|
| | 307 | { |
|---|
| | 308 | vlc_meta_Add( p_sys->meta, VLC_META_DESCRIPTION, p_cd->psz_description ); |
|---|
| | 309 | } |
|---|
| | 310 | if( p_cd->psz_rating && *p_cd->psz_rating ) |
|---|
| | 311 | { |
|---|
| | 312 | vlc_meta_Add( p_sys->meta, VLC_META_RATING, p_cd->psz_rating ); |
|---|
| | 313 | } |
|---|
| | 314 | } |
|---|
| 401 | | playlist_ItemAddInfo( p_item, psz_cat, _("Codec name"), |
|---|
| 402 | | p_cl->codec[i_stream].psz_name ); |
|---|
| 403 | | playlist_ItemAddInfo( p_item, psz_cat, |
|---|
| 404 | | _("Codec description"), |
|---|
| 405 | | p_cl->codec[i_stream].psz_description ); |
|---|
| | 330 | vlc_meta_Add( tk, VLC_META_CODEC_NAME, |
|---|
| | 331 | p_cl->codec[i_stream].psz_name ); |
|---|
| | 469 | /***************************************************************************** |
|---|
| | 470 | * Control: |
|---|
| | 471 | *****************************************************************************/ |
|---|
| | 472 | static int Control( input_thread_t *p_input, int i_query, va_list args ) |
|---|
| | 473 | { |
|---|
| | 474 | demux_sys_t *p_sys = p_input->p_demux_data; |
|---|
| | 475 | int64_t *pi64; |
|---|
| | 476 | vlc_meta_t **pp_meta; |
|---|
| | 477 | |
|---|
| | 478 | switch( i_query ) |
|---|
| | 479 | { |
|---|
| | 480 | case DEMUX_GET_LENGTH: |
|---|
| | 481 | pi64 = (int64_t*)va_arg( args, int64_t * ); |
|---|
| | 482 | *pi64 = p_sys->i_length; |
|---|
| | 483 | return VLC_SUCCESS; |
|---|
| | 484 | |
|---|
| | 485 | case DEMUX_GET_META: |
|---|
| | 486 | pp_meta = (vlc_meta_t**)va_arg( args, vlc_meta_t** ); |
|---|
| | 487 | *pp_meta = vlc_meta_Duplicate( p_sys->meta ); |
|---|
| | 488 | return VLC_SUCCESS; |
|---|
| | 489 | |
|---|
| | 490 | default: |
|---|
| | 491 | return demux_vaControlDefault( p_input, i_query, args ); |
|---|
| | 492 | } |
|---|
| | 493 | } |
|---|