blob: 3dcda915df904328c10b55672527d6f20b9bf03b [file] [log] [blame] [edit]
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Next min version: 2
module cros.mojom;
// Keep in sync with
// https://cs.chromium.org/chromium/src/media/base/video_types.h
enum VideoPixelFormat {
PIXEL_FORMAT_UNKNOWN = 0,
PIXEL_FORMAT_I420 = 1,
PIXEL_FORMAT_NV12 = 6,
};
// This structure defines a DMA-buf buffer plane. |fd_handle| holds the DMA-buf
// file descriptor. The layout is specified by |stride|, |offset| and |size|.
struct DmaBufPlane {
handle fd_handle;
int32 stride;
uint32 offset;
uint32 size;
};
// This structure defines a simplified version of media::VideoFrame backed by
// DMA-bufs (see media/base/video_frame.h) for Chrome OS usage. The video frame
// has pixel format |format| and coded size |coded_width|x|coded_height|.
// Per-plane DMA-buf FDs and layouts are defined in |planes|. The |modifier| of
// buffer is valid only if |has_modifier| is true.
struct DmaBufVideoFrame {
VideoPixelFormat format;
uint32 coded_width;
uint32 coded_height;
array<DmaBufPlane> planes;
[MinVersion=1] bool has_modifier;
[MinVersion=1] uint64 modifier;
};