-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMP4WriterInter.cpp
43 lines (33 loc) · 953 Bytes
/
MP4WriterInter.cpp
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
#include "MP4WriterInter.h"
AFMP4Handle MP4WriterInit()
{
MP4Writer *pCMP4Writer = new MP4Writer();
return (AFMP4Handle)pCMP4Writer;
}
int MP4WriterExit(AFMP4Handle hMP4File)
{
MP4Writer *pCMP4Writer = (MP4Writer *)hMP4File;
if (pCMP4Writer)
{
delete pCMP4Writer;
pCMP4Writer = NULL;
}
return 0;
}
int MP4WriterCreateFile(AFMP4Handle hMP4File, char *strName, MP4_ENC_TYPE nEncType, int nWidth, int nHeight, int nFps)
{
MP4Writer *pCMP4Writer = (MP4Writer *)hMP4File;
int ret = pCMP4Writer->Create(strName);
if(!ret) pCMP4Writer->AddVideoTrack(nEncType, nWidth, nHeight, nFps);
return ret;
}
int MP4WriterSaveFile(AFMP4Handle hMP4File)
{
MP4Writer *pCMP4Writer = (MP4Writer *)hMP4File;
return pCMP4Writer->Save();
}
int MP4WriterWriteFile(AFMP4Handle hMP4File, unsigned char *pData, int nSize, uint64_t nTimeStamp)
{
MP4Writer *pCMP4Writer = (MP4Writer *)hMP4File;
return pCMP4Writer->WriteVideo(pData, nSize, nTimeStamp);
}