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

📄 uoctrl.cpp

📁 这是DVD中伺服部分的核心代码
💻 CPP
📖 第 1 页 / 共 3 页
字号:
 *      UOCTRL_FAILURE if error occurs
 */
UOCTRL_STATUS   UOCtrlBackwardPlay(uint32 speed)
{
    UOCTRL_STATUS   tRetStatus    = UOCTRL_SUCCESS;
    uint64          UO_mask_table = 0;

    DBGPRINT(DBG_ON(DBG_TRACE), ("UOCtrlBackwardPlay: Enter\n"));

    /* Entering playback control critical section */
    PlayCtrlTakeSemaphore();

    /* Get the UO Mask table */
    if (PlayCtrlGetUOPMaskTable(&UO_mask_table) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("UOCtrlBackwardPlay: Failed to get UO Mask table!\n"));
        tRetStatus = UOCTRL_FAILURE;
    }
    else
    {
        /* Check the UO Mask */
        if ( (UO_mask_table & UOMASK_BACKWARD_PLAY) != 0)
        {
            /* UO is prohibited */
            tRetStatus = UOCTRL_PROHIBITED;
#ifdef VDVD_ENABLE_BDJ
            BDJ_SystemEvent( bdj_handle, BDJ_UOP_MASKED, (UInt32)(UOP_MASK_BACKWARD_PLAY_MASK) );
#endif
        }
        else
        {
            /* Tell playback control engine to play backward at specified speed */
            if (PlayCtrlBackwardPlay(speed) != PLAYCTRL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("UOCtrlBackwardPlay: Failed to play backward!\n"));
                tRetStatus = UOCTRL_FAILURE;
            }
        }
    }

    /* Leaving playback control critical section */
    PlayCtrlGiveSemaphore();

    return (tRetStatus);
}

/**
 * UOCtrlPrimaryAudioChange -- change presentation of audio stream.
 *
 * @param
 *      audio_stream_number -- the audio stream number to present.
 *
 * @retval
 *      UOCTRL_SUCCESS if UO is allowed
 *      UOCTRL_PROHIBITED if UO is prohibited
 *      UOCTRL_FAILURE if error occurs
 */
UOCTRL_STATUS   UOCtrlPrimaryAudioChange(uint32 audio_stream_number)
{
    UOCTRL_STATUS   tRetStatus    = UOCTRL_SUCCESS;
    uint64          UO_mask_table = 0;

    DBGPRINT(DBG_ON(DBG_TRACE), ("UOCtrlPrimaryAudioChange: Enter\n"));

    /* Entering playback control critical section */
    PlayCtrlTakeSemaphore();

    /* Get the UO Mask table */
    if (PlayCtrlGetUOPMaskTable(&UO_mask_table) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("UOCtrlPrimaryAudioChange: Failed to get UO Mask table!\n"));
        tRetStatus = UOCTRL_FAILURE;
    }
    else
    {
        /* Check the UO Mask */
        if ( (UO_mask_table & UOMASK_PRIMARY_AUDIO_CHANGE) != 0)
        {
            /* UO is prohibited */
            tRetStatus = UOCTRL_PROHIBITED;
#ifdef VDVD_ENABLE_BDJ
            BDJ_SystemEvent( bdj_handle, BDJ_UOP_MASKED, (UInt32)(UOP_MASK_AUDIO_CHANGE_MASK) );
#endif
        }
        else
        {
            /* Tell playback control engine to change audio stream */
            if (PlayCtrlAudioChange(audio_stream_number) != PLAYCTRL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("UOCtrlPrimaryAudioChange: Failed to change audio stream!\n"));
                tRetStatus = UOCTRL_FAILURE;
            }
        }
    }

    /* Leaving playback control critical section */
    PlayCtrlGiveSemaphore();

    return (tRetStatus);
}

/**
 * UOCtrlSecondaryVideoEnable -- The operation to change the presentation of
 *      secondary video stream from enable to disable, and vice versa.
 *
 * @param
 *      disp_v_flag -- enable  = 1
 *                     disable = 0
 *
 * @retval
 *      UOCTRL_SUCCESS if UO is allowed
 *      UOCTRL_PROHIBITED if UO is prohibited
 *      UOCTRL_FAILURE if error occurs
 */
