}
std::unique_ptr<Source> source_ptr;
- auto ret = Source::CreateSource(name, pipeline_, &source_ptr);
+ auto ret = Source::CreateSource(name, pipeline_, source_ptr);
if (ret) {
sources_.insert({name, std::move(source_ptr)});
}
LoggerD("Switch [%s] not found", name.c_str());
std::unique_ptr<Switch> switch_ptr;
- auto ret = Switch::CreateSwitch(name, pipeline_, &switch_ptr);
+ auto ret = Switch::CreateSwitch(name, pipeline_, switch_ptr);
if (ret) {
*type = switch_ptr->GetType();
switches_.insert({name, std::move(switch_ptr)});
LoggerD("Creating [%s] Valve", name.c_str());
std::unique_ptr<Valve> valve_ptr;
- auto ret = Valve::CreateValve(name, pipeline_, *this, &valve_ptr);
+ auto ret = Valve::CreateValve(name, pipeline_, *this, valve_ptr);
if (ret) {
valves_.insert({name, std::move(valve_ptr)});
}
namespace pipeline {
PlatformResult Source::CreateSource(const std::string& name, ml_pipeline_h pipeline,
- std::unique_ptr<Source>* out) {
+ std::unique_ptr<Source>& out) {
ScopeLogger("name: [%s], pipeline: [%p]", name.c_str(), pipeline);
ml_pipeline_src_h source_handle = nullptr;
auto ret = ml_pipeline_src_get_handle(pipeline, name.c_str(), &source_handle);
return util::ToPlatformResult(ret, "Could not get source");
}
- out->reset(new (std::nothrow) Source{name, source_handle});
+ out.reset(new (std::nothrow) Source{name, source_handle});
if (!out) {
ret = ml_pipeline_src_release_handle(source_handle);
if (ML_ERROR_NONE != ret) {
class Source {
public:
static PlatformResult CreateSource(const std::string& name, ml_pipeline_h pipeline,
- std::unique_ptr<Source>* out);
+ std::unique_ptr<Source>& out);
~Source();
namespace pipeline {
PlatformResult Switch::CreateSwitch(const std::string& name, ml_pipeline_h pipeline,
- std::unique_ptr<Switch>* out) {
+ std::unique_ptr<Switch>& out) {
ScopeLogger("name: [%s], pipeline: [%p]", name.c_str(), pipeline);
ml_pipeline_switch_e type = ML_PIPELINE_SWITCH_INPUT_SELECTOR;
}
LoggerD("ml_pipeline_switch_get_handle() succeeded");
- out->reset(new (std::nothrow) Switch{name, TypeToString(type), switch_handle});
+ out.reset(new (std::nothrow) Switch{name, TypeToString(type), switch_handle});
if (!out) {
ret = ml_pipeline_switch_release_handle(switch_handle);
if (ML_ERROR_NONE != ret) {
class Switch {
public:
static PlatformResult CreateSwitch(const std::string& name, ml_pipeline_h pipeline,
- std::unique_ptr<Switch>* out);
+ std::unique_ptr<Switch>& out);
std::string GetType() const;
PlatformResult GetPadList(picojson::array* out) const;
namespace pipeline {
PlatformResult Valve::CreateValve(const std::string& name, ml_pipeline_h native_pipeline_handle,
- Pipeline& pipeline, std::unique_ptr<Valve>* out) {
+ Pipeline& pipeline, std::unique_ptr<Valve>& out) {
ScopeLogger("name: [%s], native_pipeline_handle: [%p]", name.c_str(), native_pipeline_handle);
ml_pipeline_valve_h valve_handle = nullptr;
}
LoggerD("ml_pipeline_valve_get_handle() succeeded");
- out->reset(new (std::nothrow) Valve{name, valve_handle, pipeline});
+ out.reset(new (std::nothrow) Valve{name, valve_handle, pipeline});
if (!out) {
ret = ml_pipeline_valve_release_handle(valve_handle);
if (ML_ERROR_NONE != ret) {
class Valve {
public:
static PlatformResult CreateValve(const std::string& name, ml_pipeline_h native_pipeline_handle,
- Pipeline& pipeline, std::unique_ptr<Valve>* out);
+ Pipeline& pipeline, std::unique_ptr<Valve>& out);
~Valve();