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
07a96b62
Commit
07a96b62
authored
Jan 18, 2018
by
Yogender Gupta
Committed by
Timo Rothenpieler
Jan 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/cuviddec: set key frame for decoded frames
Signed-off-by:
Timo Rothenpieler
<
timo@rothenpieler.org
>
parent
e07649e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
cuviddec.c
libavcodec/cuviddec.c
+13
-0
No files found.
libavcodec/cuviddec.c
View file @
07a96b62
...
...
@@ -74,6 +74,8 @@ typedef struct CuvidContext
int
internal_error
;
int
decoder_flushing
;
int
*
key_frame
;
cudaVideoCodec
codec_type
;
cudaVideoChromaFormat
chroma_format
;
...
...
@@ -340,6 +342,8 @@ static int CUDAAPI cuvid_handle_picture_decode(void *opaque, CUVIDPICPARAMS* pic
av_log
(
avctx
,
AV_LOG_TRACE
,
"pfnDecodePicture
\n
"
);
ctx
->
key_frame
[
picparams
->
CurrPicIdx
]
=
picparams
->
intra_pic_flag
;
ctx
->
internal_error
=
CHECK_CU
(
ctx
->
cvdl
->
cuvidDecodePicture
(
ctx
->
cudecoder
,
picparams
));
if
(
ctx
->
internal_error
<
0
)
return
0
;
...
...
@@ -590,6 +594,7 @@ static int cuvid_output_frame(AVCodecContext *avctx, AVFrame *frame)
goto
error
;
}
frame
->
key_frame
=
ctx
->
key_frame
[
parsed_frame
.
dispinfo
.
picture_index
];
frame
->
width
=
avctx
->
width
;
frame
->
height
=
avctx
->
height
;
if
(
avctx
->
pkt_timebase
.
num
&&
avctx
->
pkt_timebase
.
den
)
...
...
@@ -693,6 +698,8 @@ static av_cold int cuvid_decode_end(AVCodecContext *avctx)
av_buffer_unref
(
&
ctx
->
hwframe
);
av_buffer_unref
(
&
ctx
->
hwdevice
);
av_freep
(
&
ctx
->
key_frame
);
cuvid_free_functions
(
&
ctx
->
cvdl
);
return
0
;
...
...
@@ -977,6 +984,12 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx)
FFMIN
(
sizeof
(
ctx
->
cuparse_ext
.
raw_seqhdr_data
),
avctx
->
extradata_size
));
}
ctx
->
key_frame
=
av_mallocz
(
ctx
->
nb_surfaces
*
sizeof
(
int
));
if
(
!
ctx
->
key_frame
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
error
;
}
ctx
->
cuparseinfo
.
ulMaxNumDecodeSurfaces
=
ctx
->
nb_surfaces
;
ctx
->
cuparseinfo
.
ulMaxDisplayDelay
=
4
;
ctx
->
cuparseinfo
.
pUserData
=
avctx
;
...
...
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