2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FMedia_ImageUriDataFactory.h
20 * @brief This file contains the declaration of _ImageUriDataFactory class,
21 * required internally by Image::DecodeUrl.
24 #ifndef FMEDIA_INTERNAL_IMAGEURIDATAFACTORY_H_
25 #define FMEDIA_INTERNAL_IMAGEURIDATAFACTORY_H_
27 #include <unique_ptr.h>
29 namespace Tizen{ namespace Media{
31 static const int _TIMEOUT_INFINITE = 0;
33 class _ImageUriDataFactory
34 : public Tizen::Base::Object
35 , Tizen::Base::Runtime::IEventListener
38 static _ImageUriDataFactory* GetInstance(void);
40 result Construct(void);
43 DecodeUrl(const Tizen::Base::Utility::Uri& srcImageUrl,
44 Tizen::Graphics::BitmapPixelFormat colorFormat,
45 int destWidth, int destHeight, RequestId &reqId,
46 const Tizen::Base::Runtime::IEventListener& listener, long timeout);
48 int GetHolderCount(void);
49 int GetWorkerCount(void);
50 void Remove(RequestId reqId);
52 void OnMediaSessionEnded(RequestId requestId);
55 _ImageUriDataFactory(void);
56 virtual ~_ImageUriDataFactory(void);
57 _ImageUriDataFactory(const _ImageUriDataFactory& value);
58 _ImageUriDataFactory& operator =(const _ImageUriDataFactory& value);
60 int AddImageUriData(const Tizen::Base::Utility::Uri& srcImageUrl,
61 Tizen::Graphics::BitmapPixelFormat colorFormat,
62 int destWidth, int destHeight, RequestId &reqId,
63 const Tizen::Base::Runtime::IEventListener& listener, long timeout);
64 result StartDecode(void);
67 static void InitSingleton(void);
68 static void DestroySingleton(void);
70 RequestId __requestId;
71 static _ImageUriDataFactory* __pTheInstance;
72 friend struct std::default_delete<_ImageUriDataFactory>;
73 std::unique_ptr<Tizen::Base::Collection::Queue> __pImageUriDataHolderQueue;
74 std::unique_ptr<Tizen::Base::Collection::LinkedList> __pImageUriDataWorkingList;
80 #endif // FMEDIA_INTERNAL_IMAGEURIDATAFACTORY_H_