source: svn/trunk/newcon3bcm2_21bu/magnum/syslib/synclib/7552/bsynclib_channel.c

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

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 4.5 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_channel.c $
11* $brcm_Revision: Hydra_Software_Devel/3 $
12* $brcm_Date: 2/12/10 8:46p $
13*
14* Revision History:
15*
16* $brcm_Log: /magnum/syslib/synclib/noarch/bsynclib_channel.c $
17*
18* Hydra_Software_Devel/3   2/12/10 8:46p bandrews
19* SW7405-3912: assert all inputs are not null
20*
21* Hydra_Software_Devel/2   10/30/08 10:34p bandrews
22* PR48566: Added support for preferred callback units
23*
24* Hydra_Software_Devel/1   3/24/08 3:09p bandrews
25* PR40865: Fixed
26*
27* Hydra_Software_Devel/3   2/26/08 10:21p bandrews
28* PR37951: Fixed units.  Implemented static rate mismatch detection.
29*
30* Hydra_Software_Devel/2   1/3/08 5:17p bandrews
31* PR37951: Updated based on initial feedback
32*
33* Hydra_Software_Devel/1   12/12/07 2:53p bandrews
34* PR37951: Initial check-in
35***************************************************************************/
36
37#include "bstd.h"
38#include "bkni.h"
39#include "bsyslib.h"
40#include "bsynclib.h"
41#include "bsynclib_priv.h"
42#include "bsynclib_channel_priv.h"
43
44BDBG_MODULE(synclib);
45
46void BSYNClib_Channel_GetSettings
47(
48        const BSYNClib_Channel_Handle hChn,
49        BSYNClib_Channel_Settings * psSettings /* [out] */
50)
51{
52        BDBG_ENTER(BSYNClib_Channel_GetSettings);
53
54        BDBG_ASSERT(hChn);
55        BDBG_ASSERT(psSettings);
56
57        *psSettings = hChn->sSettings;
58
59        BDBG_LEAVE(BSYNClib_Channel_GetSettings);
60}
61
62BERR_Code BSYNClib_Channel_SetSettings
63(
64        BSYNClib_Channel_Handle hChn,
65        const BSYNClib_Channel_Settings * psSettings
66)
67{
68        BERR_Code rc = BERR_SUCCESS;
69
70        BDBG_ENTER(BSYNClib_Channel_SetSettings);
71
72        BDBG_ASSERT(hChn);
73        BDBG_ASSERT(psSettings);
74
75        hChn->sSettings = *psSettings;
76
77        BDBG_LEAVE(BSYNClib_Channel_SetSettings);
78
79        return rc;
80}
81
82
83void BSYNClib_Channel_GetStatus(
84        BSYNClib_Channel_Handle hChn,
85        BSYNClib_Channel_Status * psStatus /* [out] */
86)
87{
88        BDBG_ENTER(BSYNClib_Channel_GetStatus);
89       
90        BDBG_ASSERT(hChn);
91
92        if (BSYNClib_P_Enabled(hChn->hParent))
93        {
94                BDBG_ASSERT(psStatus);
95
96                *psStatus = hChn->sStatus;
97        }
98       
99        BDBG_LEAVE(BSYNClib_Channel_GetStatus);
100}
101
102void BSYNClib_Channel_GetVideoSourceStatus
103(
104        const BSYNClib_Channel_Handle hChn,
105        unsigned int uiSource,
106        BSYNClib_Source_Status * psStatus /* [out] */
107)
108{
109        BDBG_ENTER(BSYNClib_Channel_GetVideoSourceStatus);
110
111        BDBG_ASSERT(hChn);
112
113        if (BSYNClib_P_Enabled(hChn->hParent))
114        {
115                BSYNClib_VideoSource * psSource;
116
117                psSource = (BSYNClib_VideoSource *)BSYSlib_List_GetByIndex(hChn->sVideo.hSources, uiSource);
118
119                if (psSource)
120                {
121                        BDBG_ASSERT(psStatus);
122                        *psStatus = psSource->sStatus;
123                }
124        }
125
126        BDBG_LEAVE(BSYNClib_Channel_GetVideoSourceStatus);
127}
128
129void BSYNClib_Channel_GetVideoSinkStatus
130(
131        const BSYNClib_Channel_Handle hChn,
132        unsigned int uiSink,
133        BSYNClib_Sink_Status * psStatus /* [out] */
134)
135{
136        BDBG_ENTER(BSYNClib_Channel_GetVideoSinkStatus);
137
138        BDBG_ASSERT(hChn);
139
140        if (BSYNClib_P_Enabled(hChn->hParent))
141        {
142                BSYNClib_VideoSink * psSink;
143
144                psSink = (BSYNClib_VideoSink *)BSYSlib_List_GetByIndex(hChn->sVideo.hSinks, uiSink);
145
146                if (psSink)
147                {
148                        BDBG_ASSERT(psStatus);
149                        *psStatus = psSink->sStatus;
150                }
151        }
152
153        BDBG_LEAVE(BSYNClib_Channel_GetVideoSinkStatus);
154}
155
156void BSYNClib_Channel_GetAudioSourceStatus
157(
158        const BSYNClib_Channel_Handle hChn,
159        unsigned int uiSource,
160        BSYNClib_Source_Status * psStatus /* [out] */
161)
162{
163        BDBG_ENTER(BSYNClib_Channel_GetAudioSourceStatus);
164
165        BDBG_ASSERT(hChn);
166
167        if (BSYNClib_P_Enabled(hChn->hParent))
168        {
169                BSYNClib_AudioSource * psSource;
170
171                psSource = (BSYNClib_AudioSource *)BSYSlib_List_GetByIndex(hChn->sAudio.hSources, uiSource);
172
173                if (psSource)
174                {
175                        BDBG_ASSERT(psStatus);
176                        *psStatus = psSource->sStatus;
177                }
178        }
179
180        BDBG_LEAVE(BSYNClib_Channel_GetAudioSourceStatus);
181}
182
183void BSYNClib_Channel_GetAudioSinkStatus
184(
185        const BSYNClib_Channel_Handle hChn,
186        unsigned int uiSink,
187        BSYNClib_Sink_Status * psStatus /* [out] */
188)
189{
190        BDBG_ENTER(BSYNClib_Channel_GetAudioSinkStatus);
191
192        BDBG_ASSERT(hChn);
193
194        if (BSYNClib_P_Enabled(hChn->hParent))
195        {
196                BSYNClib_AudioSink * psSink;
197
198                psSink = (BSYNClib_AudioSink *)BSYSlib_List_GetByIndex(hChn->sAudio.hSinks, uiSink);
199
200                if (psSink)
201                {
202                        BDBG_ASSERT(psStatus);
203                        *psStatus = psSink->sStatus;
204                }
205        }
206
207        BDBG_LEAVE(BSYNClib_Channel_GetAudioSinkStatus);
208}
209
Note: See TracBrowser for help on using the repository browser.