package com.paul.drone.data.mqtt; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.Getter; import lombok.Setter; /** * 视频流控制消息 * Topic: drone/remote/{serialNumber}/live */ @Data @Setter @Getter public class LiveControlMessage { @SerializedName("action") private String action; // "start" | "stop" @SerializedName("rtmp_url") private String rtmpUrl; @SerializedName("quality") private String quality; // "SD" | "HD" | "FULL_HD" @SerializedName("timestamp") private Long timestamp; public LiveControlMessage() {} public LiveControlMessage(String action, String rtmpUrl, String quality, Long timestamp) { this.action = action; this.rtmpUrl = rtmpUrl; this.quality = quality; this.timestamp = timestamp; } public enum Action { START("start"), STOP("stop"), SET_QUALITY("set_quality"); private final String value; Action(String value) { this.value = value; } public String getValue() { return value; } } public enum Quality { SD("SD"), HD("HD"), FULL_HD("FULL_HD"); private final String value; Quality(String value) { this.value = value; } public String getValue() { return value; } } }