Moved _GifDecoder::GetValue() function to _GifDecoderImpl::
authorJungYumin <y_m.jung@samsung.com>
Wed, 20 Mar 2013 08:35:02 +0000 (17:35 +0900)
committerJungYumin <y_m.jung@samsung.com>
Wed, 20 Mar 2013 08:35:02 +0000 (17:35 +0900)
Change-Id: I7ecef977422073e7f497db5df7ee9083701700ba
Signed-off-by: JungYumin <y_m.jung@samsung.com>
src/FMedia_GifDecoderImpl.cpp
src/FMedia_GifDecoderImpl.h

index 1edb0b7..f953f20 100644 (file)
@@ -135,7 +135,7 @@ _GifDecoderImpl::GetNextFrameN(long& duration)
        SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagated. ", GetErrorMessage(r));
        pBuf.get()->Flip();
 
-       r = __pGifDecoder->GetValue(String("duration"), longValue);
+       r = GetValue(String("duration"), longValue);
        SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r,
                           "[%s] dec.GetValue(duration)", GetErrorMessage(r));
        duration = longValue.ToLong();
@@ -170,4 +170,22 @@ _GifDecoderImpl::GetNextBitmapN(long& duration, Tizen::Graphics::BufferScaling b
        return pBitmap.release();
 }
 
+result
+_GifDecoderImpl::GetValue(const Tizen::Base::String& key, Tizen::Base::Object &value)
+{
+       result r = E_SUCCESS;
+       if (key.Equals(L"duration", false))
+       {
+               Long *pLong = null;
+               pLong = dynamic_cast<Long*>(&value);
+
+               SysTryReturn(NID_MEDIA, pLong, E_INVALID_ARG, E_INVALID_ARG, "value is not a Long");
+               pLong->value = __pGifDecoder->GetDuration();
+       }
+       else
+       {
+               r = E_OBJ_NOT_FOUND;
+       }
+       return r;
+}
 }} // Tizen::Media
index 387c5df..7126235 100644 (file)
@@ -132,6 +132,19 @@ public:
         *                      The specific error code can be accessed using the GetLastResult() method.
         */
        Tizen::Graphics::Bitmap* GetNextBitmapN(long& duration, Tizen::Graphics::BufferScaling bufferScaling = Tizen::Graphics::BUFFER_SCALING_AUTO);
+
+       /**
+        * Gets the value of given key.
+        *
+        * @return   An error code
+        * @param[in]  key                                        The key of the value.
+        * @param[out] value                                    The output value.
+        * @exception  E_SUCCESS                                The method is successful.
+        * @exception  E_INVALID_ARG                    The input parameter is invalid.
+        * @exception  E_UNSUPPORTED_OPERATION  This method is unsupported.
+        */
+       result GetValue(const Tizen::Base::String& key, Tizen::Base::Object &value);
+
 private:
        _GifDecoderImpl(const _GifDecoderImpl& rhs);
        _GifDecoderImpl& operator =(const _GifDecoderImpl& rhs);