blob: 3fa64f55fc005f455a6371e9d55267cd6211f19a [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.mediastreams;
using fuchsia.math;
/// Describes a format used for video elementary streams without
/// reference to compression. Where compression is supported, this
/// type should be combined with a `Compression` struct.
struct VideoFormat {
/// Describes the manner in which pixels are encoded.
PixelFormat pixel_format;
/// Indicates the color space used to interpret pixel values.
ColorSpace color_space;
/// The size of a frame in terms of the number of pixels that
/// are represented in a frame payload.
fuchsia.math.Size coded_size;
/// The size of a frame in terms of the number of pixels that
/// should be displayed. These values will always be less than
/// or equal to the corresponding `coded_size` values.
fuchsia.math.Size display_size;
/// Aspect ratio of a single pixel as the video is intended to
/// be displayed.
fuchsia.math.Size? aspect_ratio;
// TODO: fuchsia.sysmem2.ImageFormat has bytes_per_row, but
// that’s a function of pixel_format and coded_size. Do we
// need that?
};
/// Expresses the manner in which video pixels are encoded.
// TODO: Do we need a pixel format modifier?
enum PixelFormat {
INVALID = 0;
R8G8B8A8 = 1;
BGRA32 = 101;
I420 = 102;
M420 = 103;
NV12 = 104;
YUY2 = 105;
MJPEG = 106;
YV12 = 107;
BGR24 = 108;
RGB565 = 109;
RGB332 = 110;
RGB2220 = 111;
L8 = 112;
R8 = 113;
R8G8 = 114;
};
/// Expresses the color space used to interpret video pixel values.
enum ColorSpace {
INVALID = 0;
SRGB = 1;
REC601_NTSC = 2;
REC601_NTSC_FULL_RANGE = 3;
REC601_PAL = 4;
REC601_PAL_FULL_RANGE = 5;
REC709 = 6;
REC2020 = 7;
REC2100 = 8;
};