blob: ac3d8b62d0b304370f95d4bebbd64a9278ab3156 [file] [log] [blame]
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* StreamRB.h
*
* Project:
* --------
* MOLY_sw
*
* Description:
* ------------
* StreamRB utility
*
* Author:
* -------
* -------
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
*
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#ifndef _StreamRB_DOT_H_
#define _StreamRB_DOT_H_
/*****************************************************************************
* C O M P I L E R F L A G S
******************************************************************************
*/
/*****************************************************************************
* E X T E R N A L R E F E R E N C E S
******************************************************************************
*/
#include "l1aud_common_def.h"
/*****************************************************************************
* C O N S T A N T S
******************************************************************************
*/
/*****************************************************************************
* D A T A T Y P E S
******************************************************************************
*/
typedef struct StreamRingBufferStruct StreamRB;
struct StreamRingBufferStruct {
uint8 *buffer;
int32 read;
int32 write;
int32 size;
};
/*****************************************************************************
* P U B L I C D A T A
******************************************************************************
*/
/*****************************************************************************
* M A C R O S
******************************************************************************
*/
/*****************************************************************************
* D A T A D E C L A R A T I O N S
******************************************************************************
*/
/*****************************************************************************
* F U N C T I O N D E C L A R A T I O N S
******************************************************************************
*/
bool StreamRB_Init( StreamRB *rb, uint8 *buffer, int32 buffer_size );
int32 StreamRB_GetFreeSpace( StreamRB *rb );
int32 StreamRB_GetDataCount( StreamRB *rb );
void StreamRB_Write( StreamRB *dest_rb, uint8 *src_buffer, int32 size );
void StreamRB_Read( StreamRB *src_rb, uint8 *dest_buffer, int32 size );
void StreamRB_GetWriteBlock( StreamRB *dest_rb, uint8 **write_ptr, int32 *write_cnt );
void StreamRB_GetReadBlock( StreamRB *src_rb, uint8 **read_ptr, int32 *read_cnt );
void StreamRB_ShiftWritePointer( StreamRB *rb, int32 shamt );
void StreamRB_ShiftReadPointer( StreamRB *rb, int32 shamt );
//void StreamRB_ShiftReadPointer2( StreamRB *rb, int32 shamt );
/*****************************************************************************
* I N L I N E F U N C T I O N D E C L A R A T I O N S
******************************************************************************
*/
#endif // ..._StreamRB_DOT_H_