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
728d2811
Commit
728d2811
authored
Aug 16, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
control/media_descriptor.c: Forward vlc_InputItemSubItemAdded event.
parent
42ab1e40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
include/vlc/libvlc_structures.h
include/vlc/libvlc_structures.h
+5
-0
src/control/media_descriptor.c
src/control/media_descriptor.c
+35
-0
No files found.
include/vlc/libvlc_structures.h
View file @
728d2811
...
@@ -242,6 +242,7 @@ typedef struct libvlc_log_message_t
...
@@ -242,6 +242,7 @@ typedef struct libvlc_log_message_t
typedef
enum
libvlc_event_type_t
{
typedef
enum
libvlc_event_type_t
{
libvlc_MediaDescriptorMetaChanged
,
libvlc_MediaDescriptorMetaChanged
,
libvlc_MediaDescriptorSubItemAdded
,
libvlc_MediaInstanceReachedEnd
,
libvlc_MediaInstanceReachedEnd
,
libvlc_MediaListItemAdded
,
libvlc_MediaListItemAdded
,
libvlc_MediaListItemDeleted
,
libvlc_MediaListItemDeleted
,
...
@@ -266,6 +267,10 @@ typedef struct libvlc_event_t
...
@@ -266,6 +267,10 @@ typedef struct libvlc_event_t
libvlc_meta_t
meta_type
;
libvlc_meta_t
meta_type
;
}
media_descriptor_meta_changed
;
}
media_descriptor_meta_changed
;
struct
struct
{
libvlc_media_descriptor_t
*
new_child
;
}
media_descriptor_subitem_added
;
struct
{
{
libvlc_media_descriptor_t
*
item
;
libvlc_media_descriptor_t
*
item
;
int
index
;
int
index
;
...
...
src/control/media_descriptor.c
View file @
728d2811
...
@@ -69,6 +69,29 @@ static const libvlc_meta_t vlc_to_libvlc_meta[] =
...
@@ -69,6 +69,29 @@ static const libvlc_meta_t vlc_to_libvlc_meta[] =
[
vlc_meta_TrackID
]
=
libvlc_meta_TrackID
[
vlc_meta_TrackID
]
=
libvlc_meta_TrackID
};
};
/**************************************************************************
* input_item_subitem_added (Private) (vlc event Callback)
**************************************************************************/
static
void
input_item_subitem_added
(
const
vlc_event_t
*
p_event
,
void
*
user_data
)
{
libvlc_media_descriptor_t
*
p_md
=
user_data
;
libvlc_media_descriptor_t
*
p_md_child
;
libvlc_event_t
event
;
p_md_child
=
libvlc_media_descriptor_new_from_input_item
(
p_md
->
p_libvlc_instance
,
p_event
->
u
.
input_item_subitem_added
.
p_new_child
,
NULL
);
/* Construct the event */
event
.
type
=
libvlc_MediaDescriptorSubItemAdded
;
event
.
u
.
media_descriptor_subitem_added
.
new_child
=
p_md_child
;
/* Send the event */
libvlc_event_send
(
p_md
->
p_event_manager
,
&
event
);
libvlc_media_descriptor_release
(
p_md_child
);
}
/**************************************************************************
/**************************************************************************
* input_item_meta_changed (Private) (vlc event Callback)
* input_item_meta_changed (Private) (vlc event Callback)
**************************************************************************/
**************************************************************************/
...
@@ -93,6 +116,10 @@ static void input_item_meta_changed( const vlc_event_t *p_event,
...
@@ -93,6 +116,10 @@ static void input_item_meta_changed( const vlc_event_t *p_event,
**************************************************************************/
**************************************************************************/
static
void
install_input_item_observer
(
libvlc_media_descriptor_t
*
p_md
)
static
void
install_input_item_observer
(
libvlc_media_descriptor_t
*
p_md
)
{
{
vlc_event_attach
(
&
p_md
->
p_input_item
->
event_manager
,
vlc_InputItemSubItemAdded
,
input_item_subitem_added
,
p_md
);
vlc_event_attach
(
&
p_md
->
p_input_item
->
event_manager
,
vlc_event_attach
(
&
p_md
->
p_input_item
->
event_manager
,
vlc_InputItemMetaChanged
,
vlc_InputItemMetaChanged
,
input_item_meta_changed
,
input_item_meta_changed
,
...
@@ -104,6 +131,10 @@ static void install_input_item_observer( libvlc_media_descriptor_t *p_md )
...
@@ -104,6 +131,10 @@ static void install_input_item_observer( libvlc_media_descriptor_t *p_md )
**************************************************************************/
**************************************************************************/
static
void
uninstall_input_item_observer
(
libvlc_media_descriptor_t
*
p_md
)
static
void
uninstall_input_item_observer
(
libvlc_media_descriptor_t
*
p_md
)
{
{
vlc_event_detach
(
&
p_md
->
p_input_item
->
event_manager
,
vlc_InputItemSubItemAdded
,
input_item_subitem_added
,
p_md
);
vlc_event_detach
(
&
p_md
->
p_input_item
->
event_manager
,
vlc_event_detach
(
&
p_md
->
p_input_item
->
event_manager
,
vlc_InputItemMetaChanged
,
vlc_InputItemMetaChanged
,
input_item_meta_changed
,
input_item_meta_changed
,
...
@@ -148,8 +179,12 @@ libvlc_media_descriptor_t * libvlc_media_descriptor_new_from_input_item(
...
@@ -148,8 +179,12 @@ libvlc_media_descriptor_t * libvlc_media_descriptor_new_from_input_item(
p_md
->
b_preparsed
=
VLC_TRUE
;
p_md
->
b_preparsed
=
VLC_TRUE
;
p_md
->
i_refcount
=
1
;
p_md
->
i_refcount
=
1
;
p_md
->
p_event_manager
=
libvlc_event_manager_new
(
p_md
,
p_instance
,
p_e
);
p_md
->
p_event_manager
=
libvlc_event_manager_new
(
p_md
,
p_instance
,
p_e
);
libvlc_event_manager_register_event_type
(
p_md
->
p_event_manager
,
libvlc_event_manager_register_event_type
(
p_md
->
p_event_manager
,
libvlc_MediaDescriptorMetaChanged
,
p_e
);
libvlc_MediaDescriptorMetaChanged
,
p_e
);
libvlc_event_manager_register_event_type
(
p_md
->
p_event_manager
,
libvlc_MediaDescriptorSubItemAdded
,
p_e
);
vlc_gc_incref
(
p_md
->
p_input_item
);
vlc_gc_incref
(
p_md
->
p_input_item
);
install_input_item_observer
(
p_md
);
install_input_item_observer
(
p_md
);
...
...
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