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
badf0951
Commit
badf0951
authored
Jul 01, 2017
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decode: add a mechanism for performing delayed processing on the decoded frames
This will be useful in the CUVID hwaccel.
parent
359a8a3e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
decode.c
libavcodec/decode.c
+11
-0
decode.h
libavcodec/decode.h
+15
-0
No files found.
libavcodec/decode.c
View file @
badf0951
...
...
@@ -419,6 +419,14 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
fdd
=
(
FrameDecodeData
*
)
frame
->
opaque_ref
->
data
;
if
(
fdd
->
post_process
)
{
ret
=
fdd
->
post_process
(
avctx
,
frame
);
if
(
ret
<
0
)
{
av_frame_unref
(
frame
);
return
ret
;
}
}
user_opaque_ref
=
fdd
->
user_opaque_ref
;
fdd
->
user_opaque_ref
=
NULL
;
av_buffer_unref
(
&
frame
->
opaque_ref
);
...
...
@@ -1014,6 +1022,9 @@ static void decode_data_free(void *opaque, uint8_t *data)
av_buffer_unref
(
&
fdd
->
user_opaque_ref
);
if
(
fdd
->
post_process_opaque_free
)
fdd
->
post_process_opaque_free
(
fdd
->
post_process_opaque
);
av_freep
(
&
fdd
);
}
...
...
libavcodec/decode.h
View file @
badf0951
...
...
@@ -22,6 +22,7 @@
#define AVCODEC_DECODE_H
#include "libavutil/buffer.h"
#include "libavutil/frame.h"
#include "avcodec.h"
...
...
@@ -34,6 +35,20 @@ typedef struct FrameDecodeData {
* The original user-set opaque_ref.
*/
AVBufferRef
*
user_opaque_ref
;
/**
* The callback to perform some delayed processing on the frame right
* before it is returned to the caller.
*
* @note This code is called at some unspecified point after the frame is
* returned from the decoder's decode/receive_frame call. Therefore it cannot rely
* on AVCodecContext being in any specific state, so it does not get to
* access AVCodecContext directly at all. All the state it needs must be
* stored in the post_process_opaque object.
*/
int
(
*
post_process
)(
void
*
logctx
,
AVFrame
*
frame
);
void
*
post_process_opaque
;
void
(
*
post_process_opaque_free
)(
void
*
opaque
);
}
FrameDecodeData
;
/**
...
...
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