mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-05 13:34:41 +00:00
Use consistent style for pointer declarations and casts
This commit is contained in:
@@ -239,7 +239,7 @@ static void COREMEDIA_CloseDevice(SDL_Camera *device)
|
||||
hidden.session = nil;
|
||||
[session stopRunning];
|
||||
[session removeInput:[session.inputs objectAtIndex:0]];
|
||||
[session removeOutput:(AVCaptureVideoDataOutput*)[session.outputs objectAtIndex:0]];
|
||||
[session removeOutput:(AVCaptureVideoDataOutput *)[session.outputs objectAtIndex:0]];
|
||||
session = nil;
|
||||
}
|
||||
|
||||
|
||||
@@ -675,7 +675,7 @@ static HRESULT GetDefaultStride(IMFMediaType *pType, LONG *plStride)
|
||||
LONG lStride = 0;
|
||||
|
||||
// Try to get the default stride from the media type.
|
||||
HRESULT ret = IMFMediaType_GetUINT32(pType, &SDL_MF_MT_DEFAULT_STRIDE, (UINT32*)&lStride);
|
||||
HRESULT ret = IMFMediaType_GetUINT32(pType, &SDL_MF_MT_DEFAULT_STRIDE, (UINT32 *)&lStride);
|
||||
if (FAILED(ret)) {
|
||||
// Attribute not set. Try to calculate the default stride.
|
||||
|
||||
@@ -1001,7 +1001,7 @@ static void MaybeAddDevice(IMFActivate *activation)
|
||||
if (name && symlink) {
|
||||
IMFMediaSource *source = NULL;
|
||||
// "activating" here only creates an object, it doesn't open the actual camera hardware or start recording.
|
||||
HRESULT ret = IMFActivate_ActivateObject(activation, &SDL_IID_IMFMediaSource, (void**)&source);
|
||||
HRESULT ret = IMFActivate_ActivateObject(activation, &SDL_IID_IMFMediaSource, (void **)&source);
|
||||
if (SUCCEEDED(ret) && source) {
|
||||
CameraFormatAddData add_data;
|
||||
GatherCameraSpecs(source, &add_data);
|
||||
|
||||
@@ -838,7 +838,7 @@ static void node_event_info(void *object, const struct pw_node_info *info)
|
||||
if (!(info->params[i].flags & SPA_PARAM_INFO_READ))
|
||||
continue;
|
||||
|
||||
res = pw_node_enum_params((struct pw_node*)g->proxy,
|
||||
res = pw_node_enum_params((struct pw_node *)g->proxy,
|
||||
++SPA_PARAMS_INFO_SEQ(info->params[i]), id, 0, -1, NULL);
|
||||
if (SPA_RESULT_IS_ASYNC(res))
|
||||
SPA_PARAMS_INFO_SEQ(info->params[i]) = res;
|
||||
|
||||
@@ -193,7 +193,7 @@ static SDL_CameraFrameResult V4L2_AcquireFrame(SDL_Camera *device, SDL_Surface *
|
||||
*timestampNS = (((Uint64) buf.timestamp.tv_sec) * SDL_NS_PER_SECOND) + SDL_US_TO_NS(buf.timestamp.tv_usec);
|
||||
|
||||
#if DEBUG_CAMERA
|
||||
SDL_Log("CAMERA: debug mmap: image %d/%d data[0]=%p", buf.index, device->hidden->nb_buffers, (void*)frame->pixels);
|
||||
SDL_Log("CAMERA: debug mmap: image %d/%d data[0]=%p", buf.index, device->hidden->nb_buffers, (void *)frame->pixels);
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -230,7 +230,7 @@ static SDL_CameraFrameResult V4L2_AcquireFrame(SDL_Camera *device, SDL_Surface *
|
||||
return SDL_CAMERA_FRAME_ERROR;
|
||||
}
|
||||
|
||||
frame->pixels = (void*)buf.m.userptr;
|
||||
frame->pixels = (void *)buf.m.userptr;
|
||||
if (device->hidden->driver_pitch) {
|
||||
frame->pitch = device->hidden->driver_pitch;
|
||||
} else {
|
||||
@@ -241,7 +241,7 @@ static SDL_CameraFrameResult V4L2_AcquireFrame(SDL_Camera *device, SDL_Surface *
|
||||
*timestampNS = (((Uint64) buf.timestamp.tv_sec) * SDL_NS_PER_SECOND) + SDL_US_TO_NS(buf.timestamp.tv_usec);
|
||||
|
||||
#if DEBUG_CAMERA
|
||||
SDL_Log("CAMERA: debug userptr: image %d/%d data[0]=%p", buf.index, device->hidden->nb_buffers, (void*)frame->pixels);
|
||||
SDL_Log("CAMERA: debug userptr: image %d/%d data[0]=%p", buf.index, device->hidden->nb_buffers, (void *)frame->pixels);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ static void MaybeAddDevice(Sint32 devid)
|
||||
GatherCameraSpecs(devid, &add_data, &fullname, &position);
|
||||
|
||||
if (add_data.num_specs > 0) {
|
||||
SDL_AddCamera(fullname, position, add_data.num_specs, add_data.specs, (void*)devid);
|
||||
SDL_AddCamera(fullname, position, add_data.num_specs, add_data.specs, (void *)devid);
|
||||
}
|
||||
|
||||
SDL_free(fullname);
|
||||
@@ -102,7 +102,7 @@ static void MaybeAddDevice(Sint32 devid)
|
||||
|
||||
static SceUID imbUid = -1;
|
||||
|
||||
static void freeBuffers(SceCameraInfo* info)
|
||||
static void freeBuffers(SceCameraInfo *info)
|
||||
{
|
||||
if (imbUid != -1) {
|
||||
sceKernelFreeMemBlock(imbUid);
|
||||
@@ -118,7 +118,7 @@ static bool VITACAMERA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec
|
||||
return SDL_SetError("Only one camera can be active");
|
||||
}
|
||||
|
||||
SceCameraInfo* info = (SceCameraInfo*)SDL_calloc(1, sizeof(SceCameraInfo));
|
||||
SceCameraInfo *info = (SceCameraInfo *)SDL_calloc(1, sizeof(SceCameraInfo));
|
||||
|
||||
info->size = sizeof(SceCameraInfo);
|
||||
info->priority = SCE_CAMERA_PRIORITY_SHARE;
|
||||
@@ -139,12 +139,12 @@ static bool VITACAMERA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec
|
||||
info->format = SCE_CAMERA_FORMAT_YUV420_PLANE;
|
||||
info->pitch = 0; // same size surface
|
||||
|
||||
info->sizeIBase = spec->width*spec->height;;
|
||||
info->sizeIBase = spec->width * spec->height;;
|
||||
info->sizeUBase = ((spec->width+1)/2) * ((spec->height+1) / 2);
|
||||
info->sizeVBase = ((spec->width+1)/2) * ((spec->height+1) / 2);
|
||||
|
||||
// PHYCONT memory size *must* be a multiple of 1MB, we can just always spend 2MB, since we don't use PHYCONT anywhere else
|
||||
imbUid = sceKernelAllocMemBlock("CameraI", SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW, 2*1024*1024 , NULL);
|
||||
imbUid = sceKernelAllocMemBlock("CameraI", SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW, 2 * 1024 * 1024 , NULL);
|
||||
if (imbUid < 0)
|
||||
{
|
||||
return SDL_SetError("sceKernelAllocMemBlock error: 0x%08X", imbUid);
|
||||
@@ -179,7 +179,7 @@ static void VITACAMERA_CloseDevice(SDL_Camera *device)
|
||||
if (device->hidden) {
|
||||
sceCameraStop((int)device->handle);
|
||||
sceCameraClose((int)device->handle);
|
||||
freeBuffers((SceCameraInfo*)device->hidden);
|
||||
freeBuffers((SceCameraInfo *)device->hidden);
|
||||
SDL_free(device->hidden);
|
||||
}
|
||||
}
|
||||
@@ -205,7 +205,7 @@ static SDL_CameraFrameResult VITACAMERA_AcquireFrame(SDL_Camera *device, SDL_Sur
|
||||
|
||||
*timestampNS = read.timestamp;
|
||||
|
||||
SceCameraInfo* info = (SceCameraInfo*)(device->hidden);
|
||||
SceCameraInfo *info = (SceCameraInfo *)(device->hidden);
|
||||
|
||||
frame->pitch = info->width;
|
||||
frame->pixels = SDL_aligned_alloc(SDL_GetSIMDAlignment(), info->sizeIBase + info->sizeUBase + info->sizeVBase);
|
||||
|
||||
Reference in New Issue
Block a user