forked from EasyDarwin/EasyAACEncoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEasyAACEncoderAPI.cpp
More file actions
47 lines (41 loc) · 1.08 KB
/
Copy pathEasyAACEncoderAPI.cpp
File metadata and controls
47 lines (41 loc) · 1.08 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
/*
Copyright (c) 2013-2015 EasyDarwin.ORG. All rights reserved.
Github: https://github.com/EasyDarwin
WEChat: EasyDarwin
Website: http://www.easydarwin.org
*/
/*
* File: libEasyAACEncoder.cpp
* Author: Wellsen
*
* Created on 2015年4月11日, 上午10:57
*/
#include "EasyAACEncoderAPI.h"
#include "EasyAACEncoder.h"
#include "condef.h"
Easy_API EasyAACEncoder_Handle Easy_APICALL Easy_AACEncoder_Init(InitParam initPar)
{
G7ToAac *encoder = new G7ToAac();
InAudioInfo info(initPar );
bool ret = encoder->init(info);
if (!ret)
{
SAFE_DELETE_OBJ(encoder);
}
return encoder;
}
Easy_API int Easy_APICALL Easy_AACEncoder_Encode(EasyAACEncoder_Handle handle, unsigned char* inbuf, unsigned int inlen, unsigned char* outbuf, unsigned int* outlen)
{
if(handle == NULL)
{
return -1;
}
return ((G7ToAac*)handle)->aac_encode(inbuf, inlen, outbuf, outlen);
}
Easy_API void Easy_APICALL Easy_AACEncoder_Release(EasyAACEncoder_Handle handle)
{
if(handle != NULL)
{
delete ((G7ToAac*)handle);
}
}