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
9b82e333
Commit
9b82e333
authored
May 08, 2018
by
Timo Rothenpieler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/hwcontext_cuda: explicitly synchronize cuMemcpy calls
parent
880236e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
hwcontext_cuda.c
libavutil/hwcontext_cuda.c
+15
-3
No files found.
libavutil/hwcontext_cuda.c
View file @
9b82e333
...
...
@@ -258,13 +258,19 @@ static int cuda_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst,
.
Height
=
src
->
height
>>
(
i
?
priv
->
shift_height
:
0
),
};
err
=
cu
->
cuMemcpy2D
(
&
cpy
);
err
=
cu
->
cuMemcpy2D
Async
(
&
cpy
,
device_hwctx
->
stream
);
if
(
err
!=
CUDA_SUCCESS
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Error transferring the data from the CUDA frame
\n
"
);
return
AVERROR_UNKNOWN
;
}
}
err
=
cu
->
cuStreamSynchronize
(
device_hwctx
->
stream
);
if
(
err
!=
CUDA_SUCCESS
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Error synchronizing CUDA stream
\n
"
);
return
AVERROR_UNKNOWN
;
}
cu
->
cuCtxPopCurrent
(
&
dummy
);
return
0
;
...
...
@@ -297,13 +303,19 @@ static int cuda_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
.
Height
=
src
->
height
>>
(
i
?
priv
->
shift_height
:
0
),
};
err
=
cu
->
cuMemcpy2D
(
&
cpy
);
err
=
cu
->
cuMemcpy2D
Async
(
&
cpy
,
device_hwctx
->
stream
);
if
(
err
!=
CUDA_SUCCESS
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Error transferring the data
from
the CUDA frame
\n
"
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"Error transferring the data
to
the CUDA frame
\n
"
);
return
AVERROR_UNKNOWN
;
}
}
err
=
cu
->
cuStreamSynchronize
(
device_hwctx
->
stream
);
if
(
err
!=
CUDA_SUCCESS
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Error synchronizing CUDA stream
\n
"
);
return
AVERROR_UNKNOWN
;
}
cu
->
cuCtxPopCurrent
(
&
dummy
);
return
0
;
...
...
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