ADTF  v2.14.3
Harddisk Recorder - Events received and emitted

The Harddisk Recorder receives and emits several events during runlevel ucom::IRuntime::RL_Running.

It also listens for events for starting and stopping a recording and splitting a DAT file. The following table shows the events.

Receive Events Explanation UseCase
IEvent::EC_StartRecording This event is received to start recording. (UseCase) Control the Recorder with programming access (UseCase) Change filename of the recorded file
IEvent::EC_SplitRecording This event is received to split a recording. You can send this event to force the recording into a new file and stop recording into the current file! (UseCase) Control the Recorder with programming access (UseCase) Change filename of the recorded file
IEvent::EC_StopRecording This event is received to stop a recording. (UseCase) Control the Recorder with programming access (UseCase) Change filename of the recorded file
Emitted Events you should react to ! Explanation UseCase
IEvent::EC_RecPreFileOpen The recorder opens a file for recording into. (UseCase) Retrieve and set information by IScriptable of the Recorder by event
IEvent::EC_RecPostFileOpen
IEvent::EC_RecPreFileClose The recorder closes the file that was used for recording. (UseCase) Retrieve and set information by IScriptable of the Recorder by event
IEvent::EC_RecPostFileClose
Emitted Events you should only use to support a GUI or Record Dialog! Explanation UseCase
IEvent::EC_RecordingActivated The recorder starts recording into the previously opened file. The parameter pvData points to a tUInt8 value 0 indicating that no split was activating this recording. If the recording was triggered by a split event (see IEvent::EC_SplitRecording) or automatic splitting, the parameter pvData points to a tUInt8 value of 1! Show Recording state within GUI. Mind: This Event is sent asynchronously!
IEvent::EC_RecordingDeactivated The recorder stops recording into the previously opened file. The parameter pvData points to a tUInt8 value 0 indicating that no split was deactivating this recording. If the recording is deactivated by a split event, the parameter pvData points to a tUInt8 value of 1! Show Recording state within GUI. Mind: This Event is sent asynchronously!
IEvent::EC_RecordingFinished The recording has been successfully stopped, but the file is not closed yet. This event will only be emitted if EC_StartRecording or EC_StopRecording is not sent with i32Param1 == 1. If this event was triggered by a split event (see IEvent::EC_SplitRecording) or automatic splitting, the parameter pvData points to a tUInt8 value of 1! This Event is usfule to catch the file closing (i.e. for a Record Dialog, see IRecorderFile )

UseCases on the Recorder

(UseCase) Control the Recorder with programming access

The ADTF Harddisk Recorder reacts on the following events:


By receiving or sending these events it is possible to change the description of the file, the filepath of the file, just start and stop filerecording to add some additional extionsion for convenience.

  • The following sample shows how to trigger a Harddisk Recorder using the adtf::IEvent::EC_StartRecording event.
    //this example is for using within a filter
    tADTFMediaDescriptor sDesc;
    strcpy(sDesc.strFilename, "/data/files/newfile.dat");
    strcpy(sDesc.strShortDesc, "short description");
    strcpy(sDesc.strLongDesc, "long description");
    tEventInfo sEventInfo;
    memset(&sEventInfo, 0, sizeof(tEventInfo));
    sEventInfo.pSource = static_cast<IObject*> (static_cast<IFilter*> (this));
    sEventInfo.i32EventClass = adtf::IEvent::CLASS_APPLICATION;
    sEventInfo.i32EventCode = adtf::IEvent::EC_StartRecording;
    sEventInfo.i32Param1 = 0;
    sEventInfo.i32Param2 = 0; //RecorderEventID -> the recorder id which is set in the recorder filter
    sEventInfo.pvData = (tVoid*)&sDesc;
    sEventInfo.szDataLength = sizeof(sDesc);
    _kernel->SignalSend(&sEventInfo);

(UseCase) Retrieve and set information by IScriptable of the Recorder by event


By receiving the following event it is possible to retrieve the information with the help of ucom::IScriptable in


By receiving the following events it is possible to set the information with the help of ucom::IScriptable in


The ucom::IScriptable interface can be retrieved from the sEventInfo.pSource member on reception of a Harddisk Player event.

To retrieve the filename use following code:

// ...
tResult cMyFilter::Run(tInt nActivationCode,
const tVoid* pvUserData,
tInt szUserData,
__exception)
{
// process a event
if (nActivationCode == IRunnable::RUN_SIGNAL && pvUserData != NULL)
{
const tSignalEventInfo* pEventInfo = (const tSignalEventInfo*) pvUserData;
if (pEventInfo->i32EventClass == IEvent::CLASS_APPLICATION &&
pEventInfo->i32EventCode == IEvent::EC_PlayPreFileOpen)
{
if (pEventInfo->pSource)
{
if (pScriptOfPlayer)
{
ucom::cException oLocalException;
tChar strPlayerFilename[512];
tResult nRes = pScriptOfPlayer->ScriptRunCommand(__script_cmd0(CMD_HDS_GET_FILENAME),
(tVoid*)strPlayerFilename,
512,
&oLocalException);
if (IS_OK(nRes))
{
LOG_INFO(adtf_util::cString::Format("Filename is %s", strPlayerFilename).GetPtr());
}
else
{
__catch_exception(oLocalException)
{
//retrieve more information on the error
}
}
}
else
{
LOG_ERROR("Unable to aquire scriptable interface");
}
}
}
}
else
{
return cFilter::Run(nActivationCode, pvUserData, szUserData, __exception_ptr);
}
}

(UseCase) Change filename of the recorded file

You will have several ways to change the filename during recording time.

  • Use the common way and set the "filename" property of the recorder with the help of environment variables.

Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Fri Mar 22 2019 by doxygen 1.8.10)