This commit is contained in:
刘可亮
2024-10-30 16:50:31 +08:00
parent 0ef85b55da
commit 661e71562d
458 changed files with 46555 additions and 12133 deletions

View File

@@ -0,0 +1,33 @@
/*
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
* Author: <che.jiang@artinchip.com>
* Desc: mpp ringbuf interface
*/
#ifndef MPP_RINGBUF_H
#define MPP_RINGBUF_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef void *mpp_ringbuf_t;
mpp_ringbuf_t mpp_ringbuffer_create(int length);
void mpp_ringbuffer_destroy(mpp_ringbuf_t rb);
void mpp_ringbuffer_reset(mpp_ringbuf_t rb);
int mpp_ringbuffer_put(mpp_ringbuf_t rb, const unsigned char *ptr, int length);
int mpp_ringbuffer_get(mpp_ringbuf_t rb, unsigned char *ptr, int length);
int mpp_ringbuffer_data_len(mpp_ringbuf_t rb);
int mpp_ringbuffer_space_len(mpp_ringbuf_t rb);
#ifdef __cplusplus
}
#endif
#endif /* MPP_RINGBUF_H */

View File

@@ -0,0 +1,36 @@
/*
* Copyright (c) 2022-2024, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
* Author: <che.jiang@artinchip.com>
* Desc: mpp thread interface
*/
#ifndef MPP_THREAD_H
#define MPP_THREAD_H
#include <stdint.h>
#include <inttypes.h>
#include "mpp_types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MPP_WAIT_FOREVER (-1)
typedef void *mpp_sem_t;
mpp_sem_t mpp_sem_create();
void mpp_sem_delete(mpp_sem_t sem);
int mpp_sem_signal(mpp_sem_t sem);
int mpp_sem_wait(mpp_sem_t sem, int64_t us);
#ifdef __cplusplus
}
#endif
#endif /* MPP_THREAD_H */