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_events.h 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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_EVENTS_H
  26. #define MMAL_EVENTS_H
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. #include "mmal_common.h"
  31. #include "mmal_parameters.h"
  32. #include "mmal_port.h"
  33. /** \defgroup MmalEvents List of pre-defined event types
  34. * This defines a list of standard event types. Components can still define proprietary
  35. * event types by using their own FourCC and defining their own event structures. */
  36. /* @{ */
  37. /** \name Pre-defined event FourCCs */
  38. /* @{ */
  39. /** Error event. Data contains a \ref MMAL_STATUS_T */
  40. #define MMAL_EVENT_ERROR MMAL_FOURCC('E','R','R','O')
  41. /** End-of-stream event. Data contains a \ref MMAL_EVENT_END_OF_STREAM_T */
  42. #define MMAL_EVENT_EOS MMAL_FOURCC('E','E','O','S')
  43. /** Format changed event. Data contains a \ref MMAL_EVENT_FORMAT_CHANGED_T */
  44. #define MMAL_EVENT_FORMAT_CHANGED MMAL_FOURCC('E','F','C','H')
  45. /** Parameter changed event. Data contains the new parameter value, see
  46. * \ref MMAL_EVENT_PARAMETER_CHANGED_T
  47. */
  48. #define MMAL_EVENT_PARAMETER_CHANGED MMAL_FOURCC('E','P','C','H')
  49. /* @} */
  50. /** End-of-stream event. */
  51. typedef struct MMAL_EVENT_END_OF_STREAM_T
  52. {
  53. MMAL_PORT_TYPE_T port_type; /**< Type of port that received the end of stream */
  54. uint32_t port_index; /**< Index of port that received the end of stream */
  55. } MMAL_EVENT_END_OF_STREAM_T;
  56. /** Format changed event data. */
  57. typedef struct MMAL_EVENT_FORMAT_CHANGED_T
  58. {
  59. uint32_t buffer_size_min; /**< Minimum size of buffers the port requires */
  60. uint32_t buffer_num_min; /**< Minimum number of buffers the port requires */
  61. uint32_t buffer_size_recommended; /**< Size of buffers the port recommends for optimal performance.
  62. A value of zero means no special recommendation. */
  63. uint32_t buffer_num_recommended; /**< Number of buffers the port recommends for optimal
  64. performance. A value of zero means no special recommendation. */
  65. MMAL_ES_FORMAT_T *format; /**< New elementary stream format */
  66. } MMAL_EVENT_FORMAT_CHANGED_T;
  67. /** Parameter changed event data.
  68. * This is a variable sized event. The full parameter is included in the event
  69. * data, not just the header. Use the \ref MMAL_PARAMETER_HEADER_T::id field to determine how to
  70. * cast the structure. The \ref MMAL_PARAMETER_HEADER_T::size field can be used to check validity.
  71. */
  72. typedef struct MMAL_EVENT_PARAMETER_CHANGED_T
  73. {
  74. MMAL_PARAMETER_HEADER_T hdr;
  75. } MMAL_EVENT_PARAMETER_CHANGED_T;
  76. /** Get a pointer to the \ref MMAL_EVENT_FORMAT_CHANGED_T structure contained in the buffer header.
  77. * Note that the pointer will point inside the data contained in the buffer header
  78. * so doesn't need to be freed explicitly.
  79. *
  80. * @param buffer buffer header containing the MMAL_EVENT_FORMAT_CHANGED event.
  81. * @return pointer to a MMAL_EVENT_FORMAT_CHANGED_T structure.
  82. */
  83. MMAL_EVENT_FORMAT_CHANGED_T *mmal_event_format_changed_get(MMAL_BUFFER_HEADER_T *buffer);
  84. /* @} */
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88. #endif /* MMAL_EVENTS_H */