UOCTRL_STATUS   UOCtrlSecondaryVideoEnable(BOOLEAN disp_v_flag)
{
    DBGPRINT(DBG_ON(DBG_TRACE), ("UOCtrlSecondaryVideoEnable: STUBBED\n"));
    return (UOCTRL_NOT_IMPLEMENTED);
}

/**
 * UOCtrlSecondaryVideoChange -- change presentation of the secondary video stream.
 *
 * @param
 *      video_stream_number -- the video stream number to present.
 *
 * @retval
 *      UOCTRL_SUCCESS if UO is allowed
 *      UOCTRL_PROHIBITED if UO is prohibited
 *      UOCTRL_FAILURE if error occurs
 */
UOCTRL_STATUS   UOCtrlSecondaryVideoChange(uint32 video_stream_number)
{
    DBGPRINT(DBG_ON(DBG_TRACE), ("UOCtrlSecondaryVideoChange: STUBBED\n"));
    return (UOCTRL_NOT_IMPLEMENTED);
}

/**
 * UOCtrlSecondaryAudioEnable -- The operation to change the presentation of
 *      secondary audio stream from enable to disable, and vice versa.
 *
 * @param
 *      disp_a_flag -- enable  = 1
 *                     disable = 0
 *
 * @retval
 *      UOCTRL_SUCCESS if UO is allowed
 *      UOCTRL_PROHIBITED if UO is prohibited
 *      UOCTRL_FAILURE if error occurs
 */
UOCTRL_STATUS UOCtrlSecondaryAudioEnable(BOOLEAN disp_a_flag)
{
    DBGPRINT(DBG_ON(DBG_TRACE), ("UOCtrlSecondaryAudioEnable: STUBBED\n"));
    return (UOCTRL_NOT_IMPLEMENTED);
}

/**
 * UOCtrlSecondaryAudioChange -- change presentation of the secondary audio stream.
 *
 * @param
 *      audio_stream_number -- the audio stream number to present.
 *
 * @retval
 *      UOCTRL_SUCCESS if UO is allowed
 *      UOCTRL_PROHIBITED if UO is prohibited
 *      UOCTRL_FAILURE if error occurs
 */
UOCTRL_STATUS UOCtrlSecondaryAudioChange(uint32 audio_stream_number)
{
    DBGPRINT(DBG_ON(DBG_TRACE), ("UOCtrlSecondaryAudioChange: STUBBED\n"));
    return (UOCTRL_NOT_IMPLEMENTED);
}

/**
 * UOCtrlPGandSTEnable -- The operation to change the presentation of
 *      PG textST stream from enable to disable, and vice versa.
 *
 * @param
 *      disp_s_flag -- enable  = 1
 *                     disable = 0
 *
 * @retval
 *      UOCTRL_SUCCESS if UO is allowed
 *      UOCTRL_PROHIBITED if UO is prohibited
 *      UOCTRL_FAILURE if error occurs
 */
UOCTRL_STATUS   UOCtrlPGandSTEnable(BOOLEAN disp_s_flag)
{
    UOCTRL_STATUS   tRetStatus    = UOCTRL_SUCCESS;
    uint64          UO_mask_table = 0;

    DBGPRINT(DBG_ON(DBG_TRACE), ("UOCtrlPGandSTEnable: Enter\n"));

    /* Entering playback control critical section */
    PlayCtrlTakeSemaphore();

    /* Get the UO Mask table */
    if (PlayCtrlGetUOPMaskTable(&UO_mask_table) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("UOCtrlPGandSTEnable: Failed to get UO Mask table!\n"));
        tRetStatus = UOCTRL_FAILURE;
    }
    else
    {
        /* Check the UO Mask */
        if ( (UO_mask_table & UOMASK_PG_AND_ST_ENABLE) != 0)
        {
            /* UO is prohibited */
            tRetStatus = UOCTRL_PROHIBITED;
#ifdef VDVD_ENABLE_BDJ
            BDJ_SystemEvent( bdj_handle, BDJ_UOP_MASKED, (UInt32)(UOP_MASK_PG_TEXTST_ENABLE_DISABLE_MASK) );
#endif
        }
        else
        {
            /* turn subtitle display on or off */
            if (disp_s_flag)
            {
                PlayCtrlSubtitleDisplayOn();
            }
            else
            {
                PlayCtrlSubtitleDisplayOff();
            }
        }
    }

    /* Leaving playback control critical section */
    PlayCtrlGiveSemaphore();

    return (tRetStatus);
}

