C
Qul::Platform::DeviceLinkInterface Class
class Qul::Platform::DeviceLinkInterfaceThis provides the interface to implement by the platform. More...
Header: | #include <platform/devicelink.h> |
Since: | Qt Quick Ultralite (Platform) 2.3 |
Public Functions
virtual Qul::Platform::ChunkedFramebufferDataTransferSizes | chunkedFramebufferDataTransferSizes(const Qul::PlatformInterface::LayerEngine::ItemLayer *layer) const |
virtual void | framebufferDataTransferComplete() |
virtual Qul::Platform::FramebufferFormat | framebufferFormat(const Qul::PlatformInterface::LayerEngine::ItemLayer *layer) = 0 |
virtual void | platformInit() = 0 |
virtual Qul::Platform::FramebufferDataChunk | requestFramebufferDataChunk(const Qul::PlatformInterface::LayerEngine::ItemLayer *layer, const Qul::PlatformInterface::Rect &rect) |
virtual void | transmitChars(const uint8_t *data, uint32_t size) = 0 |
Detailed Description
Each platform using the device link has to provide an implementation of this interface.
See also Qul::Platform::DeviceLink and Porting DeviceLink Communication.
Member Function Documentation
[virtual]
Qul::Platform::ChunkedFramebufferDataTransferSizes DeviceLinkInterface::chunkedFramebufferDataTransferSizes(const Qul::PlatformInterface::LayerEngine::ItemLayer *layer) const
Gets the sizes to use for chunked framebuffer data transfer for the given layer.
Chunked framebuffer data will always be requested a full vertical or horizontal scanline at the time, depending on the display rotation of the application.
The Qul::Platform::ChunkedFramebufferDataTransferSizes::chunkHeight value returned should be the height of the chunks to use if the framebuffer data gets requested a full horizontal scanline at the time.
The Qul::Platform::ChunkedFramebufferDataTransferSizes::chunkWidth value returned should be the width of the chunks to use if the framebuffer data gets requested a full vertical scanline at the time.
This function only gets called if framebufferFormat() returns a nullptr address. If it's possible to always get an address to the full framebuffer data, this function does not have to be implemented.
The layer parameter can be ignored if the platform does not support multiple layers.
If framebuffer data can't be read on an individual layer basis, the layer parameter should still be used to identify the screen from which to read the framebuffer data, but the platform can then choose to return the framebuffer data for the entire screen.
See also Qul::Platform::DeviceLinkInterface::requestFramebufferDataChunk().
[virtual]
void DeviceLinkInterface::framebufferDataTransferComplete()
Signals that the framebuffer data transfer is completed
The framebuffer data transfer initiated by calling framebufferFormat or requestFramebufferDataChunk has been completed.
The platform might not have to implement this, but it could be useful if temporary resources are allocated to support the framebuffer transfer.
[pure virtual]
Qul::Platform::FramebufferFormat DeviceLinkInterface::framebufferFormat(const Qul::PlatformInterface::LayerEngine::ItemLayer *layer)
Get information about a framebuffer for the given layer.
This is used by the device link implementation to read the data and transfer it to the host when a screenshot is requested.
The Qul::Platform::FramebufferFormat::address pointer is assumed to remain valid until framebufferDataTransferComplete() gets called.
If the entire framebuffer data can't be read in a single chunk, set Qul::Platform::FramebufferFormat::address to nullptr and Qul::Platform::FramebufferFormat::bytesPerLine to 0. That way, requestHorizontalFramebufferDataChunk() or requestVerticalFramebufferDataChunk() will instead be called multiple times in order to read the framebuffer data.
The layer parameter can be ignored if the platform does not support multiple layers.
If framebuffer data can't be read on an individual layer basis, the layer parameter should still be used to identify the screen from which to read the framebuffer data, but the platform can then choose to return the framebuffer data for the entire screen.
[pure virtual]
void DeviceLinkInterface::platformInit()
Perform last minute platform specific setup.
This function is called after the DeviceLink component is ready to send and receive data. The implementation may enable the serial port interrupts or set other flags that enable sending and receiving actual data.
[virtual]
Qul::Platform::FramebufferDataChunk DeviceLinkInterface::requestFramebufferDataChunk(const Qul::PlatformInterface::LayerEngine::ItemLayer *layer, const Qul::PlatformInterface::Rect &rect)
Read a single chunk of framebuffer data the given layer.
The returned FramebufferDataChunk value should contain the address and bytes per line of the framebuffer data chunk corresponding to the given rect. The format of the framebuffer data has to be the same as what was originally returned from framebufferFormat().
The size of the rect will at most be (chunk width, framebuffer height) for vertical chunks, or (framebuffer width, chunk height) for horizontal chunks. Where the chunk width and chunk height are the values returned from chunkedFramebufferDataTransferSizes(), and the framebuffer width and framebuffer height are the values returned from framebufferFormat().
This function only gets called if framebufferFormat() returns a nullptr address. If it's possible to always get an address to the full framebuffer data, this function does not have to be implemented.
The layer parameter can be ignored if the platform does not support multiple layers.
If framebuffer data can't be read on an individual layer basis, the layer parameter should still be used to identify the screen from which to read the framebuffer data, but the platform can then choose to return the framebuffer data for the entire screen.
The Qul::Platform::FramebufferDataChunk::address pointer is assumed to remain valid until requestFramebufferDataChunk() gets called again, or until framebufferDataTransferComplete() gets called, whichever happens first.
[pure virtual]
void DeviceLinkInterface::transmitChars(const uint8_t *data, uint32_t size)
Send a data stream to the host after it has been packed and framed.
This function is called when there is message data to be transferred to the host. The implementation has to use the serial port write functions to send the data with size.
Available under certain Qt licenses.
Find out more.