package cn.tee3.avd;

/**
 * 视频类设备结构.
 *
 * 视频类设备结构定义了视频类设备的基本信息，主要包含摄像头和屏幕窗口设备。
 */
public class VideoDevice extends Device {
    protected int level;                              /**< 应用层对设备设置的数据，可用于表示视频权重等, 应用层开发可用  */
    protected String description;                     /**< 应用层对设备的描述，应用层开发可用  */
    protected VideoDeviceOptions deviceQualities;      /**< 视频设备质量类型集：摄像头通知时包含摄像头支持的视频质量集合  */
    protected PublishVideoOptions publishedQualities; /**< 视频发布质量类型集：设备发布时包含的发布视频的质量集合 */

    protected VideoDevice(String id, String name, int level, String description, DeviceStatus status, int deviceQualities, int publishedQualities) {
        super(id, name, status);
        this.level = level;
        this.description = (null == description) ? "" : description;
        this.deviceQualities = new VideoDeviceOptions(deviceQualities);
        this.publishedQualities = new PublishVideoOptions(publishedQualities);
    }

    protected VideoDevice(String id, String name, int level, String description, DeviceStatus status, int deviceQualities, MVideo.CameraCapability cap, VideoOptions.VideoCodec codec) {
        super(id, name, status);
        this.level = level;
        this.description = (null == description) ? "" : description;
        this.deviceQualities = new VideoDeviceOptions(deviceQualities);
        this.publishedQualities = new PublishVideoOptions(cap, codec);
    }

    public int getLevel() { return this.level; }
    public void setLevel(int level) { this.level = level; }
    public String getDescription() { return this.description; }
    public void setDescription(String description) {
        this.description = (null == description) ? "" : description;
    }
    public VideoDeviceOptions getDeviceQualities() { return this.deviceQualities; }
    public PublishVideoOptions getPublishedQualities() { return this.publishedQualities; }
    public void setPublishedQualities(PublishVideoOptions value) { this.publishedQualities = value; }

    @Override
    public String toString() {
        return "VD:" + super.toString()+",level="+this.level + ",description="+this.description
                + ",device="+this.deviceQualities.getValue()+ ",published="+this.publishedQualities.getValue();
    }
}
