1. Introduction
The LT API is organized around REST which stands for Representational State Transfer. This is an architectural pattern that describes how systems can expose a consistent interface. When people use the term REST API, they are generally referring to an API accessed with a predefined set of URLs.
These URLs represent various resources which are returned as JSON objects. Resources have one or more methods like GET, POST or DELETE.
The LT API requests are processed by a host service called lt100agent. The lt100agent uses the standard Operating System IPC, SG-DMA and shared memory mechanisms to serve the LT API requests with the minimum possible latency. Video and Audio data is distributed to the various consumers with shared memory segments to increase the performance with either the large data buffers and the concurrent access.
The LT API is structured in a way that the LT boards can be seen as hardware as a service. The hardware specific implementations are hidden behind a unique general API that let the users to focus only on what the boards are most useful for: grab, play, record and stream audio and video data.
Clients REST LT API LT Agent LT Driver
============= ==========
ecurl (CLI) <-- | | | | |
<-- | | | | |
<-- | | Controls | | |
GO <-- | | Status | | | <--> LT board #0
C++ <-- | | Logs | | |
C# <-- | | | | | <--> LT board #1
Python <-- | | | | PCIe |
<-- | --> |-----------| <--> | Driver | ...
Directshow <-- | | | | (DMA) | ...
V4L2 <-- | | | | |
<-- | | Data | | | <--> LT board #n
NamedPipe <-- | | Server | | |
UART <-- | | | | |
TCP <-- | | | | |
HTTP (TBD) <-- | | | | |
<-- | |-----------| | |
<-- | | Firmwares | | |
============= ==========
2. Installation
2.1. Windows
Download and run the latest lt100install_x.x.x.exe to deploy the lt100 family drivers, tools and services. If necessary the previous version will be uninstalled.
Once installed, the lt100agent service will be started automatically and will be (re)started automatically with each system (re)boot.
The lt100agent can be controlled using the Windows Services Manager or the lt100agent command line interface. Please see [control_service].
The LT boards plugged into the host should appear in the Windows Device Manager under the Sound, video and game controllers.
|
Note
|
To uninstall the lt100 family drivers, tools and services, run the uninstall script located in the installation directory. |
2.2. Linux
Download and extract the latest lt100install_x.x.x.tar.gz, then execute the lt100install.sh script to deploy the lt100 family drivers, tools and services. If necessary the previous version will be uninstalled.
After a successful installation, the lt100agent daemon will be started automatically and will be (re)started automatically with each system (re)boot. If the installation failed, please check the lt100install.log file.
The lt100agent can be controlled using the lt100agent command line interface. Please see [control_service].
The LT boards plugged into the host should appear in the /proc directory. Please type the command below to check the boards status.
$ TBD
|
Note
|
To uninstall the lt100 family drivers, tools and services, run the uninstall script located in the installation directory. |
2.3. SDK
Download the latest lt100sdk_x.x.x_{windows,linux}.zip archive and extract it anywhere you want. The SDK contains the API documentation and the API libraries for the following languages Go, C++, Python and C#.
Please navigate through the examples to learn how to program the API.
You can also make scripts with the ecurl command line interface tool. Please see [ecurl].
2.4. Tools
Two tools are installed along with the lt100agent service:
By default, the tools are added to the PATH environment variable, so you can use them from any command line.
2.5. LT Board Firmware
If the boards installed into the host need a firmware update, the lt100agent service will automatically make an update when the service start. This step can take up to 2 minutes depending to the board type. The service availability will be delayed until the update is completed.
Please use the command below if you want to check the boards firmwares version.
$ lt100agent version
This is also possible to manually update the board firmwares.
$ lt100agent update
2.6. lt100agent Controls
To use the LT API you need to ensure that the lt100agent is running on your host system.
The following commands will help you to control the lt100agent.
$ lt100agent install
$ lt100agent uninstall
$ lt100agent version
$ lt100agent status
$ lt100agent start
$ lt100agent stop
$ lt100agent restart
$ lt100agent run
3. ecurl (CLI)
The ecurl program is a developer tool to help you make requests on the LT API directly from your terminal. The tool is deployed along with the lt100agent at the installation stage. The tool has been developed with our SDK and is available for Linux and Windows platforms.
You can use the ecurl CLI to:
-
Create, retrieve, update or delete LT API objects.
-
Play and record any video or audio resources.
-
Use the multi-channel feature of the LT boards.
-
Control and test the installed LT boards.
|
Note
|
The lt100agent has to be running otherwise ecurl will not work. |
3.1. GET command
$ ecurl get <url>
Perform a GET requests to retrieve an individual API object designed by the <url>.
$ ecurl get lt100:/
$ ecurl get lt100:/0
3.2. POST command
$ ecurl post <url> [-d @file.json] [-d field=value] [-d data=@file.bin]
Create or modify the resource designated by the <url>.
Arguments may be added to the request with the -d optional flags. It is possible to use a file content as input by preceding the filename with the @ character.
$ ecurl post lt100:/canvas/0/init -d source=video.mp4
3.3. DELETE Command
$ ecurl delete <url>
Delete or reset the resource pointed by the <url>.
$ ecurl delete lt100:/canvas/0
3.4. PLAY Command
$ ecurl play <url> [-d]
Play video or audio source until Ctrl+c is pressed.
Arguments may be added to the request with the -d optional flags.
$ ecurl play lt100:/0/sdi-in/0/data -d type=video/yuyv
$ ecurl play lt100:/0/sdi-in/0/data -d type=audio/pcm
$ ecurl play lt100:/0/sdi-in/0
3.5. REC Command
$ ecurl rec <url> [-d]
Record video or audio source until Ctrl+c is pressed.
Arguments may be added to the request with the -d optional flags.
$ ecurl rec lt100:/0/sdi-in/0/file -d type=video/mp4
4. API description
An API endpoint is a URL where the API receives requests about a specific resource. The endpoints are accessed with URLs with the following syntax scheme:/path.
It comprises:
-
A non-empty scheme component followed by a colon (
lt100:). -
A path component consisting of a sequence of path segments separated by a slash (
/).
For convenience, the URLs endpoints are described in tables where the scheme is omitted (lt100:) and the vertical separators replace the path slash (/). Paths are read from left to right. Methods written into a cell show the path available methods. An empty cell means that no method exists on the path.
4.1. Agent
The agent endpoint allows to retrieve the lt100agent software version.
4.1.1. Agent Object
|
4.1.2. View lt100agent Information
Retrieves the lt100agent software version.
ecurl
$ ecurl get lt100:/
GO
var response lt.Agent // struct to store the response
err := lt.Get("lt100:/", &response)
C++
lt::Agent response; // struct to store the response
lt::error err = lt::Get("lt100:/", response);
4.2. Board
The board endpoint allows to retrieve information on boards installed into the host.
|
4.2.1. Board Object
|
4.2.2. View Board Information
To retrieve the board information at a given position, send a GET request to the /:board endpoint.
ecurl
$ ecurl get lt100:/0
GO
var response lt.Board // struct to store the response
err := lt.Get("lt100:/0", &response)
C++
lt::Board response; // object to store the response
lt::error err = lt::Get("lt100:/0", response);
4.3. CVBS Input
This endpoint describes how to use cvbs-in inputs.
Native data can be accessed via the format path enumerator yuyv (video) and pcm (audio).
The pci endpoint allows to limit the maximum width, height, framerate and pixelrate coming through the PCIe bus to save bandwidth and ensure best quality of service for multi-channel scenarios.
Some of the proposed formats might require to use the host CPU and/or GPU before being delivered.
|
|||
|
4.3.1. CVBS Input Object
|
|
4.3.2. View CVBS Input Status
To retrieve the cvbs-in signal status, send a GET request to the cvbs-in/:id endpoint
ecurl
$ ecurl get lt100:/0/cvbs-in/0
GO
var response lt.Input // struct to store the response
err := lt.Get("lt100:/0/cvbs-in/0", &response)
C++
lt::Input response; // struct to store the response
lt::error err = lt::Get("lt100:/0/cvbs-in/0", response);
4.3.3. CVBS Input from the command line
Please use our dedicated tool ecurl to access or test the cvbs-in capabilities from the command line.
These ecurl samples are provided for convenience and are not exhaustive. If you want to learn more about LT API programming, please download our SDK and look at the provided examples.
$ ecurl get lt100:/0/cvbs-in/0
$ ecurl play lt100:/0/cvbs-in/0/data -d media=audio/pcm
$ ecurl play lt100:/0/cvbs-in/0 -d media=video/yuyv
$ ecurl play lt100:/0/cvbs-in/0
$ ecurl rec lt100:/0/cvbs-in/0 -d media=image/jpeg
$ ecurl rec lt100:/0/cvbs-in/0 -d media=image/png
$ ecurl rec lt100:/0/cvbs-in/0
4.4. SVIDEO Input
This endpoint describes how to use svideo-in inputs.
Native data can be accessed via the format path enumerator yuyv (video) and pcm (audio).
The pci endpoint allows to limit the maximum width, height, framerate and pixelrate coming through the PCIe bus to save bandwidth and ensure best quality of service for multi-channel scenarios.
Some of the proposed formats might require to use the host CPU and/or GPU before being delivered.
|
|||
|
4.4.1. SVIDEO Input Object
|
|
4.4.2. View SVIDEO Input Status
To retrieve the svideo-in signal status, send a GET request to the svideo-in/:id endpoint
ecurl
$ ecurl get lt100:/0/svideo-in/0
GO
var response lt.Input // struct to store the response
err := lt.Get("lt100:/0/svideo-in/0", &response)
C++
lt::Input response; // struct to store the response
lt::error err = lt::Get("lt100:/0/svideo-in/0", response);
4.4.3. SVIDEO Input from the command line
Please use our dedicated tool ecurl to access or test the svideo-in capabilities from the command line.
These ecurl samples are provided for convenience and are not exhaustive. If you want to learn more about LT API programming, please download our SDK and look at the provided examples.
$ ecurl get lt100:/0/svideo-in/0
$ ecurl play lt100:/0/svideo-in/0/data -d media=audio/pcm
$ ecurl play lt100:/0/svideo-in/0 -d media=video/yuyv
$ ecurl play lt100:/0/svideo-in/0
$ ecurl rec lt100:/0/svideo-in/0 -d media=image/jpeg
$ ecurl rec lt100:/0/svideo-in/0 -d media=image/png
$ ecurl rec lt100:/0/svideo-in/0
4.5. DVI Input
This endpoint describes how to use dvi-in inputs.
Native data can be accessed via the format path enumerator yuyv (video) and pcm (audio).
The pci endpoint allows to limit the maximum width, height, framerate and pixelrate coming through the PCIe bus to save bandwidth and ensure best quality of service for multi-channel scenarios.
Some of the proposed formats might require to use the host CPU and/or GPU before being delivered.
|
|||
|
4.5.1. DVI Input Object
|
|
4.5.2. View DVI Input Status
To retrieve the dvi-in signal status, send a GET request to the dvi-in/:id endpoint
ecurl
$ ecurl get lt100:/0/dvi-in/0
GO
var response lt.Input // struct to store the response
err := lt.Get("lt100:/0/dvi-in/0", &response)
C++
lt::Input response; // struct to store the response
lt::error err = lt::Get("lt100:/0/dvi-in/0", response);
4.5.3. DVI Input from the command line
Please use our dedicated tool ecurl to access or test the dvi-in capabilities from the command line.
These ecurl samples are provided for convenience and are not exhaustive. If you want to learn more about LT API programming, please download our SDK and look at the provided examples.
$ ecurl get lt100:/0/dvi-in/0
$ ecurl play lt100:/0/dvi-in/0/data -d media=audio/pcm
$ ecurl play lt100:/0/dvi-in/0 -d media=video/yuyv
$ ecurl play lt100:/0/dvi-in/0
$ ecurl rec lt100:/0/dvi-in/0 -d media=image/jpeg
$ ecurl rec lt100:/0/dvi-in/0 -d media=image/png
$ ecurl rec lt100:/0/dvi-in/0
4.6. SDI Input
This endpoint describes how to use sdi-in inputs.
Native data can be accessed via the format path enumerator yuyv (video) and pcm (audio).
The pci endpoint allows to limit the maximum width, height, framerate and pixelrate coming through the PCIe bus to save bandwidth and ensure best quality of service for multi-channel scenarios.
Some of the proposed formats might require to use the host CPU and/or GPU before being delivered.
|
|||
|
4.6.1. SDI Input Object
|
|
4.6.2. View SDI Input Status
To retrieve the sdi-in signal status, send a GET request to the sdi-in/:id endpoint
ecurl
$ ecurl get lt100:/0/sdi-in/0
GO
var response lt.Input // struct to store the response
err := lt.Get("lt100:/0/sdi-in/0", &response)
C++
lt::Input response; // struct to store the response
lt::error err = lt::Get("lt100:/0/sdi-in/0", response);
4.6.3. SDI Input from the command line
Please use our dedicated tool ecurl to access or test the sdi-in capabilities from the command line.
These ecurl samples are provided for convenience and are not exhaustive. If you want to learn more about LT API programming, please download our SDK and look at the provided examples.
$ ecurl get lt100:/0/sdi-in/0
$ ecurl play lt100:/0/sdi-in/0/data -d media=audio/pcm
$ ecurl play lt100:/0/sdi-in/0 -d media=video/yuyv
$ ecurl play lt100:/0/sdi-in/0
$ ecurl rec lt100:/0/sdi-in/0 -d media=image/jpeg
$ ecurl rec lt100:/0/sdi-in/0 -d media=image/png
$ ecurl rec lt100:/0/sdi-in/0
4.7. Canvas
The canvas endpoint is both a virtual audio/video source and a dynamic synthetic image generator which supports draw operations. It could be used to emulate the LT boards video inputs and to send overlay images onto the hdmi and/or sdi outputs.
|
|||
|
|
|||
|
4.7.1. Canvas Object
|
|
4.7.2. View Canvas Status
To retrieve the canvas signal status, send a GET request to the canvas/:id endpoint
ecurl
$ ecurl get lt100:/canvas/0
GO
var response lt.Input // struct to store the response
err := lt.Get("lt100:/canvas/0", &response)
C++
lt::Input response; // struct to store the response
lt::error err = lt::Get("lt100:/canvas/0", response);
4.7.3. Delete Operation
Clear the canvas to a "NO SIGNAL" equivalent. Helps to simulate a video input loss.
Parameters
None. Response
Returns an error if the request failed. |
ecurl
$ ecurl delete lt100:/canvas/0
GO
err := lt.Delete("lt100:/canvas/0", nil, nil)
C++
lt::error err = lt::Delete("lt100:/canvas/0", nullptr, nullptr);
4.7.4. Init Operation
Clear the canvas and fill the background with the specified file, pattern or color.
Parameters
Response
Returns the init operation parameters if the request succeeded. |
ecurl
$ ecurl post lt100:/canvas/0/init -d source=video.mp4
GO
body := lt.JSON{
"source": "video.mp4",
}
err := lt.Post("lt100:/canvas/0/init", body, nil)
C++
lt::json body = {
{"source", "video.mp4"}
};
lt::error err = lt::Post("lt100:/canvas/0/init", body, nullptr);
4.7.5. Text Operation
Draw text onto the canvas.
Parameters
Response
Returns the text operation parameters if the request succeeded. |
ecurl
$ ecurl post lt100:/canvas/0/text -d text="hello world!"
GO
body := lt.JSON{
"text": "hello world!",
}
err := lt.Post("lt100:/canvas/0/text", body, nil)
C++
lt::json body = {
{"text", "hello world!"}
};
lt::error err = lt::Post("lt100:/canvas/0/text", body, nullptr);
4.7.6. Line Operation
Draw a line whose top left anchor is (x,y) coordinates.
Parameters
Response
Returns the line operation parameters if the request succeeded. |
ecurl
$ ecurl post lt100:/canvas/0/line \
-d position=0,0 \
-d size=3840,2160 \
-d color=255,0,0,255
GO
body := lt.JSON{
"position": [0,0],
"size": [3840,2160],
"color": [255,0,0,255]
}
err := lt.Post("lt100:/canvas/0/line", body, nil)
C++
lt::json body = {
{"position", {0,0}},
{"size", {3840,2160}},
{"color", {255,0,0,255}}
};
lt::error err = lt::Post("lt100:/canvas/0/line", body, nullptr);
4.7.7. Ellipse Operation
Draw an ellipse whose top left anchor is (x,y) coordinates.
Parameters
Response
Returns the ellipse operation parameters if the request succeeded. |
ecurl
$ ecurl post lt100:/canvas/0/ellipse \
-d position=0,0 \
-d size=3840,2160 \
-d color=255,0,0,255 \
-d fill=0,255,0,255
GO
body := lt.JSON{
"position": [0,0],
"size": [3840,2160],
"color": [255,0,0,255],
"fill": [0,255,0,255]
}
err := lt.Post("lt100:/canvas/0/ellipse", body, nil)
C++
lt::json body = {
{"position", {0,0}},
{"size", {3840,2160}},
{"color", {255,0,0,255}},
{"fill", {0,255,0,255}}
};
lt::error err = lt::Post("lt100:/canvas/0/ellipse", body, nullptr);
4.7.8. Rectangle Operation
Draw a rectangle whose top left anchor is (x,y) coordinates.
Parameters
Response
Returns the rectangle operation parameters if the request succeeded. |
ecurl
$ ecurl post lt100:/canvas/0/rectangle \
-d position=100,100 \
-d size=400,400 \
-d fill=0,0,255,255
GO
body := lt.JSON{
"position": [100,100],
"size": [400,400],
"fill": [0,0,255,255]
}
err := lt.Post("lt100:/canvas/0/rectangle", body, nil)
C++
lt::json body = {
{"position", {100,100}},
{"size", {400,400}},
{"fill", {0,0,255,255}}
};
lt::error err = lt::Post("lt100:/canvas/0/rectangle", body, nullptr);
4.7.9. Image Operation
There are two ways to draw an image on the canvas:
-
Using a file path with the
sourceparameter. Theformat,data,widthandheightparameters are ignored. -
Using a data buffer with the
dataparameter. Theformatparameter is mandatory and if a raw format is used (i.e.rgbaorrgb), thewidthandheightparameters are required too.
Parameters
Response
Returns the image operation parameters if the request succeeded. |
ecurl
$ ecurl post lt100:/canvas/0/image \
-d source=image.png \
-d position=0,0 \
-d size=640,480
GO
body := lt.JSON{
"source": "image.png",
"position": [0,0],
"size": [640,480]
}
err := lt.Post("lt100:/canvas/0/image", body, nil)
C++
lt::json body = {
{"source", "image.png"},
{"position", {0,0}},
{"size", {640,480}}
};
lt::error err = lt::Post("lt100:/canvas/0/image", body, nullptr);
4.7.10. Video Operation
Place a video on the canvas.
Parameters
Response
Returns the video operation parameters if the request succeeded. |
ecurl
$ ecurl post lt100:/canvas/0/video \
-d source=0/sdi-in/0 \
-d position=0,0 \
-d size=1920,1080
GO
body := lt.JSON{
"source": "0/sdi-in/0",
"position": [0,0],
"size": [1920,1080]
}
err := lt.Post("lt100:/canvas/0/video", body, nil)
C++
lt::json body = {
{"source", "0/sdi-in/0"},
{"position", {0,0}},
{"size", {1920,1080}}
};
lt::error err = lt::Post("lt100:/canvas/0/video", body, nullptr);
4.7.11. Batch Operations
Draw operations in batch.
Parameters
Response
Returns the operations if succeeded. |
4.7.12. Canvas from the command line
Please use our dedicated tool ecurl to access or test the canvas capabilities from the command line.
These ecurl samples are provided for convenience and are not exhaustive. If you want to learn more about LT API programming, please download our SDK and look at the provided examples.
$ ecurl get lt100:/canvas/0
$ ecurl play lt100:/canvas/0/data -d media=audio/pcm
$ ecurl play lt100:/canvas/0 -d media=video/yuyv
$ ecurl play lt100:/canvas/0
$ ecurl rec lt100:/canvas/0 -d media=image/jpeg
$ ecurl rec lt100:/canvas/0 -d media=image/png
$ ecurl rec lt100:/canvas/0
4.8. Client
The client endpoint retains the connection context, the living memory references and the running workers. Once a client is done with a resource, it has to delete it. If the client dies or ceases to communicate, the lt100agent will automatically collect the resources and clean them.
|
|
|
|
|
|||
|
|||
|
|
||
|
4.8.1. Fetch Worker Updates
The long running task(s) (eg: recording a mp4) are child processe(s) of the client(s) which have initiated the request(s). These task(s) are processed by worker(s) that are attached into the client(s) context(s) with an unique ID. Retrieving the updates periodically ensures that the tasks are properly processed and allow to fetch the data out of the lt100agent. |
4.8.2. Terminate Worker
Terminate a worker task. |
4.8.3. Terminate ALL Workers
Terminate all the client workers tasks. |
4.8.4. Release Referenced Memory
Clients and lt100agent communicate by exchanging references on shared memory blocks. Once processed, it is recommended to expressly release the references, otherwise the lt100agent memory pool can run out of shared memory blocks. Depending to your development language (Garbage Collected or not), the SDK wrapper might automatically release the memory for you. |
4.9. Workers
All the API processing is based on Worker objects created by the server (on behalf of the clients requests) to serve data or metadata packets. The workers creation endpoints are easily recognizable by their URLs patterns:
|
|
||
|
|||
|
|||
|
The workers can serve streams under 3 types:
-
datathe de facto interface to process data into a third party application. These kind of workers use the host shared memory mechanisms with pooled buffers to distribute large chunk of data to multiple concurrent consumers. -
filethis helps you record files onto the host hard drive. These workers supports splitting and containerized formats like mp4, asf, or avi. Each time that a file is finished or split, the completed field of the Worker object is set to true. The next request will point toward a new file via a redirected URL. -
netthis maps any data source to the network adapter. Not ready at this time. TBD
Finally, the Workers transfer packets from the LT agent to the LT clients. Packets may contains data, metadata, video, audio, …
4.9.1. Worker Creation
A type has to be submitted to the data, file or net endpoint to create a worker. The type is a string that describes the data class audio, image and video and the data format. The type is a mandatory field and must be set to a valid value.
Audio: audio/pcm, audio/wav, audio/aac.
Image: image/yuyv, image/yuv422, image/nv12, image/rgba, image/rgb, image/jpeg, image/png, image/bmp.
Video: video/yuyv, video/yuv422, video/nv12, video/rgba, video/rgb, video/jpeg, video/png, video/bmp, video/h264, video/mp4.
4.9.1.1. Audio Data Worker
Create a worker object that serves audio data packets.
Parameters
Response
Returns the location of the worker object onto the form of a redirect error. |
GO
err := lt.Post("lt100:/:url/data", lt.AudioDataWorker{Media: "audio/pcm"}, nil)
if !errors.Is(err, lt.ErrRedirect) {
log.Fatal("worker creation failed:", err)
}
workerURL := lt.RedirectLocation(err)
C++
lt::error err = lt::Post("lt100:/:url/data", lt::AudioDataWorker{ "audio/pcm" }, nullptr);
if (!lt::ErrorIs(err, lt::ErrRedirect)) {
logFatal("worker creation failed:" + err);
}
string workerURL = lt::RedirectLocation(err);
4.9.1.2. Image Data Worker
Create a worker object that serves one image data packet.
Parameters
Response
Returns the location of the worker object onto the form of a redirect error. |
GO
err := lt.Post("lt100:/:url/data", lt.ImageDataWorker{Media: "image/jpeg"}, nil)
if !errors.Is(err, lt.ErrRedirect) {
log.Fatal("worker creation failed:", err)
}
workerURL := lt.RedirectLocation(err)
C++
lt::error err = lt::Post("lt100:/:url/data", lt::ImageDataWorker{ "image/jpeg" }, nullptr);
if (!lt::ErrorIs(err, lt::ErrRedirect)) {
logFatal("worker creation failed:" + err);
}
string workerURL = lt::RedirectLocation(err);
4.9.1.3. Video Data Worker
Create a worker object that continuously serves video data packets.
Parameters
Response
Returns the location of the worker object onto the form of a redirect error. |
GO
err := lt.Post("lt100:/:url/data", lt.VideoDataWorker{Media: "video/nv12"}, nil)
if !errors.Is(err, lt.ErrRedirect) {
log.Fatal("worker creation failed:", err)
}
workerURL := lt.RedirectLocation(err)
C++
lt::error err = lt::Post("lt100:/:url/data", lt::VideoDataWorker{ "video/nv12" }, nullptr);
if (!lt::ErrorIs(err, lt::ErrRedirect)) {
logFatal("worker creation failed:" + err);
}
string workerURL = lt::RedirectLocation(err);
4.9.1.4. Audio File Worker
Create a worker object that records an audio file. The file is split when the file length or the file duration is reached.
Parameters
Response
Returns the location of the worker object onto the form of a redirect error. |
GO
err := lt.Post("lt100:/:url/data", lt.AudioFileWorker{Media: "audio/wav"}, nil)
if !errors.Is(err, lt.ErrRedirect) {
log.Fatal("worker creation failed:", err)
}
workerURL := lt.RedirectLocation(err)
C++
lt::error err = lt::Post("lt100:/:url/data", lt::AudioFileWorker{ "audio/wav" }, nullptr);
if (!lt::ErrorIs(err, lt::ErrRedirect)) {
logFatal("worker creation failed:" + err);
}
string workerURL = lt::RedirectLocation(err);
4.9.1.5. Image File Worker
Create a worker object that records one image file.
Parameters
Response
Returns the location of the worker object onto the form of a redirect error. |
GO
err := lt.Post("lt100:/:url/data", lt.ImageFileWorker{Media: "image/jpeg"}, nil)
if !errors.Is(err, lt.ErrRedirect) {
log.Fatal("worker creation failed:", err)
}
workerURL := lt.RedirectLocation(err)
C++
lt::error err = lt::Post("lt100:/:url/data", lt::ImageFileWorker{ "image/jpeg" }, nullptr);
if (!lt::ErrorIs(err, lt::ErrRedirect)) {
logFatal("worker creation failed:" + err);
}
string workerURL = lt::RedirectLocation(err);
4.9.1.6. Video File Worker
Create a worker object that records a video file. The file is split when the file length or the file duration is reached.
Parameters
Response
Returns the location of the worker object onto the form of a redirect error. |
GO
err := lt.Post("lt100:/:url/data", lt.VideoFileWorker{Media: "video/mp4"}, nil)
if !errors.Is(err, lt.ErrRedirect) {
log.Fatal("worker creation failed:", err)
}
workerURL := lt.RedirectLocation(err)
C++
lt::error err = lt::Post("lt100:/:url/data", lt::VideoFileWorker{ "video/mp4" }, nullptr);
if (!lt::ErrorIs(err, lt::ErrRedirect)) {
logFatal("worker creation failed:" + err);
}
string workerURL = lt::RedirectLocation(err);
4.9.1.7. Audio Net Worker
TBD
4.9.1.8. Image Net Worker
TBD
4.9.1.9. Video Net Worker
TBD
4.9.2. Worker Object
The Worker object is the result of a GET request onto a worker endpoint. It contains the worker status, data packets and metadata. A Worker might process one or multiples tracks and the SDK provides helpers functions to automatically parse the worker into a comprehensive structure with the contained audio and video packets.
|
4.9.3. Packet Object
The packet object wraps the data and the metadata of an audio, video, … track.
The SDK provides a helper function to automatically parse the packets into a comprehensive structure.
|
4.9.3.1. SharedPacket Object
This has the same description as the Packet object, use only for reference. To lower the cpu consumption and the latency, big data blocks are transmitted to the user using the OS standard shared memory mechanisms. No memory copy is involved in the packet transmission.
The SDK provides a helper function to automatically parse the shared packets into a comprehensive structure.
|
4.9.3.2. Audio Metadata
Packets with audio/* type.
|
4.9.3.3. Image Metadata
Packets with image/* type.
|
4.9.3.4. Video Metadata
Packets with video/* type.
|
4.9.4. Data Worker Workflow
Create a worker object that serves data packets. Data packets could be of type audio, image or video.
Create Worker
|
|
4.9.5. File Worker Workflow
Create a worker object that records a file. The file is split when the file length or the file duration is reached. Files could be of type audio, image or video.
Create file worker
|
Process file worker
|
5. Cheatsheet
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|
|
|
|||
|
|||
|
|
||
6. Changelog
# 3.2.1 (28/10/2024):
# 3.2.0 (17/10/2024):
# 3.1.0 (10/10/2024):
# 3.0.0 (17/09/2024):