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

📄 vdoplyapp.c

📁 plutommi mtkapp Video Src
💻 C
📖 第 1 页 / 共 5 页
字号:
#if defined(__MMI_AUDIO_PLAYER__) && defined(__MMI_BT_MTK_SUPPORT__) && defined(__MMI_A2DP_SUPPORT__)    
    if (mmi_vdoply_is_output_to_bt())
    {
        av_bt_close_codec();
    }
#endif /* __MMI_AUDIO_PLAYER__ && __MMI_BT_MTK_SUPPORT__ && __MMI_A2DP_SUPPORT__ */
 
}



/*****************************************************************************
*
* VDOPLY Play                                                        
*
*****************************************************************************/


/*****************************************************************************
 * FUNCTION
 *  mmi_vdoply_is_in_app
 * DESCRIPTION
 *  is in video player app or not
 * PARAMETERS
 *  void
 * RETURNS
 * BOOL
 *****************************************************************************/
BOOL mmi_vdoply_is_in_app(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_vdoply_cntx.state != VDOPLY_STATE_EXIT)
    {
        return TRUE;
    }
    else
    {
        return FALSE;
    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_vdoply_null_key_event
 * DESCRIPTION
 *  empty key event
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void mmi_vdoply_null_key_event(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
}


/*****************************************************************************
 * FUNCTION
 *  mmi_vdoply_blt_screen
 * DESCRIPTION
 *  blt full screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void mmi_vdoply_blt_screen(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
   
    if (g_vdoply_cntx.ui_type == VDOPLY_UI_TYPE_NORMAL)
    {
    #ifdef __VDOPLY_FEATURE_HORIZONTAL_VIEW__        
        gdi_layer_blt_previous(0, 0, UI_device_height - 1, UI_device_width - 1);
    #else
        gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
    #endif
    }
    else if (g_vdoply_cntx.ui_type == VDOPLY_UI_TYPE_FULLSCR)
    {
        gdi_layer_blt_previous(0, 0, UI_device_height - 1, UI_device_width - 1);
    }

}


/*****************************************************************************
 * FUNCTION
 *  mmi_vdoply_get_storage_disk_path
 * DESCRIPTION
 *  get current active storage disk path
 * PARAMETERS
 *  drv_buf     [IN]        
 * RETURNS
 * BOOL
 *****************************************************************************/
static BOOL mmi_vdoply_get_storage_disk_path(PS8 drv_buf)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S8 buf[64];

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (FS_NO_ERROR == FS_GetDevStatus(g_vdoply_cntx.storage, FS_MOUNT_STATE_ENUM))
    {
        sprintf(buf, "%c:\\", (U8)g_vdoply_cntx.storage);
        AnsiiToUnicodeString(drv_buf, buf);
        return TRUE;
    }
    else
    {
        g_vdoply_cntx.storage = (U16)MMI_PUBLIC_DRV;

        if (FS_NO_ERROR != FS_GetDevStatus(g_vdoply_cntx.storage ,FS_MOUNT_STATE_ENUM))
            return FALSE;

        sprintf(buf, "%c:\\", (U8)g_vdoply_cntx.storage );
        AnsiiToUnicodeString(drv_buf, buf);
        return TRUE;
    }   
}


/*****************************************************************************
 * FUNCTION
 *  mmi_vdoply_get_storage_file_path
 * DESCRIPTION
 *  get current active storage disk path
 * PARAMETERS
 *  filepath        [OUT]       Storage file path
 * RETURNS
 * BOOL
 *****************************************************************************/
BOOL mmi_vdoply_get_storage_file_path(PS8 filepath)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S8 drv_buf[8];

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_vdoply_load_setting();
    
    if (mmi_vdoply_get_storage_disk_path(drv_buf))
    {
        pfnUnicodeStrcpy((PS8)filepath, (PS8)drv_buf);
        pfnUnicodeStrcat((PS8)filepath, (PS8)VDOPLY_STORAGE_FILEPATH_PHONE);
        return TRUE;
    }
    else
    {
        return FALSE;
    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_vdoply_create_file_dir
 * DESCRIPTION
 *  create file directory-resursivly
 * PARAMETERS
 *  filepath        [IN]        Filepath to be created
 * RETURNS
 *  S32
 *****************************************************************************/
S32 mmi_vdoply_create_file_dir(S8 *filepath)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S8 buf_createpath[128];
    S8 buf_filepath[FMGR_PATH_BUFFER_SIZE];
    S32 fs_ret;
    S32 str_len;
    S32 cmp_ret;
    S32 i;
    FS_HANDLE file_handle;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    fs_ret = 0;

    file_handle = FS_Open((kal_uint16*) filepath, FS_OPEN_DIR | FS_READ_ONLY);

    /* path already exist */
    if (file_handle >= 0)
    {
        FS_Close(file_handle);
        return 0;   /* already exist, 0 means successful in file system */
    }

    /* create directory if it is not there */
    pfnUnicodeStrcpy((PS8) buf_filepath, (PS8) filepath);

    str_len = pfnUnicodeStrlen((PS8) buf_filepath);
    str_len *= ENCODING_LENGTH;

    /* skip drive. "C:\" */
    for (i = 3 * ENCODING_LENGTH; i < str_len; i += 2)
    {
        cmp_ret = pfnUnicodeStrncmp((PS8) & buf_filepath[i], (PS8) L"\\", 1);
        if (cmp_ret == 0)
        {
            /* create dir */

            pfnUnicodeStrncpy((PS8) buf_createpath, (PS8) buf_filepath, i / ENCODING_LENGTH);
            buf_createpath[i] = '\0';
            buf_createpath[i + 1] = '\0';

            fs_ret = FS_CreateDir((PU16) buf_createpath);

            if (fs_ret < 0)
            {
                return fs_ret;
            }
        }
    }

    return fs_ret;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_vdoply_check_and_restore_valid_drv
 * DESCRIPTION
 *  check if current storage path is valid or not.
 * PARAMETERS
 *  void
 * RETURNS
 * BOOL
 *****************************************************************************/
BOOL mmi_vdoply_check_and_restore_valid_drv(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    if (FS_NO_ERROR == FS_GetDevStatus(g_vdoply_cntx.storage ,FS_MOUNT_STATE_ENUM))
    {
        return TRUE;
    }
    else
    {
        g_vdoply_cntx.storage = (U16)MMI_PUBLIC_DRV;
        if (FS_NO_ERROR == FS_GetDevStatus(g_vdoply_cntx.storage ,FS_MOUNT_STATE_ENUM))
        {
            mmi_vdoply_store_setting();
            return TRUE;
        }
        else
        {
        #ifdef __USB_IN_NORMAL_MODE__
            if (mmi_usb_is_in_mass_storage_mode())
            {            
                /* user driver is mass storage mode */
                return FALSE;
            }
            else
            {
                MMI_ASSERT(0);
            }
        #else /* __USB_IN_NORMAL_MODE__ */
            MMI_ASSERT(0);
        #endif /* __USB_IN_NORMAL_MODE__ */
        }
    }

    return TRUE;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_vdoply_get_storage
 * DESCRIPTION
 *  get storage
 * PARAMETERS
 *  void
 * RETURNS
 *  U16
 *****************************************************************************/
U16 mmi_vdoply_get_storage(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    return g_vdoply_cntx.storage;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_vdoply_set_storage
 * DESCRIPTION
 *  set storage
 * PARAMETERS
 *  storage     [IN]        Storage location enum
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_vdoply_set_storage(U16 storage)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    g_vdoply_cntx.storage = storage;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_vdoply_load_setting
 * DESCRIPTION
 *  load setting from NVRAM
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_vdoply_load_setting(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S16 error;
    MMI_BOOL is_inited_before;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_vdoply_cntx.is_load_setting)
    {
        return;
    }

    is_inited_before = TRUE;

    g_vdoply_cntx.is_load_setting = TRUE;

    /* storage setting */

⌨️ 快捷键说明

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