Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
ccf942a0
Commit
ccf942a0
authored
Jun 23, 2016
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffprobe: refactor pkt side data printing
parent
78f5589b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
31 deletions
+32
-31
ffprobe.c
ffprobe.c
+32
-31
No files found.
ffprobe.c
View file @
ccf942a0
...
@@ -1759,6 +1759,31 @@ static inline int show_tags(WriterContext *w, AVDictionary *tags, int section_id
...
@@ -1759,6 +1759,31 @@ static inline int show_tags(WriterContext *w, AVDictionary *tags, int section_id
return
ret
;
return
ret
;
}
}
static
void
print_pkt_side_data
(
WriterContext
*
w
,
const
AVPacketSideData
*
side_data
,
int
nb_side_data
,
SectionID
id_data_list
,
SectionID
id_data
)
{
int
i
;
writer_print_section_header
(
w
,
SECTION_ID_STREAM_SIDE_DATA_LIST
);
for
(
i
=
0
;
i
<
nb_side_data
;
i
++
)
{
const
AVPacketSideData
*
sd
=
&
side_data
[
i
];
const
char
*
name
=
av_packet_side_data_name
(
sd
->
type
);
writer_print_section_header
(
w
,
SECTION_ID_STREAM_SIDE_DATA
);
print_str
(
"side_data_type"
,
name
?
name
:
"unknown"
);
print_int
(
"side_data_size"
,
sd
->
size
);
if
(
sd
->
type
==
AV_PKT_DATA_DISPLAYMATRIX
&&
sd
->
size
>=
9
*
4
)
{
writer_print_integers
(
w
,
"displaymatrix"
,
sd
->
data
,
9
,
" %11d"
,
3
,
4
,
1
);
print_int
(
"rotation"
,
av_display_rotation_get
((
int32_t
*
)
sd
->
data
));
}
writer_print_section_footer
(
w
);
}
writer_print_section_footer
(
w
);
}
static
void
show_packet
(
WriterContext
*
w
,
InputFile
*
ifile
,
AVPacket
*
pkt
,
int
packet_idx
)
static
void
show_packet
(
WriterContext
*
w
,
InputFile
*
ifile
,
AVPacket
*
pkt
,
int
packet_idx
)
{
{
char
val_str
[
128
];
char
val_str
[
128
];
...
@@ -1788,7 +1813,6 @@ static void show_packet(WriterContext *w, InputFile *ifile, AVPacket *pkt, int p
...
@@ -1788,7 +1813,6 @@ static void show_packet(WriterContext *w, InputFile *ifile, AVPacket *pkt, int p
print_fmt
(
"flags"
,
"%c"
,
pkt
->
flags
&
AV_PKT_FLAG_KEY
?
'K'
:
'_'
);
print_fmt
(
"flags"
,
"%c"
,
pkt
->
flags
&
AV_PKT_FLAG_KEY
?
'K'
:
'_'
);
if
(
pkt
->
side_data_elems
)
{
if
(
pkt
->
side_data_elems
)
{
int
i
;
int
size
;
int
size
;
const
uint8_t
*
side_metadata
;
const
uint8_t
*
side_metadata
;
...
@@ -1799,20 +1823,10 @@ static void show_packet(WriterContext *w, InputFile *ifile, AVPacket *pkt, int p
...
@@ -1799,20 +1823,10 @@ static void show_packet(WriterContext *w, InputFile *ifile, AVPacket *pkt, int p
show_tags
(
w
,
dict
,
SECTION_ID_PACKET_TAGS
);
show_tags
(
w
,
dict
,
SECTION_ID_PACKET_TAGS
);
av_dict_free
(
&
dict
);
av_dict_free
(
&
dict
);
}
}
writer_print_section_header
(
w
,
SECTION_ID_PACKET_SIDE_DATA_LIST
);
for
(
i
=
0
;
i
<
pkt
->
side_data_elems
;
i
++
)
{
print_pkt_side_data
(
w
,
pkt
->
side_data
,
pkt
->
side_data_elems
,
AVPacketSideData
*
sd
=
&
pkt
->
side_data
[
i
];
SECTION_ID_PACKET_SIDE_DATA_LIST
,
const
char
*
name
=
av_packet_side_data_name
(
sd
->
type
);
SECTION_ID_PACKET_SIDE_DATA
);
writer_print_section_header
(
w
,
SECTION_ID_PACKET_SIDE_DATA
);
print_str
(
"side_data_type"
,
name
?
name
:
"unknown"
);
print_int
(
"side_data_size"
,
sd
->
size
);
if
(
sd
->
type
==
AV_PKT_DATA_DISPLAYMATRIX
&&
sd
->
size
>=
9
*
4
)
{
writer_print_integers
(
w
,
"displaymatrix"
,
sd
->
data
,
9
,
" %11d"
,
3
,
4
,
1
);
print_int
(
"rotation"
,
av_display_rotation_get
((
int32_t
*
)
sd
->
data
));
}
writer_print_section_footer
(
w
);
}
writer_print_section_footer
(
w
);
}
}
if
(
do_show_data
)
if
(
do_show_data
)
...
@@ -2357,22 +2371,9 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
...
@@ -2357,22 +2371,9 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
ret
=
show_tags
(
w
,
stream
->
metadata
,
in_program
?
SECTION_ID_PROGRAM_STREAM_TAGS
:
SECTION_ID_STREAM_TAGS
);
ret
=
show_tags
(
w
,
stream
->
metadata
,
in_program
?
SECTION_ID_PROGRAM_STREAM_TAGS
:
SECTION_ID_STREAM_TAGS
);
if
(
stream
->
nb_side_data
)
{
if
(
stream
->
nb_side_data
)
{
int
i
;
print_pkt_side_data
(
w
,
stream
->
side_data
,
stream
->
nb_side_data
,
writer_print_section_header
(
w
,
SECTION_ID_STREAM_SIDE_DATA_LIST
);
SECTION_ID_STREAM_SIDE_DATA_LIST
,
for
(
i
=
0
;
i
<
stream
->
nb_side_data
;
i
++
)
{
SECTION_ID_STREAM_SIDE_DATA
);
AVPacketSideData
*
sd
=
&
stream
->
side_data
[
i
];
const
char
*
name
=
av_packet_side_data_name
(
sd
->
type
);
writer_print_section_header
(
w
,
SECTION_ID_STREAM_SIDE_DATA
);
print_str
(
"side_data_type"
,
name
?
name
:
"unknown"
);
print_int
(
"side_data_size"
,
sd
->
size
);
if
(
sd
->
type
==
AV_PKT_DATA_DISPLAYMATRIX
&&
sd
->
size
>=
9
*
4
)
{
writer_print_integers
(
w
,
"displaymatrix"
,
sd
->
data
,
9
,
" %11d"
,
3
,
4
,
1
);
print_int
(
"rotation"
,
av_display_rotation_get
((
int32_t
*
)
sd
->
data
));
}
writer_print_section_footer
(
w
);
}
writer_print_section_footer
(
w
);
}
}
writer_print_section_footer
(
w
);
writer_print_section_footer
(
w
);
...
...
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