Loading...
Searching...
No Matches
AVStreamGroupTileGrid Struct Reference

AVStreamGroupTileGrid holds information on how to combine several independent images on a single canvas for presentation. More...

`#include <libavformat/avformat.h>`

## Data Fields

const AVClass * | av_class
unsigned int | nb_tiles
| Amount of tiles in the grid.
int | coded_width
| Width of the canvas.
int | coded_height
| Width of the canvas.
struct { |
unsigned int idx |
| Index of the stream in the group this tile references. More...
int horizontal |
| Offset in pixels from the left edge of the canvas where the tile should be placed. More...
int vertical |
| Offset in pixels from the top edge of the canvas where the tile should be placed. More...
} * | offsets
| An nb_tiles sized array of offsets in pixels from the topleft edge of the canvas, indicating where each stream should be placed.
uint8_t | background [4]
| The pixel value per channel in RGBA format used if no pixel of any tile is located at a particular pixel location.
int | horizontal_offset
| Offset in pixels from the left edge of the canvas where the actual image meant for presentation starts.
int | vertical_offset
| Offset in pixels from the top edge of the canvas where the actual image meant for presentation starts.
int | width
| Width of the final image for presentation.
int | height
| Height of the final image for presentation.
AVPacketSideData * | coded_side_data
| Additional data associated with the grid.
int | nb_coded_side_data
| Amount of entries in coded_side_data.

## Detailed Description

AVStreamGroupTileGrid holds information on how to combine several independent images on a single canvas for presentation.

The output should be a background colored coded_width x coded_height canvas where a nb_tiles amount of tiles are placed in the order they appear in the offsets array, at the exact offset described for them. In particular, if two or more tiles overlap, the image with higher index in the offsets array takes priority. Note that a single image may be used multiple times, i.e. multiple entries in offsets may have the same value of idx.

The following is an example of a simple grid with 3 rows and 4 columns:

+—+—+—+—+ | 0 | 1 | 2 | 3 | +—+—+—+—+ | 4 | 5 | 6 | 7 | +—+—+—+—+ | 8 | 9 |10 |11 | +—+—+—+—+

Assuming all tiles have a dimension of 512x512, the offset of the topleft pixel of the first stream in the group is "0,0", the offset of the topleft pixel of the second stream in the group is "512,0", the offset of the topleft pixel of the fifth stream in the group is "0,512", the offset, of the topleft pixel of the sixth stream in the group is "512,512", etc.

The following is an example of a canvas with overlapping tiles:

+--------—+ | %%%%% | |***%%3%%@| |**0%%%%%2@| |***##1@@| | ##### | +--------—+

Assuming a canvas with size 1024x1024 and all tiles with a dimension of 512x512, a possible offset for the topleft pixel of the first stream in the group would be 0x256, the offset for the topleft pixel of the second stream in the group would be 256x512, the offset for the topleft pixel of the third stream in the group would be 512x256, and the offset for the topleft pixel of the fourth stream in the group would be 256x0.

sizeof(AVStreamGroupTileGrid) is not a part of the ABI and may only be allocated by avformat_stream_group_create().

Definition at line 951 of file avformat.h.

## Field Documentation

## av_class

const AVClass* AVStreamGroupTileGrid::av_class

Definition at line 952 of file avformat.h.

## nb_tiles

unsigned int AVStreamGroupTileGrid::nb_tiles

Amount of tiles in the grid.

Must be > 0.

Definition at line 959 of file avformat.h.

## coded_width

int AVStreamGroupTileGrid::coded_width

Width of the canvas.

Must be > 0.

Definition at line 966 of file avformat.h.

## coded_height

int AVStreamGroupTileGrid::coded_height

Width of the canvas.

Must be > 0.

Definition at line 972 of file avformat.h.

## idx

unsigned int AVStreamGroupTileGrid::idx

Index of the stream in the group this tile references.

Must be < nb_streams.

Definition at line 990 of file avformat.h.

## horizontal

int AVStreamGroupTileGrid::horizontal

Offset in pixels from the left edge of the canvas where the tile should be placed.

Definition at line 995 of file avformat.h.

## vertical

int AVStreamGroupTileGrid::vertical

Offset in pixels from the top edge of the canvas where the tile should be placed.

Definition at line 1000 of file avformat.h.

## [struct]

struct { ... } * AVStreamGroupTileGrid::offsets

An nb_tiles sized array of offsets in pixels from the topleft edge of the canvas, indicating where each stream should be placed.

It must be allocated with the av_malloc() family of functions.

- demuxing: set by libavformat, must not be modified by the caller.
- muxing: set by the caller before avformat_write_header().

Freed by libavformat in avformat_free_context().

## background

uint8_t AVStreamGroupTileGrid::background[4]

The pixel value per channel in RGBA format used if no pixel of any tile is located at a particular pixel location.

See also
  av_image_fill_color().
  av_parse_color().

Definition at line 1010 of file avformat.h.

## horizontal_offset

int AVStreamGroupTileGrid::horizontal_offset

Offset in pixels from the left edge of the canvas where the actual image meant for presentation starts.

This field must be >= 0 and < coded_width.

Definition at line 1018 of file avformat.h.

## vertical_offset

int AVStreamGroupTileGrid::vertical_offset

Offset in pixels from the top edge of the canvas where the actual image meant for presentation starts.

This field must be >= 0 and < coded_height.

Definition at line 1025 of file avformat.h.

## width

int AVStreamGroupTileGrid::width

Width of the final image for presentation.

Must be > 0 and <= (coded_width - horizontal_offset). When it's not equal to (coded_width - horizontal_offset), the result of (coded_width - width - horizontal_offset) is the amount amount of pixels to be cropped from the right edge of the final image before presentation.

Definition at line 1036 of file avformat.h.

## height

int AVStreamGroupTileGrid::height

Height of the final image for presentation.

Must be > 0 and <= (coded_height - vertical_offset). When it's not equal to (coded_height - vertical_offset), the result of (coded_height - height - vertical_offset) is the amount amount of pixels to be cropped from the bottom edge of the final image before presentation.

Definition at line 1046 of file avformat.h.

## coded_side_data

AVPacketSideData* AVStreamGroupTileGrid::coded_side_data

Additional data associated with the grid.

Should be allocated with av_packet_side_data_new() or av_packet_side_data_add(), and will be freed by avformat_free_context().

Definition at line 1054 of file avformat.h.

## nb_coded_side_data

int AVStreamGroupTileGrid::nb_coded_side_data

Amount of entries in coded_side_data.

Definition at line 1059 of file avformat.h.

The documentation for this struct was generated from the following file:

- libavformat/avformat.h