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
d1c96b28
Commit
d1c96b28
authored
Jul 04, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libstagefright: port to refcounted frames
Untested. Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
dda8afc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
17 deletions
+9
-17
libstagefright.cpp
libavcodec/libstagefright.cpp
+9
-17
No files found.
libavcodec/libstagefright.cpp
View file @
d1c96b28
...
...
@@ -186,7 +186,7 @@ void* decode_thread(void *arg)
buffer
->
release
();
goto
push_frame
;
}
ret
=
ff_get_buffer
(
avctx
,
frame
->
vframe
,
0
);
ret
=
ff_get_buffer
(
avctx
,
frame
->
vframe
,
AV_GET_BUFFER_FLAG_REF
);
if
(
ret
<
0
)
{
frame
->
status
=
ret
;
decode_done
=
1
;
...
...
@@ -457,10 +457,8 @@ static int Stagefright_decode_frame(AVCodecContext *avctx, void *data,
return
-
1
;
}
if
(
s
->
prev_frame
)
{
avctx
->
release_buffer
(
avctx
,
s
->
prev_frame
);
av_freep
(
&
s
->
prev_frame
);
}
if
(
s
->
prev_frame
)
av_frame_free
(
&
s
->
prev_frame
);
s
->
prev_frame
=
ret_frame
;
*
got_frame
=
1
;
...
...
@@ -482,10 +480,8 @@ static av_cold int Stagefright_close(AVCodecContext *avctx)
while
(
!
s
->
out_queue
->
empty
())
{
frame
=
*
s
->
out_queue
->
begin
();
s
->
out_queue
->
erase
(
s
->
out_queue
->
begin
());
if
(
frame
->
vframe
)
{
avctx
->
release_buffer
(
avctx
,
frame
->
vframe
);
av_freep
(
&
frame
->
vframe
);
}
if
(
frame
->
vframe
)
av_frame_free
(
&
frame
->
vframe
);
av_freep
(
&
frame
);
}
pthread_mutex_unlock
(
&
s
->
out_mutex
);
...
...
@@ -515,10 +511,8 @@ static av_cold int Stagefright_close(AVCodecContext *avctx)
pthread_join
(
s
->
decode_thread_id
,
NULL
);
if
(
s
->
prev_frame
)
{
avctx
->
release_buffer
(
avctx
,
s
->
prev_frame
);
av_freep
(
&
s
->
prev_frame
);
}
if
(
s
->
prev_frame
)
av_frame_free
(
&
s
->
prev_frame
);
s
->
thread_started
=
false
;
}
...
...
@@ -534,10 +528,8 @@ static av_cold int Stagefright_close(AVCodecContext *avctx)
while
(
!
s
->
out_queue
->
empty
())
{
frame
=
*
s
->
out_queue
->
begin
();
s
->
out_queue
->
erase
(
s
->
out_queue
->
begin
());
if
(
frame
->
vframe
)
{
avctx
->
release_buffer
(
avctx
,
frame
->
vframe
);
av_freep
(
&
frame
->
vframe
);
}
if
(
frame
->
vframe
)
av_frame_free
(
&
frame
->
vframe
);
av_freep
(
&
frame
);
}
...
...
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