mtc_media.h
6.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/************************************************************************
Copyright (c) 2005-2011 by Juphoon System Software, Inc.
All rights reserved.
This software is confidential and proprietary to Juphoon System,
Inc. No part of this software may be reproduced, stored, transmitted,
disclosed or used in any form or by any means other than as expressly
provided by the written license agreement between Juphoon and its
licensee.
THIS SOFTWARE IS PROVIDED BY JUPHOON "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL JUPHOON BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Juphoon System Software, Inc.
Email: support@juphoon.com
Web: http://www.juphoon.com
************************************************************************/
/*************************************************
File name : mtc_media.h
Module : multimedia talk client
Author : tanek.ye
Created on : 2011-05-06
Description :
Marcos and structure definitions required by the mtc media.
Modify History:
1. Date: Author: Modification:
*************************************************/
#ifndef _MTC_MEDIA_H__
#define _MTC_MEDIA_H__
/**
* @file mtc_media.h
* @brief MTC Media Interface Functions
*/
/** @brief Type of MTC media file type. */
typedef enum EN_MTC_MFILE_TYPE
{
EN_MTC_MFILE_UNKNOW, /**< @brief Unknow file type. */
EN_MTC_MFILE_PCM, /**< @brief PCM file. */
EN_MTC_MFILE_WAV, /**< @brief WAV file. */
EN_MTC_MFILE_WAV_PCM, /**< @brief WAV file with codec of PCM. */
EN_MTC_MFILE_WAV_PCMU, /**< @brief WAV file with codec of PCMU. */
EN_MTC_MFILE_WAV_PCMA, /**< @brief WAV file with codec of PCMA. */
EN_MTC_MFILE_ILBC, /**< @brief WAV file with codec of iLBC. */
EN_MTC_MFILE_AMR, /**< @brief WAV file with codec of AMR. */
EN_MTC_MFILE_AVI, /**< @brief AVI file. */
EN_MTC_MFILE_AVI_VP8, /**< @brief AVI file with codec of VP8. */
EN_MTC_MFILE_AVI_I420, /**< @brief AVI file with codec of I420. */
EN_MTC_MFILE_AVI_H264, /**< @brief AVI file with codec of H264. */
EN_MTC_MFILE_MP4_H264, /**< @brief MP4 file with codec of H264 and AAC */
} EN_MTC_MFILE_TYPE;
/** @brief Type of MTC adaptive negotiation bitrate mode type. */
typedef enum EN_MTC_AN_MODE
{
EN_MTC_AN_UNKNOW, /**< @brief Invalid mode type. */
EN_MTC_AN_LOW, /**< @brief Low bitrate mode. */
EN_MTC_AN_MID, /**< @brief Middle bitrate mode. */
EN_MTC_AN_HIGH, /**< @brief High bitrate mode. */
} EN_MTC_AN_MODE;
/** @brief Display mode */
typedef enum EN_MTC_DISPLAY_MODE
{
EN_MTC_DISPLAY_FULL_CONTENT, /**< @brief Scale size to fit display
area with ratio unchanged. */
EN_MTC_DISPLAY_FULL_SCREEN /**< @brief Scale size to fullfill display
area with ratio unchanged. */
} EN_MTC_DISPLAY_MODE;
/** @brief Rectangle */
typedef struct tagMTC_RECT
{
int iX; /**< @brief Specifies the x-coordinate of
the upper-left corner of a rectangle. */
int iY; /**< @brief Specifies the y-coordinate of
the upper-left corner of a rectangle. */
int iWidth; /**< @brief Specifies the width of a rectangle. */
int iHeight; /**< @brief Specifies the height of a rectangle. */
} ST_MTC_RECT;
/** @brief MTC video record option */
typedef enum EN_MTC_VIDEO_RECORD_OPTION
{
/** @brief Do not record audio. */
EN_MTC_VIDEO_RECORD_WITHOUT_AUDIO,
/** @brief Record audio which matchs video. */
EN_MTC_VIDEO_RECORD_MATCH_VIDEO,
/** @brief Record microphone. */
EN_MTC_VIDEO_RECORD_MICROPHONE,
/** @brief Record speaker. */
EN_MTC_VIDEO_RECORD_SPEAKER,
/** @brief Record both microphone and speaker. */
EN_MTC_VIDEO_RECORD_BOTH,
} EN_MTC_VIDEO_RECORD_OPTION;
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Convert wav file to amr file.
*
* @param [in] pcInFile Input wav file name.
* @param [in] pcOutFile Output amr file name.
*
* @retval ZOK on successfully.
* @retval ZFAILED on failed.
*
* @see
*/
MTCFUNC ZINT Mtc_MediaFileWavToAmr(ZCHAR *pcInFile, ZCHAR *pcOutFile);
/**
* @brief Convert amr file to wav file.
*
* @param [in] pcInFile Input amr file name.
* @param [in] pcOutFile Output wav file name.
*
* @retval ZOK on successfully.
* @retval ZFAILED on failed.
*
* @see
*/
MTCFUNC ZINT Mtc_MediaFileAmrToWav(ZCHAR *pcInFile, ZCHAR *pcOutFile);
/**
* @brief Start record capture to file.
*
* @param [in] pcFileName The output file path.
* @param [in] pcCameraId The camera ID.
* @param [in] iWidth Video width in pixels.
* @param [in] iHeight Video height in pixels.
* @param [in] pData Pointer to the buffer of image RGBA8 data for blend, maybe ZNULL.
* @param [in] iDataSize The buffer size in bytes, must be iWidth * iHeight * 4.
* @param [in] iOption @ref EN_MTC_VIDEO_RECORD_OPTION.
*
* @retval ZOK on successfully.
* @retval ZFAILED on failed.
*
* @see Mtc_MediaFileRecSetCamera, Mtc_MediaFileStopRecord
*/
MTCFUNC ZINT Mtc_MediaFileRecordVideo(ZCONST ZCHAR *pcFileName,
ZCONST ZCHAR *pcCameraId, ZUINT iWidth, ZUINT iHeight,
ZVOID *pData, ZUINT iDataSize, ZUINT iOption);
/**
* @brief Set record camera id.
*
* @param [in] pcCameraId camera id.
*
* @see Mtc_MediaFileStopRecord
*/
MTCFUNC ZVOID Mtc_MediaFileSetCamera(ZCONST ZCHAR *pcCameraId);
/**
* @brief Stop record file
*/
MTCFUNC ZVOID Mtc_MediaFileStopRecord(ZFUNC_VOID);
/**
* @brief Recovery MP4 file in specific directory.
*
* @param [in] pcDir The file directory.
*
* @retval ZOK on successfully.
* @retval ZFAILED on failed.
*/
MTCFUNC ZINT Mtc_MediaFileRecovery(ZCONST ZCHAR *pcDir);
#ifdef __cplusplus
}
#endif
#endif