Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
8211292f
Commit
8211292f
authored
Feb 22, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libvlc: libvlc_media_get_es->libvlc_media_get_tracks_info.
parent
ad916056
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
28 deletions
+41
-28
include/vlc/libvlc_media.h
include/vlc/libvlc_media.h
+29
-16
src/control/media.c
src/control/media.c
+7
-7
src/libvlc.sym
src/libvlc.sym
+1
-1
test/libvlc/media.c
test/libvlc/media.c
+4
-4
No files found.
include/vlc/libvlc_media.h
View file @
8211292f
...
@@ -100,13 +100,13 @@ enum
...
@@ -100,13 +100,13 @@ enum
libvlc_media_option_unique
=
0x100
libvlc_media_option_unique
=
0x100
};
};
typedef
enum
libvlc_
es
_type_t
typedef
enum
libvlc_
track
_type_t
{
{
libvlc_
es
_unknown
=
-
1
,
libvlc_
track
_unknown
=
-
1
,
libvlc_
es
_audio
=
0
,
libvlc_
track
_audio
=
0
,
libvlc_
es
_video
=
1
,
libvlc_
track
_video
=
1
,
libvlc_
es
_text
=
2
,
libvlc_
track
_text
=
2
,
}
libvlc_
es
_type_t
;
}
libvlc_
track
_type_t
;
/** defgroup libvlc_media_stats_t LibVLC media statistics
/** defgroup libvlc_media_stats_t LibVLC media statistics
* \ingroup libvlc_media
* \ingroup libvlc_media
...
@@ -143,12 +143,12 @@ typedef struct libvlc_media_stats_t
...
@@ -143,12 +143,12 @@ typedef struct libvlc_media_stats_t
}
libvlc_media_stats_t
;
}
libvlc_media_stats_t
;
/** @}*/
/** @}*/
typedef
struct
libvlc_media_
es
_t
typedef
struct
libvlc_media_
track_info
_t
{
{
/* Codec fourcc */
/* Codec fourcc */
uint32_t
i_codec
;
uint32_t
i_codec
;
int
i_id
;
int
i_id
;
libvlc_
es
_type_t
i_type
;
libvlc_
track
_type_t
i_type
;
/* Codec specific */
/* Codec specific */
int
i_profile
;
int
i_profile
;
...
@@ -162,7 +162,7 @@ typedef struct libvlc_media_es_t
...
@@ -162,7 +162,7 @@ typedef struct libvlc_media_es_t
unsigned
i_height
;
unsigned
i_height
;
unsigned
i_width
;
unsigned
i_width
;
}
libvlc_media_
es
_t
;
}
libvlc_media_
track_info
_t
;
/**
/**
...
@@ -385,7 +385,7 @@ VLC_PUBLIC_API libvlc_time_t
...
@@ -385,7 +385,7 @@ VLC_PUBLIC_API libvlc_time_t
*
*
* \see libvlc_media_parse_async
* \see libvlc_media_parse_async
* \see libvlc_media_get_meta
* \see libvlc_media_get_meta
* \see libvlc_media_get_
es
* \see libvlc_media_get_
tracks_info
*
*
* \param media media descriptor object
* \param media media descriptor object
*/
*/
...
@@ -405,7 +405,7 @@ libvlc_media_parse(libvlc_media_t *media);
...
@@ -405,7 +405,7 @@ libvlc_media_parse(libvlc_media_t *media);
* \see libvlc_media_parse
* \see libvlc_media_parse
* \see libvlc_MediaPreparsedChanged
* \see libvlc_MediaPreparsedChanged
* \see libvlc_media_get_meta
* \see libvlc_media_get_meta
* \see libvlc_media_get_
es
* \see libvlc_media_get_
tracks_info
*
*
* \param media media descriptor object
* \param media media descriptor object
*/
*/
...
@@ -448,15 +448,28 @@ VLC_PUBLIC_API void *
...
@@ -448,15 +448,28 @@ VLC_PUBLIC_API void *
*
*
* Note, you need to play the media _one_ time with --sout="#description"
* Note, you need to play the media _one_ time with --sout="#description"
* Not doing this will result in an empty array, and doing it more than once
* Not doing this will result in an empty array, and doing it more than once
* will duplicate the entries in the array each time.
* will duplicate the entries in the array each time.
Something like this:
*
*
* \param p_md media descriptor object
* @begincode
* \param pp_es address to store an allocated array of Elementary Streams descriptions (must be freed by the caller)
* libvlc_media_player_t *player = libvlc_media_player_new_from_media(media);
* libvlc_media_add_option_flag(media, "sout=\"#description\"");
* libvlc_media_player_play(player);
* // ... wait until playing
* libvlc_media_player_release(player);
* @endcode
*
* This is very likely to change in next release, and be done at the parsing
* phase.
*
* \param media media descriptor object
* \param tracks address to store an allocated array of Elementary Streams
* descriptions (must be freed by the caller)
*
*
* return the number of Elementary Streams
* return the number of Elementary Streams
*/
*/
VLC_PUBLIC_API
int
VLC_PUBLIC_API
libvlc_media_get_es
(
libvlc_media_t
*
p_md
,
libvlc_media_es_t
**
pp_es
);
int
libvlc_media_get_tracks_info
(
libvlc_media_t
*
media
,
libvlc_media_track_info_t
**
tracks
);
/** @}*/
/** @}*/
...
...
src/control/media.c
View file @
8211292f
...
@@ -682,7 +682,7 @@ libvlc_media_get_user_data( libvlc_media_t * p_md )
...
@@ -682,7 +682,7 @@ libvlc_media_get_user_data( libvlc_media_t * p_md )
* Get media descriptor's elementary streams description
* Get media descriptor's elementary streams description
**************************************************************************/
**************************************************************************/
int
int
libvlc_media_get_
es
(
libvlc_media_t
*
p_md
,
libvlc_media_es
_t
**
pp_es
)
libvlc_media_get_
tracks_info
(
libvlc_media_t
*
p_md
,
libvlc_media_track_info
_t
**
pp_es
)
{
{
assert
(
p_md
);
assert
(
p_md
);
...
@@ -690,7 +690,7 @@ libvlc_media_get_es( libvlc_media_t *p_md, libvlc_media_es_t ** pp_es )
...
@@ -690,7 +690,7 @@ libvlc_media_get_es( libvlc_media_t *p_md, libvlc_media_es_t ** pp_es )
vlc_mutex_lock
(
&
p_input_item
->
lock
);
vlc_mutex_lock
(
&
p_input_item
->
lock
);
const
int
i_es
=
p_input_item
->
i_es
;
const
int
i_es
=
p_input_item
->
i_es
;
*
pp_es
=
(
i_es
>
0
)
?
malloc
(
i_es
*
sizeof
(
libvlc_media_
es
_t
)
)
:
NULL
;
*
pp_es
=
(
i_es
>
0
)
?
malloc
(
i_es
*
sizeof
(
libvlc_media_
track_info
_t
)
)
:
NULL
;
if
(
!
pp_es
)
/* no ES, or OOM */
if
(
!
pp_es
)
/* no ES, or OOM */
{
{
...
@@ -701,7 +701,7 @@ libvlc_media_get_es( libvlc_media_t *p_md, libvlc_media_es_t ** pp_es )
...
@@ -701,7 +701,7 @@ libvlc_media_get_es( libvlc_media_t *p_md, libvlc_media_es_t ** pp_es )
/* Fill array */
/* Fill array */
for
(
int
i
=
0
;
i
<
i_es
;
i
++
)
for
(
int
i
=
0
;
i
<
i_es
;
i
++
)
{
{
libvlc_media_
es
_t
*
p_mes
=
*
pp_es
+
i
;
libvlc_media_
track_info
_t
*
p_mes
=
*
pp_es
+
i
;
const
es_format_t
*
p_es
=
p_input_item
->
es
[
i
];
const
es_format_t
*
p_es
=
p_input_item
->
es
[
i
];
p_mes
->
i_channels
=
p_mes
->
i_rate
=
0
;
p_mes
->
i_channels
=
p_mes
->
i_rate
=
0
;
...
@@ -718,20 +718,20 @@ libvlc_media_get_es( libvlc_media_t *p_md, libvlc_media_es_t ** pp_es )
...
@@ -718,20 +718,20 @@ libvlc_media_get_es( libvlc_media_t *p_md, libvlc_media_es_t ** pp_es )
{
{
case
UNKNOWN_ES
:
case
UNKNOWN_ES
:
default:
default:
p_mes
->
i_type
=
libvlc_
es
_unknown
;
p_mes
->
i_type
=
libvlc_
track
_unknown
;
break
;
break
;
case
VIDEO_ES
:
case
VIDEO_ES
:
p_mes
->
i_type
=
libvlc_
es
_video
;
p_mes
->
i_type
=
libvlc_
track
_video
;
p_mes
->
i_height
=
p_es
->
video
.
i_height
;
p_mes
->
i_height
=
p_es
->
video
.
i_height
;
p_mes
->
i_width
=
p_es
->
video
.
i_width
;
p_mes
->
i_width
=
p_es
->
video
.
i_width
;
break
;
break
;
case
AUDIO_ES
:
case
AUDIO_ES
:
p_mes
->
i_type
=
libvlc_
es
_audio
;
p_mes
->
i_type
=
libvlc_
track
_audio
;
p_mes
->
i_channels
=
p_es
->
audio
.
i_channels
;
p_mes
->
i_channels
=
p_es
->
audio
.
i_channels
;
p_mes
->
i_rate
=
p_es
->
audio
.
i_rate
;
p_mes
->
i_rate
=
p_es
->
audio
.
i_rate
;
break
;
break
;
case
SPU_ES
:
case
SPU_ES
:
p_mes
->
i_type
=
libvlc_
es
_text
;
p_mes
->
i_type
=
libvlc_
track
_text
;
break
;
break
;
}
}
}
}
...
...
src/libvlc.sym
View file @
8211292f
...
@@ -55,12 +55,12 @@ libvlc_media_discoverer_release
...
@@ -55,12 +55,12 @@ libvlc_media_discoverer_release
libvlc_media_duplicate
libvlc_media_duplicate
libvlc_media_event_manager
libvlc_media_event_manager
libvlc_media_get_duration
libvlc_media_get_duration
libvlc_media_get_es
libvlc_media_get_meta
libvlc_media_get_meta
libvlc_media_get_mrl
libvlc_media_get_mrl
libvlc_media_get_state
libvlc_media_get_state
libvlc_media_get_stats
libvlc_media_get_stats
libvlc_media_get_user_data
libvlc_media_get_user_data
libvlc_media_get_tracks_info
libvlc_media_is_preparsed
libvlc_media_is_preparsed
libvlc_media_library_load
libvlc_media_library_load
libvlc_media_library_media_list
libvlc_media_library_media_list
...
...
test/libvlc/media.c
View file @
8211292f
...
@@ -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_MediaPreparsedChanged
,
preparsed_changed
,
&
received
);
libvlc_event_attach
(
em
,
libvlc_MediaPreparsedChanged
,
preparsed_changed
,
(
void
*
)
&
received
);
// Parse the media. This is synchronous.
// Parse the media. This is synchronous.
libvlc_media_parse
(
media
);
libvlc_media_parse
(
media
);
...
@@ -56,10 +56,10 @@ static void test_media_preparsed(const char** argv, int argc)
...
@@ -56,10 +56,10 @@ static void test_media_preparsed(const char** argv, int argc)
while
(
!
received
);
while
(
!
received
);
// We are good, now check Elementary Stream info.
// We are good, now check Elementary Stream info.
libvlc_media_
es_t
*
e
s
;
libvlc_media_
track_info_t
*
track
s
;
int
num
=
libvlc_media_get_es
(
media
,
&
e
s
);
int
num
=
libvlc_media_get_es
(
media
,
&
track
s
);
assert
(
num
>
0
);
assert
(
num
>
0
);
free
(
e
s
);
free
(
track
s
);
libvlc_media_release
(
media
);
libvlc_media_release
(
media
);
libvlc_release
(
vlc
);
libvlc_release
(
vlc
);
...
...
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