source: svn/trunk/newcon3bcm2_21bu/magnum/syslib/synclib/7552/bsynclib_delay_element.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 5.7 KB
Line 
1/***************************************************************************
2*     Copyright (c) 2004-2010, Broadcom Corporation
3*     All Rights Reserved
4*     Confidential Property of Broadcom Corporation
5*
6*  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7*  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8*  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9*
10* $brcm_Workfile: bsynclib_delay_element.h $
11* $brcm_Revision: Hydra_Software_Devel/6 $
12* $brcm_Date: 3/19/10 2:43p $
13*
14* Revision History:
15*
16* $brcm_Log: /magnum/syslib/synclib/noarch/bsynclib_delay_element.h $
17*
18* Hydra_Software_Devel/6   3/19/10 2:43p bandrews
19* SW7405-3774: mute control merge
20*
21* Hydra_Software_Devel/SW7405-3774/2   3/18/10 9:34p bandrews
22* SW7405-4042: rework delay estimation so that imprecise lipsync works
23* correctly
24*
25* Hydra_Software_Devel/SW7405-3774/1   2/17/10 6:17p bandrews
26* SW7405-3774: attempt to fix early audio unmute then mute
27*
28* Hydra_Software_Devel/5   12/10/09 9:18p bandrews
29* SW7401-3634: adding PWC (now JTI) support to synclib
30*
31* Hydra_Software_Devel/4   7/24/09 4:14p bandrews
32* PR52812: Added any-time source or display rate change support
33*
34* Hydra_Software_Devel/3   5/12/09 4:40p bandrews
35* PR48566: preferred units
36*
37* Hydra_Software_Devel/2   2/25/09 7:53p bandrews
38* PR52514: needed another const
39*
40* Hydra_Software_Devel/1   3/24/08 3:09p bandrews
41* PR40865: Fixed
42*
43* Hydra_Software_Devel/4   2/22/08 3:06p bandrews
44* PR37951: Debugging callbacks
45*
46* Hydra_Software_Devel/3   2/20/08 10:03p bandrews
47* PR37951: Updated based on feedback from usage
48*
49* Hydra_Software_Devel/2   1/3/08 5:17p bandrews
50* PR37951: Updated based on initial feedback
51*
52* Hydra_Software_Devel/1   12/12/07 2:53p bandrews
53* PR37951: Initial check-in
54***************************************************************************/
55
56#include "bstd.h"
57#include "bsynclib.h"
58
59#ifndef BSYNCLIB_DELAY_ELEMENT_H__
60#define BSYNCLIB_DELAY_ELEMENT_H__
61
62/*
63Summary:
64*/
65typedef struct
66{
67        bool bValid;
68        bool bTimedOut;
69        BSYNClib_Units ePreferredUnits;
70        BSYNClib_Units eOriginalUnits;
71        unsigned int uiMeasured;
72        unsigned int uiCustom;
73        unsigned int uiCapacity;
74        unsigned int uiQuantizationLevel;
75} BSYNClib_Delay_Data;
76
77/*
78Summary:
79*/
80typedef struct
81{
82        bool bAccepted;
83        bool bEstimated;
84        bool bGenerateCallback;
85        unsigned int uiApplied;
86        unsigned int uiDesired;
87} BSYNClib_Delay_Results;
88
89/*
90Summary:
91*/
92typedef struct
93{
94        BSYNClib_Delay_Data sData;
95        BSYNClib_Delay_Data sSnapshot;
96        BSYNClib_Delay_Results sResults;
97} BSYNClib_Delay;
98
99/*
100Summary:
101*/
102typedef struct
103{
104        bool bEnabled; /* TODO: is this being moved to NULLing out the callback function pointer? */
105        bool bReceived;
106#if 0
107        unsigned long ulTime;
108#endif
109        BSYNClib_Units ePreferredUnits;
110} BSYNClib_DelayNotification_Data;
111
112/*
113Summary:
114*/
115typedef struct
116{
117        bool bEnabled;
118        BSYNClib_UnsignedValue sThreshold;
119        bool bGenerateCallback;
120} BSYNClib_DelayNotification_Results;
121
122/*
123Summary:
124*/
125typedef struct
126{
127        BSYNClib_DelayNotification_Data sData;
128        BSYNClib_DelayNotification_Data sSnapshot;
129        BSYNClib_DelayNotification_Results sResults;
130} BSYNClib_DelayNotification;
131
132/*
133Summary:
134*/
135typedef enum
136{
137        BSYNClib_DelayElement_LifecycleEvent_eNone,
138        BSYNClib_DelayElement_LifecycleEvent_eStarted,
139        BSYNClib_DelayElement_LifecycleEvent_eStopped
140} BSYNClib_DelayElement_LifecycleEvent;
141
142/*
143Summary:
144*/
145typedef enum
146{
147        BSYNClib_DelayElement_SynchronizationEvent_eNone,
148        BSYNClib_DelayElement_SynchronizationEvent_eSynchronized,
149        BSYNClib_DelayElement_SynchronizationEvent_eIgnored
150} BSYNClib_DelayElement_SynchronizationEvent;
151
152#ifdef BDBG_DEBUG_BUILD
153extern const char * const BSYNClib_DelayElement_LifecycleEventNames[];
154extern const char * const BSYNClib_DelayElement_SynchronizationEventNames[];
155#endif
156
157/*
158Summary:
159*/
160typedef struct
161{
162        bool bStarted;
163        bool bSynchronize;
164} BSYNClib_DelayElement_Data;
165
166/*
167Summary:
168*/
169typedef struct
170{
171        bool bChanged;
172        BSYNClib_DelayElement_LifecycleEvent eLifecycleEvent;
173        BSYNClib_DelayElement_SynchronizationEvent eSynchronizationEvent;
174        bool bDelayReceived;
175        bool bGenerateDelayCallback;
176        bool bGenerateNotificationCallback;
177} BSYNClib_DelayElement_DiffResults;
178
179/*
180Summary:
181*/
182typedef struct
183{
184        unsigned int uiIndex;
185        BSYNClib_Channel_Handle hParent;
186
187        BSYNClib_Delay sDelay;
188        BSYNClib_DelayNotification sNotification;
189
190        BSYNClib_DelayElement_Data sData;
191        BSYNClib_DelayElement_Data sSnapshot;
192} BSYNClib_DelayElement;
193
194/*
195Summary:
196*/
197void BSYNClib_DelayElement_Init(BSYNClib_DelayElement * psElement);
198
199/*
200Summary:
201*/
202void BSYNClib_DelayElement_Reset_isr(BSYNClib_DelayElement * psElement);
203
204/*
205Summary:
206*/
207void BSYNClib_DelayElement_Snapshot_isr(BSYNClib_DelayElement * psElement);
208
209/*
210Summary:
211*/
212void BSYNClib_Delay_Init(BSYNClib_Delay * psDelay);
213
214/*
215Summary:
216*/
217void BSYNClib_Delay_Reset_isr(BSYNClib_Delay * psDelay);
218
219/*
220Summary:
221*/
222void BSYNClib_Delay_Snapshot_isr(BSYNClib_Delay * psDelay);
223
224/*
225Summary:
226*/
227void BSYNClib_DelayNotification_Init(BSYNClib_DelayNotification * psNotification);
228
229/*
230Summary:
231*/
232void BSYNClib_DelayNotification_Reset_isr(BSYNClib_DelayNotification * psNotification);
233
234/*
235Summary:
236*/
237void BSYNClib_DelayNotification_Snapshot_isr(BSYNClib_DelayNotification * psNotification);
238
239void BSYNClib_DelayElement_CheckLifecycle_isr(
240        bool bStarted,
241        const BSYNClib_DelayElement * psCurrent,
242        BSYNClib_DelayElement_DiffResults * psResults
243);
244
245void BSYNClib_DelayElement_Diff_isr(
246        const BSYNClib_DelayElement * psDesired,
247        const BSYNClib_DelayElement * psCurrent,
248        BSYNClib_DelayElement_DiffResults * psResults
249);
250
251void BSYNClib_DelayElement_Patch_isr(
252        const BSYNClib_DelayElement * psDesired,
253        BSYNClib_DelayElement * psCurrent,
254        BSYNClib_DelayElement_DiffResults * psResults
255);
256
257#endif /* BSYNCLIB_DELAY_ELEMENT_H__ */
258
Note: See TracBrowser for help on using the repository browser.