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
8adbb2d7
Commit
8adbb2d7
authored
Feb 22, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: Don't refer to media_preparsing as we don't have media_parsing.
parsing is simpler.
parent
8211292f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
35 deletions
+33
-35
include/vlc/libvlc_events.h
include/vlc/libvlc_events.h
+2
-2
include/vlc/libvlc_media.h
include/vlc/libvlc_media.h
+8
-6
src/control/event.c
src/control/event.c
+9
-9
src/control/media.c
src/control/media.c
+12
-16
test/libvlc/media.c
test/libvlc/media.c
+2
-2
No files found.
include/vlc/libvlc_events.h
View file @
8adbb2d7
...
@@ -49,7 +49,7 @@ enum libvlc_event_e {
...
@@ -49,7 +49,7 @@ enum libvlc_event_e {
libvlc_MediaMetaChanged
=
0
,
libvlc_MediaMetaChanged
=
0
,
libvlc_MediaSubItemAdded
,
libvlc_MediaSubItemAdded
,
libvlc_MediaDurationChanged
,
libvlc_MediaDurationChanged
,
libvlc_MediaP
rep
arsedChanged
,
libvlc_MediaParsedChanged
,
libvlc_MediaFreed
,
libvlc_MediaFreed
,
libvlc_MediaStateChanged
,
libvlc_MediaStateChanged
,
...
@@ -127,7 +127,7 @@ typedef struct libvlc_event_t
...
@@ -127,7 +127,7 @@ typedef struct libvlc_event_t
struct
struct
{
{
int
new_status
;
int
new_status
;
}
media_p
rep
arsed_changed
;
}
media_parsed_changed
;
struct
struct
{
{
libvlc_media_t
*
md
;
libvlc_media_t
*
md
;
...
...
include/vlc/libvlc_media.h
View file @
8adbb2d7
...
@@ -398,12 +398,12 @@ libvlc_media_parse(libvlc_media_t *media);
...
@@ -398,12 +398,12 @@ libvlc_media_parse(libvlc_media_t *media);
* This fetches (local) meta data and tracks information.
* This fetches (local) meta data and tracks information.
* The method is the asynchronous of libvlc_media_parse_async().
* The method is the asynchronous of libvlc_media_parse_async().
*
*
* To track when this is over you can listen to libvlc_MediaP
rep
arsedChanged
* To track when this is over you can listen to libvlc_MediaParsedChanged
* event. However if the media was already p
rep
arsed you will not receive this
* event. However if the media was already parsed you will not receive this
* event.
* event.
*
*
* \see libvlc_media_parse
* \see libvlc_media_parse
* \see libvlc_MediaP
rep
arsedChanged
* \see libvlc_MediaParsedChanged
* \see libvlc_media_get_meta
* \see libvlc_media_get_meta
* \see libvlc_media_get_tracks_info
* \see libvlc_media_get_tracks_info
*
*
...
@@ -413,13 +413,15 @@ VLC_PUBLIC_API void
...
@@ -413,13 +413,15 @@ VLC_PUBLIC_API void
libvlc_media_parse_async
(
libvlc_media_t
*
media
);
libvlc_media_parse_async
(
libvlc_media_t
*
media
);
/**
/**
* Get preparsed status for media descriptor object.
* Get Parsed status for media descriptor object.
*
* \see libvlc_MediaParsedChanged
*
*
* \param p_md media descriptor object
* \param p_md media descriptor object
* \return true if media object has been p
rep
arsed otherwise it returns false
* \return true if media object has been parsed otherwise it returns false
*/
*/
VLC_PUBLIC_API
int
VLC_PUBLIC_API
int
libvlc_media_is_p
rep
arsed
(
libvlc_media_t
*
p_md
);
libvlc_media_is_parsed
(
libvlc_media_t
*
p_md
);
/**
/**
* Sets media descriptor's user_data. user_data is specialized data
* Sets media descriptor's user_data. user_data is specialized data
...
...
src/control/event.c
View file @
8adbb2d7
...
@@ -212,10 +212,10 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
...
@@ -212,10 +212,10 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
else
else
{
{
/* The listener wants to block the emitter during event callback */
/* The listener wants to block the emitter during event callback */
listener_cached
->
pf_callback
(
p_event
,
listener_cached
->
p_user_data
);
listener_cached
->
pf_callback
(
p_event
,
listener_cached
->
p_user_data
);
listener_cached
++
;
listener_cached
++
;
if
(
listeners_group
->
b_sublistener_removed
)
if
(
listeners_group
->
b_sublistener_removed
)
{
{
/* If a callback was removed, this gets called */
/* If a callback was removed, this gets called */
...
@@ -228,7 +228,7 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
...
@@ -228,7 +228,7 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
listener_cached
++
;
listener_cached
++
;
continue
;
continue
;
}
}
}
}
}
}
}
}
vlc_mutex_unlock
(
&
p_em
->
event_sending_lock
);
vlc_mutex_unlock
(
&
p_em
->
event_sending_lock
);
...
@@ -252,7 +252,7 @@ static const event_name_t event_list[] = {
...
@@ -252,7 +252,7 @@ static const event_name_t event_list[] = {
DEF
(
MediaMetaChanged
)
DEF
(
MediaMetaChanged
)
DEF
(
MediaSubItemAdded
)
DEF
(
MediaSubItemAdded
)
DEF
(
MediaDurationChanged
)
DEF
(
MediaDurationChanged
)
DEF
(
MediaP
rep
arsedChanged
)
DEF
(
MediaParsedChanged
)
DEF
(
MediaFreed
)
DEF
(
MediaFreed
)
DEF
(
MediaStateChanged
)
DEF
(
MediaStateChanged
)
...
@@ -333,16 +333,16 @@ int event_attach( libvlc_event_manager_t * p_event_manager,
...
@@ -333,16 +333,16 @@ int event_attach( libvlc_event_manager_t * p_event_manager,
libvlc_event_listeners_group_t
*
listeners_group
;
libvlc_event_listeners_group_t
*
listeners_group
;
libvlc_event_listener_t
*
listener
;
libvlc_event_listener_t
*
listener
;
int
i
;
int
i
;
listener
=
malloc
(
sizeof
(
libvlc_event_listener_t
));
listener
=
malloc
(
sizeof
(
libvlc_event_listener_t
));
if
(
unlikely
(
listener
==
NULL
)
)
if
(
unlikely
(
listener
==
NULL
)
)
return
ENOMEM
;
return
ENOMEM
;
listener
->
event_type
=
event_type
;
listener
->
event_type
=
event_type
;
listener
->
p_user_data
=
p_user_data
;
listener
->
p_user_data
=
p_user_data
;
listener
->
pf_callback
=
pf_callback
;
listener
->
pf_callback
=
pf_callback
;
listener
->
is_asynchronous
=
is_asynchronous
;
listener
->
is_asynchronous
=
is_asynchronous
;
vlc_mutex_lock
(
&
p_event_manager
->
object_lock
);
vlc_mutex_lock
(
&
p_event_manager
->
object_lock
);
for
(
i
=
0
;
i
<
vlc_array_count
(
&
p_event_manager
->
listeners_groups
);
i
++
)
for
(
i
=
0
;
i
<
vlc_array_count
(
&
p_event_manager
->
listeners_groups
);
i
++
)
{
{
...
@@ -355,7 +355,7 @@ int event_attach( libvlc_event_manager_t * p_event_manager,
...
@@ -355,7 +355,7 @@ int event_attach( libvlc_event_manager_t * p_event_manager,
}
}
}
}
vlc_mutex_unlock
(
&
p_event_manager
->
object_lock
);
vlc_mutex_unlock
(
&
p_event_manager
->
object_lock
);
free
(
listener
);
free
(
listener
);
fprintf
(
stderr
,
"This object event manager doesn't know about '%s' events"
,
fprintf
(
stderr
,
"This object event manager doesn't know about '%s' events"
,
libvlc_event_type_name
(
event_type
)
);
libvlc_event_type_name
(
event_type
)
);
...
@@ -405,7 +405,7 @@ void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
...
@@ -405,7 +405,7 @@ void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
libvlc_event_listener_t
*
listener
;
libvlc_event_listener_t
*
listener
;
int
i
,
j
;
int
i
,
j
;
bool
found
=
false
;
bool
found
=
false
;
vlc_mutex_lock
(
&
p_event_manager
->
event_sending_lock
);
vlc_mutex_lock
(
&
p_event_manager
->
event_sending_lock
);
vlc_mutex_lock
(
&
p_event_manager
->
object_lock
);
vlc_mutex_lock
(
&
p_event_manager
->
object_lock
);
for
(
i
=
0
;
i
<
vlc_array_count
(
&
p_event_manager
->
listeners_groups
);
i
++
)
for
(
i
=
0
;
i
<
vlc_array_count
(
&
p_event_manager
->
listeners_groups
);
i
++
)
...
...
src/control/media.c
View file @
8adbb2d7
...
@@ -172,8 +172,8 @@ static void input_item_preparsed_changed(const vlc_event_t *p_event,
...
@@ -172,8 +172,8 @@ static void input_item_preparsed_changed(const vlc_event_t *p_event,
/* Construct the event */
/* Construct the event */
event
.
type
=
libvlc_MediaP
rep
arsedChanged
;
event
.
type
=
libvlc_MediaParsedChanged
;
event
.
u
.
media_p
rep
arsed_changed
.
new_status
=
event
.
u
.
media_parsed_changed
.
new_status
=
p_event
->
u
.
input_item_preparsed_changed
.
new_status
;
p_event
->
u
.
input_item_preparsed_changed
.
new_status
;
/* Send the event */
/* Send the event */
...
@@ -284,18 +284,14 @@ libvlc_media_t * libvlc_media_new_from_input_item(
...
@@ -284,18 +284,14 @@ libvlc_media_t * libvlc_media_new_from_input_item(
free
(
p_md
);
free
(
p_md
);
return
NULL
;
return
NULL
;
}
}
libvlc_event_manager_register_event_type
(
p_md
->
p_event_manager
,
libvlc_MediaMetaChanged
);
libvlc_event_manager_t
*
em
=
p_md
->
p_event_manager
;
libvlc_event_manager_register_event_type
(
p_md
->
p_event_manager
,
libvlc_event_manager_register_event_type
(
em
,
libvlc_MediaMetaChanged
);
libvlc_MediaSubItemAdded
);
libvlc_event_manager_register_event_type
(
em
,
libvlc_MediaSubItemAdded
);
libvlc_event_manager_register_event_type
(
p_md
->
p_event_manager
,
libvlc_event_manager_register_event_type
(
em
,
libvlc_MediaFreed
);
libvlc_MediaFreed
);
libvlc_event_manager_register_event_type
(
em
,
libvlc_MediaDurationChanged
);
libvlc_event_manager_register_event_type
(
p_md
->
p_event_manager
,
libvlc_event_manager_register_event_type
(
em
,
libvlc_MediaStateChanged
);
libvlc_MediaDurationChanged
);
libvlc_event_manager_register_event_type
(
em
,
libvlc_MediaParsedChanged
);
libvlc_event_manager_register_event_type
(
p_md
->
p_event_manager
,
libvlc_MediaStateChanged
);
libvlc_event_manager_register_event_type
(
p_md
->
p_event_manager
,
libvlc_MediaPreparsedChanged
);
vlc_gc_incref
(
p_md
->
p_input_item
);
vlc_gc_incref
(
p_md
->
p_input_item
);
...
@@ -641,10 +637,10 @@ libvlc_media_parse_async(libvlc_media_t *media)
...
@@ -641,10 +637,10 @@ libvlc_media_parse_async(libvlc_media_t *media)
}
}
/**************************************************************************
/**************************************************************************
* Get p
rep
arsed status for media object.
* Get parsed status for media object.
**************************************************************************/
**************************************************************************/
int
int
libvlc_media_is_p
rep
arsed
(
libvlc_media_t
*
p_md
)
libvlc_media_is_parsed
(
libvlc_media_t
*
p_md
)
{
{
assert
(
p_md
);
assert
(
p_md
);
...
...
test/libvlc/media.c
View file @
8adbb2d7
...
@@ -47,7 +47,7 @@ static void test_media_preparsed(const char** argv, int argc)
...
@@ -47,7 +47,7 @@ static void test_media_preparsed(const char** argv, int argc)
// Check to see if we are properly receiving the event.
// Check to see if we are properly receiving the event.
libvlc_event_manager_t
*
em
=
libvlc_media_event_manager
(
media
);
libvlc_event_manager_t
*
em
=
libvlc_media_event_manager
(
media
);
libvlc_event_attach
(
em
,
libvlc_MediaP
rep
arsedChanged
,
preparsed_changed
,
(
void
*
)
&
received
);
libvlc_event_attach
(
em
,
libvlc_MediaParsedChanged
,
preparsed_changed
,
(
void
*
)
&
received
);
// Parse the media. This is synchronous.
// Parse the media. This is synchronous.
libvlc_media_parse
(
media
);
libvlc_media_parse
(
media
);
...
@@ -57,7 +57,7 @@ static void test_media_preparsed(const char** argv, int argc)
...
@@ -57,7 +57,7 @@ static void test_media_preparsed(const char** argv, int argc)
// We are good, now check Elementary Stream info.
// We are good, now check Elementary Stream info.
libvlc_media_track_info_t
*
tracks
;
libvlc_media_track_info_t
*
tracks
;
int
num
=
libvlc_media_get_
es
(
media
,
&
tracks
);
int
num
=
libvlc_media_get_
tracks_info
(
media
,
&
tracks
);
assert
(
num
>
0
);
assert
(
num
>
0
);
free
(
tracks
);
free
(
tracks
);
...
...
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