Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gamera_videos_no_ui
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liusq
gamera_videos_no_ui
Commits
b1eac755
Commit
b1eac755
authored
Oct 16, 2024
by
郭峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-1007494' into 'release'
Feature 1007494 See merge request
!75
parents
f8cef98c
6e26904e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
15 deletions
+34
-15
CameraHandle.cpp
+3
-0
CameraHandle.h
+3
-0
mainwindow.cpp
+28
-15
No files found.
CameraHandle.cpp
View file @
b1eac755
...
...
@@ -910,6 +910,9 @@ void CameraHandle::updateImage(const cv::Mat & frame,qint64 currentTime){
void
CameraHandle
::
findIp
(
QString
&
ip
){
ip
=
QString
::
fromStdString
(
loginParam
->
sDevId
);
}
void
CameraHandle
::
findPort
(
int
&
port
){
port
=
loginParam
->
nDevPort
;
}
void
CameraHandle
::
findFirmwareVersion
(
QString
&
firmwareVersion
){
char
szOutBuffer
[
1024
]
=
{
0
};
...
...
CameraHandle.h
View file @
b1eac755
...
...
@@ -124,6 +124,9 @@ public:
//获取ip
void
findIp
(
QString
&
ip
);
void
findPort
(
int
&
port
);
void
sdkDownloadFileByTime
(
XSDK_HANDLE
hDevice
,
int
id
,
QString
startTimer
,
QString
endTime
);
...
...
mainwindow.cpp
View file @
b1eac755
...
...
@@ -531,7 +531,7 @@ void MainWindow::startCamera(const QString &httpurl){
HttpService
httpService
(
httpurl
);
vides_data
::
response
*
re
=
httpService
.
httpFindCameras
(
serialNumber
,
devices
);
if
(
re
->
code
==
0
||
re
->
code
==
20004
){
//本次搜索到设备列表
std
::
map
<
QString
,
vides_data
::
localDeviceStatus
*>
localDevices
;
mediaFaceImage
->
SdkSearchDevicesSyn
(
localDevices
);
if
(
localDevices
.
size
()
<=
0
){
...
...
@@ -574,18 +574,30 @@ void MainWindow::startCamera(const QString &httpurl){
instace
.
deleteObj
(
devRes
);
//未连接的CameraHandle
if
(
faceDetectionParkingPushs
.
count
(
key
)
<=
0
){
vides_data
::
cameraParameters
parameter
;
parameter
.
sDevId
=
ipAddress
;
parameter
.
nDevPort
=
localDevice
->
TCPPort
;
parameter
.
sUserName
=
devConfig
.
camera
.
username
;
parameter
.
sPassword
=
devConfig
.
camera
.
password
;
parameter
.
channel
=
localDevice
->
ChannelNum
;
parameter
.
httpUrl
=
nonConstHttpUrl
;
parameter
.
sSn
=
device
.
sSn
;
parameter
.
mac
=
localDevice
->
mac
;
//parameter.rtspUrl="rtsp://192.168.10.131:554/user=admin&password=&channel=1&stream=1.sdp?";
//parameter.rtspUrl=std::move(QString("rtsp://admin:@%1/stream1").arg(ipAddress));
this
->
initCameras
(
parameter
,
devConfig
,
device
.
areas
,
reStatus
.
camera_info_list
);
//ip变了 sn一样
auto
old
=
findHandle
(
device
.
sSn
);
if
(
old
!=
nullptr
){
QString
ipAddress
;
int
port
;
old
->
findIp
(
ipAddress
);
old
->
findPort
(
port
);
qInfo
()
<<
QString
(
"SN(%1): 清理掉变动的老ip:%2,port:%3"
).
arg
(
device
.
sSn
)
.
arg
(
ipAddress
).
arg
(
port
);
clearOfflineCameraHandle
(
ipAddress
,
port
);
}
else
{
vides_data
::
cameraParameters
parameter
;
parameter
.
sDevId
=
ipAddress
;
parameter
.
nDevPort
=
localDevice
->
TCPPort
;
parameter
.
sUserName
=
devConfig
.
camera
.
username
;
parameter
.
sPassword
=
devConfig
.
camera
.
password
;
parameter
.
channel
=
localDevice
->
ChannelNum
;
parameter
.
httpUrl
=
nonConstHttpUrl
;
parameter
.
sSn
=
device
.
sSn
;
parameter
.
mac
=
localDevice
->
mac
;
//parameter.rtspUrl="rtsp://192.168.10.131:554/user=admin&password=&channel=1&stream=1.sdp?";
//parameter.rtspUrl=std::move(QString("rtsp://admin:@%1/stream1").arg(ipAddress));
this
->
initCameras
(
parameter
,
devConfig
,
device
.
areas
,
reStatus
.
camera_info_list
);
}
}
else
{
auto
it
=
this
->
faceDetectionParkingPushs
.
find
(
key
);
...
...
@@ -598,8 +610,6 @@ void MainWindow::startCamera(const QString &httpurl){
camera_info
.
mac
=
localDevice
->
mac
;
reStatus
.
camera_info_list
.
push_front
(
camera_info
);
qInfo
()
<<
"推送mac地址"
<<
localDevice
->
mac
;;
HttpService
http_gb28181
(
httpurl
);
vides_data
::
response
*
res
=
http_gb28181
.
httpFindGb28181Config
(
camera_info
.
sSn
);
if
(
res
->
code
!=
0
){
...
...
@@ -659,6 +669,9 @@ bool MainWindow::isDeviceInList(const QString& deviceId, const std::list<vides_d
});
return
it
!=
devices
.
end
();
// 如果迭代器不是end,说明找到了匹配项
}
//从localDevices中过滤出不在devices列表中的设备
void
MainWindow
::
deleteCloudNotCamer
(
const
std
::
map
<
QString
,
vides_data
::
localDeviceStatus
*>&
localDevices
,
const
std
::
list
<
vides_data
::
responseDeviceStatus
>&
devices
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment