Reduce switch/case indentation
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
This commit is contained in:
+9
-9
@@ -51,16 +51,16 @@ VAStatus SunxiCedrusCreateBuffer(VADriverContextP context,
|
|||||||
VABufferID id;
|
VABufferID id;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case VAPictureParameterBufferType:
|
case VAPictureParameterBufferType:
|
||||||
case VAIQMatrixBufferType:
|
case VAIQMatrixBufferType:
|
||||||
case VASliceParameterBufferType:
|
case VASliceParameterBufferType:
|
||||||
case VASliceDataBufferType:
|
case VASliceDataBufferType:
|
||||||
case VAImageBufferType:
|
case VAImageBufferType:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
status = VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE;
|
status = VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
id = object_heap_allocate(&driver_data->buffer_heap);
|
id = object_heap_allocate(&driver_data->buffer_heap);
|
||||||
|
|||||||
+21
-21
@@ -47,14 +47,14 @@ VAStatus SunxiCedrusCreateConfig(VADriverContextP context, VAProfile profile,
|
|||||||
int i, index;
|
int i, index;
|
||||||
|
|
||||||
switch (profile) {
|
switch (profile) {
|
||||||
case VAProfileMPEG2Simple:
|
case VAProfileMPEG2Simple:
|
||||||
case VAProfileMPEG2Main:
|
case VAProfileMPEG2Main:
|
||||||
if (entrypoint != VAEntrypointVLD)
|
if (entrypoint != VAEntrypointVLD)
|
||||||
return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
|
return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attributes_count > SUNXI_CEDRUS_MAX_CONFIG_ATTRIBUTES)
|
if (attributes_count > SUNXI_CEDRUS_MAX_CONFIG_ATTRIBUTES)
|
||||||
@@ -121,15 +121,15 @@ VAStatus SunxiCedrusQueryConfigEntrypoints(VADriverContextP context,
|
|||||||
VAProfile profile, VAEntrypoint *entrypoints, int *entrypoints_count)
|
VAProfile profile, VAEntrypoint *entrypoints, int *entrypoints_count)
|
||||||
{
|
{
|
||||||
switch (profile) {
|
switch (profile) {
|
||||||
case VAProfileMPEG2Simple:
|
case VAProfileMPEG2Simple:
|
||||||
case VAProfileMPEG2Main:
|
case VAProfileMPEG2Main:
|
||||||
entrypoints[0] = VAEntrypointVLD;
|
entrypoints[0] = VAEntrypointVLD;
|
||||||
*entrypoints_count = 1;
|
*entrypoints_count = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
*entrypoints_count = 0;
|
*entrypoints_count = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return VA_STATUS_SUCCESS;
|
return VA_STATUS_SUCCESS;
|
||||||
@@ -173,12 +173,12 @@ VAStatus SunxiCedrusGetConfigAttributes(VADriverContextP context,
|
|||||||
|
|
||||||
for (i = 0; i < attributes_count; i++) {
|
for (i = 0; i < attributes_count; i++) {
|
||||||
switch (attributes[i].type) {
|
switch (attributes[i].type) {
|
||||||
case VAConfigAttribRTFormat:
|
case VAConfigAttribRTFormat:
|
||||||
attributes[i].value = VA_RT_FORMAT_YUV420;
|
attributes[i].value = VA_RT_FORMAT_YUV420;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
attributes[i].value = VA_ATTRIB_NOT_SUPPORTED;
|
attributes[i].value = VA_ATTRIB_NOT_SUPPORTED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -75,14 +75,14 @@ VAStatus SunxiCedrusCreateContext(VADriverContextP context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (config_object->profile) {
|
switch (config_object->profile) {
|
||||||
case VAProfileMPEG2Simple:
|
case VAProfileMPEG2Simple:
|
||||||
case VAProfileMPEG2Main:
|
case VAProfileMPEG2Main:
|
||||||
pixelformat = V4L2_PIX_FMT_MPEG2_SLICE;
|
pixelformat = V4L2_PIX_FMT_MPEG2_SLICE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = v4l2_set_format(driver_data->video_fd, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, pixelformat, picture_width, picture_height);
|
rc = v4l2_set_format(driver_data->video_fd, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, pixelformat, picture_width, picture_height);
|
||||||
|
|||||||
+27
-27
@@ -103,26 +103,26 @@ VAStatus SunxiCedrusRenderPicture(VADriverContextP context,
|
|||||||
return VA_STATUS_ERROR_INVALID_BUFFER;
|
return VA_STATUS_ERROR_INVALID_BUFFER;
|
||||||
|
|
||||||
switch (config_object->profile) {
|
switch (config_object->profile) {
|
||||||
case VAProfileMPEG2Simple:
|
case VAProfileMPEG2Simple:
|
||||||
case VAProfileMPEG2Main:
|
case VAProfileMPEG2Main:
|
||||||
if (buffer_object->type == VASliceDataBufferType) {
|
if (buffer_object->type == VASliceDataBufferType) {
|
||||||
data = buffer_object->data;
|
data = buffer_object->data;
|
||||||
size = buffer_object->size * buffer_object->count;
|
size = buffer_object->size * buffer_object->count;
|
||||||
|
|
||||||
rc = mpeg2_fill_slice_data(driver_data, context_object, surface_object, data, size);
|
rc = mpeg2_fill_slice_data(driver_data, context_object, surface_object, data, size);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||||
} else if (buffer_object->type == VAPictureParameterBufferType) {
|
} else if (buffer_object->type == VAPictureParameterBufferType) {
|
||||||
mpeg2_parameters = (VAPictureParameterBufferMPEG2 *) buffer_object->data;
|
mpeg2_parameters = (VAPictureParameterBufferMPEG2 *) buffer_object->data;
|
||||||
|
|
||||||
rc = mpeg2_fill_picture_parameters(driver_data, context_object, surface_object, mpeg2_parameters);
|
rc = mpeg2_fill_picture_parameters(driver_data, context_object, surface_object, mpeg2_parameters);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,18 +166,18 @@ VAStatus SunxiCedrusEndPicture(VADriverContextP context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (config_object->profile) {
|
switch (config_object->profile) {
|
||||||
case VAProfileMPEG2Simple:
|
case VAProfileMPEG2Simple:
|
||||||
case VAProfileMPEG2Main:
|
case VAProfileMPEG2Main:
|
||||||
surface_object->mpeg2_slice_params.slice_pos = 0;
|
surface_object->mpeg2_slice_params.slice_pos = 0;
|
||||||
surface_object->mpeg2_slice_params.slice_len = surface_object->slices_size * 8;
|
surface_object->mpeg2_slice_params.slice_len = surface_object->slices_size * 8;
|
||||||
|
|
||||||
control_id = V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS;
|
control_id = V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS;
|
||||||
control_data = &surface_object->mpeg2_slice_params;
|
control_data = &surface_object->mpeg2_slice_params;
|
||||||
control_size = sizeof(surface_object->mpeg2_slice_params);
|
control_size = sizeof(surface_object->mpeg2_slice_params);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = v4l2_set_control(driver_data->video_fd, request_fd, control_id, control_data, control_size);
|
rc = v4l2_set_control(driver_data->video_fd, request_fd, control_id, control_data, control_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user