Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
7cb35204
Commit
7cb35204
authored
Dec 11, 2014
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xtt video username password added
parent
d3a465fd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
34 deletions
+78
-34
src/wbl/pwrb/src/pwrb_c_xttvideo.wb_load
src/wbl/pwrb/src/pwrb_c_xttvideo.wb_load
+20
-0
xtt/lib/xtt/gtk/xtt_stream_gtk.cpp
xtt/lib/xtt/gtk/xtt_stream_gtk.cpp
+0
-1
xtt/lib/xtt/src/xtt_stream.cpp
xtt/lib/xtt/src/xtt_stream.cpp
+52
-32
xtt/lib/xtt/src/xtt_stream.h
xtt/lib/xtt/src/xtt_stream.h
+6
-1
No files found.
src/wbl/pwrb/src/pwrb_c_xttvideo.wb_load
View file @
7cb35204
...
...
@@ -168,6 +168,26 @@ SObject pwrb:Class
Attr Elements = 10
EndBody
EndObject
!/**
! User for camera authentication.
!*/
Object User $Attribute 15
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
Attr Flags |= PWR_MASK_CONST
EndBody
EndObject
!/**
! Password for camera authentication.
!*/
Object Password $Attribute 16
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
Attr Flags |= PWR_MASK_CONST
Attr Flags |= PWR_MASK_RTHIDE
Attr Flags |= PWR_MASK_DEVHIDEVALUE
EndBody
EndObject
EndObject
Object Template XttVideo
Body RtBody
...
...
xtt/lib/xtt/gtk/xtt_stream_gtk.cpp
View file @
7cb35204
...
...
@@ -466,7 +466,6 @@ gboolean XttStreamGtk::mousebutton_cb( GtkWidget *widget, GdkEvent *event, void
if
(
dft
<
0.5
&&
abs
(
event
->
button
.
x
-
strm
->
mb_press_x
)
<
10
&&
abs
(
event
->
button
.
y
-
strm
->
mb_press_y
)
<
10
)
{
printf
(
"Mb click %f %f
\n
"
,
event
->
button
.
x
-
offset_x
,
event
->
button
.
y
-
offset_y
);
strm
->
action_click
(
event
->
button
.
x
-
offset_x
,
event
->
button
.
y
-
offset_y
);
if
(
strm
->
ptz_box_displayed
)
{
g_object_set
(
strm
->
ptz_box
,
"visible"
,
FALSE
,
NULL
);
...
...
xtt/lib/xtt/src/xtt_stream.cpp
View file @
7cb35204
...
...
@@ -61,7 +61,6 @@
#include "xtt_xnav.h"
#include "xtt_stream.h"
static
char
outstr
[
20
];
static
int
debug
=
0
;
XttStream
::
XttStream
(
void
*
st_parent_ctx
,
const
char
*
name
,
const
char
*
st_uri
,
...
...
@@ -74,9 +73,6 @@ XttStream::XttStream( void *st_parent_ctx, const char *name, const char *st_uri,
{
pwr_tStatus
sts
;
if
(
debug
)
strcpy
(
outstr
,
""
);
strncpy
(
uri
,
st_uri
,
sizeof
(
uri
));
if
(
st_scan_time
<
0.02
)
scan_time
=
1000
;
...
...
@@ -109,13 +105,25 @@ XttStream::XttStream( void *st_parent_ctx, const char *name, const char *st_uri,
if
(
EVEN
(
sts
))
control_protocol
=
pwr_eCameraControlEnum_No
;
sts
=
gdh_ArefANameToAref
(
&
aref
,
"User"
,
&
aaref
);
if
(
ODD
(
sts
))
sts
=
gdh_GetObjectInfoAttrref
(
&
aaref
,
user
,
sizeof
(
user
));
if
(
EVEN
(
sts
))
strcpy
(
user
,
""
);
sts
=
gdh_ArefANameToAref
(
&
aref
,
"Password"
,
&
aaref
);
if
(
ODD
(
sts
))
sts
=
gdh_GetObjectInfoAttrref
(
&
aaref
,
password
,
sizeof
(
password
));
if
(
EVEN
(
sts
))
strcpy
(
user
,
""
);
if
(
strcmp
(
user
,
""
)
!=
0
&&
strcmp
(
password
,
""
)
!=
0
)
{
// sprintf( &uri[strlen(uri)], "?user=%s&pwd=%s", user, password);
}
switch
(
control_protocol
)
{
case
pwr_eCameraControlEnum_VAPIX
:
camera_control
=
new
XttCameraControlVapix
(
uri
);
if
(
debug
)
strcpy
(
outstr
,
""
);
else
strcpy
(
outstr
,
"-o /dev/null"
);
camera_control
=
new
XttCameraControlVapix
(
uri
,
user
,
password
);
break
;
case
pwr_eCameraControlEnum_ONVIF
:
// Not yet implemented...
...
...
@@ -253,7 +261,8 @@ void XttStream::activate_preset_store_pos( int idx)
if
(
EVEN
(
sts
))
return
;
}
XttCameraControlVapix
::
XttCameraControlVapix
(
char
*
x_url
)
:
XttCameraControlVapix
::
XttCameraControlVapix
(
char
*
x_url
,
char
*
x_user
,
char
*
x_password
)
:
XttCameraControl
(
x_url
)
{
strncpy
(
url
,
x_url
,
sizeof
(
url
));
...
...
@@ -264,6 +273,17 @@ XttCameraControlVapix::XttCameraControlVapix( char *x_url) :
s
=
strchr
(
++
s
,
'/'
);
if
(
s
)
*
s
=
0
;
if
(
debug
)
strcpy
(
outstr
,
""
);
else
strcpy
(
outstr
,
"-o /dev/null"
);
if
(
strcmp
(
x_user
,
""
)
!=
0
&&
strcmp
(
x_password
,
""
)
!=
0
)
sprintf
(
authstr
,
"--user %s --password %s"
,
x_user
,
x_password
);
else
strcpy
(
authstr
,
""
);
}
// Relative zoom, factor is -100 - 100, - zoom out, + zoom in.
...
...
@@ -278,8 +298,8 @@ void XttCameraControlVapix::zoom_relative( double factor)
sprintf
(
cmd
,
"wget --ignore-length %s %s/axis-cgi/com/ptz.cgi?camera=1
\\
&rzoom=%d"
,
outstr
,
url
,
zoom
);
sprintf
(
cmd
,
"wget --ignore-length %s %s
%s
/axis-cgi/com/ptz.cgi?camera=1
\\
&rzoom=%d"
,
authstr
,
outstr
,
url
,
zoom
);
int
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
printf
(
"** Error from wget: %d
\n
"
,
sts
>>
8
);
...
...
@@ -295,8 +315,8 @@ void XttCameraControlVapix::zoom_absolute( double factor)
if
(
zoom
>
9999
)
zoom
=
9999
;
sprintf
(
cmd
,
"wget --ignore-length %s %s/axis-cgi/com/ptz.cgi?camera=1
\\
&zoom=%d"
,
outstr
,
url
,
zoom
);
sprintf
(
cmd
,
"wget --ignore-length %s %s
%s
/axis-cgi/com/ptz.cgi?camera=1
\\
&zoom=%d"
,
authstr
,
outstr
,
url
,
zoom
);
int
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
printf
(
"** Error from wget: %d
\n
"
,
sts
>>
8
);
...
...
@@ -312,8 +332,8 @@ void XttCameraControlVapix::pan_relative( double value)
if
(
pan
<
-
360
)
pan
=
-
360
;
sprintf
(
cmd
,
"wget --ignore-length %s %s/axis-cgi/com/ptz.cgi?camera=1
\\
&rpan=%d"
,
outstr
,
url
,
pan
);
sprintf
(
cmd
,
"wget --ignore-length %s %s
%s
/axis-cgi/com/ptz.cgi?camera=1
\\
&rpan=%d"
,
authstr
,
outstr
,
url
,
pan
);
int
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
printf
(
"** Error from wget: %d
\n
"
,
sts
>>
8
);
...
...
@@ -330,8 +350,8 @@ void XttCameraControlVapix::pan_absolute( double value)
pan
=
-
180
;
sprintf
(
cmd
,
"wget --ignore-length %s %s/axis-cgi/com/ptz.cgi?camera=1
\\
&rpan=%d"
,
outstr
,
url
,
pan
);
sprintf
(
cmd
,
"wget --ignore-length %s %s
%s
/axis-cgi/com/ptz.cgi?camera=1
\\
&rpan=%d"
,
authstr
,
outstr
,
url
,
pan
);
int
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
printf
(
"** Error from wget: %d
\n
"
,
sts
>>
8
);
...
...
@@ -347,8 +367,8 @@ void XttCameraControlVapix::tilt_relative( double value)
if
(
tilt
<
-
360
)
tilt
=
-
360
;
sprintf
(
cmd
,
"wget --ignore-length %s %s/axis-cgi/com/ptz.cgi?camera=1
\\
&rtilt=%d"
,
outstr
,
url
,
tilt
);
sprintf
(
cmd
,
"wget --ignore-length %s %s
%s
/axis-cgi/com/ptz.cgi?camera=1
\\
&rtilt=%d"
,
authstr
,
outstr
,
url
,
tilt
);
int
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
printf
(
"** Error from wget: %d
\n
"
,
sts
>>
8
);
...
...
@@ -365,8 +385,8 @@ void XttCameraControlVapix::tilt_absolute( double value)
tilt
=
-
180
;
sprintf
(
cmd
,
"wget --ignore-length %s %s/axis-cgi/com/ptz.cgi?camera=1
\\
&rtilt=%d"
,
outstr
,
url
,
tilt
);
sprintf
(
cmd
,
"wget --ignore-length %s %s
%s
/axis-cgi/com/ptz.cgi?camera=1
\\
&rtilt=%d"
,
authstr
,
outstr
,
url
,
tilt
);
int
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
printf
(
"** Error from wget: %d
\n
"
,
sts
>>
8
);
...
...
@@ -394,8 +414,8 @@ void XttCameraControlVapix::pan_tilt_zoom_absolute( double pan, double tilt, dou
if
(
izoom
>
19999
)
izoom
=
19999
;
sprintf
(
cmd
,
"wget --ignore-length %s %s/axis-cgi/com/ptz.cgi?camera=1
\\
&pan=%.2f
\\
&tilt=%.2f
\\
&zoom=%d"
,
outstr
,
url
,
ipan
,
itilt
,
izoom
);
sprintf
(
cmd
,
"wget --ignore-length %s %s
%s
/axis-cgi/com/ptz.cgi?camera=1
\\
&pan=%.2f
\\
&tilt=%.2f
\\
&zoom=%d"
,
authstr
,
outstr
,
url
,
ipan
,
itilt
,
izoom
);
int
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
printf
(
"** Error from wget: %d
\n
"
,
sts
>>
8
);
...
...
@@ -415,10 +435,10 @@ void XttCameraControlVapix::center( int x, int y, int width, int height,
x
=
((
float
)
stream_width
)
/
width
*
x
;
y
=
((
float
)
stream_height
)
/
height
*
y
;
// sprintf( cmd, "wget --ignore-length %s %s/axis-cgi/com/ptz.cgi?camera=1\\¢er=%d,%d\\&imagewidth=%d",
// outstr, url, x, y, width);
sprintf
(
cmd
,
"wget --ignore-length %s %s/axis-cgi/com/ptz.cgi?camera=1
\\
¢er=%d,%d"
,
outstr
,
url
,
x
,
y
);
// sprintf( cmd, "wget --ignore-length %s %s
%s
/axis-cgi/com/ptz.cgi?camera=1\\¢er=%d,%d\\&imagewidth=%d",
//
authstr,
outstr, url, x, y, width);
sprintf
(
cmd
,
"wget --ignore-length %s %s
%s
/axis-cgi/com/ptz.cgi?camera=1
\\
¢er=%d,%d"
,
authstr
,
outstr
,
url
,
x
,
y
);
int
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
printf
(
"** Error from wget: %d
\n
"
,
sts
>>
8
);
...
...
@@ -444,8 +464,8 @@ void XttCameraControlVapix::area_zoom( int x, int y, int width, int height, int
if
(
zoom
>
9999
)
zoom
=
9999
;
sprintf
(
cmd
,
"wget --ignore-length %s %s/axis-cgi/com/ptz.cgi?camera=1
\\
&areazoom=%d,%d,%d"
,
outstr
,
url
,
x
,
y
,
zoom
);
sprintf
(
cmd
,
"wget --ignore-length %s %s
%s
/axis-cgi/com/ptz.cgi?camera=1
\\
&areazoom=%d,%d,%d"
,
authstr
,
outstr
,
url
,
x
,
y
,
zoom
);
int
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
printf
(
"** Error from wget: %d
\n
"
,
sts
>>
8
);
...
...
@@ -472,8 +492,8 @@ int XttCameraControlVapix::get_position( double *pan, double *tilt, double *zoom
if
(
ODD
(
sts
))
old_file_found
=
1
;
sprintf
(
cmd
,
"wget --ignore-length %s %s/axis-cgi/com/ptz.cgi?camera=1
\\
&query=position --output-document=%s"
,
outstr
,
url
,
fname
);
sprintf
(
cmd
,
"wget --ignore-length %s %s
%s
/axis-cgi/com/ptz.cgi?camera=1
\\
&query=position --output-document=%s"
,
authstr
,
outstr
,
url
,
fname
);
sts
=
system
(
cmd
);
if
(
sts
!=
0
)
printf
(
"** Error from wget: %d
\n
"
,
sts
>>
8
);
...
...
xtt/lib/xtt/src/xtt_stream.h
View file @
7cb35204
...
...
@@ -64,7 +64,10 @@ class XttCameraControl {
class
XttCameraControlVapix
:
public
XttCameraControl
{
public:
XttCameraControlVapix
(
char
*
x_url
);
char
outstr
[
20
];
char
authstr
[
100
];
XttCameraControlVapix
(
char
*
x_url
,
char
*
x_user
,
char
*
x_password
);
~
XttCameraControlVapix
()
{}
void
zoom_relative
(
double
factor
);
void
zoom_absolute
(
double
factor
);
...
...
@@ -96,6 +99,8 @@ class XttStream {
int
stream_width
;
int
stream_height
;
double
stream_ratio
;
pwr_tString40
user
;
pwr_tString40
password
;
void
(
*
close_cb
)(
void
*
,
XttStream
*
);
XttCameraControl
*
camera_control
;
pwr_tEnum
control_protocol
;
...
...
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