exhale/include/exhaleDecl.h

69 lines
2.1 KiB
C
Raw Permalink Normal View History

2020-01-24 21:00:38 +01:00
/* exhaleDecl.h - header file with declarations for exhale DLL ex-/import under Windows
* written by C. R. Helmrich, last modified in 2020 - see License.htm for legal notices
2020-01-02 02:05:09 +01:00
*
2020-10-23 10:00:00 +02:00
* The copyright in this software is being made available under the exhale Copyright License
2020-01-02 02:05:09 +01:00
* and comes with ABSOLUTELY NO WARRANTY. This software may be subject to other third-
* party rights, including patent rights. No such rights are granted under this License.
*
2021-08-30 09:00:00 +02:00
* Copyright (c) 2018-2021 Christian R. Helmrich, project ecodis. All rights reserved.
2020-01-02 02:05:09 +01:00
*/
#ifndef _EXHALE_DECL_H_
#define _EXHALE_DECL_H_
2020-06-22 21:00:11 +02:00
#include <stdint.h> /* for (u)int8_t, (u)int16_t, (u)int32_t, (u)int64_t */
2022-06-20 20:00:10 +02:00
#if !defined(_MSC_VER) || _MSC_VER >= 1800
2022-06-17 20:00:24 +02:00
#include <stdbool.h>
2022-06-20 20:00:10 +02:00
#endif
2020-01-26 16:00:49 +01:00
#if defined (_WIN32) || defined (WIN32) || defined (_WIN64) || defined (WIN64)
# ifdef EXHALE_DYN_LINK
# define EXHALE_DECL __declspec (dllexport)
# else
# define EXHALE_DECL __declspec (dllimport)
# endif
#else
# define EXHALE_DECL
#endif
2020-06-22 21:00:11 +02:00
#ifdef __cplusplus
2020-01-26 16:00:49 +01:00
struct ExhaleEncAPI
{
2020-06-22 21:00:11 +02:00
/* initializer */
2020-01-26 16:00:49 +01:00
virtual unsigned initEncoder (unsigned char* const audioConfigBuffer, uint32_t* const audioConfigBytes = nullptr) = 0;
2020-06-22 21:00:11 +02:00
/* lookahead encoder */
2020-01-26 16:00:49 +01:00
virtual unsigned encodeLookahead () = 0;
2020-06-22 21:00:11 +02:00
/* frame encoder */
2020-01-26 16:00:49 +01:00
virtual unsigned encodeFrame () = 0;
2020-06-22 21:00:11 +02:00
/* destructor */
2020-01-26 20:00:25 +01:00
virtual ~ExhaleEncAPI () { }
2020-01-26 16:00:49 +01:00
};
2020-06-22 21:00:11 +02:00
extern "C"
{
#else /* C, not C++ */
struct ExhaleEncAPI; /* opaque type */
typedef struct ExhaleEncAPI ExhaleEncAPI;
#endif
/* C constructor */
EXHALE_DECL ExhaleEncAPI* exhaleCreate (int32_t* const, unsigned char* const, const unsigned, const unsigned,
const unsigned, const unsigned, const unsigned, const bool, const bool);
/* C destructor */
EXHALE_DECL unsigned exhaleDelete (ExhaleEncAPI*);
2020-01-26 16:00:49 +01:00
2020-06-22 21:00:11 +02:00
/* C initializer */
EXHALE_DECL unsigned exhaleInitEncoder (ExhaleEncAPI*, unsigned char* const, uint32_t* const);
2020-01-26 16:00:49 +01:00
2020-06-22 21:00:11 +02:00
/* C lookahead encoder */
EXHALE_DECL unsigned exhaleEncodeLookahead (ExhaleEncAPI*);
2020-01-26 16:00:49 +01:00
2020-06-22 21:00:11 +02:00
/* C frame encoder */
EXHALE_DECL unsigned exhaleEncodeFrame (ExhaleEncAPI*);
#ifdef __cplusplus
} /* extern "C" */
#endif
2020-01-02 02:05:09 +01:00
2020-06-22 21:00:11 +02:00
#endif /* _EXHALE_DECL_H_ */