FFmpeg
Data Fields
AVStreamGroupTileGrid Struct Reference

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

#include <avformat.h>

Data Fields

const AVClassav_class
 
unsigned int nb_tiles
 Amount of tiles in the grid. More...
 
int coded_width
 Width of the canvas. More...
 
int coded_height
 Width of the canvas. More...
 
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. More...
 
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. More...
 
int horizontal_offset
 Offset in pixels from the left edge of the canvas where the actual image meant for presentation starts. More...
 
int vertical_offset
 Offset in pixels from the top edge of the canvas where the actual image meant for presentation starts. More...
 
int width
 Width of the final image for presentation. More...
 
int height
 Height of the final image for presentation. More...
 

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 overlaping 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 982 of file avformat.h.

Field Documentation

◆ av_class

const AVClass* AVStreamGroupTileGrid::av_class

Definition at line 983 of file avformat.h.

Referenced by avformat_stream_group_create().

◆ nb_tiles

unsigned int AVStreamGroupTileGrid::nb_tiles

Amount of tiles in the grid.

Must be > 0.

Definition at line 990 of file avformat.h.

Referenced by print_tile_grid_params(), read_image_grid(), and read_image_iovl().

◆ coded_width

int AVStreamGroupTileGrid::coded_width

Width of the canvas.

Must be > 0.

Definition at line 997 of file avformat.h.

Referenced by dump_stream_group(), print_tile_grid_params(), read_image_grid(), and read_image_iovl().

◆ coded_height

int AVStreamGroupTileGrid::coded_height

Width of the canvas.

Must be > 0.

Definition at line 1003 of file avformat.h.

Referenced by dump_stream_group(), print_tile_grid_params(), read_image_grid(), and read_image_iovl().

◆ idx

unsigned int AVStreamGroupTileGrid::idx

Index of the stream in the group this tile references.

Must be < nb_streams.

Definition at line 1021 of file avformat.h.

Referenced by print_tile_grid_params(), read_image_grid(), and read_image_iovl().

◆ horizontal

int AVStreamGroupTileGrid::horizontal

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

Definition at line 1026 of file avformat.h.

Referenced by print_tile_grid_params(), read_image_grid(), and read_image_iovl().

◆ vertical

int AVStreamGroupTileGrid::vertical

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

Definition at line 1031 of file avformat.h.

Referenced by print_tile_grid_params(), read_image_grid(), and read_image_iovl().

◆ offsets

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().

Referenced by ff_free_stream_group(), print_tile_grid_params(), read_image_grid(), and read_image_iovl().

◆ 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 1041 of file avformat.h.

Referenced by read_image_iovl().

◆ 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 1049 of file avformat.h.

Referenced by print_tile_grid_params().

◆ 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 1056 of file avformat.h.

Referenced by print_tile_grid_params().

◆ 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 1067 of file avformat.h.

Referenced by dump_stream_group(), print_tile_grid_params(), read_image_grid(), and read_image_iovl().

◆ 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 1077 of file avformat.h.

Referenced by dump_stream_group(), print_tile_grid_params(), read_image_grid(), and read_image_iovl().


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