本文整理汇总了C++中VCD_FAILED函数的典型用法代码示例。如果您正苦于以下问题:C++ VCD_FAILED函数的具体用法?C++ VCD_FAILED怎么用?C++ VCD_FAILED使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了VCD_FAILED函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vcd_stop_in_run
static u32 vcd_stop_in_run(struct vcd_clnt_ctxt_type_t *p_cctxt)
{
u32 rc = VCD_S_SUCCESS;
VCD_MSG_LOW("vcd_stop_in_run:");
rc = vcd_stop_cmn(p_cctxt);
if (!VCD_FAILED(rc) && p_cctxt->status.b_first_ip_frame_recvd) {
rc = vcd_power_event(p_cctxt->p_dev_ctxt,
p_cctxt, VCD_EVT_PWR_CLNT_LAST_FRAME);
}
return rc;
}
示例2: vcd_stop_in_eos
static u32 vcd_stop_in_eos(struct vcd_clnt_ctxt *cctxt)
{
u32 rc = VCD_S_SUCCESS;
VCD_MSG_LOW("vcd_stop_in_eos:");
if (cctxt->status.mask & VCD_EOS_WAIT_OP_BUF) {
rc = vcd_stop_cmn(cctxt);
if (!VCD_FAILED(rc)) {
rc = vcd_power_event(cctxt->dev_ctxt,
cctxt, VCD_EVT_PWR_CLNT_LAST_FRAME);
cctxt->status.mask &= ~VCD_EOS_WAIT_OP_BUF;
}
} else
cctxt->status.mask |= VCD_STOP_PENDING;
return rc;
}
示例3: vcd_flush_in_invalid
static u32 vcd_flush_in_invalid(struct vcd_clnt_ctxt_type_t *p_cctxt,
u32 mode)
{
u32 rc = VCD_S_SUCCESS;
VCD_MSG_LOW("vcd_flush_in_invalid:");
if (!p_cctxt->status.b_cleaning_up) {
rc = vcd_flush_buffers(p_cctxt, mode);
if (!VCD_FAILED(rc)) {
VCD_MSG_HIGH("All buffers are flushed");
p_cctxt->status.n_flush_mode = mode;
vcd_send_flush_done(p_cctxt, VCD_S_SUCCESS);
}
}
return rc;
}
示例4: VCD_MSG_LOW
static u32 vcd_term_in_not_init
(struct vcd_drv_ctxt *drv_ctxt, s32 driver_handle)
{
struct vcd_dev_ctxt *dev_ctxt = &drv_ctxt->dev_ctxt;
u32 rc;
VCD_MSG_LOW("vcd_term_in_dev_not_init:");
rc = vcd_term_cmn(drv_ctxt, driver_handle);
if (!VCD_FAILED(rc) && !dev_ctxt->refs)
vcd_term_driver_context(drv_ctxt);
return rc;
}
示例5: vcd_power_event
u32 vcd_power_event(
struct vcd_dev_ctxt *dev_ctxt,
struct vcd_clnt_ctxt *cctxt, u32 event)
{
u32 rc = VCD_S_SUCCESS;
VCD_MSG_MED("Device power state = %d", dev_ctxt->pwr_clk_state);
VCD_MSG_MED("event = 0x%x", event);
switch (event) {
case VCD_EVT_PWR_DEV_INIT_BEGIN:
case VCD_EVT_PWR_DEV_INIT_END:
case VCD_EVT_PWR_DEV_INIT_FAIL:
case VCD_EVT_PWR_DEV_TERM_BEGIN:
case VCD_EVT_PWR_DEV_TERM_END:
case VCD_EVT_PWR_DEV_TERM_FAIL:
case VCD_EVT_PWR_DEV_SLEEP_BEGIN:
case VCD_EVT_PWR_DEV_SLEEP_END:
case VCD_EVT_PWR_DEV_SET_PERFLVL:
case VCD_EVT_PWR_DEV_HWTIMEOUT:
{
rc = vcd_device_power_event(dev_ctxt, event,
cctxt);
break;
}
case VCD_EVT_PWR_CLNT_CMD_BEGIN:
case VCD_EVT_PWR_CLNT_CMD_END:
case VCD_EVT_PWR_CLNT_CMD_FAIL:
case VCD_EVT_PWR_CLNT_PAUSE:
case VCD_EVT_PWR_CLNT_RESUME:
case VCD_EVT_PWR_CLNT_FIRST_FRAME:
case VCD_EVT_PWR_CLNT_LAST_FRAME:
case VCD_EVT_PWR_CLNT_ERRFATAL:
{
rc = vcd_client_power_event(dev_ctxt, cctxt, event);
break;
}
}
if (VCD_FAILED(rc))
VCD_MSG_ERROR("vcd_power_event: event 0x%x failed", event);
return rc;
}
示例6: vcd_resume_all_sessions
static void vcd_resume_all_sessions(struct vcd_dev_ctxt_type *p_dev_ctxt)
{
struct vcd_clnt_ctxt_type_t *p_cctxt = p_dev_ctxt->p_cctxt_list_head;
u32 rc;
while (p_cctxt) {
if (p_cctxt->clnt_state.p_state_table->ev_hdlr.pf_resume) {
rc = p_cctxt->clnt_state.p_state_table->ev_hdlr.
pf_resume(p_cctxt);
if (VCD_FAILED(rc))
VCD_MSG_ERROR("Client resume failed");
}
p_cctxt = p_cctxt->p_next;
}
}
示例7: VCD_MSG_LOW
static u32 vcd_fill_output_buffer_cmn
(struct vcd_clnt_ctxt_type_t *p_cctxt,
struct vcd_frame_data_type *p_buffer)
{
u32 rc = VCD_S_SUCCESS;
struct vcd_buffer_entry_type *p_buf_entry;
u32 b_q_result = TRUE;
u32 b_handled = TRUE;
VCD_MSG_LOW("vcd_fill_output_buffer_cmn in %d:",
p_cctxt->clnt_state.e_state);
p_buf_entry = vcd_check_fill_output_buffer(p_cctxt, p_buffer);
if (!p_buf_entry)
return VCD_ERR_BAD_POINTER;
if (!p_cctxt->status.b_first_op_frame_recvd) {
rc = vcd_handle_first_fill_output_buffer(p_cctxt, p_buffer,
&b_handled);
VCD_FAILED_RETURN(rc,
"Failed: VCD_HandleFirstFillOutputBuffer");
p_cctxt->status.b_first_op_frame_recvd = TRUE;
if (b_handled)
return rc ;
}
b_q_result =
vcd_buffer_pool_entry_en_q(&p_cctxt->out_buf_pool, p_buf_entry);
if (!b_q_result && !p_cctxt->b_decoding) {
VCD_MSG_ERROR("Failed: vcd_buffer_pool_entry_en_q");
return VCD_ERR_FAIL;
}
p_buf_entry->frame = *p_buffer;
rc = vcd_return_op_buffer_to_hw(p_cctxt, p_buf_entry);
if (!VCD_FAILED(rc) && p_cctxt->sched_clnt_hdl) {
vcd_try_submit_frame(p_cctxt->p_dev_ctxt);
p_cctxt->sched_clnt_hdl->n_o_tkns++;
}
return rc;
}
示例8: VCD_MSG_LOW
static u32 vcd_set_buffer_cmn
(struct vcd_clnt_ctxt *cctxt,
enum vcd_buffer_type buffer_type, u8 *buffer, u32 buf_size)
{
u32 rc;
struct vcd_buffer_pool *buf_pool;
VCD_MSG_LOW("vcd_set_buffer_cmn in %d:", cctxt->clnt_state.state);
rc = vcd_common_allocate_set_buffer(cctxt, buffer_type, buf_size,
&buf_pool);
if (!VCD_FAILED(rc)) {
rc = vcd_set_buffer_internal(cctxt, buf_pool, buffer,
buf_size);
}
return rc;
}
示例9: vcd_pause_in_run
static u32 vcd_pause_in_run(struct vcd_clnt_ctxt_type_t *p_cctxt)
{
u32 rc = VCD_S_SUCCESS;
VCD_MSG_LOW("vcd_pause_in_run:");
if (p_cctxt->b_sched_clnt_valid) {
rc = vcd_map_sched_status(sched_suspend_resume_client
(p_cctxt->p_dev_ctxt->sched_hdl,
p_cctxt->sched_clnt_hdl, FALSE));
}
VCD_FAILED_RETURN(rc, "Failed: sched_suspend_resume_client");
if (p_cctxt->status.n_frame_submitted > 0) {
vcd_do_client_state_transition(p_cctxt,
VCD_CLIENT_STATE_PAUSING,
CLIENT_STATE_EVENT_NUMBER
(pf_pause));
} else {
VCD_MSG_HIGH("No client frames are currently being processed");
vcd_do_client_state_transition(p_cctxt,
VCD_CLIENT_STATE_PAUSED,
CLIENT_STATE_EVENT_NUMBER
(pf_pause));
p_cctxt->callback(VCD_EVT_RESP_PAUSE,
VCD_S_SUCCESS,
NULL, 0, p_cctxt, p_cctxt->p_client_data);
rc = vcd_power_event(p_cctxt->p_dev_ctxt, p_cctxt,
VCD_EVT_PWR_CLNT_PAUSE);
if (VCD_FAILED(rc))
VCD_MSG_ERROR("VCD_EVT_PWR_CLNT_PAUSE_END failed");
}
return VCD_S_SUCCESS;
}
示例10: VCD_MSG_LOW
static u32 vcd_close_in_ready
(struct vcd_drv_ctxt_type_t *p_drv_ctxt,
struct vcd_clnt_ctxt_type_t *p_cctxt) {
u32 rc;
VCD_MSG_LOW("vcd_close_in_dev_ready:");
if (p_cctxt->clnt_state.p_state_table->ev_hdlr.pf_close) {
rc = p_cctxt->clnt_state.p_state_table->ev_hdlr.
pf_close(p_cctxt);
} else {
VCD_MSG_ERROR("Unsupported API in client state %d",
p_cctxt->clnt_state.e_state);
rc = VCD_ERR_BAD_STATE;
}
if (!VCD_FAILED(rc))
vcd_handle_for_last_clnt_close(&p_drv_ctxt->dev_ctxt, TRUE);
return rc;
}
示例11: vcd_device_power_event
u32 vcd_device_power_event(struct vcd_dev_ctxt *dev_ctxt, u32 event,
struct vcd_clnt_ctxt *cctxt)
{
u32 rc = VCD_ERR_FAIL;
u32 set_perf_lvl;
switch (event) {
case VCD_EVT_PWR_DEV_INIT_BEGIN:
{
if (dev_ctxt->pwr_clk_state ==
VCD_PWRCLK_STATE_OFF) {
if (res_trk_get_max_perf_level(&dev_ctxt->
max_perf_lvl)) {
if (res_trk_power_up()) {
dev_ctxt->pwr_clk_state =
VCD_PWRCLK_STATE_ON_NOTCLOCKED;
dev_ctxt->curr_perf_lvl = 0;
dev_ctxt->reqd_perf_lvl = 0;
dev_ctxt->active_clnts = 0;
dev_ctxt->
set_perf_lvl_pending = false;
rc = vcd_enable_clock(dev_ctxt,
cctxt);
if (VCD_FAILED(rc)) {
(void)res_trk_power_down();
dev_ctxt->pwr_clk_state =
VCD_PWRCLK_STATE_OFF;
}
}
}
}
break;
}
case VCD_EVT_PWR_DEV_INIT_END:
case VCD_EVT_PWR_DEV_TERM_FAIL:
case VCD_EVT_PWR_DEV_SLEEP_BEGIN:
case VCD_EVT_PWR_DEV_HWTIMEOUT:
{
rc = vcd_gate_clock(dev_ctxt);
break;
}
case VCD_EVT_PWR_DEV_INIT_FAIL:
case VCD_EVT_PWR_DEV_TERM_END:
{
if (dev_ctxt->pwr_clk_state !=
VCD_PWRCLK_STATE_OFF) {
(void)vcd_disable_clock(dev_ctxt);
(void)res_trk_power_down();
dev_ctxt->pwr_clk_state =
VCD_PWRCLK_STATE_OFF;
dev_ctxt->curr_perf_lvl = 0;
dev_ctxt->reqd_perf_lvl = 0;
dev_ctxt->active_clnts = 0;
dev_ctxt->set_perf_lvl_pending = false;
rc = VCD_S_SUCCESS;
}
break;
}
case VCD_EVT_PWR_DEV_TERM_BEGIN:
case VCD_EVT_PWR_DEV_SLEEP_END:
{
rc = vcd_un_gate_clock(dev_ctxt);
break;
}
case VCD_EVT_PWR_DEV_SET_PERFLVL:
{
set_perf_lvl =
dev_ctxt->reqd_perf_lvl >
0 ? dev_ctxt->
reqd_perf_lvl : VCD_MIN_PERF_LEVEL;
rc = vcd_set_perf_level(dev_ctxt, set_perf_lvl);
break;
}
}
return rc;
}
示例12: VCD_MSG_ERROR
static void vcd_clnt_cb_in_eos
(struct vcd_clnt_ctxt *cctxt,
u32 event,
u32 status,
void *payload, size_t sz, u32 *ddl_handle, void *const client_data) {
struct vcd_dev_ctxt *dev_ctxt = cctxt->dev_ctxt;
struct vcd_transc *transc = NULL;
u32 frm_trans_end = false, rc = VCD_S_SUCCESS;
if (cctxt->ddl_handle != ddl_handle) {
VCD_MSG_ERROR("ddl_handle mismatch");
return;
}
switch (event) {
case VCD_EVT_RESP_INPUT_DONE:
{
rc = vcd_handle_input_done_in_eos(cctxt, payload,
status);
break;
}
case VCD_EVT_RESP_OUTPUT_DONE:
{
rc = vcd_handle_frame_done_in_eos(cctxt, payload,
status);
break;
}
case VCD_EVT_RESP_OUTPUT_REQ:
{
rc = vcd_handle_output_required(cctxt, payload,
status);
break;
}
case VCD_EVT_RESP_EOS_DONE:
{
transc = (struct vcd_transc *)client_data;
vcd_handle_eos_done(cctxt, transc, status);
vcd_mark_frame_channel(cctxt->dev_ctxt);
break;
}
case VCD_EVT_IND_OUTPUT_RECONFIG:
{
rc = vcd_handle_ind_output_reconfig(cctxt,
payload, status);
if (!VCD_FAILED(rc)) {
frm_trans_end = true;
payload = NULL;
vcd_do_client_state_transition(cctxt,
VCD_CLIENT_STATE_RUN,
CLIENT_STATE_EVENT_NUMBER
(clnt_cb));
VCD_MSG_LOW
("RECONFIGinEOS:Suspending Client");
rc = vcd_sched_suspend_resume_clnt(cctxt,
false);
if (VCD_FAILED(rc)) {
VCD_MSG_ERROR
("Failed: suspend_resume_clnt. rc=0x%x",
rc);
}
}
break;
}
case VCD_EVT_IND_HWERRFATAL:
{
vcd_handle_ind_hw_err_fatal(cctxt,
VCD_EVT_IND_HWERRFATAL, status);
break;
}
case VCD_EVT_IND_INFO_OUTPUT_RECONFIG:
{
vcd_handle_ind_info_output_reconfig(cctxt, status);
break;
}
default:
{
VCD_MSG_ERROR
("Unexpected callback event=%d status=%d from DDL",
event, status);
dev_ctxt->command_continue = false;
break;
}
}
if (!VCD_FAILED(rc) &&
(event == VCD_EVT_RESP_INPUT_DONE ||
event == VCD_EVT_RESP_OUTPUT_DONE ||
event == VCD_EVT_RESP_OUTPUT_REQ ||
event == VCD_EVT_IND_OUTPUT_RECONFIG)) {
if (payload && ((struct ddl_frame_data_tag *)
payload)->frm_trans_end) {
vcd_mark_frame_channel(cctxt->dev_ctxt);
frm_trans_end = true;
}
//.........这里部分代码省略.........
示例13: vcd_device_power_event
u32 vcd_device_power_event(struct vcd_dev_ctxt_type *p_dev_ctxt, u32 event,
struct vcd_clnt_ctxt_type_t *p_cctxt)
{
u32 rc = VCD_ERR_FAIL;
u32 n_set_perf_lvl;
switch (event) {
case VCD_EVT_PWR_DEV_INIT_BEGIN:
{
if (p_dev_ctxt->e_pwr_clk_state ==
VCD_PWRCLK_STATE_OFF) {
if (res_trk_get_max_perf_level(&p_dev_ctxt->
n_max_perf_lvl)) {
if (res_trk_power_up()) {
p_dev_ctxt->e_pwr_clk_state =
VCD_PWRCLK_STATE_ON_NOTCLOCKED;
p_dev_ctxt->n_curr_perf_lvl = 0;
p_dev_ctxt->n_reqd_perf_lvl = 0;
p_dev_ctxt->n_active_clnts = 0;
p_dev_ctxt->
b_set_perf_lvl_pending = FALSE;
rc = vcd_enable_clock(p_dev_ctxt,
p_cctxt);
if (VCD_FAILED(rc)) {
(void)res_trk_power_down();
p_dev_ctxt->e_pwr_clk_state =
VCD_PWRCLK_STATE_OFF;
}
}
}
}
break;
}
case VCD_EVT_PWR_DEV_INIT_END:
case VCD_EVT_PWR_DEV_TERM_FAIL:
case VCD_EVT_PWR_DEV_SLEEP_BEGIN:
case VCD_EVT_PWR_DEV_HWTIMEOUT:
{
rc = vcd_gate_clock(p_dev_ctxt);
break;
}
case VCD_EVT_PWR_DEV_INIT_FAIL:
case VCD_EVT_PWR_DEV_TERM_END:
{
if (p_dev_ctxt->e_pwr_clk_state !=
VCD_PWRCLK_STATE_OFF) {
(void)vcd_disable_clock(p_dev_ctxt);
(void)res_trk_power_down();
p_dev_ctxt->e_pwr_clk_state =
VCD_PWRCLK_STATE_OFF;
p_dev_ctxt->n_curr_perf_lvl = 0;
p_dev_ctxt->n_reqd_perf_lvl = 0;
p_dev_ctxt->n_active_clnts = 0;
p_dev_ctxt->b_set_perf_lvl_pending = FALSE;
rc = VCD_S_SUCCESS;
}
break;
}
case VCD_EVT_PWR_DEV_TERM_BEGIN:
case VCD_EVT_PWR_DEV_SLEEP_END:
{
rc = vcd_un_gate_clock(p_dev_ctxt);
break;
}
case VCD_EVT_PWR_DEV_SET_PERFLVL:
{
n_set_perf_lvl =
p_dev_ctxt->n_reqd_perf_lvl >
0 ? p_dev_ctxt->
n_reqd_perf_lvl : VCD_MIN_PERF_LEVEL;
rc = vcd_set_perf_level(p_dev_ctxt, n_set_perf_lvl,
p_cctxt);
break;
}
}
return rc;
}