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
cc14cdec
Commit
cc14cdec
authored
Apr 27, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src_buffer: move buffer copy in a separate function.
This will make merging with the audio part easier.
parent
f94b150a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
11 deletions
+26
-11
src_buffer.c
libavfilter/src_buffer.c
+26
-11
No files found.
libavfilter/src_buffer.c
View file @
cc14cdec
...
...
@@ -133,11 +133,33 @@ static int check_format_change(AVFilterContext *buffer_filter,
}
}
static
AVFilterBufferRef
*
copy_buffer_ref
(
AVFilterContext
*
ctx
,
AVFilterBufferRef
*
ref
)
{
AVFilterLink
*
outlink
=
ctx
->
outputs
[
0
];
AVFilterBufferRef
*
buf
;
switch
(
outlink
->
type
)
{
case
AVMEDIA_TYPE_VIDEO
:
buf
=
avfilter_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
ref
->
video
->
w
,
ref
->
video
->
h
);
av_image_copy
(
buf
->
data
,
buf
->
linesize
,
(
void
*
)
ref
->
data
,
ref
->
linesize
,
ref
->
format
,
ref
->
video
->
w
,
ref
->
video
->
h
);
break
;
default:
return
NULL
;
}
avfilter_copy_buffer_ref_props
(
buf
,
ref
);
return
buf
;
}
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
;
...
...
@@ -157,17 +179,10 @@ int av_buffersrc_add_ref(AVFilterContext *buffer_filter,
if
(
ret
<
0
)
return
ret
;
}
if
(
flags
&
AV_BUFFERSRC_FLAG_NO_COPY
)
{
if
(
flags
&
AV_BUFFERSRC_FLAG_NO_COPY
)
buf
=
picref
;
}
else
{
buf
=
avfilter_get_video_buffer
(
outlink
,
AV_PERM_WRITE
,
picref
->
video
->
w
,
picref
->
video
->
h
);
av_image_copy
(
buf
->
data
,
buf
->
linesize
,
(
void
*
)
picref
->
data
,
picref
->
linesize
,
picref
->
format
,
picref
->
video
->
w
,
picref
->
video
->
h
);
avfilter_copy_buffer_ref_props
(
buf
,
picref
);
}
else
buf
=
copy_buffer_ref
(
buffer_filter
,
picref
);
if
((
ret
=
av_fifo_generic_write
(
c
->
fifo
,
&
buf
,
sizeof
(
buf
),
NULL
))
<
0
)
{
if
(
buf
!=
picref
)
...
...
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