Fix the prevent & capture video bugs & thread issue
authorEonseokLee <eonseok.lee@samsung.com>
Thu, 13 Jun 2013 08:15:01 +0000 (17:15 +0900)
committerEonseokLee <eonseok.lee@samsung.com>
Thu, 13 Jun 2013 08:15:01 +0000 (17:15 +0900)
Change-Id: Ia632bb6e6b1b3b0d6f9c9693f81c098fef8f477a
Signed-off-by: EonseokLee <eonseok.lee@samsung.com>
inc/FMediaAudioRouteManager.h
inc/FMediaIPlayerVideoEventListener.h
inc/FMediaPlayer.h
packaging/osp-media.spec
src/FMedia_PlayerImpl.cpp

index 05fe09a..a37966a 100755 (executable)
@@ -218,7 +218,7 @@ public:
        *       @exception                      E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
        *       @remarks                
        *                                               - The specific error code can be accessed using the GetLastResult() method.
-       *                                               - @c AUDIO_STREAM_TYPE_NO_SOUND is returned when the error is occurred in this method.
+       *                                               - @c AUDIO_STREAM_TYPE_NO_SOUND is returned when an error has occurred in this method.
        */
        AudioStreamType GetActiveAudioStreamType(void) const;
 
index ad9b8fd..2d1dd59 100644 (file)
@@ -71,9 +71,8 @@ public:
        *       @exception       E_INVALID_DATA                     The video frame has invalid blocks.
        *       @remarks
        *                                       - The lifecycle of @c pBuffer is valid inside this method.
-       *                                       - When rendering the video frame with %Player::Play() method, the rendering performs worse than using Player instance constructed with Tizen::Graphics::BufferInfo.
+       *                                       - When rendering the video frame with Player::Play() method, the rendering performs worse than using Player instance constructed with Tizen::Graphics::BufferInfo.
        *
-       *       @see            Player::Play()
        *       @see            Player::Pause()
        *       @see            Player::SeekTo()
        */
index c58e1bb..bc45f0f 100755 (executable)
@@ -720,7 +720,7 @@ public:
        * @exception    E_INVALID_OPERATION             This method is invalid for the current media content.
        * @exception    E_SYSTEM                                                                        A system error has occurred.
        * @remarks      In the Real Time Streaming Protocol (RTSP), this method does not work properly.
-       *                               The application must wait till the invocation of %OnVideoFrameDecoded call back from framework for proper functioning.
+       *                               The application must wait till the invocation of IPlayerVideoEventListener::OnVideoFrameDecoded() callback from framework for proper functioning.
        */
        result CaptureVideo(void);
 
index 2a4c513..874b3a3 100755 (executable)
@@ -3,7 +3,7 @@
 
 Name:       osp-media
 Summary:    The Media library of OSP 
-Version:    1.2.1.0
+Version:    1.2.2.0
 Release:    1
 Group:      TO_BE/FILLED_IN
 License:    TO BE FILLED IN
index c67da02..8f1a5c4 100644 (file)
@@ -101,6 +101,7 @@ _PlayerImpl::~_PlayerImpl(void)
        __pEndOfStreamMutex->Acquire();
 
        EventDrivenThread::Quit();
+       EventDrivenThread::Join();
 
        r = __pMutex->Acquire();
        SysTryLog(NID_MEDIA, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
@@ -1713,7 +1714,7 @@ _PlayerImpl::PlayerVideoCapturedCallBack(unsigned char *pData, int width, int he
        }
        else
        {
-               delete pStream;
+               delete[] pStream;
        }
        __pMutex->Release();
 
@@ -1743,7 +1744,7 @@ _PlayerImpl::PlayerVideoFrameDecodedCallBack(unsigned char *pData, int width, in
        }
        else
        {
-               delete pStream;
+               delete[] pStream;
        }
        __pMutex->Release();
        //pPlyarImpl->HandlePlayerVideoFrameDecoded(pData, width , height, size);
@@ -1941,7 +1942,7 @@ _PlayerImpl::HandlePlayerVideoCaptured(unsigned char *pData, int width, int heig
        r = MapExceptionToResult(err);
        SysTryReturn(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Failed to perform player_get_state operation with - 0x%x", GetErrorMessage(r), err);
 
-       if (__corePlayerCurState == ::PLAYER_STATE_PLAYING)
+       if (__corePlayerCurState == ::PLAYER_STATE_PLAYING && __isStateChangeForVideoCapture == true)
        {
                err = player_pause(__hPlayer);
                r = MapExceptionToResult(err);
@@ -1950,10 +1951,11 @@ _PlayerImpl::HandlePlayerVideoCaptured(unsigned char *pData, int width, int heig
                err = player_get_state(__hPlayer, &__corePlayerCurState);
                r = MapExceptionToResult(err);
                SysTryReturn(NID_MEDIA, r == E_SUCCESS, , r, "[%s] Failed to perform player_get_state operation with - 0x%x", GetErrorMessage(r), err);
-       }
 
-       SysTryCatch(NID_MEDIA, __corePlayerCurState == ::PLAYER_STATE_PAUSED, r = E_INVALID_STATE, E_INVALID_STATE,
-                                                       "[E_INVALID_STATE] Player state is in an invalid state. Current state is %d", __corePlayerCurState);
+               SysTryCatch(NID_MEDIA, __corePlayerCurState == ::PLAYER_STATE_PAUSED, r = E_INVALID_STATE, E_INVALID_STATE,
+                                                               "[E_INVALID_STATE] Player state is in an invalid state. Current state is %d", __corePlayerCurState);
+               __currentState = PLAYER_STATE_PAUSED;
+       }
 
 
        SysTryCatch(NID_MEDIA, !((width == 0) || (height == 0)), r = E_INVALID_DATA, E_INVALID_DATA,
@@ -2002,7 +2004,6 @@ _PlayerImpl::HandlePlayerVideoCaptured(unsigned char *pData, int width, int heig
                r = SendCapturedVideoFrame( _PLAYER_VIDEO_EVENT_DECODED_WITHOUT_DATA, pData, size, width, height, E_SUCCESS);
                SysTryCatch(NID_MEDIA, r == E_SUCCESS, , r, "[%s]Propagating", GetErrorMessage(r));
        }
-       __currentState = PLAYER_STATE_PAUSED;
        return;
 CATCH:
        __isStateChangeForVideoCapture = false;