close Warning: Can't use blame annotator:
No changeset 2 in the repository

source: svn/newcon3bcm2_21bu/magnum/syslib/pvrlib/bpvrlib_p_ringmgr.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 9.0 KB
RevLine 
1/***************************************************************************
2 *     Copyright (c) 2002, 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 * original file: \SetTop\syslib\pvrlib\venom2\ringpbmgr.h@@Irvine_HDDemo_Devel\20
11 *
12 * $brcm_Workfile: bpvrlib_p_ringmgr.h $
13 * $brcm_Revision: Hydra_Software_Devel/5 $
14 * $brcm_Date: 1/21/04 4:43p $
15 *
16 * Module Description:
17 *
18 * Revision History:
19 *
20 * $brcm_Log: /vobs/magnum/syslib/pvrlib/bpvrlib_p_ringmgr.h $
21 *
22 * Hydra_Software_Devel/5   1/21/04 4:43p marcusk
23 * PR8927: Fixed to work with latest version of XPT porting interface.
24 * Validate channel number.
25 *
26 * Hydra_Software_Devel/4   12/12/03 2:03p dlwin
27 * PR 8970: Change naming convention to conform to Magnum
28 *
29 * Hydra_Software_Devel/3   12/10/03 2:25p marcusk
30 * PR8927: Record syslib now compiles.
31 *
32 * Hydra_Software_Devel/2   12/10/03 11:07a marcusk
33 * PR 8927: Initial magnum version (not compiled yet)
34 *
35 ***************************************************************************/
36#ifndef __BPVRLIB_P_RINGMGR__
37#define __BPVRLIB_P_RINGMGR__
38
39#include "bkni.h"
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45typedef void (*BPVRlib_P_RingMgrCb)( uint32_t channel );
46
47/*
48 * This structure is used to track all internal variables in the ring buffer
49 * manager
50 */
51typedef struct BPVRlib_P_RingMgr_Impl {
52        unsigned                channel;                                /* this is returned by notify callback */
53        uint8_t                 *p_bfr;                                 /* ring buffer virtual (CPU) address */
54        size_t                  bufferSize;                             /* size of ring buffer */
55        uint32_t                writeWrapCount;                 /* number of times the write count has wrapped */
56        size_t                  writeOffset;                    /* write offset (end of valid data) */
57        uint32_t                hwWriteWrapCount;               /* number of times the hwwrite count has wrapped */
58        size_t                  hwWriteOffset;                  /* number of bytes loaded into hardware dma (optional use) */
59        uint32_t                readWrapCount;                  /* number of times the read count has wrapped */
60        size_t                  readOffset;                             /* read offset (start of valid data) */
61        volatile bool   resetInProgress;/* set when the reset function is called until the next add request is called */
62        volatile bool   abortInProgress;/* set when the abort function is called until the next reset */
63        BKNI_EventHandle        notifyEvent;                    /* used to wake blocked calls when the read or write pointers are updated */
64        BPVRlib_P_RingMgrCb     emptyToNotEmptyCb;              /* callback that is called when the buffer goes from empty to not empty */
65        BPVRlib_P_RingMgrCb     fullToNotFullCb;                /* callback that is called when the buffer goes from full to not full */
66} BPVRlib_P_RingMgr_Impl, *BPVRlib_P_RingMgr_Handle;
67
68/****************************************************************
69Summary:
70This function creates a ring buffer manager.  It allocates
71any resources required by the ring buffer manager.
72When this call completes the ring buffer manager is
73placed in the "reset" state.
74the playback manager (NULL if error)
75****************************************************************/
76BERR_Code BPVRlib_P_RingMgr_Open( 
77                        BPVRlib_P_RingMgr_Handle *rbmgr,                        /* [out] returns context */
78                        uint32_t channel,                                                       /* returned as parameter by callback functions */
79                        BPVRlib_P_RingMgrCb emptyToNotEmptyCb,          /* optional callback function to be called when the ring buffer transitions from empty to not empty */
80                        BPVRlib_P_RingMgrCb fullToNotFullCb,            /* optional callback function to be called when the ring buffer transitions from full to not full */
81                        uint8_t *p_bfr,                                                         /* pointer to the buffer that the ring buffer manager should use */
82                        size_t bfrSize                                                  /* the size of the buffer described by the p_bfr pointer */
83                        );
84
85/****************************************************************
86Summary:
87This function resets a ring buffer manager.  This includes
88reseting any of the buffer offsets and wrap counts.
89It also wakes any blocked call pending by the ring buffer manager.
90After a reset, the rpbmgr_AddDataRequest() function
91must be called to remove the reset condition.
92****************************************************************/
93void BPVRlib_P_RingMgr_Reset( 
94                        BPVRlib_P_RingMgr_Handle rbmgr                          /* handle of ring buffer manager */
95                        );
96
97/****************************************************************
98Summary:
99This function frees any resources used by a ring buffer
100manager.
101****************************************************************/
102void BPVRlib_P_RingMgr_Close( 
103                        BPVRlib_P_RingMgr_Handle rbmgr                          /* handle of ring buffer manager */
104                        );
105
106/****************************************************************
107Summary:
108This function requests to add data into the ring buffer manager
109If there is no free space available this function will
110block (if required) until free space becomes available.
111****************************************************************/
112BERR_Code BPVRlib_P_RingMgr_AddDataRequest( 
113                        BPVRlib_P_RingMgr_Handle rbmgr,         /* handle of ring buffer manager */
114                        uint8_t **pp_bfr,                                               /* returns pointer of starting buffer address of free space */
115                        size_t *p_count,                                        /* returns size of the free space (in bytes) */
116                        bool block,                                                     /* false (do not block), true (block until free space is available) */
117                        uint32_t timeout                                                /* max num of msec to block */
118                        );
119
120/****************************************************************
121Summary:
122This function increments the ring buffer write pointer
123It is used in conjuntion with the rpbmgr_AddDataRequest()
124to add data into the ring buffer.
125****************************************************************/
126BERR_Code BPVRlib_P_RingMgr_UpdateWritePointer( 
127                        BPVRlib_P_RingMgr_Handle rbmgr,         /* handle of ring buffer manager */
128                        size_t count                                            /* number of bytes to increment the write pointer */
129                        );
130
131/****************************************************************
132Summary:
133This function requests to remove valid data from the ring buffer manager
134If there is no valid data available this function will
135block (if required) until valid data becomes available.
136****************************************************************/
137BERR_Code BPVRlib_P_RingMgr_RemoveDataRequest( 
138                        BPVRlib_P_RingMgr_Handle rbmgr,                         /* handle of ring buffer manager */
139                        uint8_t **pp_bfr,                               /* returns pointer of starting buffer address of valid data */
140                        size_t *p_count,                        /* returns size of the valid data (in bytes) */
141                        bool block,                                     /* false (do not block), true (block until free space is available) */
142                        uint32_t timeout                                /* max num of msec to block */
143                        );
144
145/****************************************************************
146Summary:
147This function increments the ring buffer read pointer.
148It is used in conjuntion with the rpbmgr_RemoveDataRequest()
149to remove valid data from the ring buffer.
150****************************************************************/
151BERR_Code BPVRlib_P_RingMgr_UpdateReadPointer( 
152                        BPVRlib_P_RingMgr_Handle rbmgr,         /* handle of ring buffer manager */
153                        size_t count                                            /* number of bytes to increment the read pointer */
154                        );
155
156/****************************************************************
157Summary:
158This function gets the amount of data that has been
159added into the ring buffer, but not placed in the
160hardware dma engine.
161****************************************************************/
162void BPVRlib_P_RingMgr_GetHwWriteDifference( 
163                        BPVRlib_P_RingMgr_Handle rbmgr,         /* handle of ring buffer manager */
164                        uint8_t **pp_bfr,                                               /* returns pointer of starting buffer address of data that needs to be added into hardware */
165                        size_t *p_count                                         /* returns size of the data that needs to be added into hardware */
166                        );
167
168/****************************************************************
169Summary:
170This function increments the ring buffer hardware write pointer.
171It is used in conjuntion with the rpbmgr_GetHwWriteDifference()
172to track what data from the ring buffer has
173been added into the hardware.
174****************************************************************/
175void BPVRlib_P_RingMgr_UpdateHwWriteCount( 
176                        BPVRlib_P_RingMgr_Handle rbmgr, /* handle of ring buffer manager */
177                        size_t count                                    /* number of bytes to increment the hw write pointer */
178                        );
179
180/****************************************************************
181Summary:
182This function returns the number of free bytes available
183in the ring buffer.
184****************************************************************/
185void BPVRlib_P_RingMgr_GetNumFreeBytes( 
186                        BPVRlib_P_RingMgr_Handle rbmgr,         /* handle of ring buffer manager */
187                        size_t *p_numFreeBytes                          /* returns number of bytes available in ring buffer */
188                        );
189
190/****************************************************************
191Summary:
192This function wakes any blocked call pending by the ring buffer manager.
193****************************************************************/
194void BPVRlib_P_RingMgr_Abort( 
195                        BPVRlib_P_RingMgr_Handle rbmgr                          /* handle of ring buffer manager */
196                        );
197
198#ifdef __cplusplus
199}
200#endif
201
202#endif /* __PLAYBACKMGR_H__ */
Note: See TracBrowser for help on using the repository browser.