blob: 3897fa9c59714ab0fd733c3e29d5f4a1a3bba94c [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
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|.
struct DmaBufVideoFrame {
VideoPixelFormat format;
uint32 coded_width;
uint32 coded_height;
array<DmaBufPlane> planes;
};