summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/common/include
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-05-14 15:45:22 -0700
committerJames Dong <jdong@google.com>2010-05-19 07:21:25 -0700
commit956c553ab0ce72f8074ad0fda2ffd66a0305700c (patch)
treefe111ecd29e01c270246f5f338c56806d6d5b136 /media/libstagefright/codecs/common/include
parente1f61055b4abb96a86d1ff24b5a7777dfe40fe5f (diff)
downloadframeworks_av-956c553ab0ce72f8074ad0fda2ffd66a0305700c.zip
frameworks_av-956c553ab0ce72f8074ad0fda2ffd66a0305700c.tar.gz
frameworks_av-956c553ab0ce72f8074ad0fda2ffd66a0305700c.tar.bz2
Initial software encoder checkins
Change-Id: I27f387db23594e46384c4eb3a0093ce220bb6b60
Diffstat (limited to 'media/libstagefright/codecs/common/include')
-rw-r--r--media/libstagefright/codecs/common/include/cmnMemory.h106
-rw-r--r--media/libstagefright/codecs/common/include/voAAC.h74
-rw-r--r--media/libstagefright/codecs/common/include/voAMRWB.h87
-rw-r--r--media/libstagefright/codecs/common/include/voAudio.h173
-rw-r--r--media/libstagefright/codecs/common/include/voIndex.h193
-rw-r--r--media/libstagefright/codecs/common/include/voMem.h65
-rw-r--r--media/libstagefright/codecs/common/include/voType.h221
7 files changed, 919 insertions, 0 deletions
diff --git a/media/libstagefright/codecs/common/include/cmnMemory.h b/media/libstagefright/codecs/common/include/cmnMemory.h
new file mode 100644
index 0000000..9315600
--- /dev/null
+++ b/media/libstagefright/codecs/common/include/cmnMemory.h
@@ -0,0 +1,106 @@
+/*
+ ** Copyright 2003-2010, VisualOn, Inc.
+ **
+ ** Licensed under the Apache License, Version 2.0 (the "License");
+ ** you may not use this file except in compliance with the License.
+ ** You may obtain a copy of the License at
+ **
+ ** http://www.apache.org/licenses/LICENSE-2.0
+ **
+ ** Unless required by applicable law or agreed to in writing, software
+ ** distributed under the License is distributed on an "AS IS" BASIS,
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ** See the License for the specific language governing permissions and
+ ** limitations under the License.
+ */
+/*******************************************************************************
+ File: cmnMemory.h
+
+ Content: memory operator implementation header file
+
+*******************************************************************************/
+
+#ifndef __cmnMemory_H__
+#define __cmnMemory_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <voMem.h>
+
+//extern VO_MEM_OPERATOR g_memOP;
+
+/**
+ * Allocate memory
+ * \param uID [in] module ID
+ * \param uSize [in] size of memory
+ * \return value is the allocated memory address. NULL is failed.
+ */
+VO_U32 cmnMemAlloc (VO_S32 uID, VO_MEM_INFO * pMemInfo);
+
+/**
+ * Free up memory
+ * \param uID [in] module ID
+ * \param pMem [in] address of memory
+ * \return value 0, if succeeded.
+ */
+VO_U32 cmnMemFree (VO_S32 uID, VO_PTR pBuffer);
+
+/**
+ * memory set function
+ * \param uID [in] module ID
+ * \param pBuff [in/out] address of memory
+ * \param uValue [in] the value to be set
+ * \param uSize [in] the size to be set
+ * \return value 0, if succeeded.
+ */
+VO_U32 cmnMemSet (VO_S32 uID, VO_PTR pBuff, VO_U8 uValue, VO_U32 uSize);
+
+/**
+ * memory copy function
+ * \param uID [in] module ID
+ * \param pDest [in/out] address of destination memory
+ * \param pSource [in] address of source memory
+ * \param uSize [in] the size to be copied
+ * \return value 0, if succeeded.
+ */
+VO_U32 cmnMemCopy (VO_S32 uID, VO_PTR pDest, VO_PTR pSource, VO_U32 uSize);
+
+/**
+ * memory check function
+ * \param uID [in] module ID
+ * \param pBuff [in] address of buffer to be checked
+ * \param uSize [in] the size to be checked
+ * \return value 0, if succeeded.
+ */
+VO_U32 cmnMemCheck (VO_S32 uID, VO_PTR pBuffer, VO_U32 uSize);
+
+/**
+ * memory compare function
+ * \param uID [in] module ID
+ * \param pBuffer1 [in] address of buffer 1 to be compared
+ * \param pBuffer2 [in] address of buffer 2 to be compared
+ * \param uSize [in] the size to be compared
+ * \return value: same as standard C run-time memcmp() function.
+ */
+VO_S32 cmnMemCompare (VO_S32 uID, VO_PTR pBuffer1, VO_PTR pBuffer2, VO_U32 uSize);
+
+/**
+ * memory move function
+ * \param uID [in] module ID
+ * \param pDest [in/out] address of destination memory
+ * \param pSource [in] address of source memory
+ * \param uSize [in] the size to be moved
+ * \return value 0, if succeeded.
+ */
+VO_U32 cmnMemMove (VO_S32 uID, VO_PTR pDest, VO_PTR pSource, VO_U32 uSize);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif // __cmnMemory_H__
+
+
diff --git a/media/libstagefright/codecs/common/include/voAAC.h b/media/libstagefright/codecs/common/include/voAAC.h
new file mode 100644
index 0000000..d11ed83
--- /dev/null
+++ b/media/libstagefright/codecs/common/include/voAAC.h
@@ -0,0 +1,74 @@
+/*
+ ** Copyright 2003-2010, VisualOn, Inc.
+ **
+ ** Licensed under the Apache License, Version 2.0 (the "License");
+ ** you may not use this file except in compliance with the License.
+ ** You may obtain a copy of the License at
+ **
+ ** http://www.apache.org/licenses/LICENSE-2.0
+ **
+ ** Unless required by applicable law or agreed to in writing, software
+ ** distributed under the License is distributed on an "AS IS" BASIS,
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ** See the License for the specific language governing permissions and
+ ** limitations under the License.
+ */
+/*******************************************************************************
+ File: voAAC.h
+
+ Content: AAC codec APIs & data types
+
+*******************************************************************************/
+
+#ifndef __voAAC_H__
+#define __voAAC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include "voAudio.h"
+
+/*!
+ * the frame type that the decoder supports
+ */
+typedef enum {
+ VOAAC_RAWDATA = 0, /*!<contains only raw aac data in a frame*/
+ VOAAC_ADTS = 1, /*!<contains ADTS header + raw AAC data in a frame*/
+ VOAAC_FT_MAX = VO_MAX_ENUM_VALUE
+} VOAACFRAMETYPE;
+
+/*!
+ * the structure for AAC encoder input parameter
+ */
+typedef struct {
+ int sampleRate; /*! audio file sample rate */
+ int bitRate; /*! encoder bit rate in bits/sec */
+ short nChannels; /*! number of channels on input (1,2) */
+ short adtsUsed; /*! whether write adts header */
+} AACENC_PARAM;
+
+/* AAC Param ID */
+#define VO_PID_AAC_Mdoule 0x42211000
+#define VO_PID_AAC_ENCPARAM VO_PID_AAC_Mdoule | 0x0040 /*!< get/set AAC encoder parameter, the parameter is a pointer to AACENC_PARAM */
+
+/* AAC decoder error ID */
+#define VO_ERR_AAC_Mdoule 0x82210000
+#define VO_ERR_AAC_UNSFILEFORMAT (VO_ERR_AAC_Mdoule | 0xF001)
+#define VO_ERR_AAC_UNSPROFILE (VO_ERR_AAC_Mdoule | 0xF002)
+
+/**
+ * Get audio encoder API interface
+ * \param pEncHandle [out] Return the AAC Encoder handle.
+ * \retval VO_ERR_OK Succeeded.
+ */
+VO_S32 VO_API voGetAACEncAPI (VO_AUDIO_CODECAPI * pEncHandle);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif // __voAAC_H__
+
+
+
diff --git a/media/libstagefright/codecs/common/include/voAMRWB.h b/media/libstagefright/codecs/common/include/voAMRWB.h
new file mode 100644
index 0000000..8a93eb8
--- /dev/null
+++ b/media/libstagefright/codecs/common/include/voAMRWB.h
@@ -0,0 +1,87 @@
+/*
+ ** Copyright 2003-2010, VisualOn, Inc.
+ **
+ ** Licensed under the Apache License, Version 2.0 (the "License");
+ ** you may not use this file except in compliance with the License.
+ ** You may obtain a copy of the License at
+ **
+ ** http://www.apache.org/licenses/LICENSE-2.0
+ **
+ ** Unless required by applicable law or agreed to in writing, software
+ ** distributed under the License is distributed on an "AS IS" BASIS,
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ** See the License for the specific language governing permissions and
+ ** limitations under the License.
+ */
+/*******************************************************************************
+ File: voAMRWB.h
+
+ Content: AMR-WB codec APIs & data types
+
+*******************************************************************************/
+#ifndef __VOAMRWB_H__
+#define __VOAMRWB_H__
+
+#include "voAudio.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+#pragma pack(push, 4)
+
+/*!* the bit rate the codec supports*/
+typedef enum {
+ VOAMRWB_MDNONE = -1, /*!< Invalid mode */
+ VOAMRWB_MD66 = 0, /*!< 6.60kbps */
+ VOAMRWB_MD885 = 1, /*!< 8.85kbps */
+ VOAMRWB_MD1265 = 2, /*!< 12.65kbps */
+ VOAMRWB_MD1425 = 3, /*!< 14.25kbps */
+ VOAMRWB_MD1585 = 4, /*!< 15.85bps */
+ VOAMRWB_MD1825 = 5, /*!< 18.25bps */
+ VOAMRWB_MD1985 = 6, /*!< 19.85kbps */
+ VOAMRWB_MD2305 = 7, /*!< 23.05kbps */
+ VOAMRWB_MD2385 = 8, /*!< 23.85kbps> */
+ VOAMRWB_N_MODES = 9, /*!< Invalid mode */
+ VOAMRWB_MODE_MAX = VO_MAX_ENUM_VALUE
+
+}VOAMRWBMODE;
+
+/*!* the frame format the codec supports*/
+typedef enum {
+ VOAMRWB_DEFAULT = 0, /*!< the frame type is the header (defined in RFC3267) + rawdata*/
+ /*One word (2-byte) for sync word (0x6b21)*/
+ /*One word (2-byte) for frame length N.*/
+ /*N words (2-byte) containing N bits (bit 0 = 0x007f, bit 1 = 0x0081).*/
+ VOAMRWB_ITU = 1,
+ /*One word (2-byte) for sync word (0x6b21).*/
+ /*One word (2-byte) to indicate the frame type.*/
+ /*One word (2-byte) to indicate the mode.*/
+ /*N words (2-byte) containing N bits (bit 0 = 0xff81, bit 1 = 0x007f).*/
+ VOAMRWB_RFC3267 = 2, /* see RFC 3267 */
+ VOAMRWB_TMAX = VO_MAX_ENUM_VALUE
+}VOAMRWBFRAMETYPE;
+
+
+#define VO_PID_AMRWB_Module 0x42261000
+#define VO_PID_AMRWB_FORMAT (VO_PID_AMRWB_Module | 0x0002)
+#define VO_PID_AMRWB_CHANNELS (VO_PID_AMRWB_Module | 0x0003)
+#define VO_PID_AMRWB_SAMPLERATE (VO_PID_AMRWB_Module | 0x0004)
+#define VO_PID_AMRWB_FRAMETYPE (VO_PID_AMRWB_Module | 0x0005)
+#define VO_PID_AMRWB_MODE (VO_PID_AMRWB_Module | 0x0006)
+#define VO_PID_AMRWB_DTX (VO_PID_AMRWB_Module | 0x0007)
+
+/**
+ * Get audio codec API interface
+ * \param pEncHandle [out] Return the AMRWB Encoder handle.
+ * \retval VO_ERR_OK Succeeded.
+ */
+VO_S32 VO_API voGetAMRWBEncAPI(VO_AUDIO_CODECAPI *pEncHandle);
+
+
+#pragma pack(pop)
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+
+#endif //__VOAMRWB_H__
+
diff --git a/media/libstagefright/codecs/common/include/voAudio.h b/media/libstagefright/codecs/common/include/voAudio.h
new file mode 100644
index 0000000..64c9dfb
--- /dev/null
+++ b/media/libstagefright/codecs/common/include/voAudio.h
@@ -0,0 +1,173 @@
+/*
+ ** Copyright 2003-2010, VisualOn, Inc.
+ **
+ ** Licensed under the Apache License, Version 2.0 (the "License");
+ ** you may not use this file except in compliance with the License.
+ ** You may obtain a copy of the License at
+ **
+ ** http://www.apache.org/licenses/LICENSE-2.0
+ **
+ ** Unless required by applicable law or agreed to in writing, software
+ ** distributed under the License is distributed on an "AS IS" BASIS,
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ** See the License for the specific language governing permissions and
+ ** limitations under the License.
+ */
+/*******************************************************************************
+ File: voAudio.h
+
+ Content: Audio types and functions
+
+*******************************************************************************/
+
+#ifndef __voAudio_H__
+#define __voAudio_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include "voIndex.h"
+#include "voMem.h"
+
+#define VO_PID_AUDIO_BASE 0x42000000 /*!< The base param ID for AUDIO codec */
+#define VO_PID_AUDIO_FORMAT (VO_PID_AUDIO_BASE | 0X0001) /*!< The format data of audio in track */
+#define VO_PID_AUDIO_SAMPLEREATE (VO_PID_AUDIO_BASE | 0X0002) /*!< The sample rate of audio */
+#define VO_PID_AUDIO_CHANNELS (VO_PID_AUDIO_BASE | 0X0003) /*!< The channel of audio */
+#define VO_PID_AUDIO_BITRATE (VO_PID_AUDIO_BASE | 0X0004) /*!< The bit rate of audio */
+#define VO_PID_AUDIO_CHANNELMODE (VO_PID_AUDIO_BASE | 0X0005) /*!< The channel mode of audio */
+
+#define VO_ERR_AUDIO_BASE 0x82000000
+#define VO_ERR_AUDIO_UNSCHANNEL VO_ERR_AUDIO_BASE | 0x0001
+#define VO_ERR_AUDIO_UNSSAMPLERATE VO_ERR_AUDIO_BASE | 0x0002
+#define VO_ERR_AUDIO_UNSFEATURE VO_ERR_AUDIO_BASE | 0x0003
+
+
+/**
+ *Enumeration used to define the possible audio coding formats.
+ */
+typedef enum VO_AUDIO_CODINGTYPE {
+ VO_AUDIO_CodingUnused = 0, /**< Placeholder value when coding is N/A */
+ VO_AUDIO_CodingPCM, /**< Any variant of PCM coding */
+ VO_AUDIO_CodingADPCM, /**< Any variant of ADPCM encoded data */
+ VO_AUDIO_CodingAMRNB, /**< Any variant of AMR encoded data */
+ VO_AUDIO_CodingAMRWB, /**< Any variant of AMR encoded data */
+ VO_AUDIO_CodingAMRWBP, /**< Any variant of AMR encoded data */
+ VO_AUDIO_CodingQCELP13, /**< Any variant of QCELP 13kbps encoded data */
+ VO_AUDIO_CodingEVRC, /**< Any variant of EVRC encoded data */
+ VO_AUDIO_CodingAAC, /**< Any variant of AAC encoded data, 0xA106 - ISO/MPEG-4 AAC, 0xFF - AAC */
+ VO_AUDIO_CodingAC3, /**< Any variant of AC3 encoded data */
+ VO_AUDIO_CodingFLAC, /**< Any variant of FLAC encoded data */
+ VO_AUDIO_CodingMP1, /**< Any variant of MP1 encoded data */
+ VO_AUDIO_CodingMP3, /**< Any variant of MP3 encoded data */
+ VO_AUDIO_CodingOGG, /**< Any variant of OGG encoded data */
+ VO_AUDIO_CodingWMA, /**< Any variant of WMA encoded data */
+ VO_AUDIO_CodingRA, /**< Any variant of RA encoded data */
+ VO_AUDIO_CodingMIDI, /**< Any variant of MIDI encoded data */
+ VO_AUDIO_CodingDRA, /**< Any variant of dra encoded data */
+ VO_AUDIO_CodingG729, /**< Any variant of dra encoded data */
+ VO_AUDIO_Coding_MAX = VO_MAX_ENUM_VALUE
+} VO_AUDIO_CODINGTYPE;
+
+/*!
+* the channel type value
+*/
+typedef enum {
+ VO_CHANNEL_CENTER = 1, /*!<center channel*/
+ VO_CHANNEL_FRONT_LEFT = 1<<1, /*!<front left channel*/
+ VO_CHANNEL_FRONT_RIGHT = 1<<2, /*!<front right channel*/
+ VO_CHANNEL_SIDE_LEFT = 1<<3, /*!<side left channel*/
+ VO_CHANNEL_SIDE_RIGHT = 1<<4, /*!<side right channel*/
+ VO_CHANNEL_BACK_LEFT = 1<<5, /*!<back left channel*/
+ VO_CHANNEL_BACK_RIGHT = 1<<6, /*!<back right channel*/
+ VO_CHANNEL_BACK_CENTER = 1<<7, /*!<back center channel*/
+ VO_CHANNEL_LFE_BASS = 1<<8, /*!<low-frequency effects bass channel*/
+ VO_CHANNEL_ALL = 0xffff,/*!<[default] include all channels */
+ VO_CHANNEL_MAX = VO_MAX_ENUM_VALUE
+} VO_AUDIO_CHANNELTYPE;
+
+/**
+ * General audio format info
+ */
+typedef struct
+{
+ VO_S32 SampleRate; /*!< Sample rate */
+ VO_S32 Channels; /*!< Channel count */
+ VO_S32 SampleBits; /*!< Bits per sample */
+} VO_AUDIO_FORMAT;
+
+/**
+ * General audio output info
+ */
+typedef struct
+{
+ VO_AUDIO_FORMAT Format; /*!< Sample rate */
+ VO_U32 InputUsed; /*!< Channel count */
+ VO_U32 Resever; /*!< Resevered */
+} VO_AUDIO_OUTPUTINFO;
+
+/**
+ * General audio codec function set
+ */
+typedef struct VO_AUDIO_CODECAPI
+{
+ /**
+ * Init the audio codec module and return codec handle
+ * \param phCodec [OUT] Return the video codec handle
+ * \param vType [IN] The codec type if the module support multi codec.
+ * \param pUserData [IN] The init param. It is either a memory operator or an allocated memory
+ * \retval VO_ERR_NONE Succeeded.
+ */
+ VO_U32 (VO_API * Init) (VO_HANDLE * phCodec, VO_AUDIO_CODINGTYPE vType, VO_CODEC_INIT_USERDATA * pUserData );
+
+ /**
+ * Set input audio data.
+ * \param hCodec [IN]] The codec handle which was created by Init function.
+ * \param pInput [IN] The input buffer param.
+ * \retval VO_ERR_NONE Succeeded.
+ */
+ VO_U32 (VO_API * SetInputData) (VO_HANDLE hCodec, VO_CODECBUFFER * pInput);
+
+ /**
+ * Get the outut audio data
+ * \param hCodec [IN]] The codec handle which was created by Init function.
+ * \param pOutBuffer [OUT] The output audio data
+ * \param pOutInfo [OUT] The codec fills audio format and the input data size used in current call.
+ * pOutInfo->InputUsed is total used input data size in byte.
+ * \retval VO_ERR_NONE Succeeded.
+ * VO_ERR_INPUT_BUFFER_SMALL. The input was finished or the input data was not enought. Continue to input
+ * data before next call.
+ */
+ VO_U32 (VO_API * GetOutputData) (VO_HANDLE hCodec, VO_CODECBUFFER * pOutBuffer, VO_AUDIO_OUTPUTINFO * pOutInfo);
+
+ /**
+ * Set the parameter for the specified param ID.
+ * \param hCodec [IN]] The codec handle which was created by Init function.
+ * \param uParamID [IN] The param ID.
+ * \param pData [IN] The param value.
+ * \retval VO_ERR_NONE Succeeded.
+ */
+ VO_U32 (VO_API * SetParam) (VO_HANDLE hCodec, VO_S32 uParamID, VO_PTR pData);
+
+ /**
+ * Get the parameter for the specified param ID.
+ * \param hCodec [IN]] The codec handle which was created by Init function.
+ * \param uParamID [IN] The param ID.
+ * \param pData [IN] The param value.
+ * \retval VO_ERR_NONE Succeeded.
+ */
+ VO_U32 (VO_API * GetParam) (VO_HANDLE hCodec, VO_S32 uParamID, VO_PTR pData);
+
+ /**
+ * Uninit the Codec.
+ * \param hCodec [IN]] The codec handle which was created by Init function.
+ * \retval VO_ERR_NONE Succeeded.
+ */
+ VO_U32 (VO_API * Uninit) (VO_HANDLE hCodec);
+} VO_AUDIO_CODECAPI;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif // __voAudio_H__
diff --git a/media/libstagefright/codecs/common/include/voIndex.h b/media/libstagefright/codecs/common/include/voIndex.h
new file mode 100644
index 0000000..541a0db
--- /dev/null
+++ b/media/libstagefright/codecs/common/include/voIndex.h
@@ -0,0 +1,193 @@
+/*
+ ** Copyright 2003-2010, VisualOn, Inc.
+ **
+ ** Licensed under the Apache License, Version 2.0 (the "License");
+ ** you may not use this file except in compliance with the License.
+ ** You may obtain a copy of the License at
+ **
+ ** http://www.apache.org/licenses/LICENSE-2.0
+ **
+ ** Unless required by applicable law or agreed to in writing, software
+ ** distributed under the License is distributed on an "AS IS" BASIS,
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ** See the License for the specific language governing permissions and
+ ** limitations under the License.
+ */
+/*******************************************************************************
+ File: voIndex.h
+
+ Content: module and ID definition
+
+*******************************************************************************/
+
+#ifndef __voIndex_H__
+#define __voIndex_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include "voType.h"
+
+/* Define the module ID */
+#define _MAKE_SOURCE_ID(id, name) \
+VO_INDEX_SRC_##name = _VO_INDEX_SOURCE | id,
+
+#define _MAKE_CODEC_ID(id, name) \
+VO_INDEX_DEC_##name = _VO_INDEX_DEC | id, \
+VO_INDEX_ENC_##name = _VO_INDEX_ENC | id,
+
+#define _MAKE_EFFECT_ID(id, name) \
+VO_INDEX_EFT_##name = _VO_INDEX_EFFECT | id,
+
+#define _MAKE_SINK_ID(id, name) \
+VO_INDEX_SNK_##name = _VO_INDEX_SINK | id,
+
+#define _MAKE_FILTER_ID(id, name) \
+VO_INDEX_FLT_##name = _VO_INDEX_FILTER | id,
+
+#define _MAKE_OMX_ID(id, name) \
+VO_INDEX_OMX_##name = _VO_INDEX_OMX | id,
+
+#define _MAKE_MFW_ID(id, name) \
+VO_INDEX_MFW_##name = _VO_INDEX_MFW | id,
+
+enum
+{
+ _VO_INDEX_SOURCE = 0x01000000,
+ _VO_INDEX_DEC = 0x02000000,
+ _VO_INDEX_ENC = 0x03000000,
+ _VO_INDEX_EFFECT = 0x04000000,
+ _VO_INDEX_SINK = 0x05000000,
+ _VO_INDEX_FILTER = 0x06000000,
+ _VO_INDEX_OMX = 0x07000000,
+ _VO_INDEX_MFW = 0x08000000,
+
+ // define file parser modules
+ _MAKE_SOURCE_ID (0x010000, MP4)
+ _MAKE_SOURCE_ID (0x020000, AVI)
+ _MAKE_SOURCE_ID (0x030000, ASF)
+ _MAKE_SOURCE_ID (0x040000, REAL)
+ _MAKE_SOURCE_ID (0x050000, AUDIO)
+ _MAKE_SOURCE_ID (0x060000, FLASH)
+ _MAKE_SOURCE_ID (0x070000, OGG)
+ _MAKE_SOURCE_ID (0x080000, MKV)
+
+ // define network source modules
+ _MAKE_SOURCE_ID (0x110000, RTSP)
+ _MAKE_SOURCE_ID (0x120000, HTTP)
+
+ // define CMMB source modules
+ _MAKE_SOURCE_ID (0x200000, CMMB)
+ _MAKE_SOURCE_ID (0x210000, CMMB_INNO)
+ _MAKE_SOURCE_ID (0x220000, CMMB_TELE)
+ _MAKE_SOURCE_ID (0x230000, CMMB_SIANO)
+
+ // define DVBT source modules
+ _MAKE_SOURCE_ID (0x300000, DVBT)
+ _MAKE_SOURCE_ID (0x310000, DVBT_DIBCOM)
+
+ // define other source modules
+ _MAKE_SOURCE_ID (0x400000, ID3)
+
+ // define video codec modules
+ _MAKE_CODEC_ID (0x010000, H264)
+ _MAKE_CODEC_ID (0x020000, MPEG4)
+ _MAKE_CODEC_ID (0x030000, H263)
+ _MAKE_CODEC_ID (0x040000, S263)
+ _MAKE_CODEC_ID (0x050000, RV)
+ _MAKE_CODEC_ID (0x060000, WMV)
+ _MAKE_CODEC_ID (0x070000, DIVX3)
+ _MAKE_CODEC_ID (0x080000, MJPEG)
+ _MAKE_CODEC_ID (0x090000, MPEG2)
+ _MAKE_CODEC_ID (0x0A0000, VP6)
+
+ // define audio codec modules
+ _MAKE_CODEC_ID (0x210000, AAC)
+ _MAKE_CODEC_ID (0x220000, MP3)
+ _MAKE_CODEC_ID (0x230000, WMA)
+ _MAKE_CODEC_ID (0x240000, RA)
+ _MAKE_CODEC_ID (0x250000, AMRNB)
+ _MAKE_CODEC_ID (0x260000, AMRWB)
+ _MAKE_CODEC_ID (0x270000, AMRWBP)
+ _MAKE_CODEC_ID (0x280000, QCELP)
+ _MAKE_CODEC_ID (0x290000, EVRC)
+ _MAKE_CODEC_ID (0x2A0000, ADPCM)
+ _MAKE_CODEC_ID (0x2B0000, MIDI)
+ _MAKE_CODEC_ID (0x2C0000, AC3)
+ _MAKE_CODEC_ID (0x2D0000, FLAC)
+ _MAKE_CODEC_ID (0x2E0000, DRA)
+ _MAKE_CODEC_ID (0x2F0000, OGG)
+ _MAKE_CODEC_ID (0x300000, G729)
+
+ // define image codec modules
+ _MAKE_CODEC_ID (0x410000, JPEG)
+ _MAKE_CODEC_ID (0x420000, GIF)
+ _MAKE_CODEC_ID (0x430000, PNG)
+ _MAKE_CODEC_ID (0x440000, TIF)
+
+ // define effect modules
+ _MAKE_EFFECT_ID (0x010000, EQ)
+
+ // define sink modules
+ _MAKE_SINK_ID (0x010000, VIDEO)
+ _MAKE_SINK_ID (0x020000, AUDIO)
+ _MAKE_SINK_ID (0x030000, CCRRR)
+ _MAKE_SINK_ID (0x040000, CCRRV)
+
+ _MAKE_SINK_ID (0x110000, MP4)
+ _MAKE_SINK_ID (0x120000, AVI)
+ _MAKE_SINK_ID (0x130000, AFW)
+
+ // define media frame module ID
+ _MAKE_MFW_ID (0x010000, VOMMPLAY)
+ _MAKE_MFW_ID (0x020000, VOMMREC)
+ _MAKE_MFW_ID (0x030000, VOME)
+};
+
+
+/* define the error ID */
+#define VO_ERR_NONE 0x00000000
+#define VO_ERR_FINISH 0x00000001
+#define VO_ERR_BASE 0X80000000
+#define VO_ERR_FAILED 0x80000001
+#define VO_ERR_OUTOF_MEMORY 0x80000002
+#define VO_ERR_NOT_IMPLEMENT 0x80000003
+#define VO_ERR_INVALID_ARG 0x80000004
+#define VO_ERR_INPUT_BUFFER_SMALL 0x80000005
+#define VO_ERR_OUTPUT_BUFFER_SMALL 0x80000006
+#define VO_ERR_WRONG_STATUS 0x80000007
+#define VO_ERR_WRONG_PARAM_ID 0x80000008
+#define VO_ERR_LICENSE_ERROR 0x80000009
+
+/* xxx is the module ID
+#define VO_ERR_FAILED 0x8xxx0001
+#define VO_ERR_OUTOF_MEMORY 0x8xxx0002
+#define VO_ERR_NOT_IMPLEMENT 0x8xxx0003
+#define VO_ERR_INVALID_ARG 0x8xxx0004
+#define VO_ERR_INPUT_BUFFER_SMALL 0x8xxx0005
+#define VO_ERR_OUTPUT_BUFFER_SMALL 0x8xxx0006
+#define VO_ERR_WRONG_STATUS 0x8xxx0007
+#define VO_ERR_WRONG_PARAM_ID 0x8xxx0008
+#define VO_ERR_LICENSE_ERROR 0x8xxx0009
+// Module own error ID
+#define VO_ERR_Module 0x8xxx0X00
+*/
+
+#define VO_PID_COMMON_BASE 0x40000000 /*!< The base of common param ID */
+#define VO_PID_COMMON_QUERYMEM (VO_PID_COMMON_BASE | 0X0001) /*!< Query the memory needed; Reserved. */
+#define VO_PID_COMMON_INPUTTYPE (VO_PID_COMMON_BASE | 0X0002) /*!< Set or get the input buffer type. VO_INPUT_TYPE */
+#define VO_PID_COMMON_HASRESOURCE (VO_PID_COMMON_BASE | 0X0003) /*!< Query it has resource to be used. VO_U32 *, 1 have, 0 No */
+#define VO_PID_COMMON_HEADDATA (VO_PID_COMMON_BASE | 0X0004) /*!< Decoder track header data. VO_CODECBUFFER * */
+#define VO_PID_COMMON_FLUSH (VO_PID_COMMON_BASE | 0X0005) /*!< Flush the codec buffer. VO_U32 *, 1 Flush, 0 No * */
+
+/*
+// Module Param ID
+#define VO_ID_Mdoule 0x0xxx1000
+*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif // __voIndex_H__
diff --git a/media/libstagefright/codecs/common/include/voMem.h b/media/libstagefright/codecs/common/include/voMem.h
new file mode 100644
index 0000000..8dfb634
--- /dev/null
+++ b/media/libstagefright/codecs/common/include/voMem.h
@@ -0,0 +1,65 @@
+/*
+ ** Copyright 2003-2010, VisualOn, Inc.
+ **
+ ** Licensed under the Apache License, Version 2.0 (the "License");
+ ** you may not use this file except in compliance with the License.
+ ** You may obtain a copy of the License at
+ **
+ ** http://www.apache.org/licenses/LICENSE-2.0
+ **
+ ** Unless required by applicable law or agreed to in writing, software
+ ** distributed under the License is distributed on an "AS IS" BASIS,
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ** See the License for the specific language governing permissions and
+ ** limitations under the License.
+ */
+/*******************************************************************************
+ File: voMem.h
+
+ Content: memory functions & data structures
+
+*******************************************************************************/
+
+#ifndef __voMem_H__
+#define __voMem_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include "voIndex.h"
+
+typedef struct
+{
+ VO_S32 Size; /*!< Buffer stride */
+ VO_S32 Flag;
+ VO_PTR VBuffer; /*!< user data pointer */
+ VO_PTR PBuffer; /*!< user data pointer */
+}
+VO_MEM_INFO;
+
+typedef struct VO_MEM_OPERATOR
+{
+ VO_U32 (VO_API * Alloc) (VO_S32 uID, VO_MEM_INFO * pMemInfo);
+ VO_U32 (VO_API * Free) (VO_S32 uID, VO_PTR pBuff);
+ VO_U32 (VO_API * Set) (VO_S32 uID, VO_PTR pBuff, VO_U8 uValue, VO_U32 uSize);
+ VO_U32 (VO_API * Copy) (VO_S32 uID, VO_PTR pDest, VO_PTR pSource, VO_U32 uSize);
+ VO_U32 (VO_API * Check) (VO_S32 uID, VO_PTR pBuffer, VO_U32 uSize);
+ VO_S32 (VO_API * Compare) (VO_S32 uID, VO_PTR pBuffer1, VO_PTR pBuffer2, VO_U32 uSize);
+ VO_U32 (VO_API * Move) (VO_S32 uID, VO_PTR pDest, VO_PTR pSource, VO_U32 uSize);
+} VO_MEM_OPERATOR;
+
+#define voMemAlloc(pBuff, pMemOP, ID, nSize) \
+{ \
+ VO_MEM_INFO voMemInfo; \
+ voMemInfo.Size=nSize; \
+ pMemOP->Alloc(ID, &voMemInfo); \
+ pBuff=(VO_PBYTE)voMemInfo.VBuffer; \
+}
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif // __voMem_H__
diff --git a/media/libstagefright/codecs/common/include/voType.h b/media/libstagefright/codecs/common/include/voType.h
new file mode 100644
index 0000000..2669134
--- /dev/null
+++ b/media/libstagefright/codecs/common/include/voType.h
@@ -0,0 +1,221 @@
+/*
+ ** Copyright 2003-2010, VisualOn, Inc.
+ **
+ ** Licensed under the Apache License, Version 2.0 (the "License");
+ ** you may not use this file except in compliance with the License.
+ ** You may obtain a copy of the License at
+ **
+ ** http://www.apache.org/licenses/LICENSE-2.0
+ **
+ ** Unless required by applicable law or agreed to in writing, software
+ ** distributed under the License is distributed on an "AS IS" BASIS,
+ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ** See the License for the specific language governing permissions and
+ ** limitations under the License.
+ */
+/*******************************************************************************
+ File: voType.h
+
+ Content: data type definition
+
+*******************************************************************************/
+#ifndef __voType_H__
+#define __voType_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#ifdef _WIN32
+# define VO_API __cdecl
+# define VO_CBI __stdcall
+#else
+# define VO_API
+# define VO_CBI
+#endif //_WIN32
+
+/** VO_IN is used to identify inputs to an VO function. This designation
+ will also be used in the case of a pointer that points to a parameter
+ that is used as an output. */
+#ifndef VO_IN
+#define VO_IN
+#endif
+
+/** VO_OUT is used to identify outputs from an VO function. This
+ designation will also be used in the case of a pointer that points
+ to a parameter that is used as an input. */
+#ifndef VO_OUT
+#define VO_OUT
+#endif
+
+/** VO_INOUT is used to identify parameters that may be either inputs or
+ outputs from an VO function at the same time. This designation will
+ also be used in the case of a pointer that points to a parameter that
+ is used both as an input and an output. */
+#ifndef VO_INOUT
+#define VO_INOUT
+#endif
+
+#define VO_MAX_ENUM_VALUE 0X7FFFFFFF
+
+/** VO_VOID */
+typedef void VO_VOID;
+
+/** VO_U8 is an 8 bit unsigned quantity that is byte aligned */
+typedef unsigned char VO_U8;
+
+/** VO_BYTE is an 8 bit unsigned quantity that is byte aligned */
+typedef unsigned char VO_BYTE;
+
+/** VO_S8 is an 8 bit signed quantity that is byte aligned */
+typedef signed char VO_S8;
+
+/** VO_CHAR is an 8 bit signed quantity that is byte aligned */
+typedef char VO_CHAR;
+
+/** VO_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */
+typedef unsigned short VO_U16;
+
+/** VO_WCHAR is a 16 bit unsigned quantity that is 16 bit word aligned */
+#if defined _WIN32
+typedef unsigned short VO_WCHAR;
+typedef unsigned short* VO_PWCHAR;
+#elif defined LINUX
+typedef unsigned char VO_WCHAR;
+typedef unsigned char* VO_PWCHAR;
+#endif
+
+/** VO_S16 is a 16 bit signed quantity that is 16 bit word aligned */
+typedef signed short VO_S16;
+
+/** VO_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */
+typedef unsigned long VO_U32;
+
+/** VO_S32 is a 32 bit signed quantity that is 32 bit word aligned */
+typedef signed long VO_S32;
+
+/* Users with compilers that cannot accept the "long long" designation should
+ define the VO_SKIP64BIT macro. It should be noted that this may cause
+ some components to fail to compile if the component was written to require
+ 64 bit integral types. However, these components would NOT compile anyway
+ since the compiler does not support the way the component was written.
+*/
+#ifndef VO_SKIP64BIT
+#ifdef _WIN32
+/** VO_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
+typedef unsigned __int64 VO_U64;
+/** VO_S64 is a 64 bit signed quantity that is 64 bit word aligned */
+typedef signed __int64 VO_S64;
+#else // WIN32
+/** VO_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
+typedef unsigned long long VO_U64;
+/** VO_S64 is a 64 bit signed quantity that is 64 bit word aligned */
+typedef signed long long VO_S64;
+#endif // WIN32
+#endif // VO_SKIP64BIT
+
+/** The VO_BOOL type is intended to be used to represent a true or a false
+ value when passing parameters to and from the VO core and components. The
+ VO_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary.
+ */
+typedef enum VO_BOOL {
+ VO_FALSE = 0,
+ VO_TRUE = !VO_FALSE,
+ VO_BOOL_MAX = VO_MAX_ENUM_VALUE
+} VO_BOOL;
+
+/** The VO_PTR type is intended to be used to pass pointers between the VO
+ applications and the VO Core and components. This is a 32 bit pointer and
+ is aligned on a 32 bit boundary.
+ */
+typedef void* VO_PTR;
+
+/** The VO_HANDLE type is intended to be used to pass pointers between the VO
+ applications and the VO Core and components. This is a 32 bit pointer and
+ is aligned on a 32 bit boundary.
+ */
+typedef void* VO_HANDLE;
+
+/** The VO_STRING type is intended to be used to pass "C" type strings between
+ the application and the core and component. The VO_STRING type is a 32
+ bit pointer to a zero terminated string. The pointer is word aligned and
+ the string is byte aligned.
+ */
+typedef char* VO_PCHAR;
+
+/** The VO_PBYTE type is intended to be used to pass arrays of bytes such as
+ buffers between the application and the component and core. The VO_PBYTE
+ type is a 32 bit pointer to a zero terminated string. The pointer is word
+ aligned and the string is byte aligned.
+ */
+typedef unsigned char* VO_PBYTE;
+
+/** The VO_PTCHAR type is intended to be used to pass arrays of wchar such as
+ unicode char between the application and the component and core. The VO_PTCHAR
+ type is a 32 bit pointer to a zero terminated string. The pointer is word
+ aligned and the string is byte aligned.
+ */
+/*
+#if !defined LINUX
+typedef unsigned short* VO_PTCHAR;
+typedef unsigned short* VO_TCHAR;
+#else
+typedef char* VO_PTCHAR;
+typedef char VO_TCHAR;
+#endif
+*/
+
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif
+
+/**
+ * Input stream format, Frame or Stream..
+ */
+typedef enum {
+ VO_INPUT_FRAME = 1, /*!< Input contains completely frame(s) data. */
+ VO_INPUT_STREAM, /*!< Input is stream data. */
+ VO_INPUT_STREAM_MAX = VO_MAX_ENUM_VALUE
+} VO_INPUT_TYPE;
+
+
+/**
+ * General data buffer, used as input or output.
+ */
+typedef struct {
+ VO_PBYTE Buffer; /*!< Buffer pointer */
+ VO_U32 Length; /*!< Buffer size in byte */
+ VO_S64 Time; /*!< The time of the buffer */
+} VO_CODECBUFFER;
+
+
+/**
+ * The init memdata flag.
+ */
+typedef enum{
+ VO_IMF_USERMEMOPERATOR =0, /*!< memData is the pointer of memoperator function*/
+ VO_IMF_PREALLOCATEDBUFFER =1, /*!< memData is preallocated memory*/
+ VO_IMF_MAX = VO_MAX_ENUM_VALUE
+}VO_INIT_MEM_FlAG;
+
+
+/**
+ * The init memory structure..
+ */
+typedef struct{
+ VO_INIT_MEM_FlAG memflag; /*!<memory flag */
+ VO_PTR memData; /*!<a pointer to VO_MEM_OPERATOR or a preallocated buffer */
+ VO_U32 reserved1; /*!<reserved */
+ VO_U32 reserved2; /*!<reserved */
+}VO_CODEC_INIT_USERDATA;
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif // __voType_H__