Commit d0961d30 authored by Timo Rothenpieler's avatar Timo Rothenpieler

avcodec/nvenc: sanitize variable names

parent a56d0497
...@@ -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 *tmpoutsurf, *inSurf; NvencSurface *tmp_out_surf, *in_surf;
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) {
inSurf = get_free_frame(ctx); in_surf = get_free_frame(ctx);
if (!inSurf) if (!in_surf)
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, inSurf); res = nvenc_upload_frame(avctx, frame, in_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) {
...@@ -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 = inSurf->input_surface; pic_params.inputBuffer = in_surf->input_surface;
pic_params.bufferFmt = inSurf->format; pic_params.bufferFmt = in_surf->format;
pic_params.inputWidth = inSurf->width; pic_params.inputWidth = in_surf->width;
pic_params.inputHeight = inSurf->height; pic_params.inputHeight = in_surf->height;
pic_params.inputPitch = inSurf->pitch; pic_params.inputPitch = in_surf->pitch;
pic_params.outputBitstream = inSurf->output_surface; pic_params.outputBitstream = in_surf->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, &inSurf, sizeof(inSurf), NULL); av_fifo_generic_write(ctx->output_surface_queue, &in_surf, sizeof(in_surf), 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, &tmpoutsurf, sizeof(tmpoutsurf), 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, &tmpoutsurf, sizeof(tmpoutsurf), 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 *tmpoutsurf; 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, &tmpoutsurf, sizeof(tmpoutsurf), 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, tmpoutsurf); 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, &tmpoutsurf, sizeof(tmpoutsurf), 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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment