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;
|
||||
|
||||
switch (type) {
|
||||
case VAPictureParameterBufferType:
|
||||
case VAIQMatrixBufferType:
|
||||
case VASliceParameterBufferType:
|
||||
case VASliceDataBufferType:
|
||||
case VAImageBufferType:
|
||||
break;
|
||||
case VAPictureParameterBufferType:
|
||||
case VAIQMatrixBufferType:
|
||||
case VASliceParameterBufferType:
|
||||
case VASliceDataBufferType:
|
||||
case VAImageBufferType:
|
||||
break;
|
||||
|
||||
default:
|
||||
status = VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE;
|
||||
goto error;
|
||||
default:
|
||||
status = VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE;
|
||||
goto error;
|
||||
}
|
||||
|
||||
id = object_heap_allocate(&driver_data->buffer_heap);
|
||||
|
||||
+21
-21
@@ -47,14 +47,14 @@ VAStatus SunxiCedrusCreateConfig(VADriverContextP context, VAProfile profile,
|
||||
int i, index;
|
||||
|
||||
switch (profile) {
|
||||
case VAProfileMPEG2Simple:
|
||||
case VAProfileMPEG2Main:
|
||||
if (entrypoint != VAEntrypointVLD)
|
||||
return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
|
||||
break;
|
||||
case VAProfileMPEG2Simple:
|
||||
case VAProfileMPEG2Main:
|
||||
if (entrypoint != VAEntrypointVLD)
|
||||
return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
|
||||
break;
|
||||
|
||||
default:
|
||||
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||
default:
|
||||
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||
}
|
||||
|
||||
if (attributes_count > SUNXI_CEDRUS_MAX_CONFIG_ATTRIBUTES)
|
||||
@@ -121,15 +121,15 @@ VAStatus SunxiCedrusQueryConfigEntrypoints(VADriverContextP context,
|
||||
VAProfile profile, VAEntrypoint *entrypoints, int *entrypoints_count)
|
||||
{
|
||||
switch (profile) {
|
||||
case VAProfileMPEG2Simple:
|
||||
case VAProfileMPEG2Main:
|
||||
entrypoints[0] = VAEntrypointVLD;
|
||||
*entrypoints_count = 1;
|
||||
break;
|
||||
case VAProfileMPEG2Simple:
|
||||
case VAProfileMPEG2Main:
|
||||
entrypoints[0] = VAEntrypointVLD;
|
||||
*entrypoints_count = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
*entrypoints_count = 0;
|
||||
break;
|
||||
default:
|
||||
*entrypoints_count = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return VA_STATUS_SUCCESS;
|
||||
@@ -173,12 +173,12 @@ VAStatus SunxiCedrusGetConfigAttributes(VADriverContextP context,
|
||||
|
||||
for (i = 0; i < attributes_count; i++) {
|
||||
switch (attributes[i].type) {
|
||||
case VAConfigAttribRTFormat:
|
||||
attributes[i].value = VA_RT_FORMAT_YUV420;
|
||||
break;
|
||||
default:
|
||||
attributes[i].value = VA_ATTRIB_NOT_SUPPORTED;
|
||||
break;
|
||||
case VAConfigAttribRTFormat:
|
||||
attributes[i].value = VA_RT_FORMAT_YUV420;
|
||||
break;
|
||||
default:
|
||||
attributes[i].value = VA_ATTRIB_NOT_SUPPORTED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -75,14 +75,14 @@ VAStatus SunxiCedrusCreateContext(VADriverContextP context,
|
||||
}
|
||||
|
||||
switch (config_object->profile) {
|
||||
case VAProfileMPEG2Simple:
|
||||
case VAProfileMPEG2Main:
|
||||
pixelformat = V4L2_PIX_FMT_MPEG2_SLICE;
|
||||
break;
|
||||
case VAProfileMPEG2Simple:
|
||||
case VAProfileMPEG2Main:
|
||||
pixelformat = V4L2_PIX_FMT_MPEG2_SLICE;
|
||||
break;
|
||||
|
||||
default:
|
||||
status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||
goto error;
|
||||
default:
|
||||
status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||
goto error;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
switch (config_object->profile) {
|
||||
case VAProfileMPEG2Simple:
|
||||
case VAProfileMPEG2Main:
|
||||
if (buffer_object->type == VASliceDataBufferType) {
|
||||
data = buffer_object->data;
|
||||
size = buffer_object->size * buffer_object->count;
|
||||
case VAProfileMPEG2Simple:
|
||||
case VAProfileMPEG2Main:
|
||||
if (buffer_object->type == VASliceDataBufferType) {
|
||||
data = buffer_object->data;
|
||||
size = buffer_object->size * buffer_object->count;
|
||||
|
||||
rc = mpeg2_fill_slice_data(driver_data, context_object, surface_object, data, size);
|
||||
if (rc < 0)
|
||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||
} else if (buffer_object->type == VAPictureParameterBufferType) {
|
||||
mpeg2_parameters = (VAPictureParameterBufferMPEG2 *) buffer_object->data;
|
||||
rc = mpeg2_fill_slice_data(driver_data, context_object, surface_object, data, size);
|
||||
if (rc < 0)
|
||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||
} else if (buffer_object->type == VAPictureParameterBufferType) {
|
||||
mpeg2_parameters = (VAPictureParameterBufferMPEG2 *) buffer_object->data;
|
||||
|
||||
rc = mpeg2_fill_picture_parameters(driver_data, context_object, surface_object, mpeg2_parameters);
|
||||
if (rc < 0)
|
||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||
}
|
||||
break;
|
||||
rc = mpeg2_fill_picture_parameters(driver_data, context_object, surface_object, mpeg2_parameters);
|
||||
if (rc < 0)
|
||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,18 +166,18 @@ VAStatus SunxiCedrusEndPicture(VADriverContextP context,
|
||||
}
|
||||
|
||||
switch (config_object->profile) {
|
||||
case VAProfileMPEG2Simple:
|
||||
case VAProfileMPEG2Main:
|
||||
surface_object->mpeg2_slice_params.slice_pos = 0;
|
||||
surface_object->mpeg2_slice_params.slice_len = surface_object->slices_size * 8;
|
||||
case VAProfileMPEG2Simple:
|
||||
case VAProfileMPEG2Main:
|
||||
surface_object->mpeg2_slice_params.slice_pos = 0;
|
||||
surface_object->mpeg2_slice_params.slice_len = surface_object->slices_size * 8;
|
||||
|
||||
control_id = V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS;
|
||||
control_data = &surface_object->mpeg2_slice_params;
|
||||
control_size = sizeof(surface_object->mpeg2_slice_params);
|
||||
break;
|
||||
control_id = V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS;
|
||||
control_data = &surface_object->mpeg2_slice_params;
|
||||
control_size = sizeof(surface_object->mpeg2_slice_params);
|
||||
break;
|
||||
|
||||
default:
|
||||
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||
default:
|
||||
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||
}
|
||||
|
||||
rc = v4l2_set_control(driver_data->video_fd, request_fd, control_id, control_data, control_size);
|
||||
|
||||
Reference in New Issue
Block a user