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
42b43513
Commit
42b43513
authored
May 25, 2018
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/img2dec: Auto-detect xwd images.
parent
7c333dc6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
1 deletion
+35
-1
Makefile
libavformat/Makefile
+1
-0
allformats.c
libavformat/allformats.c
+1
-0
img2dec.c
libavformat/img2dec.c
+32
-0
version.h
libavformat/version.h
+1
-1
No files found.
libavformat/Makefile
View file @
42b43513
...
...
@@ -258,6 +258,7 @@ OBJS-$(CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_TIFF_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_WEBP_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_XPM_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_IMAGE_XWD_PIPE_DEMUXER)
+=
img2dec.o
img2.o
OBJS-$(CONFIG_INGENIENT_DEMUXER)
+=
ingenientdec.o
rawdec.o
OBJS-$(CONFIG_IPMOVIE_DEMUXER)
+=
ipmovie.o
OBJS-$(CONFIG_IRCAM_DEMUXER)
+=
ircamdec.o
ircam.o
pcm.o
...
...
libavformat/allformats.c
View file @
42b43513
...
...
@@ -476,6 +476,7 @@ extern AVInputFormat ff_image_sunrast_pipe_demuxer;
extern
AVInputFormat
ff_image_tiff_pipe_demuxer
;
extern
AVInputFormat
ff_image_webp_pipe_demuxer
;
extern
AVInputFormat
ff_image_xpm_pipe_demuxer
;
extern
AVInputFormat
ff_image_xwd_pipe_demuxer
;
/* external libraries */
extern
AVOutputFormat
ff_chromaprint_muxer
;
...
...
libavformat/img2dec.c
View file @
42b43513
...
...
@@ -34,6 +34,7 @@
#include "internal.h"
#include "img2.h"
#include "libavcodec/mjpeg.h"
#include "libavcodec/xwd.h"
#include "subtitles.h"
#if HAVE_GLOB
...
...
@@ -974,6 +975,36 @@ static int xpm_probe(AVProbeData *p)
return
0
;
}
static
int
xwd_probe
(
AVProbeData
*
p
)
{
const
uint8_t
*
b
=
p
->
buf
;
unsigned
width
,
bpp
,
bpad
,
lsize
;
if
(
p
->
buf_size
<
XWD_HEADER_SIZE
||
AV_RB32
(
b
)
<
XWD_HEADER_SIZE
// header size
||
AV_RB32
(
b
+
4
)
!=
XWD_VERSION
// version
||
AV_RB32
(
b
+
8
)
!=
XWD_Z_PIXMAP
// format
||
AV_RB32
(
b
+
12
)
>
32
||
!
AV_RB32
(
b
+
12
)
// depth
||
AV_RB32
(
b
+
16
)
==
0
// width
||
AV_RB32
(
b
+
20
)
==
0
// height
||
AV_RB32
(
b
+
28
)
>
1
// byteorder
||
AV_RB32
(
b
+
32
)
&
~
56
||
av_popcount
(
AV_RB32
(
b
+
32
))
!=
1
// bitmap unit
||
AV_RB32
(
b
+
36
)
>
1
// bitorder
||
AV_RB32
(
b
+
40
)
&
~
56
||
av_popcount
(
AV_RB32
(
b
+
40
))
!=
1
// padding
||
AV_RB32
(
b
+
44
)
>
32
||
!
AV_RB32
(
b
+
44
)
// bpp
||
AV_RB32
(
b
+
68
)
>
256
)
// colours
return
0
;
width
=
AV_RB32
(
b
+
16
);
bpad
=
AV_RB32
(
b
+
40
);
bpp
=
AV_RB32
(
b
+
44
);
lsize
=
AV_RB32
(
b
+
48
);
if
(
lsize
<
FFALIGN
(
width
*
bpp
,
bpad
)
>>
3
)
return
0
;
return
AVPROBE_SCORE_MAX
/
2
+
1
;
}
#define IMAGEAUTO_DEMUXER(imgname, codecid)\
static const AVClass imgname ## _class = {\
.class_name = AV_STRINGIFY(imgname) " demuxer",\
...
...
@@ -1016,3 +1047,4 @@ IMAGEAUTO_DEMUXER(svg, AV_CODEC_ID_SVG)
IMAGEAUTO_DEMUXER
(
tiff
,
AV_CODEC_ID_TIFF
)
IMAGEAUTO_DEMUXER
(
webp
,
AV_CODEC_ID_WEBP
)
IMAGEAUTO_DEMUXER
(
xpm
,
AV_CODEC_ID_XPM
)
IMAGEAUTO_DEMUXER
(
xwd
,
AV_CODEC_ID_XWD
)
libavformat/version.h
View file @
42b43513
...
...
@@ -32,7 +32,7 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58
#define LIBAVFORMAT_VERSION_MINOR 1
6
#define LIBAVFORMAT_VERSION_MINOR 1
7
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
...
...
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