Add the DISPLAY_RIGHT_VIOLATED exception
authorEonseokLee <eonseok.lee@samsung.com>
Fri, 29 Mar 2013 05:24:11 +0000 (14:24 +0900)
committerEonseokLee <eonseok.lee@samsung.com>
Fri, 29 Mar 2013 08:30:20 +0000 (17:30 +0900)
Change-Id: I110edb00e1094ceaff687ab43d7ce6c4fabcbfa2
Signed-off-by: EonseokLee <eonseok.lee@samsung.com>
inc/FMediaPlayer.h
inc/FMediaPlayerTypes.h
src/FMedia_PlayerImpl.cpp

index 9a8c76e..255c0bf 100755 (executable)
@@ -357,6 +357,7 @@ public:
        * @exception    E_RIGHT_EXPIRED                                 The content right has expired.
        * @exception    E_RIGHT_NO_LICENSE                              The content has no license.
        * @exception    E_RIGHT_FUTURE_USE                              The content right is for future use.
+       * @exception    E_DISPLAY_RIGHT_VIOLATED                                The display right is not valid for the specific output device. @b Since: @b 2.1
        * @see                          Close()
        */
        result OpenFile(const Tizen::Base::String& mediaLocalPath, bool isAsync = false);
@@ -382,6 +383,7 @@ public:
        * @exception    E_RIGHT_EXPIRED                                 The content right has expired.
        * @exception    E_RIGHT_NO_LICENSE                              The content has no license.
        * @exception    E_RIGHT_FUTURE_USE                              The content right is for future use.
+       * @exception    E_DISPLAY_RIGHT_VIOLATED                                The display right is not valid for the specific output device. @b Since: @b 2.1
        * @remarks      This method is not thread-safe when @c isAsync is @c false.
        * @remarks      Input URL should be encoded if there are non-alphanumeric characters in URL.
        * @see                  Close()
@@ -409,6 +411,7 @@ public:
        * @exception    E_RIGHT_EXPIRED                                 The content right has expired.
        * @exception    E_RIGHT_NO_LICENSE                              The content has no license.
        * @exception    E_RIGHT_FUTURE_USE                              The content right is for future use.
+       * @exception    E_DISPLAY_RIGHT_VIOLATED                                The display right is not valid for the specific output device. @b Since: @b 2.1
        * @see                          Close()
        */
        result OpenBuffer(const Tizen::Base::ByteBuffer& mediaBuffer, bool isAsync = false);
index 61a7e0e..31d351f 100644 (file)
@@ -75,6 +75,8 @@ enum PlayerErrorReason
        PLAYER_ERROR_RIGHT_EXPIRED,                /**< The content right has expired */
        PLAYER_ERROR_RIGHT_NO_LICENSE,                  /**< The content has no license */
        PLAYER_ERROR_RIGHT_FUTURE_USE,                  /**< The content right is for future use */
+       PLAYER_ERROR_DISPLAY_RIGHT_VIOLATED,                    /**< The display right is not valid for the specific output device @b Since: @b 2.1*/
+
 };
 
 }} // Tizen::Media
index e772e3a..89604e2 100644 (file)
@@ -1383,6 +1383,10 @@ _PlayerImpl::MapExceptionToPlayerErrorReason(int reason)
                return PLAYER_ERROR_RIGHT_FUTURE_USE;
                break;
 
+       case ::PLAYER_ERROR_DRM_NOT_PERMITTED:
+               return PLAYER_ERROR_DISPLAY_RIGHT_VIOLATED;
+               break;
+
        //Sound policy error
        case ::PLAYER_ERROR_SOUND_POLICY:
        //fall through
@@ -1472,6 +1476,10 @@ _PlayerImpl::MapExceptionToResult(int reason)
                return E_RIGHT_FUTURE_USE;
                break;
 
+       case ::PLAYER_ERROR_DRM_NOT_PERMITTED:
+               return E_DISPLAY_RIGHT_VIOLATED;
+               break;
+
        default:
                return E_SYSTEM;
                break;
@@ -1541,13 +1549,15 @@ _PlayerImpl::PlayerErrorCallBack(int errorCode, void *pUserData)
 {
        SysTryReturn(NID_MEDIA, pUserData, , E_SYSTEM, "[E_SYSTEM] A system error has been occurred. pUserData is null.");
        _PlayerImpl *pPlayerImpl = (_PlayerImpl *)pUserData;
-       if (((errorCode == ::PLAYER_ERROR_DRM_EXPIRED) ||
+       if ((((errorCode == ::PLAYER_ERROR_DRM_EXPIRED) ||
                        (errorCode == ::PLAYER_ERROR_DRM_NO_LICENSE) ||
                        (errorCode == ::PLAYER_ERROR_DRM_FUTURE_USE) ||
                        (errorCode == ::PLAYER_ERROR_NOT_SUPPORTED_FILE) ||
                        (errorCode == ::PLAYER_ERROR_INVALID_URI) ||
-                       (errorCode == ::PLAYER_ERROR_NO_SUCH_FILE)) &&
-                       (pPlayerImpl->__isAsync == true))
+                       (errorCode == ::PLAYER_ERROR_NO_SUCH_FILE) ||
+                       (errorCode == ::PLAYER_ERROR_CONNECTION_FAILED) ||
+                       (errorCode == ::PLAYER_ERROR_DRM_NOT_PERMITTED)) &&
+                       (pPlayerImpl->__isAsync == true)) && ((pPlayerImpl->__currentState == PLAYER_STATE_INITIALIZED) || pPlayerImpl->__currentState == PLAYER_STATE_CLOSED))
        {
                pPlayerImpl->HandlePlayerPrepared(errorCode);
        }