diff options
Diffstat (limited to 'fmb_player_apl/src/sce/FmbSceStream.c')
-rw-r--r-- | fmb_player_apl/src/sce/FmbSceStream.c | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/fmb_player_apl/src/sce/FmbSceStream.c b/fmb_player_apl/src/sce/FmbSceStream.c new file mode 100644 index 0000000..f094cca --- /dev/null +++ b/fmb_player_apl/src/sce/FmbSceStream.c @@ -0,0 +1,144 @@ +/** +* @brief The scenario that sets the stream control is defined. +* @since 2009/01/08 +* @note None +* @attention None +* <B><I>COPYRIGHT FUJITSU LIMITED 2009</I></B> +*/ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include "FmbCmn.h" + + +/** +* @brief Start and create thread for send. +* @param[in] sceHandle Scenario handle +* @param[in] dummy0 +* @param[in] dummy1 +* @param[in] dummy2 +* @return SceEnmResultSyncEnd Scenario is end. +* @note None +* @attention None +*/ +enum SceResultEnum StartSendThread(HANDLE sceHandle, unsigned long dummy0, unsigned long dummy1, unsigned long dummy2) +{ + BOOL result; + struct FMBComProperty *p_ComProperty; + + FMB_FUNC(TRUE); + + result = FmbStreamBegin(FMBEnmStreamSend, sceHandle); + ASSERT_USR(result == TRUE, "Impossible start to send the stream."); + + p_ComProperty = FmbGetComProperty( SceGetDevNum(sceHandle) ); + p_ComProperty->waitStreamSendEnd = FMBEnmStreamSendEndOn; + + FMB_FUNC(FALSE); + return SceEnmResultSyncEnd; +} + +/** +* @brief Start and create thread for receive. +* @param[in] sceHandle Scenario handle +* @param[in] dummy0 +* @param[in] dummy1 +* @param[in] dummy2 +* @return SceEnmResultSyncEnd Scenario is end. +* @note None +* @attention None +*/ +enum SceResultEnum StartRecvThread(HANDLE sceHandle, unsigned long dummy0, unsigned long dummy1, unsigned long dummy2) +{ + BOOL result; + + FMB_FUNC(TRUE); + + result = FmbStreamBegin(FMBEnmStreamRcv, sceHandle); + ASSERT_USR(result == TRUE, "Impossible start to receive the stream."); + + FMB_FUNC(FALSE); + return SceEnmResultSyncEnd; +} + +/** +* @brief Stop thread for send. +* @param[in] sceHandle Scenario handle +* @param[in] dummy0 +* @param[in] dummy1 +* @param[in] dummy2 +* @return SceEnmResultSyncEnd Scenario is end. +* @note None +* @attention None +*/ +enum SceResultEnum StopSendThread(HANDLE sceHandle, unsigned long dummy0, unsigned long dummy1, unsigned long dummy2) +{ + struct FMBComProperty *p_ComProperty; + struct FMBDeviceInfo *p_DevInfo; + enum FMBDeviceNumEnum deviceNum; + + FMB_FUNC(TRUE); + + deviceNum = SceGetDevNum(sceHandle); + p_DevInfo = FmbGetDevInfo(deviceNum); + + FmbSetStreamStop(FMBEnmStreamSend, &p_DevInfo->t_StreamThread_A[FMBEnmStreamSend] ); + + p_ComProperty = FmbGetComProperty( deviceNum ); + p_ComProperty->waitStreamSendEnd = FMBEnmStreamSendEndOff; + + FMB_FUNC(FALSE); + return SceEnmResultSyncEnd; +} + + +/** +* @brief Stop thread for receive. +* @param[in] sceHandle Scenario handle +* @param[in] dummy0 +* @param[in] dummy1 +* @param[in] dummy2 +* @return SceEnmResultSyncEnd Scenario is end. +* @note None +* @attention None +*/ +enum SceResultEnum StopRecvThread(HANDLE sceHandle, unsigned long dummy0, unsigned long dummy1, unsigned long dummy2) +{ + enum FMBDeviceNumEnum deviceNum; + struct FMBDeviceInfo *p_DevInfo; + FMB_FUNC(TRUE); + + deviceNum = SceGetDevNum(sceHandle); + p_DevInfo = FmbGetDevInfo(deviceNum); + + FmbSetStreamStop(FMBEnmStreamRcv, &p_DevInfo->t_StreamThread_A[FMBEnmStreamRcv] ); + + FMB_FUNC(FALSE); + return SceEnmResultSyncEnd; +} +/** +* @brief Rest thread for stream. +* @param[in] sceHandle Scenario handle +* @param[in] dummy0 +* @param[in] dummy1 +* @param[in] dummy2 +* @return SceEnmResultSyncEnd Scenario is end. +* @note None +* @attention None +*/ +enum SceResultEnum RestStreamThread(HANDLE sceHandle, unsigned long dummy0, unsigned long dummy1, unsigned long dummy2) +{ + FMB_FUNC(TRUE); + + FmbStreamRest(sceHandle); + + FMB_FUNC(FALSE); + return SceEnmResultSyncEnd; +} + + |