SysTryCatch(NID_MEDIA, __hCanvas != 0, r = E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. __hCanvas = %d", __hCanvas);
}
+ __pEndOfStreamHandler.reset(new (std::nothrow) Thread);
+ SysTryReturn(NID_MEDIA, __pEndOfStreamHandler.get() != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
+ "[E_OUT_OF_MEMORY]could not create memory for End of steam handling thread");
+ r = __pEndOfStreamHandler->Construct(*this);
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Thread::Construct failed", GetErrorMessage(r));
+
__pMutex->Acquire();
SysTryLog(NID_MEDIA, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
__playerCount++;
r = SetLooping(false);
SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Failed to perform SetLooping operation.", GetErrorMessage(r));
+ __pEndOfStreamHandler.reset(new (std::nothrow) Thread);
+ SysTryReturn(NID_MEDIA, __pEndOfStreamHandler.get() != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
+ "[E_OUT_OF_MEMORY]could not create memory for End of steam handling thread");
+ r = __pEndOfStreamHandler->Construct(*this);
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Thread::Construct failed", GetErrorMessage(r));
+
__pMutex->Acquire();
SysTryLog(NID_MEDIA, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
__playerCount++;
r = SetLooping(false);
SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Propagating. Failed to perform SetLooping operation.", GetErrorMessage(r));
+ __pEndOfStreamHandler.reset(new (std::nothrow) Thread);
+ SysTryReturn(NID_MEDIA, __pEndOfStreamHandler.get() != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
+ "[E_OUT_OF_MEMORY]could not create memory for End of steam handling thread");
+ r = __pEndOfStreamHandler->Construct(*this);
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Thread::Construct failed", GetErrorMessage(r));
+
__pMutex->Acquire();
SysTryLog(NID_MEDIA, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
__playerCount++;
pPlyarImpl->HandlePlayerSeekCompleted();
}
+//This is used exclusively for End of stream handling
+Tizen::Base::Object*
+_PlayerImpl::Run(void)
+{
+ player_stop(__hPlayer);
+ __currentState = PLAYER_STATE_ENDOFCLIP;
+ SendEvent(_PLAYER_EVENT_ENDOFCLIP, 0);
+}
+
//Tizen Handle Functions
void
_PlayerImpl::HandlePlayerPrepared(int errorCode)
void
_PlayerImpl::HandlePlayerCompleted(void)
{
- player_stop(__hPlayer);
- __currentState = PLAYER_STATE_ENDOFCLIP;
- SendEvent(_PLAYER_EVENT_ENDOFCLIP, 0);
+ result r = E_SUCCESS;
+ r = __pEndOfStreamHandler->Start();
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Thread::Start failed", GetErrorMessage(r));
}
void
class _OSP_EXPORT_ _PlayerImpl
: public Tizen::Base::Object
, public Tizen::Base::Runtime::ITimerEventListener
+ , public Tizen::Base::Runtime::IRunnable
{
enum Orientation
{
int GetHttpStreamingDownloadProgress(void) const;
void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
+ Tizen::Base::Object* Run(void);
static void PlayerStartedCallBack(void *pUserData);
static void PlayerCompletedCallBack(void *pUserData);
std::unique_ptr<_PlayerProgressiveDownloadEvent> __pPlayerProgressiveDownloadEvent;
std::unique_ptr<Tizen::Base::Runtime::Timer> __pPdTimer;
std::unique_ptr<Tizen::Base::ByteBuffer> __pTargetByteBuffer;
+ std::unique_ptr<Tizen::Base::Runtime::Thread> __pEndOfStreamHandler;
static std::unique_ptr<Tizen::Base::Runtime::Mutex> __pMutex;
static bool __isInstanceMutexInitialized;