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

📄 playctrl.cpp

📁 这是DVD中伺服部分的核心代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlStillOff: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_STILLOFF, 0, 0, 0, TRUE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlStillOff: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlForwardPlay -- Change playback to specified speed in forward direction.
 *
 * @param
 *      speed -- playback speed
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlForwardPlay(int32 speed)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlForwardPlay: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_FORWARDPLAY, speed, 0, 0, TRUE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlForwardPlay: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlBackwardPlay -- Change playback to specified speed in backward direction.
 *
 * @param
 *      speed -- playback speed
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlBackwardPlay(int32 speed)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlBackwardPlay: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_BACKWARDPLAY, speed, 0, 0, TRUE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlBackwardPlay: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlAudioChange -- Change presentation of audio to specified audio stream
 *
 * @param
 *      audio_stream_number -- audio stream number
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlAudioChange(uint32 audio_stream_number)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlAudioChange: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_AUDIOCHANGE, audio_stream_number, 0, 0, TRUE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlAudioChange: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlSecondaryAudioChange -- Change presentation of secondary audio to
 *                                 specified secondary audio stream
 *
 * @param
 *      audio_stream_number -- secondary audio stream number
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlSecondaryAudioChange(uint32 audio_stream_number)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlSecondaryAudioChange: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     * This does not need to be a synchronous operation.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_SECONDARYAUDIOCHANGE, audio_stream_number, 0, 0, FALSE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlSecondaryAudioChange: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlSubtitleChange -- Change presentation of subtitle to specified audio stream
 *
 * @param
 *      stream_number -- subtitle stream number
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlSubtitleChange(uint32 stream_number)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlSubtitleChange: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_SUBTITLECHANGE, stream_number, 0, 0, TRUE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlSubtitleChange: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlSubtitleDisplayOn -- Enable display of decoded PG and Text ST
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlSubtitleDisplayOn(void)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlSubtitleDisplayOn: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_SUBTITLEDISPLAY, TRUE, 0, 0, TRUE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlSubtitleDisplayOn: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlSubtitleDisplayOn -- Disable display of decoded PG and Text ST
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlSubtitleDisplayOff(void)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlSubtitleDisplayOff: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_SUBTITLEDISPLAY, FALSE, 0, 0, TRUE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlSubtitleDisplayOff: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlAngleChange -- Change presentation to specified angle number.
 *
 * @param
 *      angle_number -- angle number
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlAngleChange(uint32 angle_number)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlAngleChange: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_ANGLECHANGE, angle_number, 0, 0, TRUE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlAngleChange: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlIGChange -- Change presentation of interactive graphics to
 *                     specified interactive graphics stream number.
 *
 * @param
 *      stream_number -- interactive graphics number
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlIGChange(uint32 stream_number)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlIGChange: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_IGCHANGE, stream_number, 0, 0, TRUE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlIGChange: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlTextSubtitleStyleChange -- Changle a text subtitle style to specified style.
 *
 * @param
 *      style_id -- style id of text subtitle style
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlTextSubtitleStyleChange(uint32 style_id)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlTextSubtitleStyleChange: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /* make sure the subtitle info has finished loading */
    while (hPBC->fWaitingPrefill[INPUT_BDROM_SUBPATH_TEXT_SUBTITLE] == TRUE)
    {
        OS_TaskDelayMsec(100);
    }

    /*
     * Process the command in the pbc engine task.
     * This does not need to be a synchronous operation.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_TEXTSUBTITLESTYLECHANGE, style_id, 0, 0, FALSE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlTextSubtitleStyleChange: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}


/**
 * PlayCtrlPopUpOn -- Display the pop-up menu.
 *
 * @param
 *      none
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlPopUpOn(void)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlPopUpOn: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     * Make it a synchronous call so that we can check the return code for errors.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_POPUPON, 0, 0, 0, TRUE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlPopUpOn: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlPopUpOff -- Clear the pop-up menu display.
 *
 * @param
 *      none
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlPopUpOff(void)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlPopUpOff: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     * This does not need to be a synchronous operation.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_POPUPOFF, 0, 0, 0, FALSE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlPopUpOff: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlEnableButton -- Enable a button with the specified button id.
 *
 * @param
 *      button_id -- button id
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlEnableButton(uint32 button_id)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlEnableButton: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     * This does not need to be a synchronous operation.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_ENABLEBUTTON, button_id, 0, 0, FALSE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlEnableButton: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlDisableButton -- Disable a button with the specified button id.
 *
 * @param
 *      button_id -- button id
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlDisableButton(uint32 button_id)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlDisableButton: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     * This does not need to be a synchronous operation.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_DISABLEBUTTON, button_id, 0, 0, FALSE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlDisableButton: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlMoveUpSelectedButton -- Change the button currently in the selected state to
 *                                 the normal state and the predetermined up-side button
 *                                 to the selected state.
 *
 * @param
 *      none
 *
 * @retval
 *      PLAYCTRL_STATUS
 */
PLAYCTRL_STATUS PlayCtrlMoveUpSelectedButton(void)
{
    if (hPBC == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlMoveUpSelectedButton: playback control engine not created!\n"));
        return (PLAYCTRL_FAILURE);
    }

    /*
     * Process the command in the pbc engine task.
     * This does not need to be a synchronous operation.
     */
    if (PbcEngineProcessCmd(hPBC, PLAYCTRL_MOVEUPSELECTEDBUTTON, 0, 0, 0, FALSE) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PlayCtrlMoveUpSelectedButton: pbc engine failed to process command!\n"));
        return (PLAYCTRL_FAILURE);
    }

    return (PLAYCTRL_SUCCESS);
}

/**
 * PlayCtrlMoveDownSelectedButton -- Change the button currently in the selected state to
 *                                 the normal state and the predetermin

⌨️ 快捷键说明

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