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
9a8f1e72
Commit
9a8f1e72
authored
Apr 05, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
img2dec: make use of AV_OPT_TYPE_IMAGE_SIZE
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
1d5b4f9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
13 deletions
+6
-13
img2dec.c
libavformat/img2dec.c
+6
-13
No files found.
libavformat/img2dec.c
View file @
9a8f1e72
...
...
@@ -52,7 +52,7 @@ typedef struct {
int
split_planes
;
/**< use independent file for each Y, U, V plane */
char
path
[
1024
];
char
*
pixel_format
;
/**< Set by a private option. */
char
*
video_size
;
/**< Set by a private option. */
int
width
,
height
;
/**< Set by a private option. */
AVRational
framerate
;
/**< Set by a private option. */
int
loop
;
enum
{
PT_GLOB_SEQUENCE
,
PT_GLOB
,
PT_SEQUENCE
}
pattern_type
;
...
...
@@ -193,8 +193,7 @@ static int img_read_probe(AVProbeData *p)
static
int
img_read_header
(
AVFormatContext
*
s1
)
{
VideoDemuxData
*
s
=
s1
->
priv_data
;
int
first_index
,
last_index
,
ret
=
0
;
int
width
=
0
,
height
=
0
;
int
first_index
,
last_index
;
AVStream
*
st
;
enum
AVPixelFormat
pix_fmt
=
AV_PIX_FMT_NONE
;
...
...
@@ -211,12 +210,6 @@ static int img_read_header(AVFormatContext *s1)
s
->
pixel_format
);
return
AVERROR
(
EINVAL
);
}
if
(
s
->
video_size
&&
(
ret
=
av_parse_video_size
(
&
width
,
&
height
,
s
->
video_size
))
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Could not parse video size: %s.
\n
"
,
s
->
video_size
);
return
ret
;
}
av_strlcpy
(
s
->
path
,
s1
->
filename
,
sizeof
(
s
->
path
));
s
->
img_number
=
0
;
...
...
@@ -232,9 +225,9 @@ static int img_read_header(AVFormatContext *s1)
avpriv_set_pts_info
(
st
,
60
,
s
->
framerate
.
den
,
s
->
framerate
.
num
);
if
(
width
&&
height
)
{
st
->
codec
->
width
=
width
;
st
->
codec
->
height
=
height
;
if
(
s
->
width
&&
s
->
height
)
{
st
->
codec
->
width
=
s
->
width
;
st
->
codec
->
height
=
s
->
height
;
}
if
(
!
s
->
is_pipe
)
{
...
...
@@ -449,7 +442,7 @@ static const AVOption options[] = {
{
"pixel_format"
,
"set video pixel format"
,
OFFSET
(
pixel_format
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"start_number"
,
"set first number in the sequence"
,
OFFSET
(
start_number
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
DEC
},
{
"start_number_range"
,
"set range for looking at the first sequence number"
,
OFFSET
(
start_number_range
),
AV_OPT_TYPE_INT
,
{.
i64
=
5
},
1
,
INT_MAX
,
DEC
},
{
"video_size"
,
"set video size"
,
OFFSET
(
video_size
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"video_size"
,
"set video size"
,
OFFSET
(
width
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"frame_size"
,
"force frame size in bytes"
,
OFFSET
(
frame_size
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
DEC
},
{
NULL
},
};
...
...
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