package cn.reghao.oss.store.task;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 视频文件
 *
 * @author reghao
 * @date 2021-11-22 10:21:15
 */
@NoArgsConstructor
@Setter
@Getter
public class VideoFile {
    // 原始文件的 objectId
    private String videoFileId;
    private String objectId;
    private String videoCodec;
    private Long vbitRate;
    private String audioCodec;
    private Long abitRate;
    private String urlType;
    private String url;
    private String quality;
    private Integer width;
    private Integer height;
    private Boolean horizontal;
    // 单位秒
    private Integer duration;

    public VideoFile(String videoFileId, String objectId, String videoCodec, long vbitRate, String audioCodec, long abitRate,
                     String urlType, String url, String quality, int width, int height, int duration) {
        this.videoFileId = videoFileId;
        this.objectId = objectId;
        this.videoCodec = videoCodec;
        this.vbitRate = vbitRate;
        this.audioCodec = audioCodec;
        this.abitRate = abitRate;
        this.urlType = urlType;
        this.url = url;
        this.quality = quality;
        this.width = width;
        this.height = height;
        this.horizontal = width>height;
        this.duration = duration;
    }

    public VideoFile(String videoFileId, String objectId, String url, VideoFile videoFile) {
        this.videoFileId = videoFileId;
        this.objectId = objectId;
        this.videoCodec = videoFile.getVideoCodec();
        this.vbitRate = videoFile.getVbitRate();
        this.audioCodec = videoFile.getAudioCodec();
        this.abitRate = videoFile.getAbitRate();
        this.urlType = videoFile.getUrlType();
        this.url = url;
        this.quality = videoFile.getQuality();
        this.width = videoFile.getWidth();
        this.height = videoFile.getHeight();
        this.horizontal = videoFile.getHorizontal();
        this.duration = videoFile.getDuration();
    }
}
