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
f94b150a
Commit
f94b150a
authored
Apr 27, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src_buffer: move format change check in a separate function.
This will make merging the check with the audio part easier.
parent
3985ec0e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
17 deletions
+38
-17
src_buffer.c
libavfilter/src_buffer.c
+38
-17
No files found.
libavfilter/src_buffer.c
View file @
f94b150a
...
...
@@ -69,27 +69,12 @@ typedef struct {
return AVERROR(EINVAL);\
}
int
av_buffersrc_add_ref
(
AVFilterContext
*
buffer_filter
,
AVFilterBufferRef
*
picref
,
int
flags
)
static
int
check_format_change_video
(
AVFilterContext
*
buffer_filter
,
AVFilterBufferRef
*
picref
)
{
BufferSourceContext
*
c
=
buffer_filter
->
priv
;
AVFilterLink
*
outlink
=
buffer_filter
->
outputs
[
0
];
AVFilterBufferRef
*
buf
;
int
ret
;
if
(
!
picref
)
{
c
->
eof
=
1
;
return
0
;
}
else
if
(
c
->
eof
)
return
AVERROR
(
EINVAL
);
if
(
!
av_fifo_space
(
c
->
fifo
)
&&
(
ret
=
av_fifo_realloc2
(
c
->
fifo
,
av_fifo_size
(
c
->
fifo
)
+
sizeof
(
buf
)))
<
0
)
return
ret
;
if
(
!
(
flags
&
AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT
))
{
/* TODO reindent */
if
(
picref
->
video
->
w
!=
c
->
w
||
picref
->
video
->
h
!=
c
->
h
||
picref
->
format
!=
c
->
pix_fmt
)
{
AVFilterContext
*
scale
=
buffer_filter
->
outputs
[
0
]
->
dst
;
AVFilterLink
*
link
;
...
...
@@ -134,8 +119,44 @@ int av_buffersrc_add_ref(AVFilterContext *buffer_filter,
if
((
ret
=
link
->
srcpad
->
config_props
(
link
))
<
0
)
return
ret
;
}
return
0
;
}
static
int
check_format_change
(
AVFilterContext
*
buffer_filter
,
AVFilterBufferRef
*
picref
)
{
switch
(
buffer_filter
->
outputs
[
0
]
->
type
)
{
case
AVMEDIA_TYPE_VIDEO
:
return
check_format_change_video
(
buffer_filter
,
picref
);
default:
return
AVERROR
(
ENOSYS
);
}
}
int
av_buffersrc_add_ref
(
AVFilterContext
*
buffer_filter
,
AVFilterBufferRef
*
picref
,
int
flags
)
{
BufferSourceContext
*
c
=
buffer_filter
->
priv
;
AVFilterLink
*
outlink
=
buffer_filter
->
outputs
[
0
];
AVFilterBufferRef
*
buf
;
int
ret
;
if
(
!
picref
)
{
c
->
eof
=
1
;
return
0
;
}
else
if
(
c
->
eof
)
return
AVERROR
(
EINVAL
);
if
(
!
av_fifo_space
(
c
->
fifo
)
&&
(
ret
=
av_fifo_realloc2
(
c
->
fifo
,
av_fifo_size
(
c
->
fifo
)
+
sizeof
(
buf
)))
<
0
)
return
ret
;
if
(
!
(
flags
&
AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT
))
{
ret
=
check_format_change
(
buffer_filter
,
picref
);
if
(
ret
<
0
)
return
ret
;
}
if
(
flags
&
AV_BUFFERSRC_FLAG_NO_COPY
)
{
buf
=
picref
;
}
else
{
...
...
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