My Project
mmal_clock.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2012, Broadcom Europe Ltd
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the copyright holder nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 
29 #ifndef MMAL_CLOCK_H
30 #define MMAL_CLOCK_H
31 
32 #include "interface/vcos/vcos.h"
33 #include "mmal_types.h"
34 #include "mmal_common.h"
35 
68 #define MMAL_CLOCK_EVENT_MAGIC MMAL_FOURCC('C','K','L','M')
69 
71 #define MMAL_CLOCK_EVENT_REFERENCE MMAL_FOURCC('C','R','E','F')
72 
74 #define MMAL_CLOCK_EVENT_ACTIVE MMAL_FOURCC('C','A','C','T')
75 
77 #define MMAL_CLOCK_EVENT_SCALE MMAL_FOURCC('C','S','C','A')
78 
80 #define MMAL_CLOCK_EVENT_TIME MMAL_FOURCC('C','T','I','M')
81 
83 #define MMAL_CLOCK_EVENT_UPDATE_THRESHOLD MMAL_FOURCC('C','U','T','H')
84 
86 #define MMAL_CLOCK_EVENT_DISCONT_THRESHOLD MMAL_FOURCC('C','D','T','H')
87 
89 #define MMAL_CLOCK_EVENT_REQUEST_THRESHOLD MMAL_FOURCC('C','R','T','H')
90 
92 #define MMAL_CLOCK_EVENT_INPUT_BUFFER_INFO MMAL_FOURCC('C','I','B','I')
93 #define MMAL_CLOCK_EVENT_OUTPUT_BUFFER_INFO MMAL_FOURCC('C','O','B','I')
94 
96 #define MMAL_CLOCK_EVENT_LATENCY MMAL_FOURCC('C','L','A','T')
97 
99 #define MMAL_CLOCK_EVENT_INVALID 0
100 
101 
104 {
107 
111 
114 {
117  int64_t threshold;
118 
120  int64_t duration;
122 
125 {
128  int64_t threshold;
129 
133 
136 {
137  int64_t time_stamp;
138  uint32_t arrival_time;
140 
142 typedef struct MMAL_CLOCK_LATENCY_T
143 {
144  int64_t target;
145  int64_t attack_period;
146  int64_t attack_rate;
149 
151 typedef struct MMAL_CLOCK_EVENT_T
152 {
154  uint32_t id;
155 
157  uint32_t magic;
158 
161 
163  uint32_t padding0;
164 
166  union
167  {
170 
173 
175  int64_t media_time;
176 
179 
182 
185 
188 
191  } data;
192 
194  uint64_t padding1;
196 
197 /* Make sure MMAL_CLOCK_EVENT_T will preserve 64-bit alignment */
198 vcos_static_assert(!(sizeof(MMAL_CLOCK_EVENT_T) & 0x7));
199 
200 #define MMAL_CLOCK_EVENT_INIT(id) { id, MMAL_CLOCK_EVENT_MAGIC, NULL, 0, {0}, 0 }
201 
202 #endif /* MMAL_CLOCK_H */
struct MMAL_BUFFER_HEADER_T * buffer
Definition: mmal_clock.h:160
struct MMAL_CLOCK_EVENT_T MMAL_CLOCK_EVENT_T
MMAL_CLOCK_LATENCY_T latency
Definition: mmal_clock.h:190
struct MMAL_CLOCK_UPDATE_THRESHOLD_T MMAL_CLOCK_UPDATE_THRESHOLD_T
MMAL_CLOCK_DISCONT_THRESHOLD_T discont_threshold
Definition: mmal_clock.h:181
struct MMAL_CLOCK_DISCONT_THRESHOLD_T MMAL_CLOCK_DISCONT_THRESHOLD_T
union MMAL_CLOCK_EVENT_T::@0 data
MMAL_CLOCK_BUFFER_INFO_T buffer
Definition: mmal_clock.h:187
struct MMAL_CLOCK_LATENCY_T MMAL_CLOCK_LATENCY_T
MMAL_BOOL_T enable
Definition: mmal_clock.h:169
MMAL_CLOCK_UPDATE_THRESHOLD_T update_threshold
Definition: mmal_clock.h:178
struct MMAL_CLOCK_REQUEST_THRESHOLD_T MMAL_CLOCK_REQUEST_THRESHOLD_T
MMAL_CLOCK_REQUEST_THRESHOLD_T request_threshold
Definition: mmal_clock.h:184
int32_t MMAL_BOOL_T
Definition: mmal_common.h:60
struct MMAL_CLOCK_BUFFER_INFO_T MMAL_CLOCK_BUFFER_INFO_T
MMAL_RATIONAL_T scale
Definition: mmal_clock.h:172
vcos_static_assert(!(sizeof(MMAL_CLOCK_EVENT_T) &0x7))