package cn.tee3.avd;

import java.util.List;

/**
 * Created by bob.liu on 2015/11/6.
 */
public class VideoOptions {
    private static final String TAG = "VideoOptions";
    protected int optionset = 0;

    public static enum VideoRatio {
        ratio_4_3,							/**< 4:3视频  */
        ratio_16_9,						/**< 16:9视频  */
        ratio_cif,							/**< CIF比例视频  */
    }
    public static enum VideoCodec {
        codec_vp8,							/**< VP8编解码器类型  */
        codec_h264,						/**< H264编解码器类型  */
        codec_vp9,							/**< VP9编解码器类型  */
        codec_h265,						/**< H264编解码器类型  */
    }
    /**
     * 视频主辅流类型.
     */
    public static enum StreamType {
        stream_main,						/**< 主流  */
        stream_assist1,					/**< 辅流1  */
        stream_assist2,					/**< 辅流2  */
    }
    /**
     * 视频质量类型.
     */
    public static enum VideoQuality {
        quality_low,			            /**< 流畅  */
        quality_normal,			        /**< 标清  */
        quality_high,			            /**< 高清  */
    }

    public static int VideoQuality2native(VideoQuality quality) {
        if (VideoQuality.quality_low == quality) {
            return 1;
        }
        if (VideoQuality.quality_normal == quality) {
            return 2;
        }
        if (VideoQuality.quality_high == quality) {
            return 4;
        }
            return 0;
    }

    protected VideoOptions(int quaset) {
        super();
        this.optionset = quaset;
    }
    protected int getValue() {
        return optionset;
    }
    protected void setValue(int quaset) {
        this.optionset = quaset;
    }
    ///
    protected native boolean nativedevhasCapability(int set, MVideo.CameraCapability cap);
    protected native List<MVideo.CameraCapability> nativedevgetCapabilities(int set);
    ///
    protected native boolean nativepubhasQuality(int set, int quality);
    protected native int nativepubsetStreamOptions(int set, int type, MVideo.CameraCapability cap, int codec);
    protected native MVideo.CameraCapability nativepubgetStreamCapability(int set, int type);
    protected native VideoQuality nativepubgetStreamQuality(int set, int type);
    protected native VideoCodec nativepubgetStreamCodec(int set, int type);
    ///
    protected native boolean nativepubhasMainStream(int set);
    protected native boolean nativepubhasAssist1(int set);
    protected native boolean nativepubhasAssist2(int set);

}
