Пример #1
0
static u32 vcd_set_property_cmn
    (struct vcd_clnt_ctxt *cctxt,
     struct vcd_property_hdr *prop_hdr, void *prop_val)
{
	u32 rc;
	VCD_MSG_LOW("vcd_set_property_cmn in %d:", cctxt->clnt_state.state);
	VCD_MSG_LOW("property Id = %d", prop_hdr->prop_id);
	if (!prop_hdr->sz || !prop_hdr->prop_id) {
		VCD_MSG_MED("Bad parameters");
		return VCD_ERR_ILLEGAL_PARM;
	}

	rc = ddl_set_property(cctxt->ddl_handle, prop_hdr, prop_val);
	VCD_FAILED_RETURN(rc, "Failed: ddl_set_property");
	switch (prop_hdr->prop_id) {
	case VCD_I_LIVE:
		{
			struct vcd_property_live *live =
			    (struct vcd_property_live *)prop_val;
			cctxt->live = live->live;
			break;
		}
	case VCD_I_FRAME_RATE:
		{
			if (cctxt->sched_clnt_hdl) {
				rc = vcd_set_frame_rate(cctxt,
					(struct vcd_property_frame_rate *)
					prop_val);
			}
			break;
		}
	case VCD_I_FRAME_SIZE:
		{
			if (cctxt->sched_clnt_hdl) {
				rc = vcd_set_frame_size(cctxt,
					(struct vcd_property_frame_size *)
					prop_val);
			}
			break;
		}
	case VCD_I_INTRA_PERIOD:
	   {
		  struct vcd_property_i_period *iperiod =
			 (struct vcd_property_i_period *)prop_val;
		  cctxt->bframe = iperiod->b_frames;
		  break;
	   }
	default:
		{
			break;
		}
	}
	return rc;
}
Пример #2
0
static u32 vcd_set_property_cmn
    (struct vcd_clnt_ctxt *cctxt,
     struct vcd_property_hdr *prop_hdr, void *prop_val)
{
	u32 rc;
	VCD_MSG_LOW("vcd_set_property_cmn in %d:", cctxt->clnt_state.state);
	VCD_MSG_LOW("property Id = %d", prop_hdr->prop_id);
	if (!prop_hdr->sz || !prop_hdr->prop_id) {
		VCD_MSG_MED("Bad parameters");
		return VCD_ERR_ILLEGAL_PARM;
	}

	rc = ddl_set_property(cctxt->ddl_handle, prop_hdr, prop_val);
	if (rc) {
		/* Some properties aren't known to ddl that we can handle */
		if (prop_hdr->prop_id != VCD_I_VOP_TIMING_CONSTANT_DELTA)
			VCD_FAILED_RETURN(rc, "Failed: ddl_set_property");
	}

	switch (prop_hdr->prop_id) {
	case VCD_I_META_BUFFER_MODE:
		{
			struct vcd_property_live *live =
			    (struct vcd_property_live *)prop_val;
			cctxt->meta_mode = live->live;
			break;
		}
	case VCD_I_LIVE:
		{
			struct vcd_property_live *live =
			    (struct vcd_property_live *)prop_val;
			cctxt->live = live->live;
			break;
		}
	case VCD_I_FRAME_RATE:
		{
			if (cctxt->sched_clnt_hdl) {
				rc = vcd_set_frame_rate(cctxt,
					(struct vcd_property_frame_rate *)
					prop_val);
			}
			break;
		}
	case VCD_I_FRAME_SIZE:
		{
			if (cctxt->sched_clnt_hdl) {
				rc = vcd_set_frame_size(cctxt,
					(struct vcd_property_frame_size *)
					prop_val);
			}
			break;
		}
	case VCD_I_INTRA_PERIOD:
		{
			struct vcd_property_i_period *iperiod =
				(struct vcd_property_i_period *)prop_val;
			cctxt->bframe = iperiod->b_frames;
			break;
		}
	case VCD_REQ_PERF_LEVEL:
		rc = vcd_req_perf_level(cctxt,
				(struct vcd_property_perf_level *)prop_val);
		break;
	case VCD_I_VOP_TIMING_CONSTANT_DELTA:
		{
			struct vcd_property_vop_timing_constant_delta *delta =
				prop_val;

			if (delta->constant_delta > 0) {
				cctxt->time_frame_delta = delta->constant_delta;
				rc = VCD_S_SUCCESS;
			} else {
				VCD_MSG_ERROR("Frame delta must be positive");
				rc = VCD_ERR_ILLEGAL_PARM;
			}
			break;
		}
	default:
		{
			break;
		}
	}
	return rc;
}
Пример #3
0
static u32 vcd_set_property_cmn
    (struct vcd_clnt_ctxt_type_t *p_cctxt,
     struct vcd_property_hdr_type *p_prop_hdr, void *p_prop_val)
{
	u32 rc;

	VCD_MSG_LOW("vcd_set_property_cmn in %d:", p_cctxt->clnt_state.e_state);
	VCD_MSG_LOW("property Id = %d", p_prop_hdr->prop_id);

	if (!p_prop_hdr->n_size || !p_prop_hdr->prop_id) {
		VCD_MSG_MED("Bad parameters");

		return VCD_ERR_ILLEGAL_PARM;
	}

	rc = ddl_set_property(p_cctxt->ddl_handle, p_prop_hdr, p_prop_val);

	VCD_FAILED_RETURN(rc, "Failed: ddl_set_property");

	switch (p_prop_hdr->prop_id) {

	case VCD_I_LIVE:
		{
			struct vcd_property_live_type *p_live =
			    (struct vcd_property_live_type *)p_prop_val;

			p_cctxt->b_live = p_live->b_live;

			break;
		}

	case VCD_I_FRAME_RATE:
		{
			if (p_cctxt->sched_clnt_hdl) {
				rc = vcd_set_frame_rate(p_cctxt,
					(struct vcd_property_frame_rate_type *)
					p_prop_val);
			}

			break;
		}

	case VCD_I_FRAME_SIZE:
		{
			if (p_cctxt->sched_clnt_hdl) {
				rc = vcd_set_frame_size(p_cctxt,
					(struct vcd_property_frame_size_type *)
					p_prop_val);
			}

			break;
		}

	default:
		{
			break;
		}

	}

	return rc;
}