formats.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * formats.h
  3. *
  4. * Copyright 2023 Georges Basile Stavracas Neto <[email protected]>
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. * SPDX-License-Identifier: GPL-2.0-or-later
  20. */
  21. #pragma once
  22. #include <obs-module.h>
  23. #include <spa/param/video/format-utils.h>
  24. struct obs_pw_video_format {
  25. uint32_t spa_format;
  26. uint32_t drm_format;
  27. enum gs_color_format gs_format;
  28. enum video_format video_format;
  29. bool swap_red_blue;
  30. uint32_t bpp;
  31. const char *pretty_name;
  32. };
  33. bool obs_pw_video_format_from_spa_format(uint32_t spa_format, struct obs_pw_video_format *out_format_info);