Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
0222328d
Commit
0222328d
authored
Aug 21, 2007
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Advertises signals and renames VLC_ defines to MPRIS_
parent
d112d7e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
17 deletions
+27
-17
modules/control/dbus.c
modules/control/dbus.c
+8
-7
modules/control/dbus.h
modules/control/dbus.h
+19
-10
No files found.
modules/control/dbus.c
View file @
0222328d
...
...
@@ -323,7 +323,7 @@ DBUS_METHOD( Disconnect )
DBusError
error
;
int
i
;
dbus_error_init
(
&
error
);
i
=
dbus_bus_release_name
(
p_conn
,
"org.mpris.vlc"
,
&
error
);
i
=
dbus_bus_release_name
(
p_conn
,
VLC_MPRIS_DBUS_SERVICE
,
&
error
);
if
(
(
i
==
-
1
)
&&
(
dbus_error_is_set
(
&
error
)
)
)
{
msg_Err
(
(
vlc_object_t
*
)
p_this
,
"D-Bus disconnection failed : %s
\n
"
,
...
...
@@ -640,7 +640,7 @@ DBUS_METHOD( handle_introspect_tracklist )
*****************************************************************************/
#define METHOD_FUNC( method, function ) \
else if( dbus_message_is_method_call( p_from,
VLC
_DBUS_INTERFACE, method ) )\
else if( dbus_message_is_method_call( p_from,
MPRIS
_DBUS_INTERFACE, method ) )\
return function( p_conn, p_from, p_this )
DBUS_METHOD
(
handle_root
)
...
...
@@ -734,21 +734,22 @@ static int Open( vlc_object_t *p_this )
}
/* register a well-known name on the bus */
dbus_bus_request_name
(
p_conn
,
"org.mpris.vlc"
,
0
,
&
error
);
dbus_bus_request_name
(
p_conn
,
VLC_MPRIS_DBUS_SERVICE
,
0
,
&
error
);
if
(
dbus_error_is_set
(
&
error
)
)
{
msg_Err
(
p_this
,
"Error requesting org.mpris.vlc service:"
" %s
\n
"
,
error
.
message
);
msg_Err
(
p_this
,
"Error requesting % service: %s
\n
"
VLC_MPRIS_DBUS_SERVICE
,
error
.
message
);
dbus_error_free
(
&
error
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
/* we register the objects */
dbus_connection_register_object_path
(
p_conn
,
VLC
_DBUS_ROOT_PATH
,
dbus_connection_register_object_path
(
p_conn
,
MPRIS
_DBUS_ROOT_PATH
,
&
vlc_dbus_root_vtable
,
p_this
);
dbus_connection_register_object_path
(
p_conn
,
VLC
_DBUS_PLAYER_PATH
,
dbus_connection_register_object_path
(
p_conn
,
MPRIS
_DBUS_PLAYER_PATH
,
&
vlc_dbus_player_vtable
,
p_this
);
dbus_connection_register_object_path
(
p_conn
,
VLC
_DBUS_TRACKLIST_PATH
,
dbus_connection_register_object_path
(
p_conn
,
MPRIS
_DBUS_TRACKLIST_PATH
,
&
vlc_dbus_tracklist_vtable
,
p_this
);
dbus_connection_flush
(
p_conn
);
...
...
modules/control/dbus.h
View file @
0222328d
...
...
@@ -25,11 +25,11 @@
/* DBUS IDENTIFIERS */
/* name registered on the session bus */
#define VLC_
DBUS_SERVICE
"org.mpris.vlc"
#define
VLC_DBUS_INTERFACE
"org.freedesktop.MediaPlayer"
#define
VLC_DBUS_ROOT_PATH
"/"
#define
VLC_DBUS_PLAYER_PATH
"/Player"
#define
VLC_DBUS_TRACKLIST_PATH
"/TrackList"
#define VLC_
MPRIS_DBUS_SERVICE
"org.mpris.vlc"
#define
MPRIS_DBUS_INTERFACE
"org.freedesktop.MediaPlayer"
#define
MPRIS_DBUS_ROOT_PATH
"/"
#define
MPRIS_DBUS_PLAYER_PATH
"/Player"
#define
MPRIS_DBUS_TRACKLIST_PATH
"/TrackList"
/* MACROS */
...
...
@@ -54,8 +54,8 @@
return DBUS_HANDLER_RESULT_HANDLED
#define SIGNAL_INIT( signal ) \
DBusMessage *p_msg = dbus_message_new_signal(
VLC
_DBUS_PLAYER_PATH, \
VLC
_DBUS_INTERFACE, signal ); \
DBusMessage *p_msg = dbus_message_new_signal(
MPRIS
_DBUS_PLAYER_PATH, \
MPRIS
_DBUS_INTERFACE, signal ); \
if( !p_msg ) return DBUS_HANDLER_RESULT_NEED_MEMORY; \
#define SIGNAL_SEND \
...
...
@@ -149,6 +149,15 @@ const char* psz_introspection_xml_data_player =
" </method>
\n
"
" <method name=
\"
Disconnect
\"
>
\n
"
" </method>
\n
"
" <signal name=
\"
TrackChange
\"
>
\n
"
" <arg type=
\"
a{sv}
\"
/>
\n
"
" </signal>
\n
"
" <signal name=
\"
StatusChange
\"
>
\n
"
" <arg type=
\"
i
\"
>
\n
"
" </signal>
\n
"
" <signal name=
\"
CapsChange
\"
>
\n
"
" <arg type=
\"
i
\"
>
\n
"
" </signal>
\n
"
" </interface>
\n
"
"</node>
\n
"
;
...
...
@@ -190,9 +199,9 @@ const char* psz_introspection_xml_data_tracklist =
"</node>
\n
"
;
#define
VLC
_DBUS_ROOT_PATH "/"
#define
VLC
_DBUS_PLAYER_PATH "/Player"
#define
VLC
_DBUS_TRACKLIST_PATH "/TrackList"
#define
MPRIS
_DBUS_ROOT_PATH "/"
#define
MPRIS
_DBUS_PLAYER_PATH "/Player"
#define
MPRIS
_DBUS_TRACKLIST_PATH "/TrackList"
/* Handle messages reception */
DBUS_METHOD
(
handle_root
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment