-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Health & Error Callback Implementation , Improved Abs Control Module (#…
…377) * Added Error & Health Status Objects * Added Error & Health Callbacks * Removed unwanted Header Declarartion * Added Health & Error Callback Listener * Fixed Build Issue * -> Added Virtual Function to register error callback -> Added Health Callback strategy * Added Error & Health Callback in ImageEncoder Module * control module changes wip * 1. defined Control module type at framework level 2. enforced data frame checks for control modules * added a virtual method to add control module so that it can be overriden for custom behaviour in some modules * resolved conflict * Fixed Build Issue * Fixed Linking Error * Fixed Typo * revert the multiple pipelines with control module idea * Do not allow roles to be updated once registered * Added COndition to check for input and output pins * Updated handleError and Callback as a virtual function * Added handle Error & Healthback method in Simple Control Module * Removed Dummy Error Callbacks from ImageEncoder Module * USing Simple Control Module in ImageEncoder Tests * Fixed Indentation and typo * Renamed Error, Health and Callback class * Code Cleanup * Fixed warning * Using Updated Health & Error Object class * -> Fixed Formatting -> Added Register Error callback -> Sending Error Callback when frame is not there to render * Renamed Health & ErrorCallback function * Updated GtkGL to use updated APErrorCallback method * Update Module.h * Added Generic Implementation of Error Callback * Formatted APErrorObject class * Updated GtkGLRenderer to Use Generic Error Callbacks, Added Test for same * Removed Unwanted errors * Added healthUpdateIntervalInSec in ModuleProps, To make HealtCallback Frequency configurable * Added Defination of getCurrentTimestamp --------- Co-authored-by: mradul <mradul@apra.in>
- Loading branch information
1 parent
e9dab6f
commit 52980cc
Showing
25 changed files
with
2,275 additions
and
1,718 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
#include "APErrorObject.h" | ||
#include "APHealthObject.h" | ||
#include <functional> | ||
|
||
using APErrorCallback = std::function<void(const APErrorObject &)>; | ||
using APHealthCallback = std::function<void(const APHealthObject &)>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
#include <string> | ||
|
||
class APErrorObject { | ||
private: | ||
int mErrorCode; | ||
std::string mErrorMessage; | ||
std::string mModuleName; | ||
std::string mModuleId; | ||
std::string mTimestamp; | ||
|
||
std::string getCurrentTimestamp() const; | ||
|
||
public: | ||
APErrorObject(int errCode, const std::string &errorMsg); | ||
|
||
int getErrorCode() const; | ||
std::string getErrorMessage() const; | ||
std::string getModuleName() const; | ||
std::string getModuleId() const; | ||
std::string getTimestamp() const; | ||
|
||
void displayError() const; | ||
void setErrorCode(int errCode); | ||
void setErrorMessage(const std::string &errorMsg); | ||
void setModuleName(const std::string &modName); | ||
void setModuleId(const std::string &modId); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
#include <string> | ||
|
||
class APHealthObject | ||
{ | ||
private: | ||
std::string mModuleId; | ||
std::string mTimestamp; | ||
|
||
std::string getCurrentTimestamp() const; | ||
|
||
public: | ||
APHealthObject(const std::string &modId); | ||
|
||
std::string getModuleId() const; | ||
std::string getTimestamp() const; | ||
|
||
void setModuleId(const std::string &modId); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,45 @@ | ||
#pragma once | ||
#include "APCallback.h" | ||
#include "Command.h" | ||
#include "Module.h" | ||
#include <map> | ||
|
||
class PipeLine; | ||
class AbsControlModuleProps : public ModuleProps { | ||
public: | ||
AbsControlModuleProps() {} | ||
AbsControlModuleProps() {} | ||
}; | ||
|
||
class AbsControlModule : public Module { | ||
public: | ||
AbsControlModule(AbsControlModuleProps _props); | ||
~AbsControlModule(); | ||
bool init(); | ||
bool term(); | ||
std::string enrollModule(std::string pName, std::string role, | ||
boost::shared_ptr<Module> module); | ||
std::pair<bool, boost::shared_ptr<Module>> getModuleofRole(std::string pName, | ||
std::string role); | ||
virtual void handleMp4MissingVideotrack(std::string previousVideoFile, | ||
std::string nextVideoFile) {} | ||
virtual void handleMMQExport(Command cmd, bool priority = false) {} | ||
virtual void handleMMQExportView(uint64_t startTS, | ||
uint64_t endTS = 9999999999999, | ||
bool playabckDirection = true, | ||
bool Mp4ReaderExport = false, | ||
bool priority = false) {} | ||
virtual void handleSendMMQTSCmd(uint64_t mmqBeginTS, uint64_t mmqEndTS, | ||
bool priority = false) {} | ||
virtual void handleLastGtkGLRenderTS(uint64_t latestGtkGlRenderTS, | ||
bool priority) {} | ||
virtual void handleGoLive(bool goLive, bool priority) {} | ||
virtual void handlePusherPauseTS(uint64_t keyFrameTS) {} | ||
virtual void handleDecoderSpeed(DecoderPlaybackSpeed cmd, bool priority) {} | ||
boost::container::deque<boost::shared_ptr<Module>> pipelineModules; | ||
std::map<std::string, boost::shared_ptr<Module>> moduleRoles; | ||
AbsControlModule(AbsControlModuleProps _props); | ||
~AbsControlModule(); | ||
bool init(); | ||
bool term(); | ||
bool enrollModule(std::string role, boost::shared_ptr<Module> module); | ||
boost::shared_ptr<Module> getModuleofRole(std::string role); | ||
virtual void handleMp4MissingVideotrack(std::string previousVideoFile, std::string nextVideoFile) {} | ||
virtual void handleMMQExport(Command cmd, bool priority = false) {} | ||
virtual void handleMMQExportView(uint64_t startTS, uint64_t endTS = 9999999999999, bool playabckDirection = true, bool Mp4ReaderExport = false, bool priority = false) {} | ||
virtual void handleSendMMQTSCmd(uint64_t mmqBeginTS, uint64_t mmqEndTS, bool priority = false) {} | ||
virtual void handleLastGtkGLRenderTS(uint64_t latestGtkGlRenderTS, bool priority) {} | ||
virtual void handleGoLive(bool goLive, bool priority) {} | ||
virtual void handleDecoderSpeed(DecoderPlaybackSpeed cmd, bool priority) {} | ||
boost::container::deque<boost::shared_ptr<Module>> pipelineModules; | ||
std::map<std::string, boost::shared_ptr<Module>> moduleRoles; | ||
virtual void handleError(const APErrorObject &error) {} | ||
virtual void handleHealthCallback(const APHealthObject &healthObj) {} | ||
|
||
|
||
protected: | ||
bool process(frame_container &frames); | ||
bool handleCommand(Command::CommandType type, frame_sp &frame); | ||
bool handlePropsChange(frame_sp &frame); | ||
bool process(frame_container& frames); | ||
bool handleCommand(Command::CommandType type, frame_sp& frame); | ||
bool handlePropsChange(frame_sp& frame); | ||
virtual void sendEOS() {} | ||
virtual void sendEOS(frame_sp& frame) {} | ||
virtual void sendEOPFrame() {} | ||
|
||
private: | ||
class Detail; | ||
boost::shared_ptr<Detail> mDetail; | ||
class Detail; | ||
boost::shared_ptr<Detail> mDetail; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.