#define __GST_MARU_H__
#include <stdint.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
G_BEGIN_DECLS
+extern int device_version;
+
enum codec_log_level {
ERR,
WARN,
};
#define CODEC_DEV "/dev/brillcodec"
-#define CODEC_VER 1
+#define CODEC_VER 3
+
+#define CHECK_VERSION(version) (device_version >= version)
#define CODEC_LOG(level, fmt, ...) \
do { \
#define ROUND_UP_8(x) ROUND_UP_X(x, 3)
#define DIV_ROUND_UP_X(v, x) (((v) + GEN_MASK(x)) >> (x))
-typedef struct _CodecIOParams {
- int32_t api_index;
- int32_t ctx_index;
- uint32_t mem_offset;
-} CodecIOParams;
-
-typedef struct _CodecDeviceMem {
- uint32_t index;
- uint32_t offset;
-} CodecDeviceMem;
+static inline bool can_use_new_decode_api(void) {
+ if (CHECK_VERSION(3)) {
+ return true;
+ }
+ return false;
+}
typedef struct _CodecDevice {
int fd;
uint8_t *buf;
uint32_t buf_size;
- CodecDeviceMem mem_info;
} CodecDevice;
typedef struct _CodecElement {
int32_t channels, sample_rate;
int32_t block_align, depth;
int32_t sample_fmt, frame_size;
- int32_t bits_per_sample_fmt;
+ int32_t bits_per_sample_fmt, reserved;
int64_t channel_layout;
} AudioData;
CODEC_PICTURE_COPY,
CODEC_DEINIT,
CODEC_FLUSH_BUFFERS,
+ CODEC_DECODE_VIDEO2,
};
enum CODEC_IO_CMD {
CODEC_TYPE_ENCODE,
};
-enum SAMPLT_FORMAT {
+enum AUDIO_SAMPLE_FORMAT {
SAMPLE_FMT_NONE = -1,
SAMPLE_FMT_U8,
SAMPLE_FMT_S16,
SAMPLE_FMT_S32,
SAMPLE_FMT_FLT,
SAMPLE_FMT_DBL,
+
+ SAMPLE_FMT_U8P,
+ SAMPLE_FMT_S16P,
+ SAMPLE_FMT_S32P,
+ SAMPLE_FMT_FLTP,
+ SAMPLE_FMT_DBLP,
SAMPLE_FMT_NB
};