mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
We need a database of pixel format properties to remove hardcoded magic numbers. This commit creates a simple function to query the bytes per pixel for common RGBA formats. This should be promoted to or superseeded by a common spa namespaced version.
12 lines
290 B
C
12 lines
290 B
C
/* Spa */
|
|
/* SPDX-FileCopyrightText: Copyright © 2023 columbarius */
|
|
/* SPDX-License-Identifier: MIT */
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
struct pixel_format_info {
|
|
uint32_t bpp; // bytes per pixel
|
|
};
|
|
|
|
bool get_pixel_format_info(uint32_t format, struct pixel_format_info *info);
|