Loading media/codec2/hidl/client/client.cpp +57 −51 Original line number Diff line number Diff line Loading @@ -883,7 +883,9 @@ std::shared_ptr<Codec2Client::Component> Codec2Client::CreateComponentByName( const char* componentName, const std::shared_ptr<Listener>& listener, std::shared_ptr<Codec2Client>* owner) { std::shared_ptr<Codec2Client>* owner, size_t numberOfAttempts) { while (true) { std::shared_ptr<Component> component; c2_status_t status = ForAllServices( componentName, Loading @@ -906,17 +908,20 @@ std::shared_ptr<Codec2Client::Component> } return status; }); if (status != C2_OK) { LOG(DEBUG) << "Could not create component \"" << componentName << "\". " "Status = " << status << "."; if (numberOfAttempts > 0 && status == C2_TRANSACTION_FAILED) { --numberOfAttempts; continue; } return component; } } std::shared_ptr<Codec2Client::Interface> Codec2Client::CreateInterfaceByName( const char* interfaceName, std::shared_ptr<Codec2Client>* owner) { std::shared_ptr<Codec2Client>* owner, size_t numberOfAttempts) { while (true) { std::shared_ptr<Interface> interface; c2_status_t status = ForAllServices( interfaceName, Loading @@ -938,12 +943,13 @@ std::shared_ptr<Codec2Client::Interface> } return status; }); if (status != C2_OK) { LOG(DEBUG) << "Could not create interface \"" << interfaceName << "\". " "Status = " << status << "."; if (numberOfAttempts > 0 && status == C2_TRANSACTION_FAILED) { --numberOfAttempts; continue; } return interface; } } std::vector<C2Component::Traits> const& Codec2Client::ListComponents() { static std::vector<C2Component::Traits> sList{[]() { Loading media/codec2/hidl/client/include/codec2/hidl/client.h +8 −4 Original line number Diff line number Diff line Loading @@ -179,17 +179,21 @@ struct Codec2Client : public Codec2ConfigurableClient { static std::vector<std::shared_ptr<Codec2Client>> CreateFromAllServices(); // Try to create a component with a given name from all known // IComponentStore services. // IComponentStore services. numberOfAttempts determines the number of times // to retry the HIDL call if the transaction fails. static std::shared_ptr<Component> CreateComponentByName( char const* componentName, std::shared_ptr<Listener> const& listener, std::shared_ptr<Codec2Client>* owner = nullptr); std::shared_ptr<Codec2Client>* owner = nullptr, size_t numberOfAttempts = 10); // Try to create a component interface with a given name from all known // IComponentStore services. // IComponentStore services. numberOfAttempts determines the number of times // to retry the HIDL call if the transaction fails. static std::shared_ptr<Interface> CreateInterfaceByName( char const* interfaceName, std::shared_ptr<Codec2Client>* owner = nullptr); std::shared_ptr<Codec2Client>* owner = nullptr, size_t numberOfAttempts = 10); // List traits from all known IComponentStore services. static std::vector<C2Component::Traits> const& ListComponents(); Loading Loading
media/codec2/hidl/client/client.cpp +57 −51 Original line number Diff line number Diff line Loading @@ -883,7 +883,9 @@ std::shared_ptr<Codec2Client::Component> Codec2Client::CreateComponentByName( const char* componentName, const std::shared_ptr<Listener>& listener, std::shared_ptr<Codec2Client>* owner) { std::shared_ptr<Codec2Client>* owner, size_t numberOfAttempts) { while (true) { std::shared_ptr<Component> component; c2_status_t status = ForAllServices( componentName, Loading @@ -906,17 +908,20 @@ std::shared_ptr<Codec2Client::Component> } return status; }); if (status != C2_OK) { LOG(DEBUG) << "Could not create component \"" << componentName << "\". " "Status = " << status << "."; if (numberOfAttempts > 0 && status == C2_TRANSACTION_FAILED) { --numberOfAttempts; continue; } return component; } } std::shared_ptr<Codec2Client::Interface> Codec2Client::CreateInterfaceByName( const char* interfaceName, std::shared_ptr<Codec2Client>* owner) { std::shared_ptr<Codec2Client>* owner, size_t numberOfAttempts) { while (true) { std::shared_ptr<Interface> interface; c2_status_t status = ForAllServices( interfaceName, Loading @@ -938,12 +943,13 @@ std::shared_ptr<Codec2Client::Interface> } return status; }); if (status != C2_OK) { LOG(DEBUG) << "Could not create interface \"" << interfaceName << "\". " "Status = " << status << "."; if (numberOfAttempts > 0 && status == C2_TRANSACTION_FAILED) { --numberOfAttempts; continue; } return interface; } } std::vector<C2Component::Traits> const& Codec2Client::ListComponents() { static std::vector<C2Component::Traits> sList{[]() { Loading
media/codec2/hidl/client/include/codec2/hidl/client.h +8 −4 Original line number Diff line number Diff line Loading @@ -179,17 +179,21 @@ struct Codec2Client : public Codec2ConfigurableClient { static std::vector<std::shared_ptr<Codec2Client>> CreateFromAllServices(); // Try to create a component with a given name from all known // IComponentStore services. // IComponentStore services. numberOfAttempts determines the number of times // to retry the HIDL call if the transaction fails. static std::shared_ptr<Component> CreateComponentByName( char const* componentName, std::shared_ptr<Listener> const& listener, std::shared_ptr<Codec2Client>* owner = nullptr); std::shared_ptr<Codec2Client>* owner = nullptr, size_t numberOfAttempts = 10); // Try to create a component interface with a given name from all known // IComponentStore services. // IComponentStore services. numberOfAttempts determines the number of times // to retry the HIDL call if the transaction fails. static std::shared_ptr<Interface> CreateInterfaceByName( char const* interfaceName, std::shared_ptr<Codec2Client>* owner = nullptr); std::shared_ptr<Codec2Client>* owner = nullptr, size_t numberOfAttempts = 10); // List traits from all known IComponentStore services. static std::vector<C2Component::Traits> const& ListComponents(); Loading