Projektarbeit Line Following Robot bei Prof. Chowanetz im WS22/23
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mmal_metadata.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. Copyright (c) 2012, Broadcom Europe Ltd
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are met:
  6. * Redistributions of source code must retain the above copyright
  7. notice, this list of conditions and the following disclaimer.
  8. * Redistributions in binary form must reproduce the above copyright
  9. notice, this list of conditions and the following disclaimer in the
  10. documentation and/or other materials provided with the distribution.
  11. * Neither the name of the copyright holder nor the
  12. names of its contributors may be used to endorse or promote products
  13. derived from this software without specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
  18. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  20. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  21. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifndef MMAL_METADATA_H
  26. #define MMAL_METADATA_H
  27. #include "mmal_common.h"
  28. /** \defgroup MmalMetadata List of pre-defined metadata types
  29. * This defines a list of standard metadata types. Components can still define proprietary
  30. * metadata types by using their own FourCC and defining their own metadata structures. */
  31. /* @{ */
  32. /** \name Pre-defined metadata FourCCs */
  33. /* @{ */
  34. #define MMAL_METADATA_HELLO_WORLD MMAL_FOURCC('H','E','L','O')
  35. /* @} */
  36. /** Generic metadata type. All metadata structures need to begin with these fields. */
  37. typedef struct MMAL_METATDATA_T
  38. {
  39. uint32_t id; /**< Metadata id. This is a FourCC */
  40. uint32_t size; /**< Size in bytes of the following metadata (not including id and size) */
  41. } MMAL_METADATA_T;
  42. /** Hello World metadata. */
  43. typedef struct MMAL_METATDATA_HELLO_WORLD_T
  44. {
  45. uint32_t id; /**< Metadata id. This is a FourCC */
  46. uint32_t size; /**< Size in bytes of the following metadata (not including id and size) */
  47. uint32_t myvalue; /**< Metadata value */
  48. } MMAL_METADATA_HELLO_WORLD_T;
  49. /** Get metadata item from buffer header.
  50. * This will search through all the metadata in the buffer header and return a pointer to the
  51. * first instance of the requested metadata id.
  52. *
  53. * @param header buffer header containing the metadata
  54. * @param id requested metadata id
  55. *
  56. * @return Pointer to metadata requested or NULL if not found.
  57. */
  58. MMAL_METADATA_T *mmal_metadata_get(MMAL_BUFFER_HEADER_T *header, uint32_t id);
  59. /** Set metadata item in buffer header.
  60. * This will store the metadata item into the buffer header. This operation can fail if not
  61. * enough memory is available in the data section of the buffer header.
  62. *
  63. * @param header buffer header to store the metadata into
  64. * @param metadata metadata item to store in buffer header
  65. *
  66. * @return MMAL_SUCCESS on success or MMAL_ENOMEM if not enough memory is available for storing
  67. * the metadata
  68. */
  69. MMAL_STATUS_T mmal_metadata_set(MMAL_BUFFER_HEADER_T *header, MMAL_METADATA_T *metadata);
  70. /* @} */
  71. #endif /* MMAL_METADATA_H */