codecs: pass the context to the controls function as well
Some functions setting the controls will need the context in the future. Make sure that we provide it as an argument. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
This commit is contained in:
@@ -231,6 +231,7 @@ static void h264_va_slice_to_v4l2(struct cedrus_data *driver_data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int h264_set_controls(struct cedrus_data *driver_data,
|
int h264_set_controls(struct cedrus_data *driver_data,
|
||||||
|
struct object_context *context,
|
||||||
struct object_surface *surface)
|
struct object_surface *surface)
|
||||||
{
|
{
|
||||||
struct v4l2_ctrl_h264_scaling_matrix matrix = { 0 };
|
struct v4l2_ctrl_h264_scaling_matrix matrix = { 0 };
|
||||||
|
|||||||
+4
-1
@@ -27,9 +27,12 @@
|
|||||||
#ifndef _H264_H_
|
#ifndef _H264_H_
|
||||||
#define _H264_H_
|
#define _H264_H_
|
||||||
|
|
||||||
|
struct object_context;
|
||||||
struct object_surface;
|
struct object_surface;
|
||||||
struct cedrus_data;
|
struct cedrus_data;
|
||||||
|
|
||||||
int h264_set_controls(struct cedrus_data *data, struct object_surface *surface);
|
int h264_set_controls(struct cedrus_data *data,
|
||||||
|
struct object_context *context,
|
||||||
|
struct object_surface *surface);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include "v4l2.h"
|
#include "v4l2.h"
|
||||||
|
|
||||||
int mpeg2_set_controls(struct cedrus_data *driver_data,
|
int mpeg2_set_controls(struct cedrus_data *driver_data,
|
||||||
|
struct object_context *context_object,
|
||||||
struct object_surface *surface_object)
|
struct object_surface *surface_object)
|
||||||
{
|
{
|
||||||
VAPictureParameterBufferMPEG2 *parameters =
|
VAPictureParameterBufferMPEG2 *parameters =
|
||||||
|
|||||||
@@ -26,10 +26,12 @@
|
|||||||
#ifndef _MPEG2_H_
|
#ifndef _MPEG2_H_
|
||||||
#define _MPEG2_H_
|
#define _MPEG2_H_
|
||||||
|
|
||||||
|
struct object_context;
|
||||||
struct object_surface;
|
struct object_surface;
|
||||||
struct cedrus_data;
|
struct cedrus_data;
|
||||||
|
|
||||||
int mpeg2_set_controls(struct cedrus_data *driver_data,
|
int mpeg2_set_controls(struct cedrus_data *driver_data,
|
||||||
|
struct object_context *context,
|
||||||
struct object_surface *surface_object);
|
struct object_surface *surface_object);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+5
-4
@@ -131,6 +131,7 @@ static VAStatus codec_store_buffer(struct cedrus_data *driver_data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static VAStatus codec_set_controls(struct cedrus_data *driver_data,
|
static VAStatus codec_set_controls(struct cedrus_data *driver_data,
|
||||||
|
struct object_context *context,
|
||||||
VAProfile profile,
|
VAProfile profile,
|
||||||
struct object_surface *surface_object)
|
struct object_surface *surface_object)
|
||||||
{
|
{
|
||||||
@@ -139,7 +140,7 @@ static VAStatus codec_set_controls(struct cedrus_data *driver_data,
|
|||||||
switch (profile) {
|
switch (profile) {
|
||||||
case VAProfileMPEG2Simple:
|
case VAProfileMPEG2Simple:
|
||||||
case VAProfileMPEG2Main:
|
case VAProfileMPEG2Main:
|
||||||
rc = mpeg2_set_controls(driver_data, surface_object);
|
rc = mpeg2_set_controls(driver_data, context, surface_object);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||||
break;
|
break;
|
||||||
@@ -149,7 +150,7 @@ static VAStatus codec_set_controls(struct cedrus_data *driver_data,
|
|||||||
case VAProfileH264ConstrainedBaseline:
|
case VAProfileH264ConstrainedBaseline:
|
||||||
case VAProfileH264MultiviewHigh:
|
case VAProfileH264MultiviewHigh:
|
||||||
case VAProfileH264StereoHigh:
|
case VAProfileH264StereoHigh:
|
||||||
rc = h264_set_controls(driver_data, surface_object);
|
rc = h264_set_controls(driver_data, context, surface_object);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||||
break;
|
break;
|
||||||
@@ -259,8 +260,8 @@ VAStatus SunxiCedrusEndPicture(VADriverContextP context, VAContextID context_id)
|
|||||||
surface_object->request_fd = request_fd;
|
surface_object->request_fd = request_fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = codec_set_controls(driver_data, config_object->profile,
|
rc = codec_set_controls(driver_data, context_object,
|
||||||
surface_object);
|
config_object->profile, surface_object);
|
||||||
if (rc != VA_STATUS_SUCCESS)
|
if (rc != VA_STATUS_SUCCESS)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user