From 66394eb7429c77c0c45288dc384db5192f0ebd18 Mon Sep 17 00:00:00 2001 From: JungYumin Date: Wed, 20 Mar 2013 17:35:02 +0900 Subject: [PATCH] Moved _GifDecoder::GetValue() function to _GifDecoderImpl:: Change-Id: I7ecef977422073e7f497db5df7ee9083701700ba Signed-off-by: JungYumin --- src/FMedia_GifDecoderImpl.cpp | 20 +++++++++++++++++++- src/FMedia_GifDecoderImpl.h | 13 +++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/FMedia_GifDecoderImpl.cpp b/src/FMedia_GifDecoderImpl.cpp index 1edb0b7..f953f20 100644 --- a/src/FMedia_GifDecoderImpl.cpp +++ b/src/FMedia_GifDecoderImpl.cpp @@ -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(&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 diff --git a/src/FMedia_GifDecoderImpl.h b/src/FMedia_GifDecoderImpl.h index 387c5df..7126235 100644 --- a/src/FMedia_GifDecoderImpl.h +++ b/src/FMedia_GifDecoderImpl.h @@ -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); -- 2.7.4