// SPDX-License-Identifier: GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later

#ifndef _MVB_FORMAT_UTILS_H_
#define _MVB_FORMAT_UTILS_H_

#include "mvb_heap.h"

#define MVB_FRAME_PLANE_NUM_MAX 8

#define MVB_ENCODED_BUFFER_SIZE_2M  2097152
#define MVB_ENCODED_BUFFER_SIZE_4M  4194304
#define MVB_ENCODED_LIMIT_SIZE_HD   2073600

struct mvb_frame_t;

enum mvb_format_e {
  MVB_FORMAT_YUYV,

  MVB_FORMAT_NV12,
  MVB_FORMAT_YUV420,
  MVB_FORMAT_RGB,
  MVB_FORMAT_RGBA,
  MVB_FORMAT_BGRA,
  MVB_FORMAT_M21S,
  MVB_FORMAT_M2CS,
  MVB_FORMAT_MTST,
  MVB_FORMAT_MCST,
  MVB_FORMAT_MTSR,
  MVB_FORMAT_MCSR,

  MVB_FORMAT_NV12M,
  MVB_FORMAT_YUV420M,
  MVB_FORMAT_MM21,
  MVB_FORMAT_MFCS,
  MVB_FORMAT_MFST,
  MVB_FORMAT_MTSP,
  MVB_FORMAT_ENCODED,
};

struct mvb_frame_t*
mvb_format_utils_alloc_frame (struct mvb_heap_t* p_mvb_heap, int width, int height,
    enum mvb_format_e mvb_format, uint32_t mvb_flag);

void
mvb_format_utils_free_frame (struct mvb_frame_t* mvb_frame);

int
mvb_format_utils_frame_get_plane_fd (struct mvb_frame_t* frame, int plane_index);

int
mvb_format_utils_frame_get_plane_size (struct mvb_frame_t* frame, int plane_index);

int
mvb_format_utils_frame_get_plane_num (struct mvb_frame_t* frame);

uint32_t
mvb_format_utils_frame_get_flag (struct mvb_frame_t* frame);

int
mvb_format_utils_frame_get_width (struct mvb_frame_t* frame);

int
mvb_format_utils_frame_get_height (struct mvb_frame_t* frame);


#endif


