Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
QT_PAIR_RECEIVE
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lenz su
QT_PAIR_RECEIVE
Commits
323b29fd
Commit
323b29fd
authored
Jan 02, 2020
by
lenz su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备拔出 退出程序
parent
a504ee70
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
14 deletions
+15
-14
VideoDecode.pro.user
VideoDecode.pro.user
+4
-4
hid_thread.cpp
VideoDecoder/src/VideoReader/hid_thread.cpp
+11
-10
VideoDecode.exe
bin32/VideoDecode.exe
+0
-0
No files found.
VideoDecode.pro.user
View file @
323b29fd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.2, 2020-01-0
1T22:26:5
3. -->
<!-- Written by QtCreator 4.10.2, 2020-01-0
2T10:53:0
3. -->
<qtcreator>
<data>
<variable>
EnvironmentId
</variable>
...
...
@@ -306,8 +306,8 @@
<value
type=
"int"
key=
"PE.EnvironmentAspect.Base"
>
2
</value>
<valuelist
type=
"QVariantList"
key=
"PE.EnvironmentAspect.Changes"
/>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
VideoDecode
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
>
VideoDecode2
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
Qt4ProjectManager.Qt4RunConfiguration:C:/Users/sulin/Documents/QT_PAIR_RECEIVE
2
/VideoDecode.pro
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
Qt4ProjectManager.Qt4RunConfiguration:C:/Users/sulin/Documents/QT_PAIR_RECEIVE/VideoDecode.pro
</value>
<value
type=
"QString"
key=
"RunConfiguration.Arguments"
></value>
<value
type=
"uint"
key=
"RunConfiguration.QmlDebugServerPort"
>
3768
</value>
<value
type=
"bool"
key=
"RunConfiguration.UseCppDebugger"
>
false
</value>
...
...
@@ -317,7 +317,7 @@
<value
type=
"bool"
key=
"RunConfiguration.UseQmlDebugger"
>
false
</value>
<value
type=
"bool"
key=
"RunConfiguration.UseQmlDebuggerAuto"
>
true
</value>
<value
type=
"QString"
key=
"RunConfiguration.WorkingDirectory"
></value>
<value
type=
"QString"
key=
"RunConfiguration.WorkingDirectory.default"
>
C:/Users/sulin/Documents/QT_PAIR_RECEIVE
2
/bin32
</value>
<value
type=
"QString"
key=
"RunConfiguration.WorkingDirectory.default"
>
C:/Users/sulin/Documents/QT_PAIR_RECEIVE/bin32
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.Target.RunConfigurationCount"
>
1
</value>
</valuemap>
...
...
VideoDecoder/src/VideoReader/hid_thread.cpp
View file @
323b29fd
...
...
@@ -2,7 +2,7 @@
#include <QDebug>
#include "usb/USBOperator.h"
#include<QApplication>
#define MAX_PAYLOAD 1012
typedef
struct
USB_FRAM_S
{
int
head
;
...
...
@@ -27,19 +27,20 @@ void hid_thread::run()
int
res
=
hid_read
(
hid_fd
,
buffer
,
2048
);
qDebug
(
"res = %d"
,
res
);
// FILE *h264Fp = fopen("out.log","wb");
// FILE *h264Fp = fopen("out.log","wb");
char
buff
[
2048
];
while
(
true
)
{
//memset(buffer, 0, 2048);
res
=
hid_read
(
hid_fd
,
buffer
,
2048
);
if
(
res
<=
0
)
{
//qDebug("res error ");
//cout<<"error"<<endl;
if
(
res
==-
1
)
{
QApplication
*
app
;
app
->
exit
(
0
);
}
if
(
res
<
4
){
msleep
(
100
);
continue
;
}
cout
<<
"youle"
<<
endl
;
cout
<<
"pUsbFram1:"
<<
pUsbFram1
->
id
<<
endl
;
cout
<<
"pUsbFram1->buff[0]"
<<
pUsbFram1
->
head
<<
endl
;
...
...
@@ -125,9 +126,9 @@ void hid_thread::run()
qDebug
(
"fram id:%d %d "
,
pUsbFram1
->
id
,
pUsbFram1
->
length
);
memset
(
buff
,
0x00
,
sizeof
(
buff
));
sprintf
(
buff
,
"fram id:%d %d
\n
"
,
pUsbFram1
->
id
,
pUsbFram1
->
length
);
// fwrite(buff, 1, strlen(buff), h264Fp);
// fwrite(buff, 1, strlen(buff), h264Fp);
if
((
frameId
+
1
)
!=
pUsbFram1
->
id
){
qDebug
(
"fram id error current id %d real id %d"
,
frameId
,
pUsbFram1
->
id
);
qDebug
(
"fram id error current id %d real id %d"
,
frameId
,
pUsbFram1
->
id
);
}
frameId
=
pUsbFram1
->
id
;
}
...
...
@@ -141,9 +142,9 @@ void hid_thread::run()
qDebug
(
"fram id:%d %d "
,
pUsbFram2
->
id
,
pUsbFram2
->
length
);
memset
(
buff
,
0x00
,
sizeof
(
buff
));
sprintf
(
buff
,
"fram id:%d %d
\n
"
,
pUsbFram2
->
id
,
pUsbFram2
->
length
);
// fwrite(buff, 1, strlen(buff), h264Fp);
// fwrite(buff, 1, strlen(buff), h264Fp);
if
((
frameId
+
1
)
!=
pUsbFram2
->
id
){
qDebug
(
"fram id error current id %d real id %d"
,
frameId
,
pUsbFram2
->
id
);
qDebug
(
"fram id error current id %d real id %d"
,
frameId
,
pUsbFram2
->
id
);
}
frameId
=
pUsbFram2
->
id
;
}
...
...
bin32/VideoDecode.exe
View file @
323b29fd
No preview for this file type
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