| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2004-2012, 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_video_source.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/6 $ |
|---|
| 12 | * $brcm_Date: 1/16/12 8:26p $ |
|---|
| 13 | * |
|---|
| 14 | * Revision History: |
|---|
| 15 | * |
|---|
| 16 | * $brcm_Log: /magnum/syslib/synclib/noarch/bsynclib_video_source.h $ |
|---|
| 17 | * |
|---|
| 18 | * Hydra_Software_Devel/6 1/16/12 8:26p bandrews |
|---|
| 19 | * SW7346-640: preserve delay estimation when callbacks come in an |
|---|
| 20 | * unexpected order |
|---|
| 21 | * |
|---|
| 22 | * Hydra_Software_Devel/5 3/22/10 5:39p bandrews |
|---|
| 23 | * SW7408-83: remove undefined functions; add unconditional video unmute |
|---|
| 24 | * |
|---|
| 25 | * Hydra_Software_Devel/4 3/18/10 9:34p bandrews |
|---|
| 26 | * SW7405-4042: rework delay estimation so that imprecise lipsync works |
|---|
| 27 | * correctly |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/3 1/26/10 9:00p bandrews |
|---|
| 30 | * SW7405-3774: added mute control support |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/2 12/10/09 9:18p bandrews |
|---|
| 33 | * SW7401-3634: adding PWC (now JTI) support to synclib |
|---|
| 34 | * |
|---|
| 35 | * Hydra_Software_Devel/1 3/24/08 3:10p bandrews |
|---|
| 36 | * PR40865: Fixed |
|---|
| 37 | * |
|---|
| 38 | * Hydra_Software_Devel/4 2/25/08 9:33p bandrews |
|---|
| 39 | * PR37951: Fixed various bugs |
|---|
| 40 | * |
|---|
| 41 | * Hydra_Software_Devel/3 2/20/08 10:03p bandrews |
|---|
| 42 | * PR37951: Updated based on feedback from usage |
|---|
| 43 | * |
|---|
| 44 | * Hydra_Software_Devel/2 1/3/08 5:17p bandrews |
|---|
| 45 | * PR37951: Updated based on initial feedback |
|---|
| 46 | * |
|---|
| 47 | * Hydra_Software_Devel/1 12/12/07 2:54p bandrews |
|---|
| 48 | * PR37951: Initial check-in |
|---|
| 49 | ***************************************************************************/ |
|---|
| 50 | |
|---|
| 51 | #include "bstd.h" |
|---|
| 52 | #include "bsyslib.h" |
|---|
| 53 | #include "bsynclib_timer.h" |
|---|
| 54 | #include "bsynclib_video_format.h" |
|---|
| 55 | #include "bsynclib_delay_element.h" |
|---|
| 56 | #include "bsynclib_priv.h" |
|---|
| 57 | |
|---|
| 58 | #ifndef BSYNCLIB_VIDEO_SOURCE_H__ |
|---|
| 59 | #define BSYNCLIB_VIDEO_SOURCE_H__ |
|---|
| 60 | |
|---|
| 61 | typedef struct BSYNClib_VideoSource_Data |
|---|
| 62 | { |
|---|
| 63 | bool bDigital; |
|---|
| 64 | bool bLastPictureHeld; /* is the decoder holding the last picture or blanking? */ |
|---|
| 65 | unsigned int uiJitterToleranceImprovementThreshold; |
|---|
| 66 | } BSYNClib_VideoSource_Data; |
|---|
| 67 | |
|---|
| 68 | typedef struct |
|---|
| 69 | { |
|---|
| 70 | bool bAdjusted; |
|---|
| 71 | int iValue; |
|---|
| 72 | } BSYNClib_VideoSource_JitterToleranceImprovementFactor; |
|---|
| 73 | |
|---|
| 74 | typedef struct BSYNClib_VideoSource_Results |
|---|
| 75 | { |
|---|
| 76 | bool bDelaySaved; |
|---|
| 77 | BSYNClib_Delay sSavedDelay; |
|---|
| 78 | bool bMutePending; |
|---|
| 79 | |
|---|
| 80 | BSYNClib_VideoSource_JitterToleranceImprovementFactor sJtiFactor; |
|---|
| 81 | } BSYNClib_VideoSource_Results; |
|---|
| 82 | |
|---|
| 83 | typedef struct BSYNClib_VideoSource |
|---|
| 84 | { |
|---|
| 85 | BSYNClib_DelayElement sElement; |
|---|
| 86 | BSYNClib_VideoFormat sFormat; |
|---|
| 87 | |
|---|
| 88 | BSYNClib_Timer * psUnmuteTimer; |
|---|
| 89 | BSYNClib_Timer * psUnconditionalUnmuteTimer; |
|---|
| 90 | BSYNClib_Timer * psTsmLockTimer; |
|---|
| 91 | |
|---|
| 92 | BSYNClib_VideoSource_Data sData; |
|---|
| 93 | BSYNClib_VideoSource_Data sSnapshot; |
|---|
| 94 | BSYNClib_VideoSource_Results sResults; |
|---|
| 95 | BSYNClib_VideoSource_Config sConfig; |
|---|
| 96 | BSYNClib_Source_Status sStatus; |
|---|
| 97 | } BSYNClib_VideoSource; |
|---|
| 98 | |
|---|
| 99 | BSYNClib_VideoSource * BSYNClib_VideoSource_Create(void); |
|---|
| 100 | |
|---|
| 101 | void BSYNClib_VideoSource_Destroy(BSYNClib_VideoSource * psSource); |
|---|
| 102 | |
|---|
| 103 | bool BSYNClib_VideoSource_SyncCheck(BSYNClib_VideoSource * psSource); |
|---|
| 104 | |
|---|
| 105 | void BSYNClib_VideoSource_Reset_isr(BSYNClib_VideoSource * psSource); |
|---|
| 106 | |
|---|
| 107 | BERR_Code BSYNClib_VideoSource_TsmLockTimerExpired(void * pvParm1, int iParm2, BSYSlib_Timer_Handle hTimer); |
|---|
| 108 | |
|---|
| 109 | BERR_Code BSYNClib_VideoSource_SetMute(BSYNClib_VideoSource * psSource, bool bMute); |
|---|
| 110 | |
|---|
| 111 | void BSYNClib_VideoSource_GetDefaultConfig(BSYNClib_VideoSource_Config * psConfig); |
|---|
| 112 | |
|---|
| 113 | void BSYNClib_VideoSource_P_SelfClearConfig_isr(BSYNClib_VideoSource * psSource); |
|---|
| 114 | |
|---|
| 115 | BERR_Code BSYNClib_VideoSource_P_ProcessConfig_isr(BSYNClib_VideoSource * psSource); |
|---|
| 116 | |
|---|
| 117 | void BSYNClib_VideoSource_Snapshot_isr(BSYNClib_VideoSource * psSource); |
|---|
| 118 | |
|---|
| 119 | void BSYNClib_VideoSource_P_GetDefaultStatus(BSYNClib_Source_Status * psStatus); |
|---|
| 120 | |
|---|
| 121 | bool BSYNClib_VideoSource_EstimateDelay_isr(BSYNClib_VideoSource * psSource); |
|---|
| 122 | |
|---|
| 123 | BERR_Code BSYNClib_VideoSource_RateMismatchDetected(BSYNClib_VideoSource * psSource); |
|---|
| 124 | |
|---|
| 125 | BERR_Code BSYNClib_VideoSource_RateRematchDetected(BSYNClib_VideoSource * psSource); |
|---|
| 126 | |
|---|
| 127 | #endif /* BSYNCLIB_VIDEO_SOURCE_H__ */ |
|---|
| 128 | |
|---|