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
5d25140f
Commit
5d25140f
authored
Jan 03, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vsrc_buffer: error on changing frame parameters.
parent
7b9373db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
vsrc_buffer.c
libavfilter/vsrc_buffer.c
+10
-0
No files found.
libavfilter/vsrc_buffer.c
View file @
5d25140f
...
...
@@ -36,6 +36,12 @@ typedef struct {
AVRational
pixel_aspect
;
}
BufferSourceContext
;
#define CHECK_PARAM_CHANGE(s, c, width, height, format)\
if (c->w != width || c->h != height || c->pix_fmt != format) {\
av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\
return AVERROR(EINVAL);\
}
int
av_vsrc_buffer_add_frame
(
AVFilterContext
*
buffer_filter
,
AVFrame
*
frame
,
int64_t
pts
,
AVRational
pixel_aspect
)
{
...
...
@@ -49,6 +55,8 @@ int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame,
//return -1;
}
CHECK_PARAM_CHANGE
(
buffer_filter
,
c
,
frame
->
width
,
frame
->
height
,
frame
->
format
);
c
->
buf
=
avfilter_get_video_buffer
(
buffer_filter
->
outputs
[
0
],
AV_PERM_WRITE
,
c
->
w
,
c
->
h
);
av_image_copy
(
c
->
buf
->
data
,
c
->
buf
->
linesize
,
frame
->
data
,
frame
->
linesize
,
...
...
@@ -73,6 +81,8 @@ int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf)
return
AVERROR
(
EINVAL
);
}
CHECK_PARAM_CHANGE
(
s
,
c
,
buf
->
video
->
w
,
buf
->
video
->
h
,
buf
->
format
);
c
->
buf
=
buf
;
return
0
;
...
...
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