stream_processor_test/
buffer_collection_constraints.rs

1// Copyright 2019 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use {fidl_fuchsia_images2 as fimages2, fidl_fuchsia_sysmem2 as fsysmem2};
6
7pub fn image_format_constraints_default() -> fsysmem2::ImageFormatConstraints {
8    fsysmem2::ImageFormatConstraints {
9        pixel_format: Some(fimages2::PixelFormat::Nv12),
10        ..Default::default()
11    }
12}
13
14pub fn buffer_memory_constraints_default() -> fsysmem2::BufferMemoryConstraints {
15    fsysmem2::BufferMemoryConstraints { ..Default::default() }
16}
17
18pub fn buffer_collection_constraints_default() -> fsysmem2::BufferCollectionConstraints {
19    fsysmem2::BufferCollectionConstraints {
20        usage: Some(fsysmem2::BufferUsage {
21            cpu: Some(fsysmem2::CPU_USAGE_READ),
22            video: Some(fsysmem2::VIDEO_USAGE_HW_DECODER),
23            ..Default::default()
24        }),
25        ..Default::default()
26    }
27}