1 /*****************************************************************************
2 * dbus.c : D-Bus control interface
3 *****************************************************************************
4 * Copyright (C) 2006 Rafaël Carré
7 * Authors: Rafaël Carré <funman at videolanorg>
8 * Mirsal Ennaime <mirsal dot ennaime at gmail dot com>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
26 * D-Bus Specification:
27 * http://dbus.freedesktop.org/doc/dbus-specification.html
28 * D-Bus low-level C API (libdbus)
29 * http://dbus.freedesktop.org/doc/dbus/api/html/index.html
31 "If you use this low-level API directly, you're signing up for some pain."
32 * MPRIS Specification (still drafting on June, 25 of 2007):
33 * http://wiki.xmms2.xmms.se/index.php/Media_Player_Interfaces
36 /*****************************************************************************
38 *****************************************************************************/
40 #include <dbus/dbus.h>
46 #include <vlc_interface.h>
48 #include <vlc_input.h>
49 #include <vlc_playlist.h>
51 /*****************************************************************************
53 *****************************************************************************/
55 static int Open ( vlc_object_t * );
56 static void Close ( vlc_object_t * );
57 static void Run ( intf_thread_t * );
59 static int TrackChange( vlc_object_t *p_this, const char *psz_var,
60 vlc_value_t oldval, vlc_value_t newval, void *p_data );
62 static int GetInputMeta ( input_item_t *p_input,
63 DBusMessageIter *args);
67 DBusConnection *p_conn;
70 /*****************************************************************************
72 *****************************************************************************/
75 set_shortname( _("dbus"));
76 set_category( CAT_INTERFACE );
77 set_subcategory( SUBCAT_INTERFACE_CONTROL );
78 set_description( _("D-Bus control interface") );
79 set_capability( "interface", 0 );
80 set_callbacks( Open, Close );
83 /*****************************************************************************
85 *****************************************************************************/
87 DBUS_METHOD( PlaylistExport_XSPF )
88 { /*export playlist to an xspf file */
90 /* reads the filename to export to */
91 /* returns the status as int32:
100 dbus_error_init( &error );
105 dbus_message_get_args( p_from, &error,
106 DBUS_TYPE_STRING, &psz_file,
109 if( dbus_error_is_set( &error ) )
111 msg_Err( (vlc_object_t*) p_this, "D-Bus message reading : %s\n",
113 dbus_error_free( &error );
114 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
117 playlist_t *p_playlist = pl_Yield( (vlc_object_t*) p_this );
119 if( ( !playlist_IsEmpty( p_playlist ) ) &&
120 ( p_playlist->p_root_category->i_children > 0 ) )
122 if( playlist_Export( p_playlist, psz_file,
123 p_playlist->p_root_category->pp_children[0],
124 "export-xspf" ) == VLC_SUCCESS )
132 pl_Release( ((vlc_object_t*) p_this ) );
144 playlist_t *p_playlist = pl_Yield( (vlc_object_t*) p_this );
145 playlist_Stop( p_playlist );
146 pl_Release( ((vlc_object_t*) p_this) );
147 vlc_object_kill(((vlc_object_t*)p_this)->p_libvlc);
151 DBUS_METHOD( PositionGet )
152 { /* returns position as an int in the range [0;1000] */
155 vlc_value_t position;
158 playlist_t *p_playlist = pl_Yield( ((vlc_object_t*) p_this) );
159 input_thread_t *p_input = p_playlist->p_input;
165 var_Get( p_input, "position", &position );
166 i_pos = position.f_float * 1000 ;
168 pl_Release( ((vlc_object_t*) p_this) );
173 DBUS_METHOD( PositionSet )
174 { /* set position from an int in the range [0;1000] */
177 vlc_value_t position;
178 playlist_t* p_playlist = NULL;
182 dbus_error_init( &error );
184 dbus_message_get_args( p_from, &error,
185 DBUS_TYPE_INT32, &i_pos,
188 if( dbus_error_is_set( &error ) )
190 msg_Err( (vlc_object_t*) p_this, "D-Bus message reading : %s\n",
192 dbus_error_free( &error );
193 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
195 p_playlist = pl_Yield( ((vlc_object_t*) p_this) );
196 input_thread_t *p_input = p_playlist->p_input;
200 position.f_float = ((float)i_pos) / 1000;
201 var_Set( p_input, "position", position );
203 pl_Release( ((vlc_object_t*) p_this) );
207 DBUS_METHOD( VolumeGet )
208 { /* returns volume in percentage */
211 dbus_int32_t i_dbus_vol;
212 audio_volume_t i_vol;
213 /* 2nd argument of aout_VolumeGet is int32 */
214 aout_VolumeGet( (vlc_object_t*) p_this, &i_vol );
215 i_dbus_vol = ( 100 * i_vol ) / AOUT_VOLUME_MAX;
216 ADD_INT32( &i_dbus_vol );
220 DBUS_METHOD( VolumeSet )
221 { /* set volume in percentage */
225 dbus_error_init( &error );
227 dbus_int32_t i_dbus_vol;
228 audio_volume_t i_vol;
230 dbus_message_get_args( p_from, &error,
231 DBUS_TYPE_INT32, &i_dbus_vol,
234 if( dbus_error_is_set( &error ) )
236 msg_Err( (vlc_object_t*) p_this, "D-Bus message reading : %s\n",
238 dbus_error_free( &error );
239 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
242 i_vol = ( AOUT_VOLUME_MAX / 100 ) *i_dbus_vol;
243 aout_VolumeSet( (vlc_object_t*) p_this, i_vol );
249 { /* next playlist item */
251 playlist_t *p_playlist = pl_Yield( ((vlc_object_t*) p_this) );
252 playlist_Next( p_playlist );
253 pl_Release( ((vlc_object_t*) p_this) );
258 { /* previous playlist item */
260 playlist_t *p_playlist = pl_Yield( ((vlc_object_t*) p_this) );
261 playlist_Prev( p_playlist );
262 pl_Release( ((vlc_object_t*) p_this) );
269 playlist_t *p_playlist = pl_Yield( ((vlc_object_t*) p_this) );
270 playlist_Stop( p_playlist );
271 pl_Release( ((vlc_object_t*) p_this) );
275 DBUS_METHOD( GetStatus )
276 { /* returns an int: 0=playing 1=paused 2=stopped */
280 dbus_int32_t i_status;
283 playlist_t *p_playlist = pl_Yield( (vlc_object_t*) p_this );
284 input_thread_t *p_input = p_playlist->p_input;
289 var_Get( p_input, "state", &val );
290 if( val.i_int == PAUSE_S )
292 else if( val.i_int == PLAYING_S )
296 pl_Release( p_playlist );
298 ADD_INT32( &i_status );
305 playlist_t *p_playlist = pl_Yield( (vlc_object_t*) p_this );
306 playlist_Pause( p_playlist );
307 pl_Release( p_playlist );
314 playlist_t *p_playlist = pl_Yield( (vlc_object_t*) p_this );
315 playlist_Play( p_playlist );
316 pl_Release( p_playlist );
320 DBUS_METHOD( Disconnect )
325 dbus_error_init( &error );
326 i = dbus_bus_release_name( p_conn, VLC_MPRIS_DBUS_SERVICE, &error );
327 if( ( i == -1 ) && ( dbus_error_is_set( &error ) ) )
329 msg_Err( (vlc_object_t*) p_this, "D-Bus disconnection failed : %s\n",
331 dbus_error_free( &error );
336 DBUS_METHOD( GetCurrentMetadata )
340 playlist_t* p_playlist = pl_Yield( (vlc_object_t*) p_this );
342 GetInputMeta( p_playlist->status.p_item->p_input, &args );
344 pl_Release( p_playlist );
348 /* Media Player information */
350 DBUS_METHOD( Identity )
354 char *psz_identity = malloc( strlen( PACKAGE ) + strlen( VERSION ) + 2 );
355 sprintf( psz_identity, "%s %s", PACKAGE, VERSION );
356 ADD_STRING( &psz_identity );
357 free( psz_identity );
363 DBUS_METHOD( AddTrack )
364 { /* add the string to the playlist, and play it if the boolean is true */
368 dbus_error_init( &error );
369 playlist_t* p_playlist = NULL;
374 dbus_message_get_args( p_from, &error,
375 DBUS_TYPE_STRING, &psz_mrl,
376 DBUS_TYPE_BOOLEAN, &b_play,
379 if( dbus_error_is_set( &error ) )
381 msg_Err( (vlc_object_t*) p_this, "D-Bus message reading : %s\n",
383 dbus_error_free( &error );
384 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
387 p_playlist = pl_Yield( (vlc_object_t*) p_this );
388 playlist_Add( p_playlist, psz_mrl, NULL, PLAYLIST_APPEND |
389 ( ( b_play == TRUE ) ? PLAYLIST_GO : 0 ) ,
390 PLAYLIST_END, VLC_TRUE, VLC_FALSE );
391 pl_Release( p_playlist );
396 DBUS_METHOD( GetCurrentTrack )
400 dbus_int32_t i_position = 0;
401 playlist_t *p_playlist = pl_Yield( (vlc_object_t*) p_this );
402 playlist_item_t* p_tested_item = p_playlist->p_root_onelevel;
404 while ( p_tested_item->p_input->i_id !=
405 p_playlist->status.p_item->p_input->i_id )
411 pl_Release( p_playlist );
413 ADD_INT32( &i_position );
417 DBUS_METHOD( GetMetadata )
422 dbus_error_init( &error );
424 dbus_int32_t i_position, i_count = 0;
426 playlist_t *p_playlist = pl_Yield( (vlc_object_t*) p_this );
427 playlist_item_t* p_tested_item = p_playlist->p_root_onelevel;
429 dbus_message_get_args( p_from, &error,
430 DBUS_TYPE_INT32, &i_position,
433 if( dbus_error_is_set( &error ) )
435 msg_Err( (vlc_object_t*) p_this, "D-Bus message reading : %s\n",
437 dbus_error_free( &error );
438 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
441 while ( i_count < i_position )
447 GetInputMeta ( p_tested_item->p_input, &args );
449 pl_Release( p_playlist );
453 DBUS_METHOD( GetLength )
458 dbus_int32_t i_elements = 0;
459 playlist_t *p_playlist = pl_Yield( (vlc_object_t*) p_this );
460 playlist_item_t* p_tested_item = p_playlist->p_root_onelevel;
461 playlist_item_t* p_last_item = playlist_GetLastLeaf( p_playlist,
462 p_playlist->p_root_onelevel );
464 while ( p_tested_item->p_input->i_id != p_last_item->p_input->i_id )
470 pl_Release( p_playlist );
472 ADD_INT32( &i_elements );
476 DBUS_METHOD( DelTrack )
481 dbus_error_init( &error );
483 dbus_int32_t i_position, i_count = 0;
484 playlist_t *p_playlist = pl_Yield( (vlc_object_t*) p_this );
485 playlist_item_t* p_tested_item = p_playlist->p_root_onelevel;
487 dbus_message_get_args( p_from, &error,
488 DBUS_TYPE_INT32, &i_position,
491 if( dbus_error_is_set( &error ) )
493 msg_Err( (vlc_object_t*) p_this, "D-Bus message reading : %s\n",
495 dbus_error_free( &error );
496 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
499 while ( i_count < i_position )
506 playlist_DeleteFromInput( p_playlist,
507 p_tested_item->p_input->i_id,
511 pl_Release( p_playlist );
524 playlist_t* p_playlist = NULL;
526 dbus_error_init( &error );
527 dbus_message_get_args( p_from, &error,
528 DBUS_TYPE_BOOLEAN, &b_loop,
531 if( dbus_error_is_set( &error ) )
533 msg_Err( (vlc_object_t*) p_this, "D-Bus message reading : %s\n",
535 dbus_error_free( &error );
536 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
539 val.b_bool = ( b_loop == TRUE ) ? VLC_TRUE : VLC_FALSE ;
540 p_playlist = pl_Yield( (vlc_object_t*) p_this );
541 var_Set ( p_playlist, "loop", val );
542 pl_Release( ((vlc_object_t*) p_this) );
547 DBUS_METHOD( Repeat )
553 dbus_bool_t b_repeat;
555 playlist_t* p_playlist = NULL;
557 dbus_error_init( &error );
558 dbus_message_get_args( p_from, &error,
559 DBUS_TYPE_BOOLEAN, &b_repeat,
562 if( dbus_error_is_set( &error ) )
564 msg_Err( (vlc_object_t*) p_this, "D-Bus message reading : %s\n",
566 dbus_error_free( &error );
567 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
570 val.b_bool = ( b_repeat == TRUE ) ? VLC_TRUE : VLC_FALSE ;
572 p_playlist = pl_Yield( (vlc_object_t*) p_this );
573 var_Set ( p_playlist, "repeat", val );
574 pl_Release( ((vlc_object_t*) p_this) );
579 DBUS_METHOD( Random )
585 dbus_bool_t b_random;
587 playlist_t* p_playlist = NULL;
589 dbus_error_init( &error );
590 dbus_message_get_args( p_from, &error,
591 DBUS_TYPE_BOOLEAN, &b_random,
594 if( dbus_error_is_set( &error ) )
596 msg_Err( (vlc_object_t*) p_this, "D-Bus message reading : %s\n",
598 dbus_error_free( &error );
599 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
602 val.b_bool = ( b_random == TRUE ) ? VLC_TRUE : VLC_FALSE ;
604 p_playlist = pl_Yield( (vlc_object_t*) p_this );
605 var_Set ( p_playlist, "random", val );
606 pl_Release( ((vlc_object_t*) p_this) );
610 /*****************************************************************************
611 * Introspection method
612 *****************************************************************************/
614 DBUS_METHOD( handle_introspect_root )
615 { /* handles introspection of root object */
618 ADD_STRING( &psz_introspection_xml_data_root );
622 DBUS_METHOD( handle_introspect_player )
626 ADD_STRING( &psz_introspection_xml_data_player );
630 DBUS_METHOD( handle_introspect_tracklist )
634 ADD_STRING( &psz_introspection_xml_data_tracklist );
638 /*****************************************************************************
639 * handle_*: answer to incoming messages
640 *****************************************************************************/
642 #define METHOD_FUNC( method, function ) \
643 else if( dbus_message_is_method_call( p_from, MPRIS_DBUS_INTERFACE, method ) )\
644 return function( p_conn, p_from, p_this )
646 DBUS_METHOD( handle_root )
649 if( dbus_message_is_method_call( p_from,
650 DBUS_INTERFACE_INTROSPECTABLE, "Introspect" ) )
651 return handle_introspect_root( p_conn, p_from, p_this );
653 /* here D-Bus method's names are associated to an handler */
655 METHOD_FUNC( "Identity", Identity );
657 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
661 DBUS_METHOD( handle_player )
663 if( dbus_message_is_method_call( p_from,
664 DBUS_INTERFACE_INTROSPECTABLE, "Introspect" ) )
665 return handle_introspect_player( p_conn, p_from, p_this );
667 /* here D-Bus method's names are associated to an handler */
669 METHOD_FUNC( "Prev", Prev );
670 METHOD_FUNC( "Next", Next );
671 METHOD_FUNC( "Quit", Quit );
672 METHOD_FUNC( "Stop", Stop );
673 METHOD_FUNC( "Play", Play );
674 METHOD_FUNC( "Pause", Pause );
675 METHOD_FUNC( "Repeat", Repeat );
676 METHOD_FUNC( "Disconnect", Disconnect );
677 METHOD_FUNC( "VolumeSet", VolumeSet );
678 METHOD_FUNC( "VolumeGet", VolumeGet );
679 METHOD_FUNC( "PositionSet", PositionSet );
680 METHOD_FUNC( "PositionGet", PositionGet );
681 METHOD_FUNC( "GetStatus", GetStatus );
682 METHOD_FUNC( "GetMetadata", GetCurrentMetadata );
684 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
687 DBUS_METHOD( handle_tracklist )
689 if( dbus_message_is_method_call( p_from,
690 DBUS_INTERFACE_INTROSPECTABLE, "Introspect" ) )
691 return handle_introspect_tracklist( p_conn, p_from, p_this );
693 /* here D-Bus method's names are associated to an handler */
695 METHOD_FUNC( "GetMetadata", GetMetadata );
696 METHOD_FUNC( "GetCurrentTrack", GetCurrentTrack );
697 METHOD_FUNC( "GetLength", GetLength );
698 METHOD_FUNC( "AddTrack", AddTrack );
699 METHOD_FUNC( "DelTrack", DelTrack );
700 METHOD_FUNC( "Loop", Loop );
701 METHOD_FUNC( "Random", Random );
703 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
706 /*****************************************************************************
707 * Open: initialize interface
708 *****************************************************************************/
710 static int Open( vlc_object_t *p_this )
711 { /* initialisation of the connection */
712 intf_thread_t *p_intf = (intf_thread_t*)p_this;
713 intf_sys_t *p_sys = malloc( sizeof( intf_sys_t ) );
714 playlist_t *p_playlist;
715 DBusConnection *p_conn;
721 dbus_threads_init_default();
723 dbus_error_init( &error );
725 /* connect to the session bus */
726 p_conn = dbus_bus_get( DBUS_BUS_SESSION, &error );
729 msg_Err( p_this, "Failed to connect to the D-Bus session daemon: %s",
731 dbus_error_free( &error );
736 /* register a well-known name on the bus */
737 dbus_bus_request_name( p_conn, VLC_MPRIS_DBUS_SERVICE, 0, &error );
738 if( dbus_error_is_set( &error ) )
740 msg_Err( p_this, "Error requesting % service: %s\n"
741 VLC_MPRIS_DBUS_SERVICE, error.message );
742 dbus_error_free( &error );
747 /* we register the objects */
748 dbus_connection_register_object_path( p_conn, MPRIS_DBUS_ROOT_PATH,
749 &vlc_dbus_root_vtable, p_this );
750 dbus_connection_register_object_path( p_conn, MPRIS_DBUS_PLAYER_PATH,
751 &vlc_dbus_player_vtable, p_this );
752 dbus_connection_register_object_path( p_conn, MPRIS_DBUS_TRACKLIST_PATH,
753 &vlc_dbus_tracklist_vtable, p_this );
755 dbus_connection_flush( p_conn );
757 p_playlist = pl_Yield( p_intf );
759 var_AddCallback( p_playlist, "playlist-current", TrackChange, p_intf );
761 pl_Release( p_playlist );
763 p_intf->pf_run = Run;
764 p_intf->p_sys = p_sys;
765 p_sys->p_conn = p_conn;
770 /*****************************************************************************
771 * Close: destroy interface
772 *****************************************************************************/
774 static void Close ( vlc_object_t *p_this )
776 intf_thread_t *p_intf = (intf_thread_t*) p_this;
777 playlist_t *p_playlist = pl_Yield( p_intf );;
780 var_DelCallback( p_playlist, "playlist-current", TrackChange, p_intf );
782 pl_Release( p_playlist );
784 dbus_connection_unref( p_intf->p_sys->p_conn );
786 free( p_intf->p_sys );
789 /*****************************************************************************
791 *****************************************************************************/
793 static void Run ( intf_thread_t *p_intf )
795 while( !p_intf->b_die )
797 msleep( INTF_IDLE_SLEEP );
798 dbus_connection_read_write_dispatch( p_intf->p_sys->p_conn, 0 );
802 /*****************************************************************************
803 * TrackChange: Playlist item change callback
804 *****************************************************************************/
806 DBUS_SIGNAL( TrackChangeSignal )
807 { /* emit the metadata of the new item */
808 SIGNAL_INIT( "TrackChange" );
811 input_thread_t *p_input = (input_thread_t*) p_data;
812 GetInputMeta ( input_GetItem(p_input), &args );
817 static int TrackChange( vlc_object_t *p_this, const char *psz_var,
818 vlc_value_t oldval, vlc_value_t newval, void *p_data )
820 intf_thread_t *p_intf = ( intf_thread_t* ) p_data;
821 intf_sys_t *p_sys = p_intf->p_sys;
822 playlist_t *p_playlist;
823 input_thread_t *p_input = NULL;
824 (void)p_this; (void)psz_var; (void)oldval; (void)newval;
826 p_playlist = pl_Yield( p_intf );
828 p_input = p_playlist->p_input;
833 pl_Release( p_playlist );
837 vlc_object_yield( p_input );
839 pl_Release( p_playlist );
841 TrackChangeSignal( p_sys->p_conn, p_input );
843 vlc_object_release( p_input );
847 /*****************************************************************************
848 * GetInputMeta: Fill a DBusMessage with the given input item metadata
849 *****************************************************************************/
851 #define ADD_META( entry, type, data ) \
853 dbus_message_iter_open_container( &dict, DBUS_TYPE_DICT_ENTRY, \
854 NULL, &dict_entry ); \
855 dbus_message_iter_append_basic( &dict_entry, DBUS_TYPE_STRING, \
856 &ppsz_meta_items[entry] ); \
857 dbus_message_iter_open_container( &dict_entry, DBUS_TYPE_VARIANT, \
858 type##_AS_STRING, &variant ); \
859 dbus_message_iter_append_basic( &variant, \
862 dbus_message_iter_close_container( &dict_entry, &variant ); \
863 dbus_message_iter_close_container( &dict, &dict_entry ); }
865 #define ADD_VLC_META_STRING( entry, item ) \
867 char * psz = input_item_Get##item( p_input );\
868 ADD_META( entry, DBUS_TYPE_STRING, \
873 static int GetInputMeta( input_item_t* p_input,
874 DBusMessageIter *args )
875 { /*FIXME: Works only for already read metadata. */
877 DBusMessageIter dict, dict_entry, variant;
878 /* We need the track length to be expressed in seconds
879 * instead of milliseconds */
880 dbus_int64_t i_length = ( input_item_GetDuration( p_input ) / 1000 );
882 const char* ppsz_meta_items[] =
884 "title", "artist", "genre", "copyright", "album", "tracknum",
885 "description", "rating", "date", "setting", "url", "language",
886 "nowplaying", "publisher", "encodedby", "arturl", "trackid",
887 "status", "URI", "length", "video-codec", "audio-codec",
888 "video-bitrate", "audio-bitrate", "audio-samplerate"
891 dbus_message_iter_open_container( args, DBUS_TYPE_ARRAY, "{sv}", &dict );
893 ADD_VLC_META_STRING( 0, Title );
894 ADD_VLC_META_STRING( 1, Artist );
895 ADD_VLC_META_STRING( 2, Genre );
896 ADD_VLC_META_STRING( 3, Copyright );
897 ADD_VLC_META_STRING( 4, Album );
898 ADD_VLC_META_STRING( 5, TrackNum );
899 ADD_VLC_META_STRING( 6, Description );
900 ADD_VLC_META_STRING( 7, Rating );
901 ADD_VLC_META_STRING( 8, Date );
902 ADD_VLC_META_STRING( 9, Setting );
903 ADD_VLC_META_STRING( 10, URL );
904 ADD_VLC_META_STRING( 11, Language );
905 ADD_VLC_META_STRING( 12, NowPlaying );
906 ADD_VLC_META_STRING( 13, Publisher );
907 ADD_VLC_META_STRING( 14, EncodedBy );
908 ADD_VLC_META_STRING( 15, ArtURL );
909 ADD_VLC_META_STRING( 16, TrackID );
911 vlc_mutex_lock( &p_input->lock );
912 ADD_META( 17, DBUS_TYPE_INT32, p_input->p_meta->i_status );
913 vlc_mutex_unlock( &p_input->lock );
915 ADD_VLC_META_STRING( 18, URI );
916 ADD_META( 19, DBUS_TYPE_INT64, i_length );
918 dbus_message_iter_close_container( args, &dict );
923 #undef ADD_VLC_META_STRING