44 lines
1.3 KiB
C
44 lines
1.3 KiB
C
#ifndef _ENCRYPT_H
|
|
#define _ENCRYPT_H
|
|
|
|
#include "common.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef void *enc_media;
|
|
|
|
typedef struct
|
|
{
|
|
/// alloc new packet
|
|
/// @param[in] param user-defined parameter(by enc_media_create)
|
|
/// @param[in] bytes alloc memory size in byte
|
|
/// @return memory pointer
|
|
void* (API_CALL *alloc)(void* param, size_t bytes);
|
|
|
|
/// free packet
|
|
/// @param[in] param user-defined parameter(by enc_media_create)
|
|
/// @param[in] packet frame packet pointer(alloc return pointer)
|
|
void (API_CALL *free)(void* param, void* packet);
|
|
|
|
/// callback on PS packet done
|
|
/// @param[in] param user-defined parameter(by enc_media_create)
|
|
/// @param[in] packet frame packet pointer(alloc return pointer)
|
|
/// @param[in] bytes packet size
|
|
/// @param[in] timestamp packet timestamp
|
|
/// @param[in] frametype packet type
|
|
void (API_CALL *write)(void* param, void* packet, size_t bytes,uint64_t timestamp,uint8_t frametype);
|
|
}enc_media_func_t;
|
|
|
|
API_EXPORT enc_media API_CALL enc_media_create(enc_media_func_t * func, void * param) ;
|
|
|
|
API_EXPORT int API_CALL enc_media_decoded(enc_media ctx,uint8_t* frame,size_t len,uint64_t timestamp, uint8_t frame_type,uint8_t prefix);
|
|
|
|
API_EXPORT void API_CALL enc_media_release(enc_media ctx);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _DECRYPT_H */ |