/**
 * UOCtrlPGandSTChange -- change presentation of presentation graphics and subtitle stream.
 *
 * @param
 *      stream_number -- the presentation graphics and subtitle stream to present.
 *
 * @retval
 *      UOCTRL_SUCCESS if UO is allowed
 *      UOCTRL_PROHIBITED if UO is prohibited
 *      UOCTRL_FAILURE if error occurs
 *
 * NOTE: User can use either the PG textST Stream Number Change UO or the PiP PG textST Stream
 * Number Change UO at one time, can not use both at the same time.
 */
UOCTRL_STATUS   UOCtrlPGandSTChange(uint32 stream_number)
{
    UOCTRL_STATUS   tRetStatus    = UOCTRL_SUCCESS;
    uint64          UO_mask_table = 0;

    DBGPRINT(DBG_ON(DBG_TRACE), ("UOCtrlPGandSTChange: Enter\n"));

    /* Entering playback control critical section */
    PlayCtrlTakeSemaphore();

    /* Get the UO Mask table */
    if (PlayCtrlGetUOPMaskTable(&UO_mask_table) != PLAYCTRL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("UOCtrlPGandSTChange: Failed to get UO Mask table!\n"));
        tRetStatus = UOCTRL_FAILURE;
    }
    else
    {
        /* Check the UO Mask */
        if ( (UO_mask_table & UOMASK_PG_AND_ST_CHANGE) != 0)
        {
            /* UO is prohibited */
            tRetStatus = UOCTRL_PROHIBITED;
#ifdef VDVD_ENABLE_BDJ
            BDJ_SystemEvent( bdj_handle, BDJ_UOP_MASKED, (UInt32)(UOP_MASK_PG_TEXTST_CHANGE_MASK) );
#endif
        }
        else
        {
            /* a stream value of zero is used to turn off subtitle display */
            if (stream_number == 0)
            {
                PlayCtrlSubtitleDisplayOff();
            }
            else
            {
                /* Tell playback control engine to change subtitle stream */
                if (PlayCtrlSubtitleChange(stream_number) != PLAYCTRL_SUCCESS)
                {
                    DBGPRINT(DBG_ON(DBG_ERROR), ("UOCtrlPGandSTChange: Failed to change subtitle stream!\n"));
                    tRetStatus = UOCTRL_FAILURE;
                }
                else
                {
                    PlayCtrlSubtitleDisplayOn();
                }
            }
        }
    }

    /* Leaving playback control critical section */
    PlayCtrlGiveSemaphore();

    return (tRetStatus);
}

/**
 * UOCtrlPIPPGandSTEnable -- The operation to change the presentation of
 *      PG textST stream from enable to disable, and vice versa for PIP.
 *
 * @param
 *      disp_s_flag -- enable  = 1
 *                     disable = 0
 *
 * @retval
 *      UOCTRL_SUCCESS if UO is allowed
 *      UOCTRL_PROHIBITED if UO is prohibited
 *      UOCTRL_FAILURE if error occurs
 */
UOCTRL_STATUS   UOCtrlPIPPGandSTEnable(BOOLEAN disp_s_flag)
{
    DBGPRINT(DBG_ON(DBG_TRACE), ("UOCtrlPIPPGandSTEnable: STUBBED\n"));
    return (UOCTRL_NOT_IMPLEMENTED);
}

/**
 * UOCtrlPIPPGandSTChange -- change presentation stream of PG textST for PIP.
 *
 * @param
 *      stream_number -- the presentation graphics and subtitle stream to present.
 *
 * @retval
 *      UOCTRL_SUCCESS if UO is allowed
 *      UOCTRL_PROHIBITED if UO is prohibited
 *      UOCTRL_FAILURE if error occurs
 *
 * NOTE: User can use either the 揚G textST Stream Number Change

⌨️ 快捷键说明

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