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
6002fdef
Commit
6002fdef
authored
Jun 18, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
img2: add loop private option.
Deprecate AVFormatContext.loop_input.
parent
a726d7fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
avformat.h
libavformat/avformat.h
+6
-1
img2.c
libavformat/img2.c
+8
-1
version.h
libavformat/version.h
+3
-0
No files found.
libavformat/avformat.h
View file @
6002fdef
...
...
@@ -742,7 +742,12 @@ typedef struct AVFormatContext {
#endif
#define AVFMT_FLAG_CUSTOM_IO 0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
int
loop_input
;
#if FF_API_LOOP_INPUT
/**
* @deprecated, use the 'loop' img2 demuxer private option.
*/
attribute_deprecated
int
loop_input
;
#endif
/**
* decoding: size of data to probe; encoding: unused.
...
...
libavformat/img2.c
View file @
6002fdef
...
...
@@ -42,6 +42,7 @@ typedef struct {
char
*
pixel_format
;
/**< Set by a private option. */
char
*
video_size
;
/**< Set by a private option. */
char
*
framerate
;
/**< Set by a private option. */
int
loop
;
}
VideoData
;
typedef
struct
{
...
...
@@ -243,6 +244,11 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap)
framerate
=
(
AVRational
){
ap
->
time_base
.
den
,
ap
->
time_base
.
num
};
#endif
#if FF_API_LOOP_INPUT
if
(
s1
->
loop_input
)
s
->
loop
=
s1
->
loop_input
;
#endif
av_strlcpy
(
s
->
path
,
s1
->
filename
,
sizeof
(
s
->
path
));
s
->
img_number
=
0
;
s
->
img_count
=
0
;
...
...
@@ -300,7 +306,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
if
(
!
s
->
is_pipe
)
{
/* loop over input */
if
(
s
1
->
loop_input
&&
s
->
img_number
>
s
->
img_last
)
{
if
(
s
->
loop
&&
s
->
img_number
>
s
->
img_last
)
{
s
->
img_number
=
s
->
img_first
;
}
if
(
s
->
img_number
>
s
->
img_last
)
...
...
@@ -458,6 +464,7 @@ static const AVOption options[] = {
{
"pixel_format"
,
""
,
OFFSET
(
pixel_format
),
FF_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"video_size"
,
""
,
OFFSET
(
video_size
),
FF_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"framerate"
,
""
,
OFFSET
(
framerate
),
FF_OPT_TYPE_STRING
,
{.
str
=
"25"
},
0
,
0
,
DEC
},
{
"loop"
,
""
,
OFFSET
(
loop
),
FF_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
1
,
DEC
},
{
NULL
},
};
...
...
libavformat/version.h
View file @
6002fdef
...
...
@@ -77,5 +77,8 @@
#ifndef FF_API_AVSTREAM_QUALITY
#define FF_API_AVSTREAM_QUALITY (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#ifndef FF_API_LOOP_INPUT
#define FF_API_LOOP_INPUT (LIBAVFORMAT_VERSION_MAJOR < 54)
#endif
#endif
/* AVFORMAT_VERSION_H */
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