⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vid_api.c

📁 最新MTK手机软件源码
💻 C
📖 第 1 页 / 共 4 页
字号:

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    vid_result = MED_RES_OK;
    vid_send_snapshot_req(src_mod_id, snapshot);
    VID_WAIT_EVENT(VID_EVT_SNAPSHOT);
    return vid_result;
}


/*****************************************************************************
 * FUNCTION
 *  media_vid_get_iframe
 * DESCRIPTION
 *  This function is to get iframe when the video file.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  iframe          [?]         
 * RETURNS
 *  The result of this action.
 *****************************************************************************/
kal_int32 media_vid_get_iframe(module_type src_mod_id, vid_get_iframe_struct *iframe)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    vid_result = MED_RES_OK;
    vid_send_get_iframe_req(src_mod_id, iframe);
    VID_WAIT_EVENT(VID_EVT_GET_IFRAME);
    return vid_result;
}


/*****************************************************************************
 * FUNCTION
 *  media_vid_set_display
 * DESCRIPTION
 *  This function is to set display device for video play.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  device          [IN]        
 *  vid_get_iframe_struct* iframe(?)
 * RETURNS
 *  The result of this action.
 *****************************************************************************/
kal_int32 media_vid_set_display(module_type src_mod_id, kal_uint8 device)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    vid_result = MED_RES_OK;
    vid_send_set_display_req(src_mod_id, device);
    VID_WAIT_EVENT(VID_EVT_SET_DISPLAY);
    return vid_result;
}


/*****************************************************************************
 * FUNCTION
 *  media_vid_set_param
 * DESCRIPTION
 *  This function is to set video parameters.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  param           [?]         
 * RETURNS
 *  The result of this action.
 *****************************************************************************/
kal_int32 media_vid_set_param(module_type src_mod_id, void *param)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    vid_result = MED_RES_OK;
    vid_send_set_param_req(src_mod_id, param);
    return vid_result;
}


/*****************************************************************************
 * FUNCTION
 *  media_vid_set_em_mode
 * DESCRIPTION
 *  This function is to set engineer mode of video function.
 * PARAMETERS
 *  mode        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void media_vid_set_em_mode(kal_uint8 mode)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    vid_context_p->em_mode = mode;
}


/*****************************************************************************
 * FUNCTION
 *  media_vid_get_em_mode
 * DESCRIPTION
 *  This function is to get engineer mode of video function.
 * PARAMETERS
 *  void
 * RETURNS
 *  kal_uint8 mode
 *****************************************************************************/
kal_uint8 media_vid_get_em_mode(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    return vid_context_p->em_mode;
}


/*****************************************************************************
 * FUNCTION
 *  media_vid_get_max_digital_zoom_factor
 * DESCRIPTION
 *  This function is to get max digital zoom factor with given width and heigh.
 * PARAMETERS
 *  target_width        [IN]        
 *  target_height       [IN]        
 * RETURNS
 *  kal_uint8
 *****************************************************************************/
kal_uint8 media_vid_get_max_digital_zoom_factor(kal_uint16 target_width, kal_uint16 target_height)
{
#ifdef ISP_SUPPORT
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    return get_max_digital_zoom_factor(target_width, target_height);
#else /* ISP_SUPPORT */ 
    return 0;
#endif /* ISP_SUPPORT */ 
}

#if defined (__MED_VID_MOD__)


/*****************************************************************************
 * FUNCTION
 *  media_vid_get_current_play_time
 * DESCRIPTION
 *  This function is to get current time when video playing.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  time            [?]         
 * RETURNS
 *  The result of this action.(?)
 *****************************************************************************/
void media_vid_get_current_play_time(module_type src_mod_id, kal_uint64 *time)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    video_dec_get_play_time(time);
    vid_context_p->current_time = *time;
    VID_VALUE_TRACE((kal_uint32) (*time), (kal_uint32) vid_context_p->total_time, __LINE__);        
    if ((*time) >= vid_context_p->total_time &&
        VID_IN_STATE(VID_VISUAL_PLAY_FINISH) && VID_AUD_IN_STATE(VID_AUDIO_PLAY_HIGH_SPEED))
    {
        vid_send_audio_play_finish_ind(MED_RES_END_OF_FILE);
    }

}


/*****************************************************************************
 * FUNCTION
 *  media_vid_get_decode_time
 * DESCRIPTION
 *  This function is to get current time by the given frame index.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  frame_no        [IN]        
 *  time            [?]         
 * RETURNS
 *  The result of this action.
 *****************************************************************************/
kal_int32 media_vid_get_decode_time(module_type src_mod_id, kal_uint32 frame_no, kal_uint64 *time)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (Video_GetDecodeTime(frame_no, time) == MEDIA_STATUS_OK)
    {
        return MED_RES_OK;
    }
    else
    {
        return MED_RES_ERROR;
    }
}


/*****************************************************************************
 * FUNCTION
 *  media_vid_get_current_record_time
 * DESCRIPTION
 *  This function is to get current time when video recording.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  time            [?]         
 * RETURNS
 *  The result of this action.(?)
 *****************************************************************************/
void media_vid_get_current_record_time(module_type src_mod_id, kal_uint64 *time)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    *time = video_enc_get_current_time();
}


/*****************************************************************************
 * FUNCTION
 *  media_vid_get_current_frame_num
 * DESCRIPTION
 *  This function is to get current frame number when video playing.
 * PARAMETERS
 *  src_mod_id      [IN]        
 *  frame_num       [?]         
 * RETURNS
 *  The result of this action.(?)
 *****************************************************************************/
void media_vid_get_current_frame_num(module_type src_mod_id, kal_uint32 *frame_num)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    *frame_num = video_dec_get_current_frame_no();
}


/*****************************************************************************
 * FUNCTION
 *  media_vid_frame_to_time
 * DESCRIPTION
 *  This function is to map given frame number to the time.
 * PARAMETERS
 *  frame       [IN]        
 *  time        [?]         
 * RETURNS
 *  The result of this action.
 *****************************************************************************/
kal_int32 media_vid_frame_to_time(kal_uint32 frame, kal_uint32 *time)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if ((video_dec_frame2time(frame, time)) == MEDIA_STATUS_OK)
    {
        return MED_RES_OK;
    }
    else
    {
        return MED_RES_ERROR;
    }
}

⌨️ 快捷键说明

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