/*
 * Copyright (C) 2014, Sebastian Dröge <sebastian@centricular.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation
 * version 2.1 of the License.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 *
 */

#ifndef __GST_OMX_DTSX_DEC_H__
#define __GST_OMX_DTSX_DEC_H__

#include <gst/gst.h>
#include "gstomxaudiodec.h"
#include "stdint.h"

G_BEGIN_DECLS

#define GST_TYPE_OMX_DTSX_DEC \
  (gst_omx_dtsx_dec_get_type())
#define GST_OMX_DTSX_DEC(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_DTSX_DEC,GstOMXDTSXDec))
#define GST_OMX_DTSX_DEC_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_DTSX_DEC,GstOMXDTSXDecClass))
#define GST_OMX_DTSX_DEC_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_DTSX_DEC,GstOMXDTSXDecClass))
#define GST_IS_OMX_DTSX_DEC(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_DTSX_DEC))
#define GST_IS_OMX_DTSX_DEC_CLASS(obj) \
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_DTSX_DEC))

typedef struct _GstOMXDTSXDecClass GstOMXDTSXDecClass;
typedef struct _GstOMXDTSXDec GstOMXDTSXDec;

struct _GstOMXDTSXDec
{
  GstOMXAudioDec parent;
  gint spf;
  gint enable_direct_mode;
  gint drc_percent;
  gint dialog_control;
  gchar speak_config[128];
};

struct _GstOMXDTSXDecClass
{
  GstOMXAudioDecClass parent_class;
};

GType gst_omx_dtsx_dec_get_type (void);


#define GST_DTSX_BITSTREAMTYPE_UNKNOWN              0x00000000 /**< Unknown Stream type */
#define GST_DTSX_BITSTREAMTYPE_DTS_LEGACY           0x00000001 /**< 48Khz 5.1 bitstream */
#define GST_DTSX_BITSTREAMTYPE_DTS_ES_MATRIX        0x00000002 /**< 48Khz 5.1 bitstream with ES */
#define GST_DTSX_BITSTREAMTYPE_DTS_ES_DISCRETE      0x00000004 /**< 48Khz 6.1 bitstream with or without ES */
#define GST_DTSX_BITSTREAMTYPE_DTS_9624             0x00000008 /**< 96Khz 5.1 bitstream */
#define GST_DTSX_BITSTREAMTYPE_DTS_ES_8CH_DISCRETE  0x00000010 /**< 48Khz bitstream with more than 5.1 channels */
#define GST_DTSX_BITSTREAMTYPE_DTS_HIRES            0x00000020 /**< DTS HD lossy bitstream that has upto 7.1 channels at sampling rates upto 96Khz */
#define GST_DTSX_BITSTREAMTYPE_DTS_MA               0x00000040 /**< DTS HD bitstream with lossless extensions, that has upto 7.1 channels at sampling rates upto 192Khz */
#define GST_DTSX_BITSTREAMTYPE_DTS_LBR              0x00000080 /**< DTS LBR ( Low BitRate ) bitstream */
#define GST_DTSX_BITSTREAMTYPE_DTS_LOSSLESS         0x00000100 /**< Pure lossless DTS HD bitstream */
#define GST_DTSX_BITSTREAMTYPE_DTS_UHD              0x00000200 /**< DTS UHD lossy-encoded bitstream */
#define GST_DTSX_BITSTREAMTYPE_DTS_UHD_MA           0x00000400 /**< DTS UHD bitstream with lossless extensions */
#define GST_DTSX_BITSTREAMTYPE_DTS_UHD_LOSSLESS     0x00000800 /**< Pure lossless DTS UHD bitstream */
#define GST_DTSX_BITSTREAMTYPE_DTS_UHD_GAME         0x00001000 /**< Standalone DTS UHD bitstream */

typedef struct _GST_INFO_DTSX
{
    int32_t   stream_type;
    int32_t   object_audio;
    int32_t   dts_comp_gain;     //provide info for UI showing MQA flag
    uint32_t  dts_detail_type;
    uint32_t  dts_sample_rate;      //for mw time show
    uint32_t  dts_stream_layout;      //for mw time show
    uint32_t  dts_bitrate;   //bitstream orginal sample rate

    int32_t dts_dialog_avail;
    int32_t dts_dialog_min;
    int32_t dts_dialog_max;
    int32_t dts_dialog_resolution;
    int32_t dts_analog_compgain;

    int32_t dts_stream_ch_num;
    int32_t dts_stream_ch_mask;

} GST_INFO_DTSX;


G_END_DECLS

#endif /* __GST_OMX_DTSX_DEC_H__ */

