vis_ilm.c

来自「最新MTK手机软件源码」· C语言 代码 · 共 766 行 · 第 1/2 页

C
766
字号
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ind_p = (media_visual_record_finish_ind_struct*)
        construct_local_para(sizeof(media_visual_record_finish_ind_struct), TD_CTRL);

    ind_p->result = result;

    ilm_ptr = allocate_ilm(MOD_MED_V);
    ilm_ptr->src_mod_id = MOD_MED_V;
    ilm_ptr->dest_mod_id = MOD_MED;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_VISUAL_RECORD_FINISH_IND;
    ilm_ptr->local_para_ptr = (local_para_struct*) ind_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}


/*****************************************************************************
 * FUNCTION
 *  vis_send_decode_visual_data_ind
 * DESCRIPTION
 *  This function is to send decode visual data indication message.
 * PARAMETERS
 *  event       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_decode_visual_data_ind(kal_uint8 event)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    media_decode_visual_data_ind_struct *ind_p;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ind_p = (media_decode_visual_data_ind_struct*)
        construct_local_para(sizeof(media_decode_visual_data_ind_struct), TD_CTRL);

    ind_p->event = event;

    ilm_ptr = allocate_ilm(MOD_VISUAL_HISR);
    ilm_ptr->src_mod_id = MOD_VISUAL_HISR;
    ilm_ptr->dest_mod_id = MOD_MED_V;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_DECODE_VISUAL_DATA_IND;
    ilm_ptr->local_para_ptr = (local_para_struct*) ind_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}


/*****************************************************************************
 * FUNCTION
 *  vis_send_encode_visual_data_ind
 * DESCRIPTION
 *  This function is to send encode visual data indication message.
 * PARAMETERS
 *  event       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_encode_visual_data_ind(kal_uint8 event)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    media_encode_visual_data_ind_struct *ind_p;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (event == VIDEO_ENC_EVENT_COUNT_FILE_SIZE)
    {
        if (vid_evaluate_residual_size(video_enc_get_bitstream_file_size()) == 0)
        {
            video_enc_stop_record();
            event = VIDEO_ENC_EVENT_COMPLETE;
        }
        else
        {
            return;
        }
    }
    ind_p = (media_encode_visual_data_ind_struct*)
        construct_local_para(sizeof(media_encode_visual_data_ind_struct), TD_CTRL);

    ind_p->event = event;

    ilm_ptr = allocate_ilm(MOD_VISUAL_HISR);
    ilm_ptr->src_mod_id = MOD_VISUAL_HISR;
    ilm_ptr->dest_mod_id = MOD_MED_V;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_ENCODE_VISUAL_DATA_IND;
    ilm_ptr->local_para_ptr = (local_para_struct*) ind_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}


/*****************************************************************************
 * FUNCTION
 *  vis_send_seek_done_ind
 * DESCRIPTION
 *  This function is to send visual seek done indication message.
 * PARAMETERS
 *  result      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_seek_done_ind(kal_int16 result)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    /* temp */
    media_visual_play_finish_ind_struct *ind_p;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ind_p = (media_visual_play_finish_ind_struct*)
        construct_local_para(sizeof(media_visual_play_finish_ind_struct), TD_CTRL);

    ilm_ptr = allocate_ilm(MOD_VISUAL_HISR);
    ilm_ptr->src_mod_id = MOD_VISUAL_HISR;
    ilm_ptr->dest_mod_id = MOD_MED_V;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_VISUAL_PLAY_FINISH_IND;
    ilm_ptr->local_para_ptr = (local_para_struct*) ind_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}


/*****************************************************************************
 * FUNCTION
 *  vis_send_play_finish_ind
 * DESCRIPTION
 *  This function is to send visual play finish indication message.
 * PARAMETERS
 *  result      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_play_finish_ind(kal_int16 result)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    media_visual_play_finish_ind_struct *ind_p;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ind_p = (media_visual_play_finish_ind_struct*)
        construct_local_para(sizeof(media_visual_play_finish_ind_struct), TD_CTRL);

    ind_p->result = result;

    ilm_ptr = allocate_ilm(MOD_MED_V);
    ilm_ptr->src_mod_id = MOD_MED_V;
    ilm_ptr->dest_mod_id = MOD_MED;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_VISUAL_PLAY_FINISH_IND;
    ilm_ptr->local_para_ptr = (local_para_struct*) ind_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}


/*****************************************************************************
 * FUNCTION
 *  vis_send_error_recover_ind
 * DESCRIPTION
 *  This function is to send error recover indication message to Media task.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_error_recover_ind(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ilm_ptr = allocate_ilm(MOD_MED_V);
    ilm_ptr->src_mod_id = MOD_MED_V;
    ilm_ptr->dest_mod_id = MOD_MED;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_VID_ERROR_RECOVER_IND;
    ilm_ptr->local_para_ptr = NULL;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}


/*****************************************************************************
 * FUNCTION
 *  vis_send_play_restart_ind
 * DESCRIPTION
 *  This function is to send play restart indication message to Media task.
 * PARAMETERS
 *  audio_frame_number      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_play_restart_ind(kal_uint32 audio_frame_number)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    media_vid_play_restart_ind_struct *msg_p = NULL;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    msg_p = (media_vid_play_restart_ind_struct*)
        construct_local_para(sizeof(media_vid_play_restart_ind_struct), TD_CTRL);
    msg_p->audio_start_frame_num = audio_frame_number;
    ilm_ptr = allocate_ilm(MOD_MED_V);
    ilm_ptr->src_mod_id = MOD_MED_V;
    ilm_ptr->sap_id = MED_SAP;
    ilm_ptr->msg_id = MSG_ID_MEDIA_VID_PLAY_RESTART_IND;
    ilm_ptr->local_para_ptr = (local_para_struct*) msg_p;
    ilm_ptr->peer_buff_ptr = NULL;
    ilm_ptr->dest_mod_id = MOD_MED;
    msg_send_ext_queue(ilm_ptr);
}

#endif /* __MED_VID_MOD__ */ 

#if defined(__MED_MJPG_MOD__)


/*****************************************************************************
 * FUNCTION
 *  vis_send_record_cnf
 * DESCRIPTION
 *  This function is to send visual record confirm message.
 * PARAMETERS
 *  result      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_record_cnf(kal_int16 result)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    media_visual_record_cnf_struct *msg_p = NULL;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    msg_p = (media_visual_record_cnf_struct*) construct_local_para(sizeof(media_visual_record_cnf_struct), TD_CTRL);

    ilm_ptr = allocate_ilm(MOD_MED_V);
    ilm_ptr->src_mod_id = MOD_MED_V;
    ilm_ptr->dest_mod_id = MOD_MED;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_VISUAL_RECORD_CNF;
    ilm_ptr->local_para_ptr = (local_para_struct*) msg_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}


/*****************************************************************************
 * FUNCTION
 *  vis_send_stop_cnf
 * DESCRIPTION
 *  This function is to send visual stop confirm message.
 * PARAMETERS
 *  result      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_stop_cnf(kal_int16 result)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    media_visual_stop_cnf_struct *msg_p = NULL;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    msg_p = (media_visual_stop_cnf_struct*) construct_local_para(sizeof(media_visual_stop_cnf_struct), TD_CTRL);

    ilm_ptr = allocate_ilm(MOD_MED_V);
    ilm_ptr->src_mod_id = MOD_MED_V;
    ilm_ptr->dest_mod_id = MOD_MED;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_VISUAL_STOP_CNF;
    ilm_ptr->local_para_ptr = (local_para_struct*) msg_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}


/*****************************************************************************
 * FUNCTION
 *  vis_send_record_finish_ind
 * DESCRIPTION
 *  This function is to send visual record finish indication message.
 * PARAMETERS
 *  result      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void vis_send_record_finish_ind(kal_int16 result)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    media_visual_record_finish_ind_struct *ind_p;
    ilm_struct *ilm_ptr = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ind_p = (media_visual_record_finish_ind_struct*)
        construct_local_para(sizeof(media_visual_record_finish_ind_struct), TD_CTRL);

    ind_p->result = result;

    ilm_ptr = allocate_ilm(MOD_MED_V);
    ilm_ptr->src_mod_id = MOD_MED_V;
    ilm_ptr->dest_mod_id = MOD_MED;
    ilm_ptr->sap_id = MED_SAP;

    ilm_ptr->msg_id = (msg_type) MSG_ID_MEDIA_VISUAL_RECORD_FINISH_IND;
    ilm_ptr->local_para_ptr = (local_para_struct*) ind_p;
    ilm_ptr->peer_buff_ptr = NULL;

    msg_send_ext_queue(ilm_ptr);

}

#endif /* defined(__MED_MJPG_MOD__) */ 

#endif /* MED_V_NOT_PRESENT */ 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?