Lines Matching refs:std

43 std::shared_ptr<C2ComponentStore> GetPreferredCodec2ComponentStore();
58 id_t id, std::shared_ptr<C2Allocator> *const allocator) override;
60 virtual std::vector<std::shared_ptr<const C2Allocator::Traits>> listAllocators_nb() in listAllocators_nb()
62 return std::vector<std::shared_ptr<const C2Allocator::Traits>>(); /// \todo in listAllocators_nb()
69 void setComponentStore(std::shared_ptr<C2ComponentStore> store);
75 std::shared_ptr<C2Allocator> fetchIonAllocator();
78 std::shared_ptr<C2Allocator> fetchGrallocAllocator();
81 std::shared_ptr<C2Allocator> fetchBufferQueueAllocator();
84 std::mutex _mComponentStoreSetLock; // protects the entire updating _mComponentStore and its
86 std::mutex _mComponentStoreReadLock; // must protect only read/write of _mComponentStore
87 std::shared_ptr<C2ComponentStore> _mComponentStore;
94 id_t id, std::shared_ptr<C2Allocator> *const allocator) { in fetchAllocator()
129 std::mutex gIonAllocatorMutex;
130 std::weak_ptr<C2AllocatorIon> gIonAllocator;
133 const std::shared_ptr<C2AllocatorIon> allocator, in UseComponentStoreForIonAllocator()
134 std::shared_ptr<C2ComponentStore> store) { in UseComponentStoreForIonAllocator()
142 std::vector<C2FieldSupportedValuesQuery> query = { in UseComponentStoreForIonAllocator()
171 std::vector<std::unique_ptr<C2SettingResult>> failures; // TODO: remove in UseComponentStoreForIonAllocator()
187 void C2PlatformAllocatorStoreImpl::setComponentStore(std::shared_ptr<C2ComponentStore> store) { in setComponentStore()
190 std::lock_guard<std::mutex> lock(_mComponentStoreSetLock); in setComponentStore()
192 std::lock_guard<std::mutex> lock(_mComponentStoreReadLock); in setComponentStore()
195 std::shared_ptr<C2AllocatorIon> allocator; in setComponentStore()
197 std::lock_guard<std::mutex> lock(gIonAllocatorMutex); in setComponentStore()
205 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchIonAllocator() { in fetchIonAllocator()
206 std::lock_guard<std::mutex> lock(gIonAllocatorMutex); in fetchIonAllocator()
207 std::shared_ptr<C2AllocatorIon> allocator = gIonAllocator.lock(); in fetchIonAllocator()
209 std::shared_ptr<C2ComponentStore> componentStore; in fetchIonAllocator()
211 std::lock_guard<std::mutex> lock(_mComponentStoreReadLock); in fetchIonAllocator()
214 allocator = std::make_shared<C2AllocatorIon>(C2PlatformAllocatorStore::ION); in fetchIonAllocator()
221 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchGrallocAllocator() { in fetchGrallocAllocator()
222 static std::mutex mutex; in fetchGrallocAllocator()
223 static std::weak_ptr<C2Allocator> grallocAllocator; in fetchGrallocAllocator()
224 std::lock_guard<std::mutex> lock(mutex); in fetchGrallocAllocator()
225 std::shared_ptr<C2Allocator> allocator = grallocAllocator.lock(); in fetchGrallocAllocator()
227 allocator = std::make_shared<C2AllocatorGralloc>(C2PlatformAllocatorStore::GRALLOC); in fetchGrallocAllocator()
233 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchBufferQueueAllocator() { in fetchBufferQueueAllocator()
234 static std::mutex mutex; in fetchBufferQueueAllocator()
235 static std::weak_ptr<C2Allocator> grallocAllocator; in fetchBufferQueueAllocator()
236 std::lock_guard<std::mutex> lock(mutex); in fetchBufferQueueAllocator()
237 std::shared_ptr<C2Allocator> allocator = grallocAllocator.lock(); in fetchBufferQueueAllocator()
239 allocator = std::make_shared<C2AllocatorGralloc>( in fetchBufferQueueAllocator()
247 std::mutex gPreferredComponentStoreMutex;
248 std::shared_ptr<C2ComponentStore> gPreferredComponentStore;
250 std::mutex gPlatformAllocatorStoreMutex;
251 std::weak_ptr<C2PlatformAllocatorStoreImpl> gPlatformAllocatorStore;
254 std::shared_ptr<C2AllocatorStore> GetCodec2PlatformAllocatorStore() { in GetCodec2PlatformAllocatorStore()
255 std::lock_guard<std::mutex> lock(gPlatformAllocatorStoreMutex); in GetCodec2PlatformAllocatorStore()
256 std::shared_ptr<C2PlatformAllocatorStoreImpl> store = gPlatformAllocatorStore.lock(); in GetCodec2PlatformAllocatorStore()
258 store = std::make_shared<C2PlatformAllocatorStoreImpl>(); in GetCodec2PlatformAllocatorStore()
265 void SetPreferredCodec2ComponentStore(std::shared_ptr<C2ComponentStore> componentStore) { in SetPreferredCodec2ComponentStore()
266 static std::mutex mutex; in SetPreferredCodec2ComponentStore()
267 std::lock_guard<std::mutex> lock(mutex); // don't interleve set-s in SetPreferredCodec2ComponentStore()
271 std::lock_guard<std::mutex> lock(gPreferredComponentStoreMutex); in SetPreferredCodec2ComponentStore()
276 std::shared_ptr<C2PlatformAllocatorStoreImpl> allocatorStore; in SetPreferredCodec2ComponentStore()
278 std::lock_guard<std::mutex> lock(gPlatformAllocatorStoreMutex); in SetPreferredCodec2ComponentStore()
286 std::shared_ptr<C2ComponentStore> GetPreferredCodec2ComponentStore() { in GetPreferredCodec2ComponentStore()
287 std::lock_guard<std::mutex> lock(gPreferredComponentStoreMutex); in GetPreferredCodec2ComponentStore()
299 std::shared_ptr<const C2Component> component, in _createBlockPool()
301 std::shared_ptr<C2BlockPool> *pool) { in _createBlockPool()
302 std::shared_ptr<C2AllocatorStore> allocatorStore = in _createBlockPool()
304 std::shared_ptr<C2Allocator> allocator; in _createBlockPool()
313 std::shared_ptr<C2BlockPool> ptr = in _createBlockPool()
314 std::make_shared<C2PooledBlockPool>( in _createBlockPool()
326 std::shared_ptr<C2BlockPool> ptr = in _createBlockPool()
327 std::make_shared<C2PooledBlockPool>(allocator, poolId); in _createBlockPool()
337 std::shared_ptr<C2BlockPool> ptr = in _createBlockPool()
338 std::make_shared<C2BufferQueueBlockPool>( in _createBlockPool()
347 std::shared_ptr<C2BlockPool> ptr; in _createBlockPool()
362 std::shared_ptr<const C2Component> component, in createBlockPool()
363 std::shared_ptr<C2BlockPool> *pool) { in createBlockPool()
369 std::shared_ptr<const C2Component> component, in getBlockPool()
370 std::shared_ptr<C2BlockPool> *pool) { in getBlockPool()
372 std::shared_ptr<C2BlockPool> ptr; in getBlockPool()
393 std::map<C2BlockPool::local_id_t, std::weak_ptr<C2BlockPool>> mBlockPools;
394 std::map<C2BlockPool::local_id_t, std::weak_ptr<const C2Component>> mComponents;
397 static std::unique_ptr<_C2BlockPoolCache> sBlockPoolCache =
398 std::make_unique<_C2BlockPoolCache>();
399 static std::mutex sBlockPoolCacheMutex;
404 C2BlockPool::local_id_t id, std::shared_ptr<const C2Component> component, in GetCodec2BlockPool()
405 std::shared_ptr<C2BlockPool> *pool) { in GetCodec2BlockPool()
407 std::lock_guard<std::mutex> lock(sBlockPoolCacheMutex); in GetCodec2BlockPool()
408 std::shared_ptr<C2AllocatorStore> allocatorStore = GetCodec2PlatformAllocatorStore(); in GetCodec2BlockPool()
409 std::shared_ptr<C2Allocator> allocator; in GetCodec2BlockPool()
422 *pool = std::make_shared<C2BasicLinearBlockPool>(allocator); in GetCodec2BlockPool()
428 *pool = std::make_shared<C2BasicGraphicBlockPool>(allocator); in GetCodec2BlockPool()
444 std::shared_ptr<const C2Component> component, in CreateCodec2BlockPool()
445 std::shared_ptr<C2BlockPool> *pool) { in CreateCodec2BlockPool()
448 std::lock_guard<std::mutex> lock(sBlockPoolCacheMutex); in CreateCodec2BlockPool()
454 virtual std::vector<std::shared_ptr<const C2Component::Traits>> listComponents() override;
455 virtual std::shared_ptr<C2ParamReflector> getParamReflector() const override;
458 std::vector<C2FieldSupportedValuesQuery> &fields) const override;
460 std::vector<std::shared_ptr<C2ParamDescriptor>> *const params) const override;
462 const std::vector<C2Param*> &stackParams,
463 const std::vector<C2Param::Index> &heapParamIndices,
464 std::vector<std::unique_ptr<C2Param>> *const heapParams) const override;
466 C2String name, std::shared_ptr<C2ComponentInterface> *const interface) override;
468 C2String name, std::shared_ptr<C2Component> *const component) override;
470 std::shared_ptr<C2GraphicBuffer> src, std::shared_ptr<C2GraphicBuffer> dst) override;
472 const std::vector<C2Param*> &params,
473 std::vector<std::unique_ptr<C2SettingResult>> *const failures) override;
487 public std::enable_shared_from_this<ComponentModule> {
489 c2_node_id_t id, std::shared_ptr<C2Component> *component,
490 ComponentDeleter deleter = std::default_delete<C2Component>()) override;
492 c2_node_id_t id, std::shared_ptr<C2ComponentInterface> *interface,
493 InterfaceDeleter deleter = std::default_delete<C2ComponentInterface>()) override;
498 std::shared_ptr<const C2Component::Traits> getTraits();
530 c2_status_t init(std::string alias, std::string libPath);
535 std::recursive_mutex mLock; ///< lock protecting mTraits
536 std::shared_ptr<C2Component::Traits> mTraits; ///< cached component traits
567 c2_status_t fetchModule(std::shared_ptr<ComponentModule> *module) { in fetchModule()
569 std::lock_guard<std::mutex> lock(mMutex); in fetchModule()
570 std::shared_ptr<ComponentModule> localModule = mModule.lock(); in fetchModule()
572 localModule = std::make_shared<ComponentModule>(); in fetchModule()
585 ComponentLoader(std::string alias, std::string libPath) in ComponentLoader()
589 std::mutex mMutex; ///< mutex guarding the module
590 std::weak_ptr<ComponentModule> mModule; ///< weak reference to the loaded module
591 std::string mAlias; ///< component alias
592 std::string mLibPath; ///< library path
596 std::shared_ptr<C2StoreIonUsageInfo> mIonUsageInfo;
598 Interface(std::shared_ptr<C2ReflectorHelper> reflector) in Interface()
645 std::map<C2String, ComponentLoader> mComponents; ///< map of name -> components
646 std::vector<C2String> mComponentsList; ///< list of components
647 std::shared_ptr<C2ReflectorHelper> mReflector;
652 std::string alias, std::string libPath) { in init()
678 std::shared_ptr<C2ComponentInterface> intf; in init()
685 std::shared_ptr<C2Component::Traits> traits(new (std::nothrow) C2Component::Traits); in init()
692 bool encoder = (traits->name.find("encoder") != std::string::npos); in init()
695 std::vector<std::unique_ptr<C2Param>> params; in init()
715 bool decoder = (traits->name.find("decoder") != std::string::npos); in init()
747 c2_node_id_t id, std::shared_ptr<C2ComponentInterface> *interface, in createInterface()
748 std::function<void(::C2ComponentInterface*)> deleter) { in createInterface()
753 std::shared_ptr<ComponentModule> module = shared_from_this(); in createInterface()
764 c2_node_id_t id, std::shared_ptr<C2Component> *component, in createComponent()
765 std::function<void(::C2Component*)> deleter) { in createComponent()
770 std::shared_ptr<ComponentModule> module = shared_from_this(); in createComponent()
780 std::shared_ptr<const C2Component::Traits> C2PlatformComponentStore::ComponentModule::getTraits() { in getTraits()
781 std::unique_lock<std::recursive_mutex> lock(mLock); in getTraits()
786 : mReflector(std::make_shared<C2ReflectorHelper>()), in C2PlatformComponentStore()
795 std::piecewise_construct, in C2PlatformComponentStore()
796 std::forward_as_tuple(alias), in C2PlatformComponentStore()
797 std::forward_as_tuple(alias, libPath)); in C2PlatformComponentStore()
863 std::shared_ptr<C2GraphicBuffer> src, std::shared_ptr<C2GraphicBuffer> dst) { in copyBuffer()
870 const std::vector<C2Param*> &stackParams, in query_sm()
871 const std::vector<C2Param::Index> &heapParamIndices, in query_sm()
872 std::vector<std::unique_ptr<C2Param>> *const heapParams) const { in query_sm()
877 const std::vector<C2Param*> &params, in config_sm()
878 std::vector<std::unique_ptr<C2SettingResult>> *const failures) { in config_sm()
882 std::vector<std::shared_ptr<const C2Component::Traits>> C2PlatformComponentStore::listComponents() { in listComponents()
884 std::vector<std::shared_ptr<const C2Component::Traits>> list; in listComponents()
887 std::shared_ptr<ComponentModule> module; in listComponents()
890 std::shared_ptr<const C2Component::Traits> traits = module->getTraits(); in listComponents()
911 C2String name, std::shared_ptr<C2Component> *const component) { in createComponent()
917 std::shared_ptr<ComponentModule> module; in createComponent()
928 C2String name, std::shared_ptr<C2ComponentInterface> *const interface) { in createInterface()
934 std::shared_ptr<ComponentModule> module; in createInterface()
945 std::vector<std::shared_ptr<C2ParamDescriptor>> *const params) const { in querySupportedParams_nb()
950 std::vector<C2FieldSupportedValuesQuery> &fields) const { in querySupportedValues_sm()
958 std::shared_ptr<C2ParamReflector> C2PlatformComponentStore::getParamReflector() const { in getParamReflector()
962 std::shared_ptr<C2ComponentStore> GetCodec2PlatformComponentStore() { in GetCodec2PlatformComponentStore()
963 static std::mutex mutex; in GetCodec2PlatformComponentStore()
964 static std::weak_ptr<C2ComponentStore> platformStore; in GetCodec2PlatformComponentStore()
965 std::lock_guard<std::mutex> lock(mutex); in GetCodec2PlatformComponentStore()
966 std::shared_ptr<C2ComponentStore> store = platformStore.lock(); in GetCodec2PlatformComponentStore()
968 store = std::make_shared<C2PlatformComponentStore>(); in GetCodec2PlatformComponentStore()