Seperate decode and picture_copy if no pix_fmt is specified
[platform/adaptation/emulator/gst-plugins-emulator.git] / src / gstmaru.h
index 8827f4e..caaf02d 100644 (file)
@@ -32,6 +32,7 @@
 #define __GST_MARU_H__
 
 #include <stdint.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -48,6 +49,8 @@ GST_DEBUG_CATEGORY_EXTERN (maru_debug);
 
 G_BEGIN_DECLS
 
+extern int device_version;
+
 enum codec_log_level {
   ERR,
   WARN,
@@ -56,7 +59,9 @@ enum codec_log_level {
 };
 
 #define CODEC_DEV   "/dev/brillcodec"
-#define CODEC_VER   2
+#define CODEC_VER   3
+
+#define CHECK_VERSION(version)        (device_version >= version)
 
 #define CODEC_LOG(level, fmt, ...) \
   do { \
@@ -75,22 +80,17 @@ enum codec_log_level {
 #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 {
@@ -116,7 +116,7 @@ typedef struct _AudioData {
   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;
 
@@ -143,6 +143,7 @@ enum CODEC_FUNC_TYPE {
   CODEC_PICTURE_COPY,
   CODEC_DEINIT,
   CODEC_FLUSH_BUFFERS,
+  CODEC_DECODE_VIDEO2,
 };
 
 enum CODEC_IO_CMD {
@@ -169,13 +170,19 @@ enum CODEC_TYPE {
   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
 };