v4l2-mediabus.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Media Bus API header
  3. *
  4. * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
  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 version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __LINUX_V4L2_MEDIABUS_H
  11. #define __LINUX_V4L2_MEDIABUS_H
  12. #include <linux/types.h>
  13. #include <linux/videodev2.h>
  14. /*
  15. * These pixel codes uniquely identify data formats on the media bus. Mostly
  16. * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is
  17. * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the
  18. * data format is fixed. Additionally, "2X8" means that one pixel is transferred
  19. * in two 8-bit samples, "BE" or "LE" specify in which order those samples are
  20. * transferred over the bus: "LE" means that the least significant bits are
  21. * transferred first, "BE" means that the most significant bits are transferred
  22. * first, and "PADHI" and "PADLO" define which bits - low or high, in the
  23. * incomplete high byte, are filled with padding bits.
  24. */
  25. enum v4l2_mbus_pixelcode {
  26. V4L2_MBUS_FMT_FIXED = 1,
  27. V4L2_MBUS_FMT_YUYV8_2X8,
  28. V4L2_MBUS_FMT_YVYU8_2X8,
  29. V4L2_MBUS_FMT_UYVY8_2X8,
  30. V4L2_MBUS_FMT_VYUY8_2X8,
  31. V4L2_MBUS_FMT_YVYU10_2X10,
  32. V4L2_MBUS_FMT_YUYV10_2X10,
  33. V4L2_MBUS_FMT_YVYU10_1X20,
  34. V4L2_MBUS_FMT_YUYV10_1X20,
  35. V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE,
  36. V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE,
  37. V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE,
  38. V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE,
  39. V4L2_MBUS_FMT_RGB565_2X8_LE,
  40. V4L2_MBUS_FMT_RGB565_2X8_BE,
  41. V4L2_MBUS_FMT_BGR565_2X8_LE,
  42. V4L2_MBUS_FMT_BGR565_2X8_BE,
  43. V4L2_MBUS_FMT_SBGGR8_1X8,
  44. V4L2_MBUS_FMT_SBGGR10_1X10,
  45. V4L2_MBUS_FMT_GREY8_1X8,
  46. V4L2_MBUS_FMT_Y10_1X10,
  47. V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE,
  48. V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE,
  49. V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE,
  50. V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE,
  51. V4L2_MBUS_FMT_SGRBG8_1X8,
  52. V4L2_MBUS_FMT_SBGGR12_1X12,
  53. V4L2_MBUS_FMT_YUYV8_1_5X8,
  54. V4L2_MBUS_FMT_YVYU8_1_5X8,
  55. V4L2_MBUS_FMT_UYVY8_1_5X8,
  56. V4L2_MBUS_FMT_VYUY8_1_5X8,
  57. };
  58. /**
  59. * struct v4l2_mbus_framefmt - frame format on the media bus
  60. * @width: frame width
  61. * @height: frame height
  62. * @code: data format code
  63. * @field: used interlacing type
  64. * @colorspace: colorspace of the data
  65. */
  66. struct v4l2_mbus_framefmt {
  67. __u32 width;
  68. __u32 height;
  69. __u32 code;
  70. enum v4l2_field field;
  71. enum v4l2_colorspace colorspace;
  72. };
  73. #endif