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*> ¶ms,
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();
529 c2_status_t init(std::string libPath);
534 std::recursive_mutex mLock; ///< lock protecting mTraits
535 std::shared_ptr<C2Component::Traits> mTraits; ///< cached component traits
566 c2_status_t fetchModule(std::shared_ptr<ComponentModule> *module) { in fetchModule()
568 std::lock_guard<std::mutex> lock(mMutex); in fetchModule()
569 std::shared_ptr<ComponentModule> localModule = mModule.lock(); in fetchModule()
571 localModule = std::make_shared<ComponentModule>(); in fetchModule()
584 ComponentLoader(std::string libPath) in ComponentLoader()
588 std::mutex mMutex; ///< mutex guarding the module
589 std::weak_ptr<ComponentModule> mModule; ///< weak reference to the loaded module
590 std::string mLibPath; ///< library path
594 std::shared_ptr<C2StoreIonUsageInfo> mIonUsageInfo;
596 Interface(std::shared_ptr<C2ReflectorHelper> reflector) in Interface()
642 c2_status_t findComponent(C2String name, std::shared_ptr<ComponentModule> *module);
649 std::mutex mMutex; ///< mutex guarding the component lists during construction
651 std::map<C2String, ComponentLoader> mComponents; ///< path -> component module
652 std::map<C2String, C2String> mComponentNameToPath; ///< name -> path
653 std::vector<std::shared_ptr<const C2Component::Traits>> mComponentList;
655 std::shared_ptr<C2ReflectorHelper> mReflector;
660 std::string libPath) { in init()
689 std::shared_ptr<C2ComponentInterface> intf; in init()
696 std::shared_ptr<C2Component::Traits> traits(new (std::nothrow) C2Component::Traits); in init()
712 (traits->name.find("encoder") != std::string::npos) ? C2Component::KIND_ENCODER : in init()
713 (traits->name.find("decoder") != std::string::npos) ? C2Component::KIND_DECODER : in init()
720 std::vector<std::unique_ptr<C2Param>> params; in init()
736 std::string(mediaTypeConfig->m.value, in init()
797 c2_node_id_t id, std::shared_ptr<C2ComponentInterface> *interface, in createInterface()
798 std::function<void(::C2ComponentInterface*)> deleter) { in createInterface()
803 std::shared_ptr<ComponentModule> module = shared_from_this(); in createInterface()
814 c2_node_id_t id, std::shared_ptr<C2Component> *component, in createComponent()
815 std::function<void(::C2Component*)> deleter) { in createComponent()
820 std::shared_ptr<ComponentModule> module = shared_from_this(); in createComponent()
830 std::shared_ptr<const C2Component::Traits> C2PlatformComponentStore::ComponentModule::getTraits() { in getTraits()
831 std::unique_lock<std::recursive_mutex> lock(mLock); in getTraits()
837 mReflector(std::make_shared<C2ReflectorHelper>()), in C2PlatformComponentStore()
878 std::shared_ptr<C2GraphicBuffer> src, std::shared_ptr<C2GraphicBuffer> dst) { in copyBuffer()
885 const std::vector<C2Param*> &stackParams, in query_sm()
886 const std::vector<C2Param::Index> &heapParamIndices, in query_sm()
887 std::vector<std::unique_ptr<C2Param>> *const heapParams) const { in query_sm()
892 const std::vector<C2Param*> ¶ms, in config_sm()
893 std::vector<std::unique_ptr<C2SettingResult>> *const failures) { in config_sm()
898 std::lock_guard<std::mutex> lock(mMutex); in visitComponents()
905 std::shared_ptr<ComponentModule> module; in visitComponents()
907 std::shared_ptr<const C2Component::Traits> traits = module->getTraits(); in visitComponents()
920 std::vector<std::shared_ptr<const C2Component::Traits>> C2PlatformComponentStore::listComponents() { in listComponents()
927 C2String name, std::shared_ptr<ComponentModule> *module) { in findComponent()
939 C2String name, std::shared_ptr<C2Component> *const component) { in createComponent()
942 std::shared_ptr<ComponentModule> module; in createComponent()
952 C2String name, std::shared_ptr<C2ComponentInterface> *const interface) { in createInterface()
955 std::shared_ptr<ComponentModule> module; in createInterface()
965 std::vector<std::shared_ptr<C2ParamDescriptor>> *const params) const { in querySupportedParams_nb()
970 std::vector<C2FieldSupportedValuesQuery> &fields) const { in querySupportedValues_sm()
978 std::shared_ptr<C2ParamReflector> C2PlatformComponentStore::getParamReflector() const { in getParamReflector()
982 std::shared_ptr<C2ComponentStore> GetCodec2PlatformComponentStore() { in GetCodec2PlatformComponentStore()
983 static std::mutex mutex; in GetCodec2PlatformComponentStore()
984 static std::weak_ptr<C2ComponentStore> platformStore; in GetCodec2PlatformComponentStore()
985 std::lock_guard<std::mutex> lock(mutex); in GetCodec2PlatformComponentStore()
986 std::shared_ptr<C2ComponentStore> store = platformStore.lock(); in GetCodec2PlatformComponentStore()
988 store = std::make_shared<C2PlatformComponentStore>(); in GetCodec2PlatformComponentStore()