Esempio n. 1
0
static u32 vid_dec_get_buffer_req(struct video_client_ctx *client_ctx,
				  struct vdec_allocatorproperty *vdec_buf_req)
{
	u32 vcd_status = VCD_ERR_FAIL;
	struct vcd_buffer_requirement_type vcd_buf_req;

	if (!client_ctx || !vdec_buf_req)
		return FALSE;

	if (vdec_buf_req->buffer_type == VDEC_BUFFER_TYPE_INPUT) {
		vcd_status = vcd_get_buffer_requirements(client_ctx->vcd_handle,
							 VCD_BUFFER_INPUT,
							 &vcd_buf_req);
	} else {
		vcd_status = vcd_get_buffer_requirements(client_ctx->vcd_handle,
							 VCD_BUFFER_OUTPUT,
							 &vcd_buf_req);
	}

	if (vcd_status) {
		return FALSE;
	} else {
		vdec_buf_req->mincount = vcd_buf_req.n_min_count;
		vdec_buf_req->maxcount = vcd_buf_req.n_max_count;
		vdec_buf_req->actualcount = vcd_buf_req.n_actual_count;
		vdec_buf_req->buffer_size = vcd_buf_req.n_size;
		vdec_buf_req->alignment = vcd_buf_req.n_align;
		vdec_buf_req->buf_poolid = vcd_buf_req.n_buf_pool_id;

		return TRUE;
	}
}
Esempio n. 2
0
u32 vid_enc_get_buffer_req(struct video_client_ctx *client_ctx,
		struct venc_allocatorproperty *venc_buf_req, u32 input_dir)
{
	enum vcd_buffer_type e_buffer;
	struct vcd_buffer_requirement_type buffer_req;
	u32 status = TRUE;
	u32 vcd_status;

	if (!client_ctx || !venc_buf_req)
		return FALSE;

	e_buffer = VCD_BUFFER_OUTPUT;
	if (input_dir)
		e_buffer = VCD_BUFFER_INPUT;

	vcd_status = vcd_get_buffer_requirements(client_ctx->vcd_handle,
							e_buffer, &buffer_req);

	if (vcd_status)
		status = FALSE;

	if (status) {
		venc_buf_req->actualcount = buffer_req.n_actual_count;
		venc_buf_req->alignment = buffer_req.n_align;
		venc_buf_req->datasize = buffer_req.n_size;
		venc_buf_req->mincount = buffer_req.n_min_count;
		venc_buf_req->maxcount = buffer_req.n_max_count;
		venc_buf_req->alignment = buffer_req.n_align;
		venc_buf_req->bufpoolid = buffer_req.n_buf_pool_id;
		venc_buf_req->suffixsize = 0;
	}
	return status;
}