Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
a60a86bd
Commit
a60a86bd
authored
Oct 18, 2010
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SD: add a function to query a service discovery for more items.
parent
698853e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
0 deletions
+42
-0
include/vlc_playlist.h
include/vlc_playlist.h
+2
-0
include/vlc_services_discovery.h
include/vlc_services_discovery.h
+16
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/playlist/services_discovery.c
src/playlist/services_discovery.c
+23
-0
No files found.
include/vlc_playlist.h
View file @
a60a86bd
...
...
@@ -323,6 +323,8 @@ VLC_EXPORT( int, playlist_ServicesDiscoveryAdd, (playlist_t *, const char *));
VLC_EXPORT
(
int
,
playlist_ServicesDiscoveryRemove
,
(
playlist_t
*
,
const
char
*
));
/** Check whether a given SD is loaded */
VLC_EXPORT
(
bool
,
playlist_IsServicesDiscoveryLoaded
,
(
playlist_t
*
,
const
char
*
));
/** Query a services discovery */
VLC_EXPORT
(
int
,
playlist_QueryServicesDiscovery
,
(
playlist_t
*
,
const
char
*
,
const
char
*
)
);
...
...
include/vlc_services_discovery.h
View file @
a60a86bd
...
...
@@ -51,6 +51,8 @@ struct services_discovery_t
char
*
psz_name
;
config_chain_t
*
p_cfg
;
int
(
*
pf_search
)
(
services_discovery_t
*
,
const
char
*
);
services_discovery_sys_t
*
p_sys
;
};
...
...
@@ -66,6 +68,20 @@ enum services_discovery_category_e
* Service Discovery
***********************************************************************/
/**
* Ask for a research in the SD
* @param p_sd: the Service Discovery
* @param psz_query: the query
* @return VLC_SUCCESS in case of success, the error code overwise
*/
static
inline
int
vlc_sd_search
(
services_discovery_t
*
p_sd
,
const
char
*
psz_query
)
{
if
(
p_sd
->
pf_search
)
return
p_sd
->
pf_search
(
p_sd
,
psz_query
);
else
return
VLC_EGENERIC
;
}
/* Get the services discovery modules names to use in Create(), in a null
* terminated string array. Array and string must be freed after use. */
VLC_EXPORT
(
char
**
,
vlc_sd_GetNames
,
(
vlc_object_t
*
,
char
***
,
int
**
)
LIBVLC_USED
);
...
...
src/libvlccore.sym
View file @
a60a86bd
...
...
@@ -362,6 +362,7 @@ playlist_NodeDelete
playlist_NodeInsert
playlist_NodeRemoveItem
playlist_PreparseEnqueue
playlist_QueryServicesDiscovery
playlist_RecursiveNodeSort
playlist_ServicesDiscoveryAdd
playlist_ServicesDiscoveryRemove
...
...
src/playlist/services_discovery.c
View file @
a60a86bd
...
...
@@ -440,6 +440,29 @@ bool playlist_IsServicesDiscoveryLoaded( playlist_t * p_playlist,
return
found
;
}
int
playlist_QueryServicesDiscovery
(
playlist_t
*
p_playlist
,
const
char
*
psz_name
,
const
char
*
psz_query
)
{
playlist_private_t
*
priv
=
pl_priv
(
p_playlist
);
int
i_ret
=
VLC_EGENERIC
;
int
i
;
PL_LOCK
;
for
(
i
=
0
;
i
<
priv
->
i_sds
;
i
++
)
{
vlc_sd_internal_t
*
sd
=
priv
->
pp_sds
[
i
];
if
(
sd
->
psz_name
&&
!
strcmp
(
psz_name
,
sd
->
psz_name
)
)
{
i_ret
=
vlc_sd_search
(
sd
->
p_sd
,
psz_query
);
break
;
}
}
assert
(
i
!=
priv
->
i_sds
);
PL_UNLOCK
;
return
i_ret
;
}
void
playlist_ServicesDiscoveryKillAll
(
playlist_t
*
p_playlist
)
{
playlist_private_t
*
priv
=
pl_priv
(
p_playlist
);
...
...
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