Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
7438482f
Commit
7438482f
authored
Dec 25, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
control/media_discoverer.c: Forward started and ended event.
parent
b6880d76
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
2 deletions
+73
-2
include/vlc/libvlc_structures.h
include/vlc/libvlc_structures.h
+13
-0
src/control/media_discoverer.c
src/control/media_discoverer.c
+60
-2
No files found.
include/vlc/libvlc_structures.h
View file @
7438482f
...
@@ -321,6 +321,9 @@ typedef enum libvlc_event_type_t {
...
@@ -321,6 +321,9 @@ typedef enum libvlc_event_type_t {
libvlc_MediaListPlayerNextItemSet
,
libvlc_MediaListPlayerNextItemSet
,
libvlc_MediaListPlayerStopped
,
libvlc_MediaListPlayerStopped
,
libvlc_MediaDiscovererStarted
,
libvlc_MediaDiscovererEnded
}
libvlc_event_type_t
;
}
libvlc_event_type_t
;
/**
/**
...
@@ -411,6 +414,16 @@ typedef struct libvlc_event_t
...
@@ -411,6 +414,16 @@ typedef struct libvlc_event_t
libvlc_media_descriptor_t
*
item
;
libvlc_media_descriptor_t
*
item
;
int
index
;
int
index
;
}
media_list_view_will_delete_item
;
}
media_list_view_will_delete_item
;
/* media list view */
struct
{
void
*
unused
;
}
media_media_discoverer_started
;
struct
{
void
*
unused
;
}
media_media_discoverer_ended
;
}
u
;
}
u
;
}
libvlc_event_t
;
}
libvlc_event_t
;
...
...
src/control/media_discoverer.c
View file @
7438482f
...
@@ -57,7 +57,48 @@ static void services_discovery_item_added( const vlc_event_t * p_event,
...
@@ -57,7 +57,48 @@ static void services_discovery_item_added( const vlc_event_t * p_event,
static
void
services_discovery_item_removed
(
const
vlc_event_t
*
p_event
,
static
void
services_discovery_item_removed
(
const
vlc_event_t
*
p_event
,
void
*
user_data
)
void
*
user_data
)
{
{
/* Not handled */
input_item_t
*
p_item
=
p_event
->
u
.
services_discovery_item_added
.
p_new_item
;
libvlc_media_descriptor_t
*
p_md
;
libvlc_media_discoverer_t
*
p_mdis
=
user_data
;
int
i
,
count
=
libvlc_media_list_count
(
p_mdis
->
p_mlist
,
NULL
);
libvlc_media_list_lock
(
p_mdis
->
p_mlist
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
p_md
=
libvlc_media_list_item_at_index
(
p_mdis
->
p_mlist
,
i
,
NULL
);
if
(
p_md
->
p_input_item
==
p_item
)
{
libvlc_media_list_remove_index
(
p_mdis
->
p_mlist
,
i
,
NULL
);
break
;
}
}
libvlc_media_list_unlock
(
p_mdis
->
p_mlist
);
}
/**************************************************************************
* services_discovery_started (Private) (VLC event callback)
**************************************************************************/
static
void
services_discovery_started
(
const
vlc_event_t
*
p_event
,
void
*
user_data
)
{
libvlc_media_discoverer_t
*
p_mdis
=
user_data
;
libvlc_event_t
event
;
event
.
type
=
libvlc_MediaDiscovererStarted
;
libvlc_event_send
(
p_mdis
->
p_event_manager
,
&
event
);
}
/**************************************************************************
* services_discovery_ended (Private) (VLC event callback)
**************************************************************************/
static
void
services_discovery_ended
(
const
vlc_event_t
*
p_event
,
void
*
user_data
)
{
libvlc_media_discoverer_t
*
p_mdis
=
user_data
;
libvlc_event_t
event
;
event
.
type
=
libvlc_MediaDiscovererEnded
;
libvlc_event_send
(
p_mdis
->
p_event_manager
,
&
event
);
}
}
/*
/*
...
@@ -85,6 +126,15 @@ libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
...
@@ -85,6 +126,15 @@ libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
p_mdis
->
p_libvlc_instance
=
p_inst
;
p_mdis
->
p_libvlc_instance
=
p_inst
;
p_mdis
->
p_mlist
=
libvlc_media_list_new
(
p_inst
,
NULL
);
p_mdis
->
p_mlist
=
libvlc_media_list_new
(
p_inst
,
NULL
);
p_mdis
->
p_event_manager
=
libvlc_event_manager_new
(
p_mdis
,
p_inst
,
NULL
);
libvlc_event_manager_register_event_type
(
p_mdis
->
p_event_manager
,
libvlc_MediaDiscovererStarted
,
NULL
);
libvlc_event_manager_register_event_type
(
p_mdis
->
p_event_manager
,
libvlc_MediaDiscovererEnded
,
NULL
);
p_mdis
->
p_sd
=
services_discovery_Create
(
(
vlc_object_t
*
)
p_inst
->
p_libvlc_int
,
psz_name
);
p_mdis
->
p_sd
=
services_discovery_Create
(
(
vlc_object_t
*
)
p_inst
->
p_libvlc_int
,
psz_name
);
if
(
!
p_mdis
->
p_sd
)
if
(
!
p_mdis
->
p_sd
)
...
@@ -102,6 +152,14 @@ libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
...
@@ -102,6 +152,14 @@ libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
vlc_ServicesDiscoveryItemRemoved
,
vlc_ServicesDiscoveryItemRemoved
,
services_discovery_item_removed
,
services_discovery_item_removed
,
p_mdis
);
p_mdis
);
vlc_event_attach
(
services_discovery_EventManager
(
p_mdis
->
p_sd
),
vlc_ServicesDiscoveryStarted
,
services_discovery_started
,
p_mdis
);
vlc_event_attach
(
services_discovery_EventManager
(
p_mdis
->
p_sd
),
vlc_ServicesDiscoveryEnded
,
services_discovery_ended
,
p_mdis
);
services_discovery_Start
(
p_mdis
->
p_sd
);
services_discovery_Start
(
p_mdis
->
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