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
561d5ca2
Commit
561d5ca2
authored
Jan 10, 2012
by
Edward Wang
Committed by
Jean-Baptiste Kempf
Mar 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export services_discovery_RemoveAll
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
170a67b5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
0 deletions
+54
-0
include/vlc_events.h
include/vlc_events.h
+1
-0
include/vlc_services_discovery.h
include/vlc_services_discovery.h
+1
-0
lib/media_discoverer.c
lib/media_discoverer.c
+24
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/playlist/services_discovery.c
src/playlist/services_discovery.c
+27
-0
No files found.
include/vlc_events.h
View file @
561d5ca2
...
...
@@ -127,6 +127,7 @@ typedef enum vlc_event_type_t {
/* Service Discovery event */
vlc_ServicesDiscoveryItemAdded
,
vlc_ServicesDiscoveryItemRemoved
,
vlc_ServicesDiscoveryItemRemoveAll
,
vlc_ServicesDiscoveryStarted
,
vlc_ServicesDiscoveryEnded
}
vlc_event_type_t
;
...
...
include/vlc_services_discovery.h
View file @
561d5ca2
...
...
@@ -157,6 +157,7 @@ VLC_API vlc_event_manager_t * services_discovery_EventManager( services_discover
* for more options, directly set the (meta) data on the input item */
VLC_API
void
services_discovery_AddItem
(
services_discovery_t
*
p_this
,
input_item_t
*
p_item
,
const
char
*
psz_category
);
VLC_API
void
services_discovery_RemoveItem
(
services_discovery_t
*
p_this
,
input_item_t
*
p_item
);
VLC_API
void
services_discovery_RemoveAll
(
services_discovery_t
*
p_sd
);
/* SD probing */
...
...
lib/media_discoverer.c
View file @
561d5ca2
...
...
@@ -128,6 +128,22 @@ static void services_discovery_item_removed( const vlc_event_t * p_event,
libvlc_media_list_unlock
(
p_mdis
->
p_mlist
);
}
/**************************************************************************
* services_discovery_removeall (Private) (VLC event callback)
**************************************************************************/
static
void
services_discovery_removeall
(
const
vlc_event_t
*
p_event
,
void
*
user_data
)
{
libvlc_media_discoverer_t
*
p_mdis
=
user_data
;
libvlc_media_list_lock
(
p_mdis
->
p_mlist
);
for
(
int
i
=
0
;
i
<
libvlc_media_list_count
(
p_mdis
->
p_mlist
);
i
++
)
{
_libvlc_media_list_remove_index
(
p_mdis
->
p_mlist
,
i
);
}
libvlc_media_list_unlock
(
p_mdis
->
p_mlist
);
}
/**************************************************************************
* services_discovery_started (Private) (VLC event callback)
**************************************************************************/
...
...
@@ -226,6 +242,10 @@ libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
vlc_ServicesDiscoveryEnded
,
services_discovery_ended
,
p_mdis
);
vlc_event_attach
(
services_discovery_EventManager
(
p_mdis
->
p_sd
),
vlc_ServicesDiscoveryItemRemoveAll
,
services_discovery_removeall
,
p_mdis
);
/* Here we go */
if
(
!
vlc_sd_Start
(
p_mdis
->
p_sd
)
)
...
...
@@ -265,6 +285,10 @@ libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis )
vlc_ServicesDiscoveryEnded
,
services_discovery_ended
,
p_mdis
);
vlc_event_detach
(
services_discovery_EventManager
(
p_mdis
->
p_sd
),
vlc_ServicesDiscoveryItemRemoveAll
,
services_discovery_removeall
,
p_mdis
);
libvlc_media_list_release
(
p_mdis
->
p_mlist
);
...
...
src/libvlccore.sym
View file @
561d5ca2
...
...
@@ -381,6 +381,7 @@ secstotimestr
services_discovery_AddItem
services_discovery_EventManager
services_discovery_GetLocalizedName
services_discovery_RemoveAll
services_discovery_RemoveItem
sout_AccessOutControl
sout_AccessOutDelete
...
...
src/playlist/services_discovery.c
View file @
561d5ca2
...
...
@@ -120,6 +120,7 @@ services_discovery_t *vlc_sd_Create( vlc_object_t *p_super,
vlc_event_manager_init
(
em
,
p_sd
);
vlc_event_manager_register_event_type
(
em
,
vlc_ServicesDiscoveryItemAdded
);
vlc_event_manager_register_event_type
(
em
,
vlc_ServicesDiscoveryItemRemoved
);
vlc_event_manager_register_event_type
(
em
,
vlc_ServicesDiscoveryItemRemoveAll
);
vlc_event_manager_register_event_type
(
em
,
vlc_ServicesDiscoveryStarted
);
vlc_event_manager_register_event_type
(
em
,
vlc_ServicesDiscoveryEnded
);
...
...
@@ -207,6 +208,18 @@ services_discovery_EventManager ( services_discovery_t * p_sd )
return
&
p_sd
->
event_manager
;
}
/*******************************************************************//**
* Remove all items from the Service Discovery listing
***********************************************************************/
void
services_discovery_RemoveAll
(
services_discovery_t
*
p_sd
)
{
vlc_event_t
event
;
event
.
type
=
vlc_ServicesDiscoveryItemRemoveAll
;
vlc_event_send
(
&
p_sd
->
event_manager
,
&
event
);
}
/*******************************************************************//**
* Add an item to the Service Discovery listing
***********************************************************************/
...
...
@@ -306,6 +319,17 @@ static void playlist_sd_item_removed( const vlc_event_t * p_event, void * user_d
PL_UNLOCK
;
}
/* A request to remove all ideas from SD */
static
void
playlist_sd_item_removeall
(
const
vlc_event_t
*
p_event
,
void
*
user_data
)
{
playlist_item_t
*
p_sd_node
=
user_data
;
if
(
p_sd_node
==
NULL
)
return
;
playlist_t
*
p_playlist
=
p_sd_node
->
p_playlist
;
PL_LOCK
;
playlist_NodeEmpty
(
p_playlist
,
p_sd_node
,
true
);
PL_UNLOCK
;
}
int
playlist_ServicesDiscoveryAdd
(
playlist_t
*
p_playlist
,
const
char
*
psz_name
)
{
...
...
@@ -355,6 +379,9 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist,
vlc_event_attach
(
em
,
vlc_ServicesDiscoveryItemRemoved
,
playlist_sd_item_removed
,
p_node
);
vlc_event_attach
(
em
,
vlc_ServicesDiscoveryItemRemoveAll
,
playlist_sd_item_removeall
,
p_node
);
if
(
!
vlc_sd_Start
(
p_sd
)
)
{
vlc_sd_Destroy
(
p_sd
);
...
...
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