Commit 33b51c40ddd9750a19b2c6a6618fb22386f87cd7
1 parent
222d44bd
增加强制不查询编码信息配置
Showing
4 changed files
with
5 additions
and
7 deletions
pom.xml
| @@ -26,7 +26,6 @@ | @@ -26,7 +26,6 @@ | ||
| 26 | <generated.asciidoc.directory>${project.build.directory}/asciidoc</generated.asciidoc.directory> | 26 | <generated.asciidoc.directory>${project.build.directory}/asciidoc</generated.asciidoc.directory> |
| 27 | <asciidoctor.html.output.directory>${project.build.directory}/asciidoc/html</asciidoctor.html.output.directory> | 27 | <asciidoctor.html.output.directory>${project.build.directory}/asciidoc/html</asciidoctor.html.output.directory> |
| 28 | <asciidoctor.pdf.output.directory>${project.build.directory}/asciidoc/pdf</asciidoctor.pdf.output.directory> | 28 | <asciidoctor.pdf.output.directory>${project.build.directory}/asciidoc/pdf</asciidoctor.pdf.output.directory> |
| 29 | - <gson.version>2.8.6</gson.version> | ||
| 30 | </properties> | 29 | </properties> |
| 31 | 30 | ||
| 32 | <dependencies> | 31 | <dependencies> |
| @@ -153,11 +152,6 @@ | @@ -153,11 +152,6 @@ | ||
| 153 | <artifactId>fastjson</artifactId> | 152 | <artifactId>fastjson</artifactId> |
| 154 | <version>1.2.73</version> | 153 | <version>1.2.73</version> |
| 155 | </dependency> | 154 | </dependency> |
| 156 | - <!-- google json库 --> | ||
| 157 | - <dependency> | ||
| 158 | - <groupId>com.google.code.gson</groupId> | ||
| 159 | - <artifactId>gson</artifactId> | ||
| 160 | - </dependency> | ||
| 161 | 155 | ||
| 162 | <!--Guava是一种基于开源的Java库--> | 156 | <!--Guava是一种基于开源的Java库--> |
| 163 | <dependency> | 157 | <dependency> |
src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java
| @@ -11,5 +11,4 @@ public class VManageBootstrap extends LogManager { | @@ -11,5 +11,4 @@ public class VManageBootstrap extends LogManager { | ||
| 11 | public static void main(String[] args) { | 11 | public static void main(String[] args) { |
| 12 | SpringApplication.run(VManageBootstrap.class, args); | 12 | SpringApplication.run(VManageBootstrap.class, args); |
| 13 | } | 13 | } |
| 14 | - | ||
| 15 | } | 14 | } |
src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java
| @@ -38,11 +38,15 @@ public class PlayController { | @@ -38,11 +38,15 @@ public class PlayController { | ||
| 38 | @Autowired | 38 | @Autowired |
| 39 | private ZLMRESTfulUtils zlmresTfulUtils; | 39 | private ZLMRESTfulUtils zlmresTfulUtils; |
| 40 | 40 | ||
| 41 | + @Value("${media.closeWaitRTPInfo}") | ||
| 42 | + private boolean closeWaitRTPInfo; | ||
| 43 | + | ||
| 41 | @GetMapping("/play/{deviceId}/{channelId}") | 44 | @GetMapping("/play/{deviceId}/{channelId}") |
| 42 | public ResponseEntity<String> play(@PathVariable String deviceId, @PathVariable String channelId, | 45 | public ResponseEntity<String> play(@PathVariable String deviceId, @PathVariable String channelId, |
| 43 | Integer getEncoding) { | 46 | Integer getEncoding) { |
| 44 | 47 | ||
| 45 | if (getEncoding == null) getEncoding = 0; | 48 | if (getEncoding == null) getEncoding = 0; |
| 49 | + getEncoding = closeWaitRTPInfo ? 0: getEncoding; | ||
| 46 | Device device = storager.queryVideoDevice(deviceId); | 50 | Device device = storager.queryVideoDevice(deviceId); |
| 47 | StreamInfo streamInfo = storager.queryPlayByDevice(deviceId, channelId); | 51 | StreamInfo streamInfo = storager.queryPlayByDevice(deviceId, channelId); |
| 48 | 52 |
src/main/resources/application.yml
| @@ -45,6 +45,7 @@ media: #zlm服务器的ip与http端口, 重点: 这是http端口 | @@ -45,6 +45,7 @@ media: #zlm服务器的ip与http端口, 重点: 这是http端口 | ||
| 45 | port: 80 | 45 | port: 80 |
| 46 | secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc | 46 | secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc |
| 47 | streamNoneReaderDelayMS: 1800000 # 无人观看多久自动关闭流 | 47 | streamNoneReaderDelayMS: 1800000 # 无人观看多久自动关闭流 |
| 48 | + closeWaitRTPInfo: false # 强制关闭等待收到流编码信息后在返回, 设为true可以快速打开播放窗口, 设为false保证返回后流就可以播放 | ||
| 48 | rtp: # 启用udp多端口模式 | 49 | rtp: # 启用udp多端口模式 |
| 49 | enable: true | 50 | enable: true |
| 50 | udpPortRange: 30000,30500 # 端口范围 | 51 | udpPortRange: 30000,30500 # 端口范围 |