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
80abfbea
Commit
80abfbea
authored
Nov 06, 2011
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffprobe: introduce print_val() macro, ease readability
parent
d2d6bade
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
ffprobe.c
ffprobe.c
+5
-4
No files found.
ffprobe.c
View file @
80abfbea
...
...
@@ -611,6 +611,7 @@ static void writer_register_all(void)
#define print_str(k, v) writer_print_string(w, k, v)
#define print_ts(k, v) writer_print_string(w, k, ts_value_string (val_str, sizeof(val_str), v))
#define print_time(k, v, tb) writer_print_string(w, k, time_value_string(val_str, sizeof(val_str), v, tb))
#define print_val(k, v, unit) writer_print_string(w, k, value_string (val_str, sizeof(val_str), v, unit))
#define print_section_header(s) writer_print_section_header(w, s)
#define print_section_footer(s) writer_print_section_footer(w, s)
#define show_tags(metadata) writer_show_tags(w, metadata)
...
...
@@ -630,7 +631,7 @@ static void show_packet(WriterContext *w, AVFormatContext *fmt_ctx, AVPacket *pk
print_time
(
"dts_time"
,
pkt
->
dts
,
&
st
->
time_base
);
print_ts
(
"duration"
,
pkt
->
duration
);
print_time
(
"duration_time"
,
pkt
->
duration
,
&
st
->
time_base
);
print_
str
(
"size"
,
value_string
(
val_str
,
sizeof
(
val_str
),
pkt
->
size
,
unit_byte_str
)
);
print_
val
(
"size"
,
pkt
->
size
,
unit_byte_str
);
print_fmt
(
"pos"
,
"%"
PRId64
,
pkt
->
pos
);
print_fmt
(
"flags"
,
"%c"
,
pkt
->
flags
&
AV_PKT_FLAG_KEY
?
'K'
:
'_'
);
print_section_footer
(
"packet"
);
...
...
@@ -703,7 +704,7 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
case
AVMEDIA_TYPE_AUDIO
:
print_str
(
"sample_fmt"
,
av_x_if_null
(
av_get_sample_fmt_name
(
dec_ctx
->
sample_fmt
),
"unknown"
));
print_
str
(
"sample_rate"
,
value_string
(
val_str
,
sizeof
(
val_str
),
dec_ctx
->
sample_rate
,
unit_hertz_str
)
);
print_
val
(
"sample_rate"
,
dec_ctx
->
sample_rate
,
unit_hertz_str
);
print_int
(
"channels"
,
dec_ctx
->
channels
);
print_int
(
"bits_per_sample"
,
av_get_bits_per_sample
(
dec_ctx
->
codec_id
));
break
;
...
...
@@ -761,8 +762,8 @@ static void show_format(WriterContext *w, AVFormatContext *fmt_ctx)
print_time
(
"start_time"
,
fmt_ctx
->
start_time
,
&
AV_TIME_BASE_Q
);
print_time
(
"duration"
,
fmt_ctx
->
duration
,
&
AV_TIME_BASE_Q
);
if
(
size
>=
0
)
print_
str
(
"size"
,
value_string
(
val_str
,
sizeof
(
val_str
),
size
,
unit_byte_str
)
);
print_
str
(
"bit_rate"
,
value_string
(
val_str
,
sizeof
(
val_str
),
fmt_ctx
->
bit_rate
,
unit_bit_per_second_str
)
);
print_
val
(
"size"
,
size
,
unit_byte_str
);
print_
val
(
"bit_rate"
,
fmt_ctx
->
bit_rate
,
unit_bit_per_second_str
);
show_tags
(
fmt_ctx
->
metadata
);
print_section_footer
(
"format"
);
av_free
(
pbuf
.
s
);
...
...
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