TTranscoderCallback¶
primo::avblocks::modern::TTranscoderCallback
-
class TTranscoderCallback : public primo::avblocks::TranscoderCallback¶
Internal adapter that bridges
std::functioncallbacks to the rawprimo::avblocks::TranscoderCallbackinterface.Owned by
TTranscoderTviastd::unique_ptrso its address stays stable across moves. Only allocated when at least one lambda is set.Public Functions
-
inline void setOnProgress(std::function<void(double, double)> f)¶
Sets the function called periodically to report progress, with the current and total time in seconds.
-
inline void setOnStatus(std::function<void(primo::avblocks::TranscoderStatus::Enum)> f)¶
Sets the function called to report the status of the current operation.
-
inline void setOnContinue(std::function<bool(double)> f)¶
Sets the function called to let the user code stop a running transcoder.
It returns
trueto continue.
-
inline void setOnInputChange(std::function<void(int32_t)> f)¶
Sets the function called when an input format is detected or changes, with the index of the input socket.
-
inline virtual void onProgress(double cur, double total) override¶
Calls the progress function, if set.
-
inline virtual void onStatus(primo::avblocks::TranscoderStatus::Enum s) override¶
Calls the status function, if set.
-
inline virtual bool_t onContinue(double cur) override¶
Calls the continue function, if set.
Returns
TRUEwhen no function is set, so the transcoder keeps running.
-
inline virtual void onInputChange(int32_t idx) override¶
Calls the input change function, if set.
-
inline void setOnProgress(std::function<void(double, double)> f)¶