Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
d0961d30
Commit
d0961d30
authored
Sep 02, 2017
by
Timo Rothenpieler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/nvenc: sanitize variable names
parent
a56d0497
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
nvenc.c
libavcodec/nvenc.c
+17
-17
No files found.
libavcodec/nvenc.c
View file @
d0961d30
...
@@ -1812,7 +1812,7 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
...
@@ -1812,7 +1812,7 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
NVENCSTATUS
nv_status
;
NVENCSTATUS
nv_status
;
CUresult
cu_res
;
CUresult
cu_res
;
CUcontext
dummy
;
CUcontext
dummy
;
NvencSurface
*
tmp
outsurf
,
*
inS
urf
;
NvencSurface
*
tmp
_out_surf
,
*
in_s
urf
;
int
res
;
int
res
;
NvencContext
*
ctx
=
avctx
->
priv_data
;
NvencContext
*
ctx
=
avctx
->
priv_data
;
...
@@ -1829,8 +1829,8 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
...
@@ -1829,8 +1829,8 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
return
AVERROR_EOF
;
return
AVERROR_EOF
;
if
(
frame
)
{
if
(
frame
)
{
in
S
urf
=
get_free_frame
(
ctx
);
in
_s
urf
=
get_free_frame
(
ctx
);
if
(
!
in
S
urf
)
if
(
!
in
_s
urf
)
return
AVERROR
(
EAGAIN
);
return
AVERROR
(
EAGAIN
);
cu_res
=
dl_fn
->
cuda_dl
->
cuCtxPushCurrent
(
ctx
->
cu_context
);
cu_res
=
dl_fn
->
cuda_dl
->
cuCtxPushCurrent
(
ctx
->
cu_context
);
...
@@ -1839,7 +1839,7 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
...
@@ -1839,7 +1839,7 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
return
AVERROR_EXTERNAL
;
return
AVERROR_EXTERNAL
;
}
}
res
=
nvenc_upload_frame
(
avctx
,
frame
,
in
S
urf
);
res
=
nvenc_upload_frame
(
avctx
,
frame
,
in
_s
urf
);
cu_res
=
dl_fn
->
cuda_dl
->
cuCtxPopCurrent
(
&
dummy
);
cu_res
=
dl_fn
->
cuda_dl
->
cuCtxPopCurrent
(
&
dummy
);
if
(
cu_res
!=
CUDA_SUCCESS
)
{
if
(
cu_res
!=
CUDA_SUCCESS
)
{
...
@@ -1850,12 +1850,12 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
...
@@ -1850,12 +1850,12 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
if
(
res
)
if
(
res
)
return
res
;
return
res
;
pic_params
.
inputBuffer
=
in
S
urf
->
input_surface
;
pic_params
.
inputBuffer
=
in
_s
urf
->
input_surface
;
pic_params
.
bufferFmt
=
in
S
urf
->
format
;
pic_params
.
bufferFmt
=
in
_s
urf
->
format
;
pic_params
.
inputWidth
=
in
S
urf
->
width
;
pic_params
.
inputWidth
=
in
_s
urf
->
width
;
pic_params
.
inputHeight
=
in
S
urf
->
height
;
pic_params
.
inputHeight
=
in
_s
urf
->
height
;
pic_params
.
inputPitch
=
in
S
urf
->
pitch
;
pic_params
.
inputPitch
=
in
_s
urf
->
pitch
;
pic_params
.
outputBitstream
=
in
S
urf
->
output_surface
;
pic_params
.
outputBitstream
=
in
_s
urf
->
output_surface
;
if
(
avctx
->
flags
&
AV_CODEC_FLAG_INTERLACED_DCT
)
{
if
(
avctx
->
flags
&
AV_CODEC_FLAG_INTERLACED_DCT
)
{
if
(
frame
->
top_field_first
)
if
(
frame
->
top_field_first
)
...
@@ -1900,7 +1900,7 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
...
@@ -1900,7 +1900,7 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
return
nvenc_print_error
(
avctx
,
nv_status
,
"EncodePicture failed!"
);
return
nvenc_print_error
(
avctx
,
nv_status
,
"EncodePicture failed!"
);
if
(
frame
)
{
if
(
frame
)
{
av_fifo_generic_write
(
ctx
->
output_surface_queue
,
&
in
Surf
,
sizeof
(
inS
urf
),
NULL
);
av_fifo_generic_write
(
ctx
->
output_surface_queue
,
&
in
_surf
,
sizeof
(
in_s
urf
),
NULL
);
timestamp_queue_enqueue
(
ctx
->
timestamp_list
,
frame
->
pts
);
timestamp_queue_enqueue
(
ctx
->
timestamp_list
,
frame
->
pts
);
if
(
ctx
->
initial_pts
[
0
]
==
AV_NOPTS_VALUE
)
if
(
ctx
->
initial_pts
[
0
]
==
AV_NOPTS_VALUE
)
...
@@ -1912,8 +1912,8 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
...
@@ -1912,8 +1912,8 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
/* all the pending buffers are now ready for output */
/* all the pending buffers are now ready for output */
if
(
nv_status
==
NV_ENC_SUCCESS
)
{
if
(
nv_status
==
NV_ENC_SUCCESS
)
{
while
(
av_fifo_size
(
ctx
->
output_surface_queue
)
>
0
)
{
while
(
av_fifo_size
(
ctx
->
output_surface_queue
)
>
0
)
{
av_fifo_generic_read
(
ctx
->
output_surface_queue
,
&
tmp
outsurf
,
sizeof
(
tmpout
surf
),
NULL
);
av_fifo_generic_read
(
ctx
->
output_surface_queue
,
&
tmp
_out_surf
,
sizeof
(
tmp_out_
surf
),
NULL
);
av_fifo_generic_write
(
ctx
->
output_surface_ready_queue
,
&
tmp
outsurf
,
sizeof
(
tmpout
surf
),
NULL
);
av_fifo_generic_write
(
ctx
->
output_surface_ready_queue
,
&
tmp
_out_surf
,
sizeof
(
tmp_out_
surf
),
NULL
);
}
}
}
}
...
@@ -1924,7 +1924,7 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
...
@@ -1924,7 +1924,7 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
{
{
CUresult
cu_res
;
CUresult
cu_res
;
CUcontext
dummy
;
CUcontext
dummy
;
NvencSurface
*
tmp
out
surf
;
NvencSurface
*
tmp
_out_
surf
;
int
res
;
int
res
;
NvencContext
*
ctx
=
avctx
->
priv_data
;
NvencContext
*
ctx
=
avctx
->
priv_data
;
...
@@ -1934,7 +1934,7 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
...
@@ -1934,7 +1934,7 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
if
(
output_ready
(
avctx
,
ctx
->
encoder_flushing
))
{
if
(
output_ready
(
avctx
,
ctx
->
encoder_flushing
))
{
av_fifo_generic_read
(
ctx
->
output_surface_ready_queue
,
&
tmp
outsurf
,
sizeof
(
tmpout
surf
),
NULL
);
av_fifo_generic_read
(
ctx
->
output_surface_ready_queue
,
&
tmp
_out_surf
,
sizeof
(
tmp_out_
surf
),
NULL
);
cu_res
=
dl_fn
->
cuda_dl
->
cuCtxPushCurrent
(
ctx
->
cu_context
);
cu_res
=
dl_fn
->
cuda_dl
->
cuCtxPushCurrent
(
ctx
->
cu_context
);
if
(
cu_res
!=
CUDA_SUCCESS
)
{
if
(
cu_res
!=
CUDA_SUCCESS
)
{
...
@@ -1942,7 +1942,7 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
...
@@ -1942,7 +1942,7 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
return
AVERROR_EXTERNAL
;
return
AVERROR_EXTERNAL
;
}
}
res
=
process_output_surface
(
avctx
,
pkt
,
tmp
out
surf
);
res
=
process_output_surface
(
avctx
,
pkt
,
tmp
_out_
surf
);
cu_res
=
dl_fn
->
cuda_dl
->
cuCtxPopCurrent
(
&
dummy
);
cu_res
=
dl_fn
->
cuda_dl
->
cuCtxPopCurrent
(
&
dummy
);
if
(
cu_res
!=
CUDA_SUCCESS
)
{
if
(
cu_res
!=
CUDA_SUCCESS
)
{
...
@@ -1953,7 +1953,7 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
...
@@ -1953,7 +1953,7 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
if
(
res
)
if
(
res
)
return
res
;
return
res
;
av_fifo_generic_write
(
ctx
->
unused_surface_queue
,
&
tmp
outsurf
,
sizeof
(
tmpout
surf
),
NULL
);
av_fifo_generic_write
(
ctx
->
unused_surface_queue
,
&
tmp
_out_surf
,
sizeof
(
tmp_out_
surf
),
NULL
);
}
else
if
(
ctx
->
encoder_flushing
)
{
}
else
if
(
ctx
->
encoder_flushing
)
{
return
AVERROR_EOF
;
return
AVERROR_EOF
;
}
else
{
}
else
{
...
...
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