|
ADTF
|
ADTF provides a result code type tResult. This is used throughout most interface and class methods where things can go wrong.
The ADTF SDK and Runtime is prepared to cope with exceptions within any of the graph objects methods, especially in your subclasses' constructors.
You are also free to throw exceptions (THROW_ERROR_DESC) in methods that return tResult error codes.
These error types can be used as return codes and within exceptions:
| Error Code | Error String |
|---|---|
0 | ERR_NOERROR |
-2 | ERR_UNKNOWN |
-3 | ERR_UNEXPECTED |
-4 | ERR_POINTER |
-5 | ERR_INVALID_ARG |
-6 | ERR_INVALID_FUNCTION |
-7 | ERR_INVALID_ADDRESS |
-8 | ERR_INVALID_HANDLE |
-9 | ERR_INVALID_FLAGS |
-10 | ERR_INVALID_INDEX |
-11 | ERR_INVALID_FILE |
-12 | ERR_MEMORY |
-13 | ERR_TIMEOUT |
-14 | ERR_OUT_OF_SYNC |
-15 | ERR_RESOURCE_IN_USE |
-16 | ERR_NOT_IMPL |
-17 | ERR_NO_INTERFACE |
-18 | ERR_NO_CLASS |
-19 | ERR_NOT_SUPPORTED |
-20 | ERR_NOT_FOUND |
-21 | ERR_CANCELED |
-22 | ERR_RETRY |
-23 | ERR_FILE_NOT_FOUND |
-24 | ERR_PATH_NOT_FOUND |
-25 | ERR_ACCESS_DENIED |
-26 | ERR_NOT_READY |
-27 | ERR_OPEN_FAILED |
-28 | ERR_IO_INCOMPLETE |
-29 | ERR_IO_PENDING |
-30 | ERR_NOACCESS |
-31 | ERR_BAD_DEVICE |
-32 | ERR_DEVICE_IO |
-33 | ERR_DEVICE_NOT_READY |
-34 | ERR_DEVICE_IN_USE |
-35 | ERR_NOT_CONNECTED |
-36 | ERR_UNKNOWN_FORMAT |
-37 | ERR_NOT_INITIALIZED |
-38 | ERR_FAILED |
-39 | ERR_END_OF_FILE |
-40 | ERR_INVALID_STATE |
-41 | ERR_EXCEPTION_RAISED |
-42 | ERR_INVALID_TYPE |
-43 | ERR_EMPTY |
-44 | ERR_INVALID_VERSION |
-45 | ERR_INVALID_LICENSE |
-46 | ERR_SERVICE_NOT_FOUND |
-47 | ERR_DAU |
-48 | ERR_IDLE_NOWAIT |
-49 | ERR_OUT_OF_RANGE |
-50 | ERR_KNOWN_PROBLEM |
-51 | ERR_INVALID_INTERFACE |
All errors that happen during the startup and initialization phase of an ADTF System are handled by the initiating component.
Just make sure that you return meaningful error descriptions from the initialization and configuration methods of your service, streaming service, or filter with the help of the RETURN_ERROR_DESC macro.
Basically, any error that happens during a runlevel change, will revert the ADTF System back to the last stable runlevel.
Below is a list that gives you hints when the methods of ADTF components are called:
| From | To | Service | Streaming Service | Filter |
|---|---|---|---|---|
RL_Shutdown | RL_System | ServiceInit (if configured for this runlevel) | - | - |
RL_System | RL_Session | ServiceInit (if configured for this runlevel) | - | - |
RL_Session | RL_StreamingGraph | - | Construct, Init | - |
RL_StreamingGraph | RL_FilterGraph | - | - | Init(StageFirst), Init(StageNormal), Init(StageReady) |
RL_FilterGraph | RL_Running | - | StartStreaming | Start |
| From | To | Service | Streaming Service | Filter |
|---|---|---|---|---|
RL_Running | RL_FilterGraph | - | StopStreaming | Stop |
RL_FilterGraph | RL_StreamingGraph | - | - | Shutdown(StageReady), Shutdown(StageNormal), Shutdown(StageFirst) |
RL_StreamingGraph | RL_Session | - | Shutdown, Destruct | - |
RL_Session | RL_System | ServiceShutdown (if configured for this runlevel) | - | - |
RL_System | RL_Shutdown | ServiceShutdown (if configured for this runlevel) | - | - |
Errors, that occur while the ADTF Session is in runlevel RL_Running, are handled via the adtf::base::IErrorHandling interface.
If you're within a method that returns a tResult, you do not have to take any additional care.