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
bc1ef855
Commit
bc1ef855
authored
Mar 23, 2012
by
Ronald S. Bultje
Committed by
Anton Khirnov
Mar 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/avconv: support changing frame sizes in codecs with frame mt.
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
e20ad71e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
13 deletions
+11
-13
avconv.c
avconv.c
+7
-4
pthread.c
libavcodec/pthread.c
+0
-4
utils.c
libavcodec/utils.c
+4
-5
No files found.
avconv.c
View file @
bc1ef855
...
...
@@ -424,9 +424,8 @@ static void reset_options(OptionsContext *o)
init_opts
();
}
static
int
alloc_buffer
(
InputStream
*
ist
,
FrameBuffer
**
pbuf
)
static
int
alloc_buffer
(
InputStream
*
ist
,
AVCodecContext
*
s
,
FrameBuffer
**
pbuf
)
{
AVCodecContext
*
s
=
ist
->
st
->
codec
;
FrameBuffer
*
buf
=
av_mallocz
(
sizeof
(
*
buf
));
int
i
,
ret
;
const
int
pixel_size
=
av_pix_fmt_descriptors
[
s
->
pix_fmt
].
comp
[
0
].
step_minus1
+
1
;
...
...
@@ -502,7 +501,7 @@ static int codec_get_buffer(AVCodecContext *s, AVFrame *frame)
FrameBuffer
*
buf
;
int
ret
,
i
;
if
(
!
ist
->
buffer_pool
&&
(
ret
=
alloc_buffer
(
ist
,
&
ist
->
buffer_pool
))
<
0
)
if
(
!
ist
->
buffer_pool
&&
(
ret
=
alloc_buffer
(
ist
,
s
,
&
ist
->
buffer_pool
))
<
0
)
return
ret
;
buf
=
ist
->
buffer_pool
;
...
...
@@ -511,7 +510,7 @@ static int codec_get_buffer(AVCodecContext *s, AVFrame *frame)
if
(
buf
->
w
!=
s
->
width
||
buf
->
h
!=
s
->
height
||
buf
->
pix_fmt
!=
s
->
pix_fmt
)
{
av_freep
(
&
buf
->
base
[
0
]);
av_free
(
buf
);
if
((
ret
=
alloc_buffer
(
ist
,
&
buf
))
<
0
)
if
((
ret
=
alloc_buffer
(
ist
,
s
,
&
buf
))
<
0
)
return
ret
;
}
buf
->
refcount
++
;
...
...
@@ -520,6 +519,10 @@ static int codec_get_buffer(AVCodecContext *s, AVFrame *frame)
frame
->
type
=
FF_BUFFER_TYPE_USER
;
frame
->
extended_data
=
frame
->
data
;
frame
->
pkt_pts
=
s
->
pkt
?
s
->
pkt
->
pts
:
AV_NOPTS_VALUE
;
frame
->
width
=
buf
->
w
;
frame
->
height
=
buf
->
h
;
frame
->
format
=
buf
->
pix_fmt
;
frame
->
sample_aspect_ratio
=
s
->
sample_aspect_ratio
;
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
buf
->
data
);
i
++
)
{
frame
->
base
[
i
]
=
buf
->
base
[
i
];
// XXX h264.c uses base though it shouldn't
...
...
libavcodec/pthread.c
View file @
bc1ef855
...
...
@@ -630,10 +630,6 @@ int ff_thread_decode_frame(AVCodecContext *avctx,
*
picture
=
p
->
frame
;
*
got_picture_ptr
=
p
->
got_frame
;
picture
->
pkt_dts
=
p
->
avpkt
.
dts
;
picture
->
sample_aspect_ratio
=
avctx
->
sample_aspect_ratio
;
picture
->
width
=
avctx
->
width
;
picture
->
height
=
avctx
->
height
;
picture
->
format
=
avctx
->
pix_fmt
;
/*
* A later call with avkpt->size == 0 may loop over all threads,
...
...
libavcodec/utils.c
View file @
bc1ef855
...
...
@@ -392,11 +392,6 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
buf
=
&
avci
->
buffer
[
avci
->
buffer_count
];
if
(
buf
->
base
[
0
]
&&
(
buf
->
width
!=
w
||
buf
->
height
!=
h
||
buf
->
pix_fmt
!=
s
->
pix_fmt
)){
if
(
s
->
active_thread_type
&
FF_THREAD_FRAME
)
{
av_log_missing_feature
(
s
,
"Width/height changing with frame threads is"
,
0
);
return
-
1
;
}
for
(
i
=
0
;
i
<
AV_NUM_DATA_POINTERS
;
i
++
)
{
av_freep
(
&
buf
->
base
[
i
]);
buf
->
data
[
i
]
=
NULL
;
...
...
@@ -480,6 +475,10 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
}
pic
->
extended_data
=
pic
->
data
;
avci
->
buffer_count
++
;
pic
->
width
=
buf
->
width
;
pic
->
height
=
buf
->
height
;
pic
->
format
=
buf
->
pix_fmt
;
pic
->
sample_aspect_ratio
=
s
->
sample_aspect_ratio
;
if
(
s
->
pkt
)
pic
->
pkt_pts
=
s
->
pkt
->
pts
;
else
pic
->
pkt_pts
=
AV_NOPTS_VALUE
;
...
...
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