FFmpeg
|
AVStreamGroupTileGrid holds information on how to combine several independent images on a single canvas for presentation. More...
#include <avformat.h>
Data Fields | |
const AVClass * | av_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... | |
AVPacketSideData * | coded_side_data |
Additional data associated with the grid. More... | |
int | nb_coded_side_data |
Amount of entries in coded_side_data. More... | |
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 987 of file avformat.h.
const AVClass* AVStreamGroupTileGrid::av_class |
Definition at line 988 of file avformat.h.
Referenced by avformat_stream_group_create().
unsigned int AVStreamGroupTileGrid::nb_tiles |
Amount of tiles in the grid.
Must be > 0.
Definition at line 995 of file avformat.h.
Referenced by dump_stream_group(), print_tile_grid_params(), read_image_grid(), and read_image_iovl().
int AVStreamGroupTileGrid::coded_width |
Width of the canvas.
Must be > 0.
Definition at line 1002 of file avformat.h.
Referenced by dump_stream_group(), print_tile_grid_params(), read_image_grid(), and read_image_iovl().
int AVStreamGroupTileGrid::coded_height |
Width of the canvas.
Must be > 0.
Definition at line 1008 of file avformat.h.
Referenced by dump_stream_group(), print_tile_grid_params(), read_image_grid(), and read_image_iovl().
unsigned int AVStreamGroupTileGrid::idx |
Index of the stream in the group this tile references.
Must be < nb_streams.
Definition at line 1026 of file avformat.h.
Referenced by dump_stream_group(), print_tile_grid_params(), read_image_grid(), and read_image_iovl().
int AVStreamGroupTileGrid::horizontal |
Offset in pixels from the left 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().
int AVStreamGroupTileGrid::vertical |
Offset in pixels from the top edge of the canvas where the tile should be placed.
Definition at line 1036 of file avformat.h.
Referenced by print_tile_grid_params(), read_image_grid(), and read_image_iovl().
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.
Freed by libavformat in avformat_free_context().
Referenced by dump_stream_group(), ff_free_stream_group(), print_tile_grid_params(), read_image_grid(), and read_image_iovl().
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.
Definition at line 1046 of file avformat.h.
Referenced by read_image_iovl().
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 1054 of file avformat.h.
Referenced by print_tile_grid_params().
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 1061 of file avformat.h.
Referenced by print_tile_grid_params().
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 1072 of file avformat.h.
Referenced by dump_stream_group(), print_tile_grid_params(), read_image_grid(), and read_image_iovl().
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 1082 of file avformat.h.
Referenced by dump_stream_group(), print_tile_grid_params(), read_image_grid(), and read_image_iovl().
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 1090 of file avformat.h.
Referenced by dump_stream_group(), ff_free_stream_group(), read_image_grid(), and read_image_iovl().
int AVStreamGroupTileGrid::nb_coded_side_data |
Amount of entries in coded_side_data.
Definition at line 1095 of file avformat.h.
Referenced by dump_stream_group(), ff_free_stream_group(), read_image_grid(), and read_image_iovl().