![]() |
MAK Data Logger API Documentation for HLA
|
Recording simulation data and recording a video stream require separate setup.
Enabling media recording does not, by itself, prepare the GStreamer pipeline or select the media output filename. This page describes the remote-control and in-process interfaces in this source tree.
For example, the following configuration describes an MPEG transport-stream input recorded to an MPEG program-stream file:
The serialized configuration has three fields: media type, output extension, and pipeline template, separated by dollar signs. The initialization commands SetMediaRecordFromStreamConfiguration and SetMediaRecordStreamParameters apply these variables to the recorder. The template's d is the receive port, and s is the media output pathname. Use the appropriate template for the actual incoming encoding; the example is not an H.264 or H.265 pipeline.
DtRemoteControlRecordInterface::newFile() has two independent construction flags:
| Flag | Meaning |
|---|---|
| constructFileNameAndPath | Construct an exercise directory and a logger-specific simulation filename in the Logger's default recording directory. This does not enable video recording. |
| constructMediaPipeline | Enable media recording, extract the configured media pipeline template, and derive the media output pathname from the resolved simulation pathname using the configured media extension. |
When the application already supplies a complete filename, keep constructFileNameAndPath false and set constructMediaPipeline true:
The examples use C:/path/to/Logger/logger_tapes as an illustrative absolute path to the installed Logger's default recording directory. Replace it with the actual path on the Logger machine.
Here remoteRecordInterface is a DtRemoteControlRecordInterface pointer. With the configuration above, the media output pathname is C:/path/to/Logger/logger_tapes/myRecording.mpg. The driver extracts the template during NewFile processing; the media operation substitutes the filename and port before initializing GStreamer.
Use constructFileNameAndPath true only when supplying an exercise name and requesting the Logger's naming convention. For example, with default directory C:/path/to/Logger/logger_tapes and remote-control ID 1:
This selects C:/path/to/Logger/logger_tapes/myRecording/myRecording_1.lgr and, for the configuration above, the corresponding myRecording_1.mpg. It is not a flag to create the parent directory of an arbitrary absolute pathname. See 7 - File Naming Conventions.
Process the command response before issuing dependent remote commands. NewFile starts recording automatically unless pause-on-record-as is enabled. If it is enabled, wait for a successful file-open response and then call DtRemoteControlRecordInterface::record(false), using the same destination as newFile(). The default destination is a wildcard; specify a destination when only one remote Logger should receive the command. See 6 - Processing Responses.
DtLgrRecordInterface::startNewFile() is a different API. It sends NewFile with both construction flags false. For an explicitly named recording, a plug-in using this interface must supply a prepared pipeline before opening the file. Setting mediaRecordByDefault or calling setIsRecordingMediaStream(true) alone does not extract the configured template or derive the media filename.
Here recInterface is a DtLgrRecordInterface pointer. The pipeline argument must not include the mpeg$mpg$ prefix. This example supplies the actual port and media filename, with no unresolved placeholders. Prepare a new pipeline for each recording filename. DtLgrMediaPipelineBuilder can also extract a serialized configuration and construct a record pipeline from a media filename and port.
If pause-on-record-as is enabled, call DtLgrRecordInterface::record() after successful file opening. Otherwise opening the named file starts recording. Changing the pipeline after opening the file does not reconfigure the media operation that was created for that file.
The Record As dialog uses DtLgrMediaPipelineBuilder to construct the pipeline with the selected media filename and port. The GUI sends that prepared pipeline and enables media recording before calling startNewFile(). It therefore does not need the NewFile media-construction flag.
For an unnamed temporary recording, the driver initializes the configured media template from the temporary simulation filename when media recording is enabled. That fallback does not run for an explicitly named file. Consequently, success with the GUI's ordinary Record action does not establish that a plug-in has prepared the pipeline required for a named recording.