Lines Matching refs:std
50 std::shared_ptr<C2ComponentStore> GetPreferredCodec2ComponentStore();
65 id_t id, std::shared_ptr<C2Allocator> *const allocator) override;
67 virtual std::vector<std::shared_ptr<const C2Allocator::Traits>> listAllocators_nb() in listAllocators_nb()
69 return std::vector<std::shared_ptr<const C2Allocator::Traits>>(); /// \todo in listAllocators_nb()
76 void setComponentStore(std::shared_ptr<C2ComponentStore> store);
82 std::shared_ptr<C2Allocator> fetchBlobAllocator();
85 std::shared_ptr<C2Allocator> fetchIonAllocator();
86 std::shared_ptr<C2Allocator> fetchDmaBufAllocator();
89 std::shared_ptr<C2Allocator> fetchGrallocAllocator();
92 std::shared_ptr<C2Allocator> fetchBufferQueueAllocator();
95 std::mutex _mComponentStoreSetLock; // protects the entire updating _mComponentStore and its
97 std::mutex _mComponentStoreReadLock; // must protect only read/write of _mComponentStore
98 std::shared_ptr<C2ComponentStore> _mComponentStore;
133 id_t id, std::shared_ptr<C2Allocator> *const allocator) { in fetchAllocator()
177 std::mutex gIonAllocatorMutex;
178 std::mutex gDmaBufAllocatorMutex;
179 std::weak_ptr<C2AllocatorIon> gIonAllocator;
180 std::weak_ptr<C2DmaBufAllocator> gDmaBufAllocator;
183 const std::shared_ptr<C2AllocatorIon> allocator, in UseComponentStoreForIonAllocator()
184 std::shared_ptr<C2ComponentStore> store) { in UseComponentStoreForIonAllocator()
192 std::vector<C2FieldSupportedValuesQuery> query = { in UseComponentStoreForIonAllocator()
221 std::vector<std::unique_ptr<C2SettingResult>> failures; // TODO: remove in UseComponentStoreForIonAllocator()
235 void UseComponentStoreForDmaBufAllocator(const std::shared_ptr<C2DmaBufAllocator> allocator, in UseComponentStoreForDmaBufAllocator()
236 std::shared_ptr<C2ComponentStore> store) { in UseComponentStoreForDmaBufAllocator()
244 std::unique_ptr<C2StoreDmaBufUsageInfo> usageInfo; in UseComponentStoreForDmaBufAllocator()
247 std::vector<C2FieldSupportedValuesQuery> query = { in UseComponentStoreForDmaBufAllocator()
277 std::unique_ptr<C2StoreDmaBufUsageInfo> usageInfo; in UseComponentStoreForDmaBufAllocator()
279 std::vector<std::unique_ptr<C2SettingResult>> failures; // TODO: remove in UseComponentStoreForDmaBufAllocator()
296 void C2PlatformAllocatorStoreImpl::setComponentStore(std::shared_ptr<C2ComponentStore> store) { in setComponentStore()
299 std::lock_guard<std::mutex> lock(_mComponentStoreSetLock); in setComponentStore()
301 std::lock_guard<std::mutex> lock(_mComponentStoreReadLock); in setComponentStore()
304 std::shared_ptr<C2AllocatorIon> allocator; in setComponentStore()
306 std::lock_guard<std::mutex> lock(gIonAllocatorMutex); in setComponentStore()
314 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchIonAllocator() { in fetchIonAllocator()
315 std::lock_guard<std::mutex> lock(gIonAllocatorMutex); in fetchIonAllocator()
316 std::shared_ptr<C2AllocatorIon> allocator = gIonAllocator.lock(); in fetchIonAllocator()
318 std::shared_ptr<C2ComponentStore> componentStore; in fetchIonAllocator()
320 std::lock_guard<std::mutex> lock(_mComponentStoreReadLock); in fetchIonAllocator()
323 allocator = std::make_shared<C2AllocatorIon>(C2PlatformAllocatorStore::ION); in fetchIonAllocator()
330 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchDmaBufAllocator() { in fetchDmaBufAllocator()
331 std::lock_guard<std::mutex> lock(gDmaBufAllocatorMutex); in fetchDmaBufAllocator()
332 std::shared_ptr<C2DmaBufAllocator> allocator = gDmaBufAllocator.lock(); in fetchDmaBufAllocator()
334 std::shared_ptr<C2ComponentStore> componentStore; in fetchDmaBufAllocator()
336 std::lock_guard<std::mutex> lock(_mComponentStoreReadLock); in fetchDmaBufAllocator()
339 allocator = std::make_shared<C2DmaBufAllocator>(C2PlatformAllocatorStore::DMABUFHEAP); in fetchDmaBufAllocator()
346 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchBlobAllocator() { in fetchBlobAllocator()
347 static std::mutex mutex; in fetchBlobAllocator()
348 static std::weak_ptr<C2Allocator> blobAllocator; in fetchBlobAllocator()
349 std::lock_guard<std::mutex> lock(mutex); in fetchBlobAllocator()
350 std::shared_ptr<C2Allocator> allocator = blobAllocator.lock(); in fetchBlobAllocator()
352 allocator = std::make_shared<C2AllocatorBlob>(C2PlatformAllocatorStore::BLOB); in fetchBlobAllocator()
358 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchGrallocAllocator() { in fetchGrallocAllocator()
359 static std::mutex mutex; in fetchGrallocAllocator()
360 static std::weak_ptr<C2Allocator> grallocAllocator; in fetchGrallocAllocator()
361 std::lock_guard<std::mutex> lock(mutex); in fetchGrallocAllocator()
362 std::shared_ptr<C2Allocator> allocator = grallocAllocator.lock(); in fetchGrallocAllocator()
364 allocator = std::make_shared<C2AllocatorGralloc>(C2PlatformAllocatorStore::GRALLOC); in fetchGrallocAllocator()
370 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchBufferQueueAllocator() { in fetchBufferQueueAllocator()
371 static std::mutex mutex; in fetchBufferQueueAllocator()
372 static std::weak_ptr<C2Allocator> grallocAllocator; in fetchBufferQueueAllocator()
373 std::lock_guard<std::mutex> lock(mutex); in fetchBufferQueueAllocator()
374 std::shared_ptr<C2Allocator> allocator = grallocAllocator.lock(); in fetchBufferQueueAllocator()
376 allocator = std::make_shared<C2AllocatorGralloc>( in fetchBufferQueueAllocator()
384 std::mutex gPreferredComponentStoreMutex;
385 std::shared_ptr<C2ComponentStore> gPreferredComponentStore;
387 std::mutex gPlatformAllocatorStoreMutex;
388 std::weak_ptr<C2PlatformAllocatorStoreImpl> gPlatformAllocatorStore;
391 std::shared_ptr<C2AllocatorStore> GetCodec2PlatformAllocatorStore() { in GetCodec2PlatformAllocatorStore()
392 std::lock_guard<std::mutex> lock(gPlatformAllocatorStoreMutex); in GetCodec2PlatformAllocatorStore()
393 std::shared_ptr<C2PlatformAllocatorStoreImpl> store = gPlatformAllocatorStore.lock(); in GetCodec2PlatformAllocatorStore()
395 store = std::make_shared<C2PlatformAllocatorStoreImpl>(); in GetCodec2PlatformAllocatorStore()
402 void SetPreferredCodec2ComponentStore(std::shared_ptr<C2ComponentStore> componentStore) { in SetPreferredCodec2ComponentStore()
403 static std::mutex mutex; in SetPreferredCodec2ComponentStore()
404 std::lock_guard<std::mutex> lock(mutex); // don't interleve set-s in SetPreferredCodec2ComponentStore()
408 std::lock_guard<std::mutex> lock(gPreferredComponentStoreMutex); in SetPreferredCodec2ComponentStore()
413 std::shared_ptr<C2PlatformAllocatorStoreImpl> allocatorStore; in SetPreferredCodec2ComponentStore()
415 std::lock_guard<std::mutex> lock(gPlatformAllocatorStoreMutex); in SetPreferredCodec2ComponentStore()
423 std::shared_ptr<C2ComponentStore> GetPreferredCodec2ComponentStore() { in GetPreferredCodec2ComponentStore()
424 std::lock_guard<std::mutex> lock(gPreferredComponentStoreMutex); in GetPreferredCodec2ComponentStore()
448 std::vector<std::shared_ptr<const C2Component>> components, in _createBlockPool()
450 std::shared_ptr<C2BlockPool> *pool) { in _createBlockPool()
451 std::shared_ptr<C2AllocatorStore> allocatorStore = in _createBlockPool()
453 std::shared_ptr<C2Allocator> allocator; in _createBlockPool()
464 std::shared_ptr<C2BlockPool> ptr = in _createBlockPool()
465 std::make_shared<C2PooledBlockPool>( in _createBlockPool()
478 std::shared_ptr<C2BlockPool> ptr = in _createBlockPool()
479 std::make_shared<C2PooledBlockPool>( in _createBlockPool()
493 std::shared_ptr<C2BlockPool> ptr = in _createBlockPool()
494 std::make_shared<C2PooledBlockPool>(allocator, poolId); in _createBlockPool()
506 std::shared_ptr<C2BlockPool> ptr = in _createBlockPool()
507 std::make_shared<C2BufferQueueBlockPool>( in _createBlockPool()
518 std::shared_ptr<C2BlockPool> ptr; in _createBlockPool()
535 std::vector<std::shared_ptr<const C2Component>> components, in createBlockPool()
536 std::shared_ptr<C2BlockPool> *pool) { in createBlockPool()
542 std::shared_ptr<const C2Component> component, in getBlockPool()
543 std::shared_ptr<C2BlockPool> *pool) { in getBlockPool()
545 std::shared_ptr<C2BlockPool> ptr; in getBlockPool()
553 auto found = std::find_if( in getBlockPool()
556 [component](const std::weak_ptr<const C2Component> &ptr) { in getBlockPool()
571 std::map<C2BlockPool::local_id_t, std::weak_ptr<C2BlockPool>> mBlockPools;
572 std::map<C2BlockPool::local_id_t, std::vector<std::weak_ptr<const C2Component>>> mComponents;
575 static std::unique_ptr<_C2BlockPoolCache> sBlockPoolCache =
576 std::make_unique<_C2BlockPoolCache>();
577 static std::mutex sBlockPoolCacheMutex;
582 C2BlockPool::local_id_t id, std::shared_ptr<const C2Component> component, in GetCodec2BlockPool()
583 std::shared_ptr<C2BlockPool> *pool) { in GetCodec2BlockPool()
585 std::lock_guard<std::mutex> lock(sBlockPoolCacheMutex); in GetCodec2BlockPool()
586 std::shared_ptr<C2AllocatorStore> allocatorStore = GetCodec2PlatformAllocatorStore(); in GetCodec2BlockPool()
587 std::shared_ptr<C2Allocator> allocator; in GetCodec2BlockPool()
600 *pool = std::make_shared<C2BasicLinearBlockPool>(allocator); in GetCodec2BlockPool()
606 *pool = std::make_shared<C2BasicGraphicBlockPool>(allocator); in GetCodec2BlockPool()
622 const std::vector<std::shared_ptr<const C2Component>> &components, in CreateCodec2BlockPool()
623 std::shared_ptr<C2BlockPool> *pool) { in CreateCodec2BlockPool()
626 std::lock_guard<std::mutex> lock(sBlockPoolCacheMutex); in CreateCodec2BlockPool()
632 std::shared_ptr<const C2Component> component, in CreateCodec2BlockPool()
633 std::shared_ptr<C2BlockPool> *pool) { in CreateCodec2BlockPool()
636 std::lock_guard<std::mutex> lock(sBlockPoolCacheMutex); in CreateCodec2BlockPool()
642 virtual std::vector<std::shared_ptr<const C2Component::Traits>> listComponents() override;
643 virtual std::shared_ptr<C2ParamReflector> getParamReflector() const override;
646 std::vector<C2FieldSupportedValuesQuery> &fields) const override;
648 std::vector<std::shared_ptr<C2ParamDescriptor>> *const params) const override;
650 const std::vector<C2Param*> &stackParams,
651 const std::vector<C2Param::Index> &heapParamIndices,
652 std::vector<std::unique_ptr<C2Param>> *const heapParams) const override;
654 C2String name, std::shared_ptr<C2ComponentInterface> *const interface) override;
656 C2String name, std::shared_ptr<C2Component> *const component) override;
658 std::shared_ptr<C2GraphicBuffer> src, std::shared_ptr<C2GraphicBuffer> dst) override;
660 const std::vector<C2Param*> ¶ms,
661 std::vector<std::unique_ptr<C2SettingResult>> *const failures) override;
666 std::vector<std::tuple<C2String,
681 public std::enable_shared_from_this<ComponentModule> {
683 c2_node_id_t id, std::shared_ptr<C2Component> *component,
684 ComponentDeleter deleter = std::default_delete<C2Component>()) override;
686 c2_node_id_t id, std::shared_ptr<C2ComponentInterface> *interface,
687 InterfaceDeleter deleter = std::default_delete<C2ComponentInterface>()) override;
692 std::shared_ptr<const C2Component::Traits> getTraits();
741 c2_status_t init(std::string libPath);
746 std::recursive_mutex mLock; ///< lock protecting mTraits
747 std::shared_ptr<C2Component::Traits> mTraits; ///< cached component traits
778 c2_status_t fetchModule(std::shared_ptr<ComponentModule> *module) { in fetchModule()
780 std::lock_guard<std::mutex> lock(mMutex); in fetchModule()
781 std::shared_ptr<ComponentModule> localModule = mModule.lock(); in fetchModule()
785 localModule = std::make_shared<ComponentModule>(mCreateFactory, in fetchModule()
788 localModule = std::make_shared<ComponentModule>(); in fetchModule()
802 ComponentLoader(std::string libPath) in ComponentLoader()
806 ComponentLoader(std::tuple<C2String, in ComponentLoader()
809 : mLibPath(std::get<0>(func)), in ComponentLoader()
810 mCreateFactory(std::get<1>(func)), in ComponentLoader()
811 mDestroyFactory(std::get<2>(func)) {} in ComponentLoader()
814 std::mutex mMutex; ///< mutex guarding the module
815 std::weak_ptr<ComponentModule> mModule; ///< weak reference to the loaded module
816 std::string mLibPath; ///< library path
824 std::shared_ptr<C2StoreIonUsageInfo> mIonUsageInfo;
825 std::shared_ptr<C2StoreDmaBufUsageInfo> mDmaBufUsageInfo;
827 Interface(std::shared_ptr<C2ReflectorHelper> reflector) in Interface()
921 c2_status_t findComponent(C2String name, std::shared_ptr<ComponentModule> *module);
928 std::mutex mMutex; ///< mutex guarding the component lists during construction
930 std::map<C2String, ComponentLoader> mComponents; ///< path -> component module
931 std::map<C2String, C2String> mComponentNameToPath; ///< name -> path
932 std::vector<std::shared_ptr<const C2Component::Traits>> mComponentList;
934 std::shared_ptr<C2ReflectorHelper> mReflector;
938 std::vector<std::tuple<C2String,
944 std::string libPath) { in init()
976 std::shared_ptr<C2ComponentInterface> intf; in init()
983 std::shared_ptr<C2Component::Traits> traits(new (std::nothrow) C2Component::Traits); in init()
1016 c2_node_id_t id, std::shared_ptr<C2ComponentInterface> *interface, in createInterface()
1017 std::function<void(::C2ComponentInterface*)> deleter) { in createInterface()
1022 std::shared_ptr<ComponentModule> module = shared_from_this(); in createInterface()
1033 c2_node_id_t id, std::shared_ptr<C2Component> *component, in createComponent()
1034 std::function<void(::C2Component*)> deleter) { in createComponent()
1039 std::shared_ptr<ComponentModule> module = shared_from_this(); in createComponent()
1049 std::shared_ptr<const C2Component::Traits> C2PlatformComponentStore::ComponentModule::getTraits() { in getTraits()
1050 std::unique_lock<std::recursive_mutex> lock(mLock); in getTraits()
1056 mReflector(std::make_shared<C2ReflectorHelper>()), in C2PlatformComponentStore()
1100 std::vector<std::tuple<C2String, in C2PlatformComponentStore()
1104 mReflector(std::make_shared<C2ReflectorHelper>()), in C2PlatformComponentStore()
1109 mComponents.emplace(std::get<0>(func), func); in C2PlatformComponentStore()
1114 std::shared_ptr<C2GraphicBuffer> src, std::shared_ptr<C2GraphicBuffer> dst) { in copyBuffer()
1121 const std::vector<C2Param*> &stackParams, in query_sm()
1122 const std::vector<C2Param::Index> &heapParamIndices, in query_sm()
1123 std::vector<std::unique_ptr<C2Param>> *const heapParams) const { in query_sm()
1128 const std::vector<C2Param*> ¶ms, in config_sm()
1129 std::vector<std::unique_ptr<C2SettingResult>> *const failures) { in config_sm()
1134 std::lock_guard<std::mutex> lock(mMutex); in visitComponents()
1141 std::shared_ptr<ComponentModule> module; in visitComponents()
1143 std::shared_ptr<const C2Component::Traits> traits = module->getTraits(); in visitComponents()
1156 std::vector<std::shared_ptr<const C2Component::Traits>> C2PlatformComponentStore::listComponents() { in listComponents()
1163 C2String name, std::shared_ptr<ComponentModule> *module) { in findComponent()
1175 C2String name, std::shared_ptr<C2Component> *const component) { in createComponent()
1178 std::shared_ptr<ComponentModule> module; in createComponent()
1188 C2String name, std::shared_ptr<C2ComponentInterface> *const interface) { in createInterface()
1191 std::shared_ptr<ComponentModule> module; in createInterface()
1201 std::vector<std::shared_ptr<C2ParamDescriptor>> *const params) const { in querySupportedParams_nb()
1206 std::vector<C2FieldSupportedValuesQuery> &fields) const { in querySupportedValues_sm()
1214 std::shared_ptr<C2ParamReflector> C2PlatformComponentStore::getParamReflector() const { in getParamReflector()
1218 std::shared_ptr<C2ComponentStore> GetCodec2PlatformComponentStore() { in GetCodec2PlatformComponentStore()
1219 static std::mutex mutex; in GetCodec2PlatformComponentStore()
1220 static std::weak_ptr<C2ComponentStore> platformStore; in GetCodec2PlatformComponentStore()
1221 std::lock_guard<std::mutex> lock(mutex); in GetCodec2PlatformComponentStore()
1222 std::shared_ptr<C2ComponentStore> store = platformStore.lock(); in GetCodec2PlatformComponentStore()
1224 store = std::make_shared<C2PlatformComponentStore>(); in GetCodec2PlatformComponentStore()
1231 std::shared_ptr<C2ComponentStore> GetTestComponentStore( in GetTestComponentStore()
1232 std::vector<std::tuple<C2String, in GetTestComponentStore()
1235 return std::shared_ptr<C2ComponentStore>(new C2PlatformComponentStore(funcs)); in GetTestComponentStore()