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
6b4f58d4
Commit
6b4f58d4
authored
Nov 08, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/probetest: also print the time the probe functions needed
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
32584667
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
probetest.c
tools/probetest.c
+28
-1
No files found.
tools/probetest.c
View file @
6b4f58d4
...
...
@@ -23,11 +23,17 @@
#include "libavformat/avformat.h"
#include "libavcodec/put_bits.h"
#include "libavutil/lfg.h"
#include "libavutil/timer.h"
#define MAX_FORMATS 1000 //this must be larger than the number of formats
static
int
score_array
[
MAX_FORMATS
];
static
int64_t
time_array
[
MAX_FORMATS
];
static
int
failures
=
0
;
#ifndef AV_READ_TIME
#define AV_READ_TIME(x) 0
#endif
static
void
probe
(
AVProbeData
*
pd
,
int
type
,
int
p
,
int
size
)
{
int
i
=
0
;
...
...
@@ -37,7 +43,10 @@ static void probe(AVProbeData *pd, int type, int p, int size)
if
(
fmt
->
flags
&
AVFMT_NOFILE
)
continue
;
if
(
fmt
->
read_probe
)
{
int
score
=
fmt
->
read_probe
(
pd
);
int
score
;
int64_t
start
=
AV_READ_TIME
();
score
=
fmt
->
read_probe
(
pd
);
time_array
[
i
]
+=
AV_READ_TIME
()
-
start
;
if
(
score
>
score_array
[
i
]
&&
score
>
AVPROBE_SCORE_MAX
/
4
)
{
score_array
[
i
]
=
score
;
fprintf
(
stderr
,
...
...
@@ -50,6 +59,22 @@ static void probe(AVProbeData *pd, int type, int p, int size)
}
}
static
void
print_times
(
void
)
{
int
i
=
0
;
AVInputFormat
*
fmt
=
NULL
;
while
((
fmt
=
av_iformat_next
(
fmt
)))
{
if
(
fmt
->
flags
&
AVFMT_NOFILE
)
continue
;
if
(
time_array
[
i
]
>
1000000
)
{
fprintf
(
stderr
,
"%12"
PRIu64
" cycles, %12s
\n
"
,
time_array
[
i
],
fmt
->
name
);
}
i
++
;
}
}
int
main
(
int
argc
,
char
**
argv
)
{
unsigned
int
p
,
i
,
type
,
size
,
retry
;
...
...
@@ -142,5 +167,7 @@ int main(int argc, char **argv)
}
}
}
if
(
AV_READ_TIME
())
print_times
();
return
failures
;
}
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