|
ADTF
|
To add additional files to an .adtfdat recording, the Attached Files mechanism can be used.
This is an extension within the .adtfdat file to store required content for playback (e.g. databases, descriptions).
Use this mechanism to make the file self-contained for any playback or post-processing scenerio.
The Recorder can attach files to .adtfdat recordings based on a XML configuration file.
The XSD describing the format can be found at ./doc/xsd/xmlbinding/adtfxsdattachments/adtfxsdattachments.xsd
Let's take a look at the following example:
By specifing this file in the property attachment_configuration_file, these files will be attached to each recording. Please see Recorder for further properties regarding attached files handling.
If the Property cache_attachment_archive of the Recorder is set to false, then it will read the configuration and attach the files each time a recording is closed.
This happens after the kernel signal PreFileClosed (see adtf::services::IRecordingSignal) has been processed by all recipients.
This way you can create files that should be attached or even (re-)create the configuration during handling of this signal.
There are multiple ways to extract files from .adtfdat recordings:
The local interface adtf::services::IPlayer::ExtractAttachedFiles and the rpc interface adtf::remote::IPlayer::ExtractAttachedFiles allows a user to extract files at any given time.
If there is an .adtfdat recording specified in the extract_attached_files_from property of the Playback Service, then the files will be extracted during service initialization.
extraction_destination_directory property in this case.The files are stored as a tar.gz archive within the attached_files extension of an ADTFDAT file.
So the files can easily be extracted with the help of the adtf_dattool:
and then open the archive with your preferred archiver.
To access extracted files you can use the tags via macros.
The Playback Service will define a macro in the form of $(AF:<tag_name>) for each tag.
If a tag is referenced by multiple files the macro will resolve to a semi-colon seperated list.
This way you can use these macros within your properties.
Using our example above the following macros would be available:
$(AF:file1) with the path to file1.txt$(AF:hello) with the path to hello.txt$(AF:subfolder1) with the path to some/where/else$(AF:subfolder2) with the path to wildcard_folder$(AF:text_file_folder) with the path to text/files/from_folder3$(AF:files) a ; seperated list of file1.txt and hello.txt$(AF:license_plate) with the string OUTATIME