Commit e2ef4f4b authored by Claes Sjofors's avatar Claes Sjofors

XttVideo changed to XttCamera

parent 60bd4215
...@@ -33,27 +33,27 @@ ...@@ -33,27 +33,27 @@
! combined work), being distributed under the terms of the GNU ! combined work), being distributed under the terms of the GNU
! General Public License plus this exception. ! General Public License plus this exception.
! !
! pwrb_c_xttvideo.wb_load -- Defines the class XttVideo. ! pwrb_c_xttcamera.wb_load -- Defines the class XttCamera.
! !
SObject pwrb:Class SObject pwrb:Class
!/** !/**
! @Version 1.0 ! @Version 1.0
! @Group Operator,NodeConfiguration ! @Group Operator,NodeConfiguration
! @Summary Configure a video stream ! @Summary Configure a video camera stream
! The XttVideo object configures a video stream. ! The XttCamera object configures a video camera stream.
! !
! @b See also ! @b See also
! @classlink OpPlace pwrb_opplace.html ! @classlink OpPlace pwrb_opplace.html
!*/ !*/
! !
Object XttVideo $ClassDef 653 Object XttCamera $ClassDef 653
Body SysBody Body SysBody
Attr Editor = pwr_eEditor_AttrEd Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard Attr Method = pwr_eMethod_Standard
EndBody EndBody
Object RtBody $ObjBodyDef 1 Object RtBody $ObjBodyDef 1
Body SysBody Body SysBody
Attr StructName = "XttVideo" Attr StructName = "XttCamera"
EndBody EndBody
!/** !/**
! Description of the object. ! Description of the object.
...@@ -120,7 +120,7 @@ SObject pwrb:Class ...@@ -120,7 +120,7 @@ SObject pwrb:Class
EndBody EndBody
EndObject EndObject
!/** !/**
! Options for the video. ! Options for the camera.
! !
! - FullScreen Open the graph as full screen without frame. ! - FullScreen Open the graph as full screen without frame.
! - Maximize Open the graph maximized, not covering the operator window (NYI). ! - Maximize Open the graph maximized, not covering the operator window (NYI).
...@@ -130,7 +130,7 @@ SObject pwrb:Class ...@@ -130,7 +130,7 @@ SObject pwrb:Class
!*/ !*/
Object Options $Attribute 10 Object Options $Attribute 10
Body SysBody Body SysBody
Attr TypeRef = "pwrb:Type-VideoOptionsMask" Attr TypeRef = "pwrb:Type-CameraOptionsMask"
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -189,7 +189,7 @@ SObject pwrb:Class ...@@ -189,7 +189,7 @@ SObject pwrb:Class
EndBody EndBody
EndObject EndObject
EndObject EndObject
Object Template XttVideo Object Template XttCamera
Body RtBody Body RtBody
Attr Width = 800 Attr Width = 800
Attr Height = 600 Attr Height = 600
......
...@@ -33,18 +33,18 @@ ...@@ -33,18 +33,18 @@
! combined work), being distributed under the terms of the GNU ! combined work), being distributed under the terms of the GNU
! General Public License plus this exception. ! General Public License plus this exception.
! !
! pwrb_videloptionsmask.wb_load -- Defines the mask type VideoOptionsMask ! pwrb_videloptionsmask.wb_load -- Defines the mask type CameraOptionsMask
! !
SObject pwrb:Type SObject pwrb:Type
!/** !/**
! @Version 1.0 ! @Version 1.0
! @Group Types ! @Group Types
! Bitmask for xtt video options. ! Bitmask for xtt camera options.
! !
! @b See also ! @b See also
! @classlink XttVideo pwrb_xttvideo.html ! @classlink XttCamera pwrb_xttcamera.html
!*/ !*/
Object VideoOptionsMask $TypeDef 79 Object CameraOptionsMask $TypeDef 79
Body SysBody Body SysBody
Attr Type = pwr_eType_Mask Attr Type = pwr_eType_Mask
Attr Size = 4 Attr Size = 4
...@@ -102,33 +102,13 @@ SObject pwrb:Type ...@@ -102,33 +102,13 @@ SObject pwrb:Type
EndBody EndBody
EndObject EndObject
!/** !/**
! Display a video control panel with Play, Pause and Stop buttons.
!*/
Object VideoControlPanel $Bit
Body SysBody
Attr PgmName = "VideoControlPanel"
Attr Text = "VideoControlPanel"
Attr Value = 32
EndBody
EndObject
!/**
! Add progress bar to control panel.
!*/
Object VideoProgressBar $Bit
Body SysBody
Attr PgmName = "VideoProgressBar"
Attr Text = "VideoProgressBar"
Attr Value = 64
EndBody
EndObject
!/**
! Http basic authentication. ! Http basic authentication.
!*/ !*/
Object HttpBasicAuthentication $Bit Object HttpBasicAuthentication $Bit
Body SysBody Body SysBody
Attr PgmName = "HttpBasicAuthentication" Attr PgmName = "HttpBasicAuthentication"
Attr Text = "HttpBasicAuthentication" Attr Text = "HttpBasicAuthentication"
Attr Value = 128 Attr Value = 32
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -138,7 +118,7 @@ SObject pwrb:Type ...@@ -138,7 +118,7 @@ SObject pwrb:Type
Body SysBody Body SysBody
Attr PgmName = "CgiParameterAuthentication" Attr PgmName = "CgiParameterAuthentication"
Attr Text = "CgiParameterAuthentication" Attr Text = "CgiParameterAuthentication"
Attr Value = 256 Attr Value = 64
EndBody EndBody
EndObject EndObject
EndObject EndObject
......
...@@ -130,12 +130,12 @@ SObject pwrb:Type ...@@ -130,12 +130,12 @@ SObject pwrb:Type
EndBody EndBody
EndObject EndObject
!/** !/**
! Video. ! Camera.
!*/ !*/
Object Video $Value Object Camera $Value
Body SysBody Body SysBody
Attr PgmName = "Video" Attr PgmName = "Camera"
Attr Text = "Video" Attr Text = "Camera"
Attr Value = 8 Attr Value = 8
EndBody EndBody
EndObject EndObject
......
...@@ -366,9 +366,9 @@ void Xtt::activate_opengraph() ...@@ -366,9 +366,9 @@ void Xtt::activate_opengraph()
sprintf( cmd, "open mult /name=%s", vname); sprintf( cmd, "open mult /name=%s", vname);
xnav->command( cmd); xnav->command( cmd);
return; return;
case pwr_cClass_XttVideo: case pwr_cClass_XttCamera:
// Open video // Open video
sprintf( cmd, "open vide /obj=%s", vname); sprintf( cmd, "open camera /obj=%s", vname);
xnav->command( cmd); xnav->command( cmd);
return; return;
case pwr_cClass_DsTrend: case pwr_cClass_DsTrend:
......
...@@ -712,8 +712,8 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx, ...@@ -712,8 +712,8 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
break; break;
} }
case pwr_eMultiViewContentEnum_Video: { case pwr_eMultiViewContentEnum_Camera: {
pwr_sClass_XttVideo xttvideo; pwr_sClass_XttCamera xttcamera;
pwr_tObjid objid; pwr_tObjid objid;
pwr_tCid cid; pwr_tCid cid;
...@@ -724,18 +724,18 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx, ...@@ -724,18 +724,18 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
lsts = gdh_GetObjectClass( objid, &cid); lsts = gdh_GetObjectClass( objid, &cid);
if ( EVEN(lsts)) break; if ( EVEN(lsts)) break;
if ( cid != pwr_cClass_XttVideo) if ( cid != pwr_cClass_XttCamera)
break; break;
pwr_tAttrRef aref = cdh_ObjidToAref( objid); pwr_tAttrRef aref = cdh_ObjidToAref( objid);
lsts = gdh_GetObjectInfoAttrref( &aref, (pwr_tAddress)&xttvideo, sizeof(xttvideo)); lsts = gdh_GetObjectInfoAttrref( &aref, (pwr_tAddress)&xttcamera, sizeof(xttcamera));
if (EVEN(lsts)) break; if (EVEN(lsts)) break;
unsigned int options = xttvideo.Options; unsigned int options = xttcamera.Options;
strmctx[i*rows + j] = new XttStreamGtk( toplevel, this, "No title", strmctx[i*rows + j] = new XttStreamGtk( toplevel, this, "No title",
xttvideo.URL, xttcamera.URL,
mv.Action[i*rows+j].Width, mv.Action[i*rows+j].Height, mv.Action[i*rows+j].Width, mv.Action[i*rows+j].Height,
0, 0, 0, options, 1, &aref, sts); 0, 0, 0, options, 1, &aref, sts);
...@@ -743,8 +743,8 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx, ...@@ -743,8 +743,8 @@ XttMultiViewGtk::XttMultiViewGtk( GtkWidget *mv_parent_wid, void *mv_parent_ctx,
comp_widget[i*rows + j] = (GtkWidget *)strmctx[i*rows + j]->get_widget(); comp_widget[i*rows + j] = (GtkWidget *)strmctx[i*rows + j]->get_widget();
appl.insert( applist_eType_Stream, (void *)strmctx[i*rows + j], objid, xttvideo.Title, appl.insert( applist_eType_Stream, (void *)strmctx[i*rows + j], objid, xttcamera.Title,
xttvideo.URL); xttcamera.URL);
break; break;
} }
...@@ -1266,20 +1266,20 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char ...@@ -1266,20 +1266,20 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char
mv.Action[i*rows+j].Object[0] = object_aref; mv.Action[i*rows+j].Object[0] = object_aref;
} }
case pwr_eMultiViewContentEnum_Video: { case pwr_eMultiViewContentEnum_Camera: {
pwr_sClass_XttVideo xttvideo; pwr_sClass_XttCamera xttcamera;
pwr_tStatus lsts; pwr_tStatus lsts;
pwr_tAttrRef object_aref; pwr_tAttrRef object_aref;
lsts = gdh_NameToAttrref( pwr_cNObjid, object, &object_aref); lsts = gdh_NameToAttrref( pwr_cNObjid, object, &object_aref);
if ( EVEN(lsts)) break; if ( EVEN(lsts)) break;
lsts = gdh_GetObjectInfoAttrref( &object_aref, (pwr_tAddress)&xttvideo, sizeof(xttvideo)); lsts = gdh_GetObjectInfoAttrref( &object_aref, (pwr_tAddress)&xttcamera, sizeof(xttcamera));
if (EVEN(lsts)) break; if (EVEN(lsts)) break;
XttStreamGtk *ctx = new XttStreamGtk( toplevel, this, "No title", XttStreamGtk *ctx = new XttStreamGtk( toplevel, this, "No title",
xttvideo.URL, w, h, 0, 0, xttcamera.URL, w, h, 0, 0,
0, xttvideo.Options, 1, &object_aref, &lsts); 0, xttcamera.Options, 1, &object_aref, &lsts);
GtkWidget *comp_w = (GtkWidget *)ctx->get_widget(); GtkWidget *comp_w = (GtkWidget *)ctx->get_widget();
...@@ -1297,8 +1297,8 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char ...@@ -1297,8 +1297,8 @@ int XttMultiViewGtk::set_subwindow_source( const char *name, char *source, char
if ( insert) if ( insert)
recall_buffer[i*rows + j].insert( source, object); recall_buffer[i*rows + j].insert( source, object);
appl.insert( applist_eType_Stream, (void *)strmctx[i*rows + j], object_aref.Objid, xttvideo.Title, appl.insert( applist_eType_Stream, (void *)strmctx[i*rows + j], object_aref.Objid, xttcamera.Title,
xttvideo.URL); xttcamera.URL);
break; break;
} }
default: ; default: ;
......
...@@ -1086,8 +1086,8 @@ int OpGtk::configure( char *opplace_str) ...@@ -1086,8 +1086,8 @@ int OpGtk::configure( char *opplace_str)
sts = gdh_ClassAttrToAttrref( pwr_cClass_XttMultiView, ".ButtonText", &attrref); sts = gdh_ClassAttrToAttrref( pwr_cClass_XttMultiView, ".ButtonText", &attrref);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
break; break;
case pwr_cClass_XttVideo: case pwr_cClass_XttCamera:
sts = gdh_ClassAttrToAttrref( pwr_cClass_XttVideo, ".ButtonText", &attrref); sts = gdh_ClassAttrToAttrref( pwr_cClass_XttCamera, ".ButtonText", &attrref);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
break; break;
default: default:
......
...@@ -182,8 +182,8 @@ void XttStreamGtk::refresh_ui( XttStreamGtk *strm) ...@@ -182,8 +182,8 @@ void XttStreamGtk::refresh_ui( XttStreamGtk *strm)
GstFormat fmt = GST_FORMAT_TIME; GstFormat fmt = GST_FORMAT_TIME;
gint64 current = -1; gint64 current = -1;
if ( !(strm->options & pwr_mVideoOptionsMask_VideoControlPanel && if ( !(strm->options & strm_mOptions_VideoControlPanel &&
strm->options & pwr_mVideoOptionsMask_VideoProgressBar)) strm->options & strm_mOptions_VideoProgressBar))
return; return;
/* We do not want to update anything unless we are in the PAUSED or PLAYING states */ /* We do not want to update anything unless we are in the PAUSED or PLAYING states */
...@@ -560,7 +560,7 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const ...@@ -560,7 +560,7 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const
/* Set the URI to play, eg "http://192.168.67.248/mjpg/video.mjpg" */ /* Set the URI to play, eg "http://192.168.67.248/mjpg/video.mjpg" */
pwr_tURL luri; pwr_tURL luri;
char *s; char *s;
if ( options & pwr_mVideoOptionsMask_HttpBasicAuthentication) { if ( options & strm_mOptions_HttpBasicAuthentication) {
if ( strcmp( user, "") != 0 && strcmp( password, "") != 0 && (s = strstr( uri, "://"))) { if ( strcmp( user, "") != 0 && strcmp( password, "") != 0 && (s = strstr( uri, "://"))) {
unsigned long int offs = s - (char *)uri + 3; unsigned long int offs = s - (char *)uri + 3;
strncpy( luri, uri, offs); strncpy( luri, uri, offs);
...@@ -574,7 +574,7 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const ...@@ -574,7 +574,7 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const
else else
strcpy( luri, uri); strcpy( luri, uri);
} }
else if ( options & pwr_mVideoOptionsMask_CgiParameterAuthentication) else if ( options & strm_mOptions_CgiParameterAuthentication)
snprintf( luri, sizeof(luri), "%s?user=%s&pwd=%s", uri, user, password); snprintf( luri, sizeof(luri), "%s?user=%s&pwd=%s", uri, user, password);
else else
strcpy( luri, uri); strcpy( luri, uri);
...@@ -613,7 +613,7 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const ...@@ -613,7 +613,7 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const
// GtkWidget *controls; // GtkWidget *controls;
GtkWidget *hbox = gtk_hbox_new( FALSE, 0); GtkWidget *hbox = gtk_hbox_new( FALSE, 0);
if ( options & pwr_mVideoOptionsMask_VideoControlPanel) { if ( options & strm_mOptions_VideoControlPanel) {
GtkToolbar *controlbuttons; GtkToolbar *controlbuttons;
controlbuttons = (GtkToolbar *) g_object_new(GTK_TYPE_TOOLBAR, NULL); controlbuttons = (GtkToolbar *) g_object_new(GTK_TYPE_TOOLBAR, NULL);
...@@ -641,7 +641,7 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const ...@@ -641,7 +641,7 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const
gtk_box_pack_start( GTK_BOX( hbox), GTK_WIDGET(controlbuttons), FALSE, FALSE, 2); gtk_box_pack_start( GTK_BOX( hbox), GTK_WIDGET(controlbuttons), FALSE, FALSE, 2);
if ( options & pwr_mVideoOptionsMask_VideoProgressBar) { if ( options & strm_mOptions_VideoProgressBar) {
slider = gtk_hscale_new_with_range( 0, 100, 1); slider = gtk_hscale_new_with_range( 0, 100, 1);
gtk_scale_set_draw_value( GTK_SCALE( slider), 0); gtk_scale_set_draw_value( GTK_SCALE( slider), 0);
slider_update_signal_id = g_signal_connect( G_OBJECT( slider), "value-changed", G_CALLBACK( slider_cb), this); slider_update_signal_id = g_signal_connect( G_OBJECT( slider), "value-changed", G_CALLBACK( slider_cb), this);
...@@ -847,7 +847,7 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const ...@@ -847,7 +847,7 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const
main_box = gtk_vbox_new( FALSE, 0); main_box = gtk_vbox_new( FALSE, 0);
gtk_box_pack_start( GTK_BOX( main_box), GTK_WIDGET(tools_box), FALSE, FALSE, 0); gtk_box_pack_start( GTK_BOX( main_box), GTK_WIDGET(tools_box), FALSE, FALSE, 0);
gtk_box_pack_start( GTK_BOX( main_box), video_form, TRUE, TRUE, 0); gtk_box_pack_start( GTK_BOX( main_box), video_form, TRUE, TRUE, 0);
if ( options & pwr_mVideoOptionsMask_VideoControlPanel) if ( options & strm_mOptions_VideoControlPanel)
gtk_box_pack_start( GTK_BOX( main_box), GTK_WIDGET(hbox), FALSE, FALSE, 0); gtk_box_pack_start( GTK_BOX( main_box), GTK_WIDGET(hbox), FALSE, FALSE, 0);
...@@ -859,23 +859,23 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const ...@@ -859,23 +859,23 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const
if ( ptz_box) if ( ptz_box)
g_object_set( ptz_box, "visible", FALSE, NULL); g_object_set( ptz_box, "visible", FALSE, NULL);
if ( !(options & pwr_mVideoOptionsMask_CameraControlPanel)) if ( !(options & strm_mOptions_CameraControlPanel))
g_object_set( tools, "visible", FALSE, NULL); g_object_set( tools, "visible", FALSE, NULL);
if ( options & pwr_mVideoOptionsMask_FullScreen) if ( options & strm_mOptions_FullScreen)
gtk_window_fullscreen( GTK_WINDOW(toplevel)); gtk_window_fullscreen( GTK_WINDOW(toplevel));
else if ( options & pwr_mVideoOptionsMask_Maximize) else if ( options & strm_mOptions_Maximize)
gtk_window_maximize( GTK_WINDOW(toplevel)); // TODO gtk_window_maximize( GTK_WINDOW(toplevel)); // TODO
else if ( options & pwr_mVideoOptionsMask_FullMaximize) else if ( options & strm_mOptions_FullMaximize)
gtk_window_maximize( GTK_WINDOW(toplevel)); gtk_window_maximize( GTK_WINDOW(toplevel));
else if ( options & pwr_mVideoOptionsMask_Iconify) else if ( options & strm_mOptions_Iconify)
gtk_window_iconify( GTK_WINDOW(toplevel)); gtk_window_iconify( GTK_WINDOW(toplevel));
} }
else { else {
gtk_widget_set_size_request( main_box, width, height); gtk_widget_set_size_request( main_box, width, height);
if ( ptz_box) if ( ptz_box)
g_object_set( ptz_box, "visible", FALSE, NULL); g_object_set( ptz_box, "visible", FALSE, NULL);
if ( (options & pwr_mVideoOptionsMask_CameraControlPanel) == 0) if ( (options & strm_mOptions_CameraControlPanel) == 0)
g_object_set( tools, "visible", FALSE, NULL); g_object_set( tools, "visible", FALSE, NULL);
} }
...@@ -933,7 +933,7 @@ void XttStreamGtk::setup() ...@@ -933,7 +933,7 @@ void XttStreamGtk::setup()
{ {
if ( ptz_box) if ( ptz_box)
g_object_set( ptz_box, "visible", FALSE, NULL); g_object_set( ptz_box, "visible", FALSE, NULL);
if ( !(options & pwr_mVideoOptionsMask_CameraControlPanel)) if ( !(options & strm_mOptions_CameraControlPanel))
g_object_set( tools, "visible", FALSE, NULL); g_object_set( tools, "visible", FALSE, NULL);
} }
......
...@@ -501,8 +501,8 @@ static pwr_tStatus Camera( xmenu_sMenuCall *ip) ...@@ -501,8 +501,8 @@ static pwr_tStatus Camera( xmenu_sMenuCall *ip)
cdh_mName_volumeStrict); cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
// Open video // Open camera
sprintf( cmd, "open video /cameraposition=%s", name); sprintf( cmd, "open camera /cameraposition=%s", name);
((XNav *)ip->EditorContext)->command( cmd); ((XNav *)ip->EditorContext)->command( cmd);
return 1; return 1;
} }
...@@ -523,8 +523,8 @@ static pwr_tStatus Camera( xmenu_sMenuCall *ip) ...@@ -523,8 +523,8 @@ static pwr_tStatus Camera( xmenu_sMenuCall *ip)
cdh_mName_volumeStrict); cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
// Open video // Open camera
sprintf( cmd, "open video /cameraposition=%s", name); sprintf( cmd, "open camera /cameraposition=%s", name);
((XNav *)ip->EditorContext)->command( cmd); ((XNav *)ip->EditorContext)->command( cmd);
return 1; return 1;
} }
...@@ -553,8 +553,8 @@ static pwr_tStatus Camera( xmenu_sMenuCall *ip) ...@@ -553,8 +553,8 @@ static pwr_tStatus Camera( xmenu_sMenuCall *ip)
cdh_mName_volumeStrict); cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
// Open video // Open camera
sprintf( cmd, "open video /cameraposition=%s", name); sprintf( cmd, "open camera /cameraposition=%s", name);
((XNav *)ip->EditorContext)->command( cmd); ((XNav *)ip->EditorContext)->command( cmd);
return 1; return 1;
...@@ -1051,9 +1051,9 @@ static pwr_tStatus OpenGraph( xmenu_sMenuCall *ip) ...@@ -1051,9 +1051,9 @@ static pwr_tStatus OpenGraph( xmenu_sMenuCall *ip)
sts = ((XNav *)ip->EditorContext)->command( cmd); sts = ((XNav *)ip->EditorContext)->command( cmd);
return XNAV__SUCCESS; return XNAV__SUCCESS;
} }
else if ( classid == pwr_cClass_XttVideo) { else if ( classid == pwr_cClass_XttCamera) {
sts = gdh_AttrrefToName( objar, name, sizeof(name), cdh_mNName); sts = gdh_AttrrefToName( objar, name, sizeof(name), cdh_mNName);
strcpy( cmd, "ope vide/obj="); strcpy( cmd, "ope camera/obj=");
strcat( cmd, name); strcat( cmd, name);
sts = ((XNav *)ip->EditorContext)->command( cmd); sts = ((XNav *)ip->EditorContext)->command( cmd);
return XNAV__SUCCESS; return XNAV__SUCCESS;
...@@ -1085,7 +1085,7 @@ static pwr_tStatus OpenGraph( xmenu_sMenuCall *ip) ...@@ -1085,7 +1085,7 @@ static pwr_tStatus OpenGraph( xmenu_sMenuCall *ip)
sts = ((XNav *)ip->EditorContext)->command( cmd); sts = ((XNav *)ip->EditorContext)->command( cmd);
break; break;
} }
else if ( classid == pwr_cClass_XttVideo) { else if ( classid == pwr_cClass_XttCamera) {
sts = gdh_AttrrefToName( &defgraph, name, sizeof(name), cdh_mNName); sts = gdh_AttrrefToName( &defgraph, name, sizeof(name), cdh_mNName);
strcpy( cmd, "ope vide/obj="); strcpy( cmd, "ope vide/obj=");
strcat( cmd, name); strcat( cmd, name);
...@@ -1131,7 +1131,7 @@ static pwr_tStatus OpenGraphFilter( xmenu_sMenuCall *ip) ...@@ -1131,7 +1131,7 @@ static pwr_tStatus OpenGraphFilter( xmenu_sMenuCall *ip)
if ( classid == pwr_cClass_XttGraph || if ( classid == pwr_cClass_XttGraph ||
classid == pwr_cClass_XttMultiView || classid == pwr_cClass_XttMultiView ||
classid == pwr_cClass_XttVideo) classid == pwr_cClass_XttCamera)
return XNAV__SUCCESS; return XNAV__SUCCESS;
while( ODD(sts)) { while( ODD(sts)) {
...@@ -1166,7 +1166,7 @@ static pwr_tStatus OpenGraphFilter( xmenu_sMenuCall *ip) ...@@ -1166,7 +1166,7 @@ static pwr_tStatus OpenGraphFilter( xmenu_sMenuCall *ip)
} }
else if ( classid == pwr_cClass_XttMultiView) else if ( classid == pwr_cClass_XttMultiView)
return XNAV__SUCCESS; return XNAV__SUCCESS;
else if ( classid == pwr_cClass_XttVideo) else if ( classid == pwr_cClass_XttCamera)
return XNAV__SUCCESS; return XNAV__SUCCESS;
} }
......
...@@ -117,8 +117,8 @@ int Op::appl_action( int idx) ...@@ -117,8 +117,8 @@ int Op::appl_action( int idx)
strcpy( cmd, "ope mult "); strcpy( cmd, "ope mult ");
strcat( cmd, name); strcat( cmd, name);
break; break;
case pwr_cClass_XttVideo: case pwr_cClass_XttCamera:
strcpy( cmd, "ope vide/obj="); strcpy( cmd, "ope camera/obj=");
strcat( cmd, name); strcat( cmd, name);
break; break;
default: default:
......
...@@ -44,6 +44,19 @@ ...@@ -44,6 +44,19 @@
class CoWow; class CoWow;
class CoWowTimer; class CoWowTimer;
typedef enum {
strm_mOptions_FullScreen = 1,
strm_mOptions_Maximize = 2,
strm_mOptions_FullMaximize = 4,
strm_mOptions_Iconify = 8,
strm_mOptions_CameraControlPanel = 16,
strm_mOptions_VideoControlPanel = 32,
strm_mOptions_VideoProgressBar = 64,
strm_mOptions_HttpBasicAuthentication = 128,
strm_mOptions_CgiParameterAuthentication = 256,
} strm_mOptions;
class XttCameraControl { class XttCameraControl {
public: public:
pwr_tURL url; pwr_tURL url;
......
...@@ -4364,8 +4364,8 @@ void XNav::appl_startup() ...@@ -4364,8 +4364,8 @@ void XNav::appl_startup()
command( cmd); command( cmd);
break; break;
case pwr_cClass_XttVideo: case pwr_cClass_XttCamera:
strcpy( cmd, "ope vid/obj="); strcpy( cmd, "ope camera/obj=");
strcat( cmd, name); strcat( cmd, name);
command( cmd); command( cmd);
break; break;
......
...@@ -3529,7 +3529,8 @@ static int xnav_open_func( void *client_data, ...@@ -3529,7 +3529,8 @@ static int xnav_open_func( void *client_data,
} }
return XNAV__SUCCESS; return XNAV__SUCCESS;
} }
else if ( cdh_NoCaseStrncmp( arg1_str, "VIDEO", strlen( arg1_str)) == 0) { else if ( cdh_NoCaseStrncmp( arg1_str, "CAMERA", strlen( arg1_str)) == 0 ||
cdh_NoCaseStrncmp( arg1_str, "VIDEO", strlen( arg1_str)) == 0) {
char tmp_str[80]; char tmp_str[80];
int width, height; int width, height;
int x, y; int x, y;
...@@ -3542,8 +3543,10 @@ static int xnav_open_func( void *client_data, ...@@ -3542,8 +3543,10 @@ static int xnav_open_func( void *client_data,
pwr_tAName camerapos_str; pwr_tAName camerapos_str;
int camerapos_found = 0; int camerapos_found = 0;
pwr_sClass_CameraPosition pos; pwr_sClass_CameraPosition pos;
int is_video = (cdh_NoCaseStrncmp( arg1_str, "VIDEO", strlen( arg1_str)) == 0);
// Command is "OPEN VIDEO" // Command is "OPEN CAMERA" or "OPEN VIDEO"
if ( ODD( dcli_get_qualifier( "/CAMERAPOSITION", camerapos_str, sizeof(camerapos_str)))) { if ( ODD( dcli_get_qualifier( "/CAMERAPOSITION", camerapos_str, sizeof(camerapos_str)))) {
// CameraPosition object supplied // CameraPosition object supplied
...@@ -3562,15 +3565,15 @@ static int xnav_open_func( void *client_data, ...@@ -3562,15 +3565,15 @@ static int xnav_open_func( void *client_data,
camerapos_found = 1; camerapos_found = 1;
} }
if ( camerapos_found || ODD( dcli_get_qualifier( "/OBJECT", object_str, sizeof(object_str)))) { if ( camerapos_found || ODD( dcli_get_qualifier( "/OBJECT", object_str, sizeof(object_str)))) {
// XttVideo object supplied, fetch data from object // XttCamera object supplied, fetch data from object
pwr_tOName xttvideo_name; pwr_tOName xttcamera_name;
pwr_sClass_XttVideo xttvideo; pwr_sClass_XttCamera xttcamera;
pwr_tObjid objid; pwr_tObjid objid;
pwr_tCid cid; pwr_tCid cid;
xnav_replace_node_str( xttvideo_name, object_str); xnav_replace_node_str( xttcamera_name, object_str);
sts = gdh_NameToObjid( xttvideo_name, &objid); sts = gdh_NameToObjid( xttcamera_name, &objid);
if (EVEN(sts)) { if (EVEN(sts)) {
xnav->message('E', "Object not found"); xnav->message('E', "Object not found");
return XNAV__HOLDCOMMAND; return XNAV__HOLDCOMMAND;
...@@ -3579,22 +3582,36 @@ static int xnav_open_func( void *client_data, ...@@ -3579,22 +3582,36 @@ static int xnav_open_func( void *client_data,
sts = gdh_GetObjectClass( objid, &cid); sts = gdh_GetObjectClass( objid, &cid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if ( cid != pwr_cClass_XttVideo) { if ( cid != pwr_cClass_XttCamera) {
xnav->message('E', "Error in object class"); xnav->message('E', "Error in object class");
return XNAV__HOLDCOMMAND; return XNAV__HOLDCOMMAND;
} }
pwr_tAttrRef aref = cdh_ObjidToAref( objid); pwr_tAttrRef aref = cdh_ObjidToAref( objid);
sts = gdh_GetObjectInfoAttrref( &aref, (pwr_tAddress)&xttvideo, sizeof(xttvideo)); sts = gdh_GetObjectInfoAttrref( &aref, (pwr_tAddress)&xttcamera, sizeof(xttcamera));
if (EVEN(sts)) return sts; if (EVEN(sts)) return sts;
strncpy( name_str, xttvideo.Title, sizeof(name_str)); strncpy( name_str, xttcamera.Title, sizeof(name_str));
strncpy( url_str, xttvideo.URL, sizeof(url_str)); strncpy( url_str, xttcamera.URL, sizeof(url_str));
width = xttvideo.Width; width = xttcamera.Width;
height = xttvideo.Height; height = xttcamera.Height;
x = xttvideo.X; x = xttcamera.X;
y = xttvideo.Y; y = xttcamera.Y;
options = xttvideo.Options; options = 0;
if ( xttcamera.Options & pwr_mCameraOptionsMask_FullScreen)
options |= strm_mOptions_FullScreen;
if ( xttcamera.Options & pwr_mCameraOptionsMask_Maximize)
options |= strm_mOptions_Maximize;
if ( xttcamera.Options & pwr_mCameraOptionsMask_FullMaximize)
options |= strm_mOptions_FullMaximize;
if ( xttcamera.Options & pwr_mCameraOptionsMask_Iconify)
options |= strm_mOptions_Iconify;
if ( xttcamera.Options & pwr_mCameraOptionsMask_CameraControlPanel)
options |= strm_mOptions_CameraControlPanel;
if ( xttcamera.Options & pwr_mCameraOptionsMask_HttpBasicAuthentication)
options |= strm_mOptions_HttpBasicAuthentication;
if ( xttcamera.Options & pwr_mCameraOptionsMask_CgiParameterAuthentication)
options |= strm_mOptions_CgiParameterAuthentication;
XttStream *strmctx; XttStream *strmctx;
...@@ -3625,19 +3642,23 @@ static int xnav_open_func( void *client_data, ...@@ -3625,19 +3642,23 @@ static int xnav_open_func( void *client_data,
} }
if ( ODD( dcli_get_qualifier( "/FULLSCREEN", 0, 0))) if ( ODD( dcli_get_qualifier( "/FULLSCREEN", 0, 0)))
options |= pwr_mVideoOptionsMask_FullScreen; options |= strm_mOptions_FullScreen;
if ( ODD( dcli_get_qualifier( "/MAXIMIZE", 0, 0))) if ( ODD( dcli_get_qualifier( "/MAXIMIZE", 0, 0)))
options |= pwr_mVideoOptionsMask_Maximize; options |= strm_mOptions_Maximize;
if ( ODD( dcli_get_qualifier( "/FULLMAXIMIZE", 0, 0))) if ( ODD( dcli_get_qualifier( "/FULLMAXIMIZE", 0, 0)))
options |= pwr_mVideoOptionsMask_FullMaximize; options |= strm_mOptions_FullMaximize;
if ( ODD( dcli_get_qualifier( "/ICONIFY", 0, 0))) if ( ODD( dcli_get_qualifier( "/ICONIFY", 0, 0)))
options |= pwr_mVideoOptionsMask_Iconify; options |= strm_mOptions_Iconify;
if ( ODD( dcli_get_qualifier( "/CAMERACONTROLPANEL", 0, 0))) if ( is_video) {
options |= pwr_mVideoOptionsMask_CameraControlPanel; if ( ODD( dcli_get_qualifier( "/VIDEOCONTROLPANEL", 0, 0)))
if ( ODD( dcli_get_qualifier( "/VIDEOCONTROLPANEL", 0, 0))) options |= strm_mOptions_VideoControlPanel;
options |= pwr_mVideoOptionsMask_VideoControlPanel; if ( ODD( dcli_get_qualifier( "/VIDEOPROGRESSBAR", 0, 0)))
if ( ODD( dcli_get_qualifier( "/VIDEOPROGRESSBAR", 0, 0))) options |= strm_mOptions_VideoProgressBar;
options |= pwr_mVideoOptionsMask_VideoProgressBar; }
else {
if ( ODD( dcli_get_qualifier( "/CAMERACONTROLPANEL", 0, 0)))
options |= strm_mOptions_CameraControlPanel;
}
if ( ODD( dcli_get_qualifier( "/WIDTH", tmp_str, sizeof(tmp_str)))) { if ( ODD( dcli_get_qualifier( "/WIDTH", tmp_str, sizeof(tmp_str)))) {
nr = sscanf( tmp_str, "%d", &width); nr = sscanf( tmp_str, "%d", &width);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment