StreamProxy.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package com.genersoft.iot.vmp.streamProxy.bean;
  2. import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
  3. import io.swagger.v3.oas.annotations.media.Schema;
  4. import lombok.Data;
  5. import lombok.EqualsAndHashCode;
  6. import org.springframework.util.ObjectUtils;
  7. /**
  8. * @author lin
  9. */
  10. @Data
  11. @Schema(description = "拉流代理的信息")
  12. @EqualsAndHashCode(callSuper = true)
  13. public class StreamProxy extends CommonGBChannel {
  14. /**
  15. * 数据库自增ID
  16. */
  17. @Schema(description = "数据库自增ID")
  18. private int id;
  19. @Schema(description = "类型,取值,default: 流媒体直接拉流(默认),ffmpeg: ffmpeg实现拉流")
  20. private String type;
  21. @Schema(description = "应用名")
  22. private String app;
  23. @Schema(description = "流ID")
  24. private String stream;
  25. @Schema(description = "流媒体服务ID")
  26. private String mediaServerId;
  27. @Schema(description = "拉流地址")
  28. private String srcUrl;
  29. @Schema(description = "超时时间:秒")
  30. private int timeout;
  31. @Schema(description = "ffmpeg模板KEY")
  32. private String ffmpegCmdKey;
  33. @Schema(description = "rtsp拉流时,拉流方式,0:tcp,1:udp,2:组播")
  34. private String rtspType;
  35. @Schema(description = "是否启用")
  36. private boolean enable;
  37. @Schema(description = "是否启用音频")
  38. private boolean enableAudio;
  39. @Schema(description = "是否启用MP4")
  40. private boolean enableMp4;
  41. @Schema(description = "是否 无人观看时删除")
  42. private boolean enableRemoveNoneReader;
  43. @Schema(description = "是否 无人观看时自动停用")
  44. private boolean enableDisableNoneReader;
  45. @Schema(description = "拉流代理时zlm返回的key,用于停止拉流代理")
  46. private String streamKey;
  47. @Schema(description = "拉流状态")
  48. private Boolean pulling;
  49. public CommonGBChannel buildCommonGBChannel() {
  50. if (ObjectUtils.isEmpty(this.getGbDeviceId())) {
  51. return null;
  52. }
  53. if (ObjectUtils.isEmpty(this.getGbName())) {
  54. this.setGbName( app+ "-" +stream);
  55. }
  56. this.setStreamProxyId(this.getId());
  57. return this;
  58. }
  59. }