[vlc-devel] [PATCH 5/6] nvdec: reindent after code addition
Steve Lhomme
robux4 at ycbcr.xyz
Thu Sep 12 14:44:21 CEST 2019
---
modules/codec/nvdec.c | 66 +++++++++++++++++++++----------------------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/modules/codec/nvdec.c b/modules/codec/nvdec.c
index 3fbcd3ddbdb..689348c2f25 100644
--- a/modules/codec/nvdec.c
+++ b/modules/codec/nvdec.c
@@ -288,15 +288,15 @@ clean_pics:
}
else
{
- CUdeviceptr frameDevicePtr = 0;
- CUVIDPROCPARAMS params = {
- .progressive_frame = 1,
- .top_field_first = 1,
- };
- ret = CALL_CUVID( cuvidMapVideoFrame, p_sys->cudecoder, 0, &frameDevicePtr, &p_sys->outputPitch, ¶ms );
- if (ret != VLC_SUCCESS)
- goto error;
- CALL_CUVID(cuvidUnmapVideoFrame, p_sys->cudecoder, frameDevicePtr);
+ CUdeviceptr frameDevicePtr = 0;
+ CUVIDPROCPARAMS params = {
+ .progressive_frame = 1,
+ .top_field_first = 1,
+ };
+ ret = CALL_CUVID( cuvidMapVideoFrame, p_sys->cudecoder, 0, &frameDevicePtr, &p_sys->outputPitch, ¶ms );
+ if (ret != VLC_SUCCESS)
+ goto error;
+ CALL_CUVID(cuvidUnmapVideoFrame, p_sys->cudecoder, frameDevicePtr);
}
p_sys->decoderHeight = p_format->coded_height;
@@ -442,32 +442,32 @@ static int CUDAAPI HandlePictureDisplay(void *p_opaque, CUVIDPARSERDISPINFO *p_d
unsigned int i_pitch;
- // Map decoded frame to a device pointer
- result = CALL_CUVID( cuvidMapVideoFrame, p_sys->cudecoder, p_dispinfo->picture_index,
- &frameDevicePtr, &i_pitch, ¶ms );
- if (result != VLC_SUCCESS)
- goto error;
-
- // Copy decoded frame into a new VLC picture
- size_t srcY = 0;
- for (int i_plane = 0; i_plane < p_pic->i_planes; i_plane++) {
- plane_t plane = p_pic->p[i_plane];
- CUDA_MEMCPY2D cu_cpy = {
- .srcMemoryType = CU_MEMORYTYPE_DEVICE,
- .srcDevice = frameDevicePtr,
- .srcY = srcY,
- .srcPitch = i_pitch,
- .dstMemoryType = CU_MEMORYTYPE_HOST,
- .dstHost = plane.p_pixels,
- .dstPitch = plane.i_pitch,
- .WidthInBytes = i_pitch,
- .Height = plane.i_visible_lines,
- };
- result = CALL_CUDA(cuMemcpy2D, &cu_cpy);
+ // Map decoded frame to a device pointer
+ result = CALL_CUVID( cuvidMapVideoFrame, p_sys->cudecoder, p_dispinfo->picture_index,
+ &frameDevicePtr, &i_pitch, ¶ms );
if (result != VLC_SUCCESS)
goto error;
- srcY += p_sys->decoderHeight;
- }
+
+ // Copy decoded frame into a new VLC picture
+ size_t srcY = 0;
+ for (int i_plane = 0; i_plane < p_pic->i_planes; i_plane++) {
+ plane_t plane = p_pic->p[i_plane];
+ CUDA_MEMCPY2D cu_cpy = {
+ .srcMemoryType = CU_MEMORYTYPE_DEVICE,
+ .srcDevice = frameDevicePtr,
+ .srcY = srcY,
+ .srcPitch = i_pitch,
+ .dstMemoryType = CU_MEMORYTYPE_HOST,
+ .dstHost = plane.p_pixels,
+ .dstPitch = plane.i_pitch,
+ .WidthInBytes = i_pitch,
+ .Height = plane.i_visible_lines,
+ };
+ result = CALL_CUDA(cuMemcpy2D, &cu_cpy);
+ if (result != VLC_SUCCESS)
+ goto error;
+ srcY += p_sys->decoderHeight;
+ }
}
// Release surface on GPU
--
2.17.1
More information about the vlc-devel
mailing list