Lines Matching refs:std

54 std::shared_ptr<C2ComponentStore> GetPreferredCodec2ComponentStore();
69 id_t id, std::shared_ptr<C2Allocator> *const allocator) override;
71 virtual std::vector<std::shared_ptr<const C2Allocator::Traits>> listAllocators_nb() in listAllocators_nb()
73 return std::vector<std::shared_ptr<const C2Allocator::Traits>>(); /// \todo in listAllocators_nb()
80 void setComponentStore(std::shared_ptr<C2ComponentStore> store);
86 std::shared_ptr<C2Allocator> fetchBlobAllocator();
89 std::shared_ptr<C2Allocator> fetchIonAllocator();
90 std::shared_ptr<C2Allocator> fetchDmaBufAllocator();
93 std::shared_ptr<C2Allocator> fetchGrallocAllocator();
96 std::shared_ptr<C2Allocator> fetchBufferQueueAllocator();
99 std::shared_ptr<C2Allocator> fetchIgbaAllocator();
102 std::mutex _mComponentStoreSetLock; // protects the entire updating _mComponentStore and its
104 std::mutex _mComponentStoreReadLock; // must protect only read/write of _mComponentStore
105 std::shared_ptr<C2ComponentStore> _mComponentStore;
140 id_t id, std::shared_ptr<C2Allocator> *const allocator) { in fetchAllocator()
188 std::mutex gIonAllocatorMutex;
189 std::mutex gDmaBufAllocatorMutex;
190 std::weak_ptr<C2AllocatorIon> gIonAllocator;
191 std::weak_ptr<C2DmaBufAllocator> gDmaBufAllocator;
194 const std::shared_ptr<C2AllocatorIon> allocator, in UseComponentStoreForIonAllocator()
195 std::shared_ptr<C2ComponentStore> store) { in UseComponentStoreForIonAllocator()
203 std::vector<C2FieldSupportedValuesQuery> query = { in UseComponentStoreForIonAllocator()
232 std::vector<std::unique_ptr<C2SettingResult>> failures; // TODO: remove in UseComponentStoreForIonAllocator()
246 void UseComponentStoreForDmaBufAllocator(const std::shared_ptr<C2DmaBufAllocator> allocator, in UseComponentStoreForDmaBufAllocator()
247 std::shared_ptr<C2ComponentStore> store) { in UseComponentStoreForDmaBufAllocator()
255 std::unique_ptr<C2StoreDmaBufUsageInfo> usageInfo; in UseComponentStoreForDmaBufAllocator()
258 std::vector<C2FieldSupportedValuesQuery> query = { in UseComponentStoreForDmaBufAllocator()
288 std::unique_ptr<C2StoreDmaBufUsageInfo> usageInfo; in UseComponentStoreForDmaBufAllocator()
290 std::vector<std::unique_ptr<C2SettingResult>> failures; // TODO: remove in UseComponentStoreForDmaBufAllocator()
307 void C2PlatformAllocatorStoreImpl::setComponentStore(std::shared_ptr<C2ComponentStore> store) { in setComponentStore()
310 std::lock_guard<std::mutex> lock(_mComponentStoreSetLock); in setComponentStore()
312 std::lock_guard<std::mutex> lock(_mComponentStoreReadLock); in setComponentStore()
315 std::shared_ptr<C2AllocatorIon> ionAllocator; in setComponentStore()
317 std::lock_guard<std::mutex> lock(gIonAllocatorMutex); in setComponentStore()
323 std::shared_ptr<C2DmaBufAllocator> dmaAllocator; in setComponentStore()
325 std::lock_guard<std::mutex> lock(gDmaBufAllocatorMutex); in setComponentStore()
333 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchIonAllocator() { in fetchIonAllocator()
334 std::lock_guard<std::mutex> lock(gIonAllocatorMutex); in fetchIonAllocator()
335 std::shared_ptr<C2AllocatorIon> allocator = gIonAllocator.lock(); in fetchIonAllocator()
337 std::shared_ptr<C2ComponentStore> componentStore; in fetchIonAllocator()
339 std::lock_guard<std::mutex> lock(_mComponentStoreReadLock); in fetchIonAllocator()
342 allocator = std::make_shared<C2AllocatorIon>(C2PlatformAllocatorStore::ION); in fetchIonAllocator()
349 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchDmaBufAllocator() { in fetchDmaBufAllocator()
350 std::lock_guard<std::mutex> lock(gDmaBufAllocatorMutex); in fetchDmaBufAllocator()
351 std::shared_ptr<C2DmaBufAllocator> allocator = gDmaBufAllocator.lock(); in fetchDmaBufAllocator()
353 std::shared_ptr<C2ComponentStore> componentStore; in fetchDmaBufAllocator()
355 std::lock_guard<std::mutex> lock(_mComponentStoreReadLock); in fetchDmaBufAllocator()
358 allocator = std::make_shared<C2DmaBufAllocator>(C2PlatformAllocatorStore::DMABUFHEAP); in fetchDmaBufAllocator()
365 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchBlobAllocator() { in fetchBlobAllocator()
366 static std::mutex mutex; in fetchBlobAllocator()
367 static std::weak_ptr<C2Allocator> blobAllocator; in fetchBlobAllocator()
368 std::lock_guard<std::mutex> lock(mutex); in fetchBlobAllocator()
369 std::shared_ptr<C2Allocator> allocator = blobAllocator.lock(); in fetchBlobAllocator()
371 allocator = std::make_shared<C2AllocatorBlob>(C2PlatformAllocatorStore::BLOB); in fetchBlobAllocator()
377 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchGrallocAllocator() { in fetchGrallocAllocator()
378 static std::mutex mutex; in fetchGrallocAllocator()
379 static std::weak_ptr<C2Allocator> grallocAllocator; in fetchGrallocAllocator()
380 std::lock_guard<std::mutex> lock(mutex); in fetchGrallocAllocator()
381 std::shared_ptr<C2Allocator> allocator = grallocAllocator.lock(); in fetchGrallocAllocator()
383 allocator = std::make_shared<C2AllocatorGralloc>(C2PlatformAllocatorStore::GRALLOC); in fetchGrallocAllocator()
389 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchBufferQueueAllocator() { in fetchBufferQueueAllocator()
390 static std::mutex mutex; in fetchBufferQueueAllocator()
391 static std::weak_ptr<C2Allocator> grallocAllocator; in fetchBufferQueueAllocator()
392 std::lock_guard<std::mutex> lock(mutex); in fetchBufferQueueAllocator()
393 std::shared_ptr<C2Allocator> allocator = grallocAllocator.lock(); in fetchBufferQueueAllocator()
395 allocator = std::make_shared<C2AllocatorGralloc>( in fetchBufferQueueAllocator()
402 std::shared_ptr<C2Allocator> C2PlatformAllocatorStoreImpl::fetchIgbaAllocator() { in fetchIgbaAllocator()
403 static std::mutex mutex; in fetchIgbaAllocator()
404 static std::weak_ptr<C2Allocator> ahwbAllocator; in fetchIgbaAllocator()
405 std::lock_guard<std::mutex> lock(mutex); in fetchIgbaAllocator()
406 std::shared_ptr<C2Allocator> allocator = ahwbAllocator.lock(); in fetchIgbaAllocator()
408 allocator = std::make_shared<C2AllocatorAhwb>(C2PlatformAllocatorStore::IGBA); in fetchIgbaAllocator()
415 std::mutex gPreferredComponentStoreMutex;
416 std::shared_ptr<C2ComponentStore> gPreferredComponentStore;
418 std::mutex gPlatformAllocatorStoreMutex;
419 std::weak_ptr<C2PlatformAllocatorStoreImpl> gPlatformAllocatorStore;
422 std::shared_ptr<C2AllocatorStore> GetCodec2PlatformAllocatorStore() { in GetCodec2PlatformAllocatorStore()
423 std::lock_guard<std::mutex> lock(gPlatformAllocatorStoreMutex); in GetCodec2PlatformAllocatorStore()
424 std::shared_ptr<C2PlatformAllocatorStoreImpl> store = gPlatformAllocatorStore.lock(); in GetCodec2PlatformAllocatorStore()
426 store = std::make_shared<C2PlatformAllocatorStoreImpl>(); in GetCodec2PlatformAllocatorStore()
433 void SetPreferredCodec2ComponentStore(std::shared_ptr<C2ComponentStore> componentStore) { in SetPreferredCodec2ComponentStore()
434 static std::mutex mutex; in SetPreferredCodec2ComponentStore()
435 std::lock_guard<std::mutex> lock(mutex); // don't interleve set-s in SetPreferredCodec2ComponentStore()
439 std::lock_guard<std::mutex> lock(gPreferredComponentStoreMutex); in SetPreferredCodec2ComponentStore()
444 std::shared_ptr<C2PlatformAllocatorStoreImpl> allocatorStore; in SetPreferredCodec2ComponentStore()
446 std::lock_guard<std::mutex> lock(gPlatformAllocatorStoreMutex); in SetPreferredCodec2ComponentStore()
454 std::shared_ptr<C2ComponentStore> GetPreferredCodec2ComponentStore() { in GetPreferredCodec2ComponentStore()
455 std::lock_guard<std::mutex> lock(gPreferredComponentStoreMutex); in GetPreferredCodec2ComponentStore()
497 std::vector<std::shared_ptr<const C2Component>> components, in _createBlockPool()
500 std::shared_ptr<C2BlockPool> *pool) { in _createBlockPool()
501 std::shared_ptr<C2AllocatorStore> allocatorStore = in _createBlockPool()
504 std::shared_ptr<C2Allocator> allocator; in _createBlockPool()
511 std::unique_lock lock(mMutex); in _createBlockPool()
521 std::shared_ptr<C2BlockPool> ptr( in _createBlockPool()
534 std::shared_ptr<C2BlockPool> ptr( in _createBlockPool()
548 std::shared_ptr<C2BlockPool> ptr( in _createBlockPool()
561 std::shared_ptr<C2BlockPool> ptr( in _createBlockPool()
564 std::shared_ptr<C2BufferQueueBlockPool> bqPool = in _createBlockPool()
565 std::static_pointer_cast<C2BufferQueueBlockPool>(ptr); in _createBlockPool()
579 std::shared_ptr<C2BlockPool> ptr( in _createBlockPool()
582 std::move(allocatorParam.waitableFd), in _createBlockPool()
593 std::shared_ptr<C2BlockPool> ptr; in _createBlockPool()
611 std::vector<std::shared_ptr<const C2Component>> components, in createBlockPool()
612 std::shared_ptr<C2BlockPool> *pool) { in createBlockPool()
620 std::vector<std::shared_ptr<const C2Component>> components, in createBlockPool()
621 std::shared_ptr<C2BlockPool> *pool) { in createBlockPool()
622 std::unique_lock lock(mMutex); in createBlockPool()
630 std::shared_ptr<const C2Component> component, in getBlockPool()
631 std::shared_ptr<C2BlockPool> *pool) { in getBlockPool()
632 std::unique_lock lock(mMutex); in getBlockPool()
634 std::shared_ptr<C2BlockPool> ptr; in getBlockPool()
642 auto found = std::find_if( in getBlockPool()
645 [component](const std::weak_ptr<const C2Component> &ptr) { in getBlockPool()
667 std::recursive_mutex mMutex;
670 std::map<C2BlockPool::local_id_t, std::weak_ptr<C2BlockPool>> mBlockPools;
671 std::map<C2BlockPool::local_id_t, std::vector<std::weak_ptr<const C2Component>>> mComponents;
676 static std::unique_ptr<_C2BlockPoolCache> sBlockPoolCache =
677 std::make_unique<_C2BlockPoolCache>();
682 C2BlockPool::local_id_t id, std::shared_ptr<const C2Component> component, in GetCodec2BlockPool()
683 std::shared_ptr<C2BlockPool> *pool) { in GetCodec2BlockPool()
685 std::shared_ptr<C2AllocatorStore> allocatorStore = GetCodec2PlatformAllocatorStore(); in GetCodec2BlockPool()
686 std::shared_ptr<C2Allocator> allocator; in GetCodec2BlockPool()
697 *pool = std::make_shared<C2BasicLinearBlockPool>(allocator); in GetCodec2BlockPool()
703 *pool = std::make_shared<C2BasicGraphicBlockPool>(allocator); in GetCodec2BlockPool()
714 const std::vector<std::shared_ptr<const C2Component>> &components, in CreateCodec2BlockPool()
715 std::shared_ptr<C2BlockPool> *pool) { in CreateCodec2BlockPool()
725 std::shared_ptr<const C2Component> component, in CreateCodec2BlockPool()
726 std::shared_ptr<C2BlockPool> *pool) { in CreateCodec2BlockPool()
736 const std::vector<std::shared_ptr<const C2Component>> &components, in CreateCodec2BlockPool()
737 std::shared_ptr<C2BlockPool> *pool) { in CreateCodec2BlockPool()
745 std::shared_ptr<const C2Component> component, in CreateCodec2BlockPool()
746 std::shared_ptr<C2BlockPool> *pool) { in CreateCodec2BlockPool()
754 virtual std::vector<std::shared_ptr<const C2Component::Traits>> listComponents() override;
755 virtual std::shared_ptr<C2ParamReflector> getParamReflector() const override;
758 std::vector<C2FieldSupportedValuesQuery> &fields) const override;
760 std::vector<std::shared_ptr<C2ParamDescriptor>> *const params) const override;
762 const std::vector<C2Param*> &stackParams,
763 const std::vector<C2Param::Index> &heapParamIndices,
764 std::vector<std::unique_ptr<C2Param>> *const heapParams) const override;
766 C2String name, std::shared_ptr<C2ComponentInterface> *const interface) override;
768 C2String name, std::shared_ptr<C2Component> *const component) override;
770 std::shared_ptr<C2GraphicBuffer> src, std::shared_ptr<C2GraphicBuffer> dst) override;
772 const std::vector<C2Param*> &params,
773 std::vector<std::unique_ptr<C2SettingResult>> *const failures) override;
778 std::vector<std::tuple<C2String,
793 public std::enable_shared_from_this<ComponentModule> {
795 c2_node_id_t id, std::shared_ptr<C2Component> *component,
796 ComponentDeleter deleter = std::default_delete<C2Component>()) override;
798 c2_node_id_t id, std::shared_ptr<C2ComponentInterface> *interface,
799 InterfaceDeleter deleter = std::default_delete<C2ComponentInterface>()) override;
804 std::shared_ptr<const C2Component::Traits> getTraits();
853 c2_status_t init(std::string libPath);
858 std::recursive_mutex mLock; ///< lock protecting mTraits
859 std::shared_ptr<C2Component::Traits> mTraits; ///< cached component traits
890 c2_status_t fetchModule(std::shared_ptr<ComponentModule> *module) { in fetchModule()
892 std::lock_guard<std::mutex> lock(mMutex); in fetchModule()
893 std::shared_ptr<ComponentModule> localModule = mModule.lock(); in fetchModule()
897 localModule = std::make_shared<ComponentModule>(mCreateFactory, in fetchModule()
900 localModule = std::make_shared<ComponentModule>(); in fetchModule()
914 ComponentLoader(std::string libPath) in ComponentLoader()
918 ComponentLoader(std::tuple<C2String, in ComponentLoader()
921 : mLibPath(std::get<0>(func)), in ComponentLoader()
922 mCreateFactory(std::get<1>(func)), in ComponentLoader()
923 mDestroyFactory(std::get<2>(func)) {} in ComponentLoader()
926 std::mutex mMutex; ///< mutex guarding the module
927 std::weak_ptr<ComponentModule> mModule; ///< weak reference to the loaded module
928 std::string mLibPath; ///< library path
936 std::shared_ptr<C2StoreIonUsageInfo> mIonUsageInfo;
937 std::shared_ptr<C2StoreDmaBufUsageInfo> mDmaBufUsageInfo;
939 Interface(std::shared_ptr<C2ReflectorHelper> reflector) in Interface()
1033 c2_status_t findComponent(C2String name, std::shared_ptr<ComponentModule> *module);
1040 std::mutex mMutex; ///< mutex guarding the component lists during construction
1042 std::map<C2String, ComponentLoader> mComponents; ///< path -> component module
1043 std::map<C2String, C2String> mComponentNameToPath; ///< name -> path
1044 std::vector<std::shared_ptr<const C2Component::Traits>> mComponentList;
1046 std::shared_ptr<C2ReflectorHelper> mReflector;
1050 std::vector<std::tuple<C2String,
1056 std::string libPath) { in init()
1088 std::shared_ptr<C2ComponentInterface> intf; in init()
1095 std::shared_ptr<C2Component::Traits> traits(new (std::nothrow) C2Component::Traits); in init()
1128 c2_node_id_t id, std::shared_ptr<C2ComponentInterface> *interface, in createInterface()
1129 std::function<void(::C2ComponentInterface*)> deleter) { in createInterface()
1134 std::shared_ptr<ComponentModule> module = shared_from_this(); in createInterface()
1145 c2_node_id_t id, std::shared_ptr<C2Component> *component, in createComponent()
1146 std::function<void(::C2Component*)> deleter) { in createComponent()
1151 std::shared_ptr<ComponentModule> module = shared_from_this(); in createComponent()
1161 std::shared_ptr<const C2Component::Traits> C2PlatformComponentStore::ComponentModule::getTraits() { in getTraits()
1162 std::unique_lock<std::recursive_mutex> lock(mLock); in getTraits()
1168 mReflector(std::make_shared<C2ReflectorHelper>()), in C2PlatformComponentStore()
1214 std::vector<std::tuple<C2String, in C2PlatformComponentStore()
1218 mReflector(std::make_shared<C2ReflectorHelper>()), in C2PlatformComponentStore()
1223 mComponents.emplace(std::get<0>(func), func); in C2PlatformComponentStore()
1228 std::shared_ptr<C2GraphicBuffer> src, std::shared_ptr<C2GraphicBuffer> dst) { in copyBuffer()
1235 const std::vector<C2Param*> &stackParams, in query_sm()
1236 const std::vector<C2Param::Index> &heapParamIndices, in query_sm()
1237 std::vector<std::unique_ptr<C2Param>> *const heapParams) const { in query_sm()
1242 const std::vector<C2Param*> &params, in config_sm()
1243 std::vector<std::unique_ptr<C2SettingResult>> *const failures) { in config_sm()
1248 std::lock_guard<std::mutex> lock(mMutex); in visitComponents()
1255 std::shared_ptr<ComponentModule> module; in visitComponents()
1257 std::shared_ptr<const C2Component::Traits> traits = module->getTraits(); in visitComponents()
1270 std::vector<std::shared_ptr<const C2Component::Traits>> C2PlatformComponentStore::listComponents() { in listComponents()
1277 C2String name, std::shared_ptr<ComponentModule> *module) { in findComponent()
1289 C2String name, std::shared_ptr<C2Component> *const component) { in createComponent()
1292 std::shared_ptr<ComponentModule> module; in createComponent()
1302 C2String name, std::shared_ptr<C2ComponentInterface> *const interface) { in createInterface()
1305 std::shared_ptr<ComponentModule> module; in createInterface()
1315 std::vector<std::shared_ptr<C2ParamDescriptor>> *const params) const { in querySupportedParams_nb()
1320 std::vector<C2FieldSupportedValuesQuery> &fields) const { in querySupportedValues_sm()
1328 std::shared_ptr<C2ParamReflector> C2PlatformComponentStore::getParamReflector() const { in getParamReflector()
1332 std::shared_ptr<C2ComponentStore> GetCodec2PlatformComponentStore() { in GetCodec2PlatformComponentStore()
1333 static std::mutex mutex; in GetCodec2PlatformComponentStore()
1334 static std::weak_ptr<C2ComponentStore> platformStore; in GetCodec2PlatformComponentStore()
1335 std::lock_guard<std::mutex> lock(mutex); in GetCodec2PlatformComponentStore()
1336 std::shared_ptr<C2ComponentStore> store = platformStore.lock(); in GetCodec2PlatformComponentStore()
1338 store = std::make_shared<C2PlatformComponentStore>(); in GetCodec2PlatformComponentStore()
1345 std::shared_ptr<C2ComponentStore> GetTestComponentStore( in GetTestComponentStore()
1346 std::vector<std::tuple<C2String, in GetTestComponentStore()
1349 return std::shared_ptr<C2ComponentStore>(new C2PlatformComponentStore(funcs)); in GetTestComponentStore()