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
49511501
Commit
49511501
authored
Sep 29, 2016
by
Timo Rothenpieler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/cuvid: support a pre-initialized hw_frames_ctx
parent
f0ea96d8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
cuvid.c
libavcodec/cuvid.c
+6
-7
No files found.
libavcodec/cuvid.c
View file @
49511501
...
...
@@ -52,7 +52,6 @@ typedef struct CuvidContext
int64_t
prev_pts
;
int
internal_error
;
int
ever_flushed
;
int
decoder_flushing
;
cudaVideoCodec
codec_type
;
...
...
@@ -145,8 +144,12 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
return
0
;
}
if
(
hwframe_ctx
->
pool
&&
!
ctx
->
ever_flushed
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"AVHWFramesContext is already initialized
\n
"
);
if
(
hwframe_ctx
->
pool
&&
(
hwframe_ctx
->
width
<
avctx
->
width
||
hwframe_ctx
->
height
<
avctx
->
height
||
hwframe_ctx
->
format
!=
AV_PIX_FMT_CUDA
||
hwframe_ctx
->
sw_format
!=
AV_PIX_FMT_NV12
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"AVHWFramesContext is already initialized with incompatible parameters
\n
"
);
ctx
->
internal_error
=
AVERROR
(
EINVAL
);
return
0
;
}
...
...
@@ -805,8 +808,6 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx)
if
(
ret
<
0
)
goto
error
;
ctx
->
ever_flushed
=
0
;
ctx
->
prev_pts
=
INT64_MIN
;
if
(
!
avctx
->
pkt_timebase
.
num
||
!
avctx
->
pkt_timebase
.
den
)
...
...
@@ -828,8 +829,6 @@ static void cuvid_flush(AVCodecContext *avctx)
CUVIDSOURCEDATAPACKET
seq_pkt
=
{
0
};
int
ret
;
ctx
->
ever_flushed
=
1
;
ret
=
CHECK_CU
(
cuCtxPushCurrent
(
cuda_ctx
));
if
(
ret
<
0
)
goto
error
;
...
...
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