Data Definition
The output data structure of the VO module consists of the extra data packet information (extData), data packet size, and actual data. The data is specified by the VIDEO_RETURN_VIDEO_DATA command word in the VmiCmd enumeration and returned to developers through callbacks. Example:
1 2 3 4 5 | VmiDataType module = DATA_VIDEO; VmiCmd cmd = VIDEO_RETURN_VIDEO_DATA; VideoData videoData; uint8_t* data = &videoData; DataCallback(module, cmd, data, sizeof(VideoData)); |
Definition of VideoData
1 2 3 4 5 | struct VideoData { ExtDataVideo extData; // Extra information about the stream packet uint32_t size; // Stream packet size uint8_t data[0]; // Stream data } __attribute__((packed)); |
Definition of ExtDataVideo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | struct FrameSize { uint32_t width = 720; // 720 (defaults to 720P) uint32_t height = 1280; // 1280 (defaults to 720P) uint32_t widthAligned = 720; // 720 (not aligned by default) uint32_t heightAligned = 1280; // 1280 (not aligned by default) } __attribute__((packed)); struct VideoLatency { uint64_t startCaptureTimestamp; // Snapshot capturing start time uint64_t endCaptureTimestamp; // Snapshot capturing end time uint64_t startEncodeTimestamp; // Encoding start time uint64_t endEncodeTimestamp; // Encoding end time } __attribute__((packed)); struct ExtDataVideo { int64_t timestamp; // Timestamp when the frame rendering is complete uint8_t orientation; // Orientation of the current frame FrameSize size; // Current frame size VideoLatency latencyInfo; // Snapshotting and encoding time points uint32_t frameRate; // Current screen refresh rate uint32_t transform; // Image rotation, which is 0 if CompositionBypass is disabled and may not be 0 if CompositionBypass is enabled }; |
Parent topic: Video Output Development