00001 /***************************************************************** 00002 | 00003 | Copyright 2004-2006 Axiomatic Systems LLC 00004 | 00005 | This file is part of Melo (Melo AAC Decoder). 00006 | 00007 | Unless you have obtained Melo under a difference license, 00008 | this version of Melo is Melo|GPL. 00009 | Melo|GPL is free software; you can redistribute it and/or modify 00010 | it under the terms of the GNU General Public License as published by 00011 | the Free Software Foundation; either version 2, or (at your option) 00012 | any later version. 00013 | 00014 | Melo|GPL is distributed in the hope that it will be useful, 00015 | but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 | GNU General Public License for more details. 00018 | 00019 | You should have received a copy of the GNU General Public License 00020 | along with Melo|GPL; see the file COPYING. If not, write to the 00021 | Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 00022 | 02111-1307, USA. 00023 | 00024 ****************************************************************/ 00030 #ifndef _MLO_SAMPLE_BUFFER_H_ 00031 #define _MLO_SAMPLE_BUFFER_H_ 00032 00037 /*---------------------------------------------------------------------- 00038 | includes 00039 +---------------------------------------------------------------------*/ 00040 #include "MloTypes.h" 00041 #include "MloUtils.h" 00042 00043 /*---------------------------------------------------------------------- 00044 | types 00045 +---------------------------------------------------------------------*/ 00050 typedef struct MLO_SampleBuffer MLO_SampleBuffer; 00051 00056 typedef enum 00057 { 00066 MLO_SAMPLE_TYPE_INTERLACED_SIGNED = 0 00067 } MLO_SampleType; 00068 00073 typedef struct 00074 { 00075 MLO_SampleType type; 00076 MLO_Cardinal sample_rate; 00077 MLO_Cardinal channel_count; 00078 MLO_Cardinal bits_per_sample; 00079 } MLO_SampleFormat; 00080 00081 /*---------------------------------------------------------------------- 00082 | functions 00083 +---------------------------------------------------------------------*/ 00084 #ifdef __cplusplus 00085 extern "C" { 00086 #endif /* __cplusplus */ 00087 00102 MLO_Result 00103 MLO_SampleBuffer_Create(MLO_Size size, MLO_SampleBuffer** buffer); 00104 00113 MLO_Result 00114 MLO_SampleBuffer_Destroy(MLO_SampleBuffer* self); 00115 00129 const void* 00130 MLO_SampleBuffer_GetSamples(const MLO_SampleBuffer* self); 00131 00146 void* 00147 MLO_SampleBuffer_UseSamples(MLO_SampleBuffer* self); 00148 00157 MLO_Cardinal 00158 MLO_SampleBuffer_GetSampleCount(const MLO_SampleBuffer* self); 00159 00171 MLO_Result 00172 MLO_SampleBuffer_SetSampleCount(MLO_SampleBuffer* self, MLO_Cardinal sample_count); 00173 00182 MLO_Size 00183 MLO_SampleBuffer_GetSize(const MLO_SampleBuffer* self); 00184 00194 const MLO_SampleFormat* 00195 MLO_SampleBuffer_GetFormat(const MLO_SampleBuffer* self); 00196 00211 void 00212 MLO_SampleBuffer_SetFormat(MLO_SampleBuffer* self, const MLO_SampleFormat* format); 00213 00214 #ifdef __cplusplus 00215 } 00216 #endif /* __cplusplus */ 00217 00220 #endif /* _MLO_SAMPLE_BUFFER_H_ */