648540858
2020-11-13 33b51c40ddd9750a19b2c6a6618fb22386f87cd7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
package com.genersoft.iot.vmp.storager;
 
import java.util.List;
import java.util.Map;
 
import com.alibaba.fastjson.JSONObject;
import com.genersoft.iot.vmp.common.PageResult;
import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.conf.MediaServerConfig;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
 
/**    
 * @Description:视频设备数据存储接口
 * @author: swwheihei
 * @date:   2020年5月6日 下午2:14:31     
 */
public interface IVideoManagerStorager {
 
    /**
     * 更新流媒体信息
     * @param mediaServerConfig
     * @return
     */
    public boolean updateMediaInfo(MediaServerConfig mediaServerConfig);
 
    /**
     * 获取流媒体信息
     * @return
     */
    public MediaServerConfig getMediaInfo();
 
    /**   
     * 根据设备ID判断设备是否存在
     * 
     * @param deviceId 设备ID
     * @return true:存在  false:不存在
     */
    public boolean exists(String deviceId);
    
    /**   
     * 视频设备创建
     * 
     * @param device 设备对象
     * @return true:创建成功  false:创建失败
     */
    public boolean create(Device device);
    
    /**   
     * 视频设备更新
     * 
     * @param device 设备对象
     * @return true:创建成功  false:创建失败
     */
    public boolean updateDevice(Device device);
 
    /**
     * 添加设备通道
     *
     * @param deviceId 设备id
     * @param channel 通道
     */
    public void updateChannel(String deviceId, DeviceChannel channel);
    
    /**   
     * 获取设备
     * 
     * @param deviceId 设备ID
     * @return DShadow 设备对象
     */
    public Device queryVideoDevice(String deviceId);
 
    /**
     * 获取某个设备的通道列表
     *
     * @param deviceId 设备ID
     * @param page 分页 当前页
     * @param count 每页数量
     * @return
     */
    public PageResult queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, String online, int page, int count);
 
    /**
     * 获取某个设备的通道列表
     *
     * @param deviceId 设备ID
     * @return
     */
    public List<DeviceChannel> queryChannelsByDeviceId(String deviceId);
    /**
     * 获取某个设备的通道
     * @param deviceId 设备ID
     * @param channelId 通道ID
     */
    public DeviceChannel queryChannel(String deviceId, String channelId);
 
    /**   
     * 获取多个设备
     * 
     * @param deviceIds 设备ID数组
     * @return List<Device> 设备对象数组
     */
    public PageResult<Device> queryVideoDeviceList(String[] deviceIds, int page, int count);
 
    /**
     * 获取多个设备
     *
     * @param deviceIds 设备ID数组
     * @return List<Device> 设备对象数组
     */
    public List<Device> queryVideoDeviceList(String[] deviceIds);
 
    /**   
     * 删除设备
     * 
     * @param deviceId 设备ID
     * @return true:删除成功  false:删除失败
     */
    public boolean delete(String deviceId);
    
    /**   
     * 更新设备在线
     * 
     * @param deviceId 设备ID
     * @return true:更新成功  false:更新失败
     */
    public boolean online(String deviceId);
    
    /**   
     * 更新设备离线
     * 
     * @param deviceId 设备ID
     * @return true:更新成功  false:更新失败
     */
    public boolean outline(String deviceId);
 
    /**
     * 开始播放时将流存入
     *
     * @param stream 流信息
     * @return
     */
    public boolean startPlay(StreamInfo stream);
 
    /**
     * 停止播放时删除
     *
     * @return
     */
    public boolean stopPlay(StreamInfo streamInfo);
 
    /**
     * 查找视频流
     *
     * @return
     */
    public StreamInfo queryPlay(StreamInfo streamInfo);
 
    /**
     * 查询子设备
     *
     * @param deviceId
     * @param channelId
     * @param page
     * @param count
     * @return
     */
    PageResult querySubChannels(String deviceId, String channelId, String query, Boolean hasSubChannel, String online, int page, int count);
 
    /**
     * 更新缓存
     */
    public void updateCatch();
 
    /**
     * 清空通道
     * @param deviceId
     */
    void cleanChannelsForDevice(String deviceId);
 
    StreamInfo queryPlayBySSRC(String ssrc);
 
    StreamInfo queryPlayByDevice(String deviceId, String code);
 
    Map<String, StreamInfo> queryPlayByDeviceId(String deviceId);
 
    boolean startPlayback(StreamInfo streamInfo);
 
    boolean stopPlayback(StreamInfo streamInfo);
 
    StreamInfo queryPlaybackByDevice(String deviceId, String channelId);
 
    StreamInfo queryPlaybackBySSRC(String ssrc);
}