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
48ac4532
Commit
48ac4532
authored
Jun 08, 2016
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/img2dec: add pnm pipe demuxers
parent
99c3c323
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
148 additions
and
71 deletions
+148
-71
Makefile
libavformat/Makefile
+5
-0
allformats.c
libavformat/allformats.c
+5
-0
img2dec.c
libavformat/img2dec.c
+55
-0
version.h
libavformat/version.h
+2
-2
lavf-pbmpipe
tests/ref/seek/lavf-pbmpipe
+27
-23
lavf-pgmpipe
tests/ref/seek/lavf-pgmpipe
+27
-23
lavf-ppmpipe
tests/ref/seek/lavf-ppmpipe
+27
-23
No files found.
libavformat/Makefile
View file @
48ac4532
...
...
@@ -226,9 +226,14 @@ OBJS-$(CONFIG_IMAGE_EXR_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_J2K_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_JPEG_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_PAM_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_PBM_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_PCX_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_PGM_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_PICTOR_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_PNG_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_PPM_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_QDRAW_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_SGI_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER)
+=
img2dec.o
img2.o
...
...
libavformat/allformats.c
View file @
48ac4532
...
...
@@ -356,9 +356,14 @@ void av_register_all(void)
REGISTER_DEMUXER
(
IMAGE_J2K_PIPE
,
image_j2k_pipe
);
REGISTER_DEMUXER
(
IMAGE_JPEG_PIPE
,
image_jpeg_pipe
);
REGISTER_DEMUXER
(
IMAGE_JPEGLS_PIPE
,
image_jpegls_pipe
);
REGISTER_DEMUXER
(
IMAGE_PAM_PIPE
,
image_pam_pipe
);
REGISTER_DEMUXER
(
IMAGE_PBM_PIPE
,
image_pbm_pipe
);
REGISTER_DEMUXER
(
IMAGE_PCX_PIPE
,
image_pcx_pipe
);
REGISTER_DEMUXER
(
IMAGE_PGMYUV_PIPE
,
image_pgmyuv_pipe
);
REGISTER_DEMUXER
(
IMAGE_PGM_PIPE
,
image_pgm_pipe
);
REGISTER_DEMUXER
(
IMAGE_PICTOR_PIPE
,
image_pictor_pipe
);
REGISTER_DEMUXER
(
IMAGE_PNG_PIPE
,
image_png_pipe
);
REGISTER_DEMUXER
(
IMAGE_PPM_PIPE
,
image_ppm_pipe
);
REGISTER_DEMUXER
(
IMAGE_QDRAW_PIPE
,
image_qdraw_pipe
);
REGISTER_DEMUXER
(
IMAGE_SGI_PIPE
,
image_sgi_pipe
);
REGISTER_DEMUXER
(
IMAGE_SUNRAST_PIPE
,
image_sunrast_pipe
);
...
...
libavformat/img2dec.c
View file @
48ac4532
...
...
@@ -862,6 +862,56 @@ static int webp_probe(AVProbeData *p)
return
0
;
}
static
int
pnm_magic_check
(
const
AVProbeData
*
p
,
int
magic
)
{
const
uint8_t
*
b
=
p
->
buf
;
return
b
[
0
]
==
'P'
&&
b
[
1
]
==
magic
+
'0'
;
}
static
inline
int
pnm_probe
(
const
AVProbeData
*
p
)
{
const
uint8_t
*
b
=
p
->
buf
;
while
(
b
[
2
]
==
'\r'
)
b
++
;
if
(
b
[
2
]
==
'\n'
&&
(
b
[
3
]
==
'#'
||
(
b
[
3
]
>=
'0'
&&
b
[
3
]
<=
'9'
)))
return
AVPROBE_SCORE_EXTENSION
+
2
;
return
0
;
}
static
int
pbm_probe
(
AVProbeData
*
p
)
{
return
pnm_magic_check
(
p
,
1
)
||
pnm_magic_check
(
p
,
4
)
?
pnm_probe
(
p
)
:
0
;
}
static
inline
int
pgmx_probe
(
AVProbeData
*
p
)
{
return
pnm_magic_check
(
p
,
2
)
||
pnm_magic_check
(
p
,
5
)
?
pnm_probe
(
p
)
:
0
;
}
static
int
pgm_probe
(
AVProbeData
*
p
)
{
int
ret
=
pgmx_probe
(
p
);
return
ret
&&
!
av_match_ext
(
p
->
filename
,
"pgmyuv"
)
?
ret
:
0
;
}
static
int
pgmyuv_probe
(
AVProbeData
*
p
)
// custom FFmpeg format recognized by file extension
{
int
ret
=
pgmx_probe
(
p
);
return
ret
&&
av_match_ext
(
p
->
filename
,
"pgmyuv"
)
?
ret
:
0
;
}
static
int
ppm_probe
(
AVProbeData
*
p
)
{
return
pnm_magic_check
(
p
,
3
)
||
pnm_magic_check
(
p
,
6
)
?
pnm_probe
(
p
)
:
0
;
}
static
int
pam_probe
(
AVProbeData
*
p
)
{
return
pnm_magic_check
(
p
,
7
)
?
pnm_probe
(
p
)
:
0
;
}
#define IMAGEAUTO_DEMUXER(imgname, codecid)\
static const AVClass imgname ## _class = {\
.class_name = AV_STRINGIFY(imgname) " demuxer",\
...
...
@@ -888,9 +938,14 @@ IMAGEAUTO_DEMUXER(exr, AV_CODEC_ID_EXR)
IMAGEAUTO_DEMUXER
(
j2k
,
AV_CODEC_ID_JPEG2000
)
IMAGEAUTO_DEMUXER
(
jpeg
,
AV_CODEC_ID_MJPEG
)
IMAGEAUTO_DEMUXER
(
jpegls
,
AV_CODEC_ID_JPEGLS
)
IMAGEAUTO_DEMUXER
(
pam
,
AV_CODEC_ID_PAM
)
IMAGEAUTO_DEMUXER
(
pbm
,
AV_CODEC_ID_PBM
)
IMAGEAUTO_DEMUXER
(
pcx
,
AV_CODEC_ID_PCX
)
IMAGEAUTO_DEMUXER
(
pgm
,
AV_CODEC_ID_PGM
)
IMAGEAUTO_DEMUXER
(
pgmyuv
,
AV_CODEC_ID_PGMYUV
)
IMAGEAUTO_DEMUXER
(
pictor
,
AV_CODEC_ID_PICTOR
)
IMAGEAUTO_DEMUXER
(
png
,
AV_CODEC_ID_PNG
)
IMAGEAUTO_DEMUXER
(
ppm
,
AV_CODEC_ID_PPM
)
IMAGEAUTO_DEMUXER
(
qdraw
,
AV_CODEC_ID_QDRAW
)
IMAGEAUTO_DEMUXER
(
sgi
,
AV_CODEC_ID_SGI
)
IMAGEAUTO_DEMUXER
(
sunrast
,
AV_CODEC_ID_SUNRAST
)
...
...
libavformat/version.h
View file @
48ac4532
...
...
@@ -32,8 +32,8 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you belive might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 57
#define LIBAVFORMAT_VERSION_MINOR 3
8
#define LIBAVFORMAT_VERSION_MICRO 10
2
#define LIBAVFORMAT_VERSION_MINOR 3
9
#define LIBAVFORMAT_VERSION_MICRO 10
0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
...
...
tests/ref/seek/lavf-pbmpipe
View file @
48ac4532
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:317075
ret:-1 st:-1 flags:0 ts:-1.000000
ret:-1 st:-1 flags:1 ts: 1.894167
ret:-1 st: 0 flags:0 ts: 0.800000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 12683
ret: 0 st:-1 flags:0 ts:-1.000000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 12683
ret:-EINVAL st:-1 flags:1 ts: 1.894167
ret:-EINVAL st: 0 flags:0 ts: 0.800000
ret:-1 st: 0 flags:1 ts:-0.320000
ret:-
1
st:-1 flags:0 ts: 2.576668
ret:-
1
st:-1 flags:1 ts: 1.470835
ret:-
1
st: 0 flags:0 ts: 0.360000
ret:-
EINVAL
st:-1 flags:0 ts: 2.576668
ret:-
EINVAL
st:-1 flags:1 ts: 1.470835
ret:-
EINVAL
st: 0 flags:0 ts: 0.360000
ret:-1 st: 0 flags:1 ts:-0.760000
ret:-1 st:-1 flags:0 ts: 2.153336
ret:-1 st:-1 flags:1 ts: 1.047503
ret:-1 st: 0 flags:0 ts:-0.040000
ret:-1 st: 0 flags:1 ts: 2.840000
ret:-1 st:-1 flags:0 ts: 1.730004
ret:-1 st:-1 flags:1 ts: 0.624171
ret:-1 st: 0 flags:0 ts:-0.480000
ret:-1 st: 0 flags:1 ts: 2.400000
ret:-1 st:-1 flags:0 ts: 1.306672
ret:-1 st:-1 flags:1 ts: 0.200839
ret:-1 st: 0 flags:0 ts:-0.920000
ret:-1 st: 0 flags:1 ts: 2.000000
ret:-1 st:-1 flags:0 ts: 0.883340
ret:-EINVAL st:-1 flags:0 ts: 2.153336
ret:-EINVAL st:-1 flags:1 ts: 1.047503
ret: 0 st: 0 flags:0 ts:-0.040000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 12683
ret:-EINVAL st: 0 flags:1 ts: 2.840000
ret:-EINVAL st:-1 flags:0 ts: 1.730004
ret:-EINVAL st:-1 flags:1 ts: 0.624171
ret: 0 st: 0 flags:0 ts:-0.480000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 12683
ret:-EINVAL st: 0 flags:1 ts: 2.400000
ret:-EINVAL st:-1 flags:0 ts: 1.306672
ret:-EINVAL st:-1 flags:1 ts: 0.200839
ret: 0 st: 0 flags:0 ts:-0.920000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size: 12683
ret:-EINVAL st: 0 flags:1 ts: 2.000000
ret:-EINVAL st:-1 flags:0 ts: 0.883340
ret:-1 st:-1 flags:1 ts:-0.222493
ret:-
1
st: 0 flags:0 ts: 2.680000
ret:-
1
st: 0 flags:1 ts: 1.560000
ret:-
1
st:-1 flags:0 ts: 0.460008
ret:-
EINVAL
st: 0 flags:0 ts: 2.680000
ret:-
EINVAL
st: 0 flags:1 ts: 1.560000
ret:-
EINVAL
st:-1 flags:0 ts: 0.460008
ret:-1 st:-1 flags:1 ts:-0.645825
tests/ref/seek/lavf-pgmpipe
View file @
48ac4532
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:2534775
ret:-1 st:-1 flags:0 ts:-1.000000
ret:-1 st:-1 flags:1 ts: 1.894167
ret:-1 st: 0 flags:0 ts: 0.800000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:101391
ret: 0 st:-1 flags:0 ts:-1.000000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:101391
ret:-EINVAL st:-1 flags:1 ts: 1.894167
ret:-EINVAL st: 0 flags:0 ts: 0.800000
ret:-1 st: 0 flags:1 ts:-0.320000
ret:-
1
st:-1 flags:0 ts: 2.576668
ret:-
1
st:-1 flags:1 ts: 1.470835
ret:-
1
st: 0 flags:0 ts: 0.360000
ret:-
EINVAL
st:-1 flags:0 ts: 2.576668
ret:-
EINVAL
st:-1 flags:1 ts: 1.470835
ret:-
EINVAL
st: 0 flags:0 ts: 0.360000
ret:-1 st: 0 flags:1 ts:-0.760000
ret:-1 st:-1 flags:0 ts: 2.153336
ret:-1 st:-1 flags:1 ts: 1.047503
ret:-1 st: 0 flags:0 ts:-0.040000
ret:-1 st: 0 flags:1 ts: 2.840000
ret:-1 st:-1 flags:0 ts: 1.730004
ret:-1 st:-1 flags:1 ts: 0.624171
ret:-1 st: 0 flags:0 ts:-0.480000
ret:-1 st: 0 flags:1 ts: 2.400000
ret:-1 st:-1 flags:0 ts: 1.306672
ret:-1 st:-1 flags:1 ts: 0.200839
ret:-1 st: 0 flags:0 ts:-0.920000
ret:-1 st: 0 flags:1 ts: 2.000000
ret:-1 st:-1 flags:0 ts: 0.883340
ret:-EINVAL st:-1 flags:0 ts: 2.153336
ret:-EINVAL st:-1 flags:1 ts: 1.047503
ret: 0 st: 0 flags:0 ts:-0.040000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:101391
ret:-EINVAL st: 0 flags:1 ts: 2.840000
ret:-EINVAL st:-1 flags:0 ts: 1.730004
ret:-EINVAL st:-1 flags:1 ts: 0.624171
ret: 0 st: 0 flags:0 ts:-0.480000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:101391
ret:-EINVAL st: 0 flags:1 ts: 2.400000
ret:-EINVAL st:-1 flags:0 ts: 1.306672
ret:-EINVAL st:-1 flags:1 ts: 0.200839
ret: 0 st: 0 flags:0 ts:-0.920000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:101391
ret:-EINVAL st: 0 flags:1 ts: 2.000000
ret:-EINVAL st:-1 flags:0 ts: 0.883340
ret:-1 st:-1 flags:1 ts:-0.222493
ret:-
1
st: 0 flags:0 ts: 2.680000
ret:-
1
st: 0 flags:1 ts: 1.560000
ret:-
1
st:-1 flags:0 ts: 0.460008
ret:-
EINVAL
st: 0 flags:0 ts: 2.680000
ret:-
EINVAL
st: 0 flags:1 ts: 1.560000
ret:-
EINVAL
st:-1 flags:0 ts: 0.460008
ret:-1 st:-1 flags:1 ts:-0.645825
tests/ref/seek/lavf-ppmpipe
View file @
48ac4532
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: -1 size:7603575
ret:-1 st:-1 flags:0 ts:-1.000000
ret:-1 st:-1 flags:1 ts: 1.894167
ret:-1 st: 0 flags:0 ts: 0.800000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:304143
ret: 0 st:-1 flags:0 ts:-1.000000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:304143
ret:-EINVAL st:-1 flags:1 ts: 1.894167
ret:-EINVAL st: 0 flags:0 ts: 0.800000
ret:-1 st: 0 flags:1 ts:-0.320000
ret:-
1
st:-1 flags:0 ts: 2.576668
ret:-
1
st:-1 flags:1 ts: 1.470835
ret:-
1
st: 0 flags:0 ts: 0.360000
ret:-
EINVAL
st:-1 flags:0 ts: 2.576668
ret:-
EINVAL
st:-1 flags:1 ts: 1.470835
ret:-
EINVAL
st: 0 flags:0 ts: 0.360000
ret:-1 st: 0 flags:1 ts:-0.760000
ret:-1 st:-1 flags:0 ts: 2.153336
ret:-1 st:-1 flags:1 ts: 1.047503
ret:-1 st: 0 flags:0 ts:-0.040000
ret:-1 st: 0 flags:1 ts: 2.840000
ret:-1 st:-1 flags:0 ts: 1.730004
ret:-1 st:-1 flags:1 ts: 0.624171
ret:-1 st: 0 flags:0 ts:-0.480000
ret:-1 st: 0 flags:1 ts: 2.400000
ret:-1 st:-1 flags:0 ts: 1.306672
ret:-1 st:-1 flags:1 ts: 0.200839
ret:-1 st: 0 flags:0 ts:-0.920000
ret:-1 st: 0 flags:1 ts: 2.000000
ret:-1 st:-1 flags:0 ts: 0.883340
ret:-EINVAL st:-1 flags:0 ts: 2.153336
ret:-EINVAL st:-1 flags:1 ts: 1.047503
ret: 0 st: 0 flags:0 ts:-0.040000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:304143
ret:-EINVAL st: 0 flags:1 ts: 2.840000
ret:-EINVAL st:-1 flags:0 ts: 1.730004
ret:-EINVAL st:-1 flags:1 ts: 0.624171
ret: 0 st: 0 flags:0 ts:-0.480000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:304143
ret:-EINVAL st: 0 flags:1 ts: 2.400000
ret:-EINVAL st:-1 flags:0 ts: 1.306672
ret:-EINVAL st:-1 flags:1 ts: 0.200839
ret: 0 st: 0 flags:0 ts:-0.920000
ret: 0 st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos: 0 size:304143
ret:-EINVAL st: 0 flags:1 ts: 2.000000
ret:-EINVAL st:-1 flags:0 ts: 0.883340
ret:-1 st:-1 flags:1 ts:-0.222493
ret:-
1
st: 0 flags:0 ts: 2.680000
ret:-
1
st: 0 flags:1 ts: 1.560000
ret:-
1
st:-1 flags:0 ts: 0.460008
ret:-
EINVAL
st: 0 flags:0 ts: 2.680000
ret:-
EINVAL
st: 0 flags:1 ts: 1.560000
ret:-
EINVAL
st:-1 flags:0 ts: 0.460008
ret:-1 st:-1 flags:1 ts:-0.645825
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