u32 vid_enc_start_stop(struct video_client_ctx *client_ctx, u32 start)
{
	u32 vcd_status;

	if (!client_ctx)
		return FALSE;

	if (start) {
			vcd_status = vcd_encode_start(client_ctx->vcd_handle);

			if (vcd_status) {
				ERR("%s(): vcd_encode_start failed."
				" vcd_status = %u\n", __func__, vcd_status);
				return FALSE;
			}
	} else {
		vcd_status = vcd_stop(client_ctx->vcd_handle);
		if (vcd_status) {
			ERR("%s(): vcd_stop failed.  vcd_status = %u\n",
		__func__, vcd_status);
			return FALSE;
		}
		DBG("Send STOP_DONE message to client = %p\n",
				client_ctx);
	}
	return TRUE;
}
Beispiel #2
0
static u32 vid_dec_start_stop(struct video_client_ctx *client_ctx, u32 start)
{
	struct vid_dec_msg *vdec_msg = NULL;
	u32 vcd_status;

	INFO("\n msm_vidc_dec: Inside %s()", __func__);
	if (!client_ctx) {
		ERR("\n Invalid client_ctx");
		return FALSE;
	}

	if (start) {
		if (client_ctx->seq_header_set) {
			INFO("\n %s(): Seq Hdr set: Send START_DONE to client",
				 __func__);
			vdec_msg = kzalloc(sizeof(*vdec_msg), GFP_KERNEL);
			if (!vdec_msg) {
				ERR("vid_dec_start_stop: cannot allocate"
				    "buffer\n");
				return FALSE;
			}
			vdec_msg->vdec_msg_info.msgcode =
			    VDEC_MSG_RESP_START_DONE;
			vdec_msg->vdec_msg_info.status_code = VDEC_S_SUCCESS;
			vdec_msg->vdec_msg_info.msgdatasize = 0;
			mutex_lock(&client_ctx->msg_queue_lock);
			list_add_tail(&vdec_msg->list, &client_ctx->msg_queue);
			mutex_unlock(&client_ctx->msg_queue_lock);

			wake_up(&client_ctx->msg_wait);

			DBG("Send START_DONE message to client = %p\n",
			    client_ctx);

		} else {
			INFO("\n %s(): Calling decode_start()", __func__);
			vcd_status =
			    vcd_decode_start(client_ctx->vcd_handle, NULL);

			if (vcd_status) {
				ERR("%s(): vcd_decode_start failed."
				    " vcd_status = %u\n", __func__, vcd_status);
				return FALSE;
			}
		}
	} else {
		INFO("\n %s(): Calling vcd_stop()", __func__);
		vcd_status = vcd_stop(client_ctx->vcd_handle);
		if (vcd_status) {

			ERR("%s(): vcd_stop failed.  vcd_status = %u\n",
			    __func__, vcd_status);
			return FALSE;
		}
		DBG("Send STOP_DONE message to client = %p\n", client_ctx);
	}
	return TRUE;
}