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
17a8f94e
Commit
17a8f94e
authored
Jan 26, 2015
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xtt stream work
parent
9fd2a1f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
15 deletions
+99
-15
xtt/lib/xtt/gtk/xtt_stream_gtk.cpp
xtt/lib/xtt/gtk/xtt_stream_gtk.cpp
+87
-13
xtt/lib/xtt/gtk/xtt_stream_gtk.h
xtt/lib/xtt/gtk/xtt_stream_gtk.h
+2
-0
xtt/lib/xtt/src/xtt_xnav_command.cpp
xtt/lib/xtt/src/xtt_xnav_command.cpp
+10
-2
No files found.
xtt/lib/xtt/gtk/xtt_stream_gtk.cpp
View file @
17a8f94e
...
...
@@ -237,18 +237,88 @@ void XttStreamGtk::tags_cb( GstElement *playbin2, gint stream, void *data)
void
XttStreamGtk
::
error_cb
(
GstBus
*
bus
,
GstMessage
*
msg
,
void
*
data
)
{
XttStreamGtk
*
strm
=
(
XttStreamGtk
*
)
data
;
GError
*
err
;
gchar
*
debug_info
;
/* Print error details on the screen */
gst_message_parse_error
(
msg
,
&
err
,
&
debug_info
);
printf
(
"Error received from element %s: %s
\n
"
,
GST_OBJECT_NAME
(
msg
->
src
),
err
->
message
);
printf
(
"Debugging information: %s
\n
"
,
debug_info
?
debug_info
:
"none"
);
g_clear_error
(
&
err
);
g_free
(
debug_info
);
switch
(
GST_MESSAGE_TYPE
(
msg
))
{
case
GST_MESSAGE_ERROR
:
{
GError
*
err
;
gchar
*
debug_info
;
/* Set the pipeline to READY (which stops playback) */
gst_element_set_state
(
strm
->
playbin2
,
GST_STATE_READY
);
printf
(
"Message %d
\n
"
,
GST_MESSAGE_TYPE
(
data
));
/* Print error details on the screen */
gst_message_parse_error
(
msg
,
&
err
,
&
debug_info
);
printf
(
"Error received from element %s: %s
\n
"
,
GST_OBJECT_NAME
(
msg
->
src
),
err
->
message
);
printf
(
"Debugging information: %s
\n
"
,
debug_info
?
debug_info
:
"none"
);
g_clear_error
(
&
err
);
g_free
(
debug_info
);
/* Set the pipeline to READY (which stops playback) */
gst_element_set_state
(
strm
->
playbin2
,
GST_STATE_READY
);
break
;
}
case
GST_MESSAGE_BUFFERING
:
{
if
(
strm
->
is_live
)
break
;
#if 0
gint percent = 0;
gst_message_parse_buffering( msg, &percent);
// printf( "Buffering %d %%\n", percent);
// Wait until buffering is complete before start/resume playing
if ( percent < 100) {
if ( percent < 50) {
pwr_tTime current_time;
time_GetTime( ¤t_time);
if ( strm->buftime.tv_sec == 0 && strm->buftime.tv_nsec == 0)
strm->buftime = current_time;
else {
pwr_tDeltaTime dt;
pwr_tFloat32 fdt;
time_Adiff( &dt, ¤t_time, &strm->buftime);
time_DToFloat( &fdt, &dt);
printf( "Buffering %d %% %f\n", percent, fdt);
if ( fdt > 5) {
strm->buftime = pwr_cNTime;
gst_element_set_state( strm->playbin2, GST_STATE_PAUSED);
}
}
}
else
strm->buftime = pwr_cNTime;
}
else {
strm->buftime = pwr_cNTime;
gst_element_set_state( strm->playbin2, GST_STATE_PLAYING);
}
#endif
#if 0
if ( percent < 100)
gst_element_set_state( strm->playbin2, GST_STATE_PAUSED);
else
gst_element_set_state( strm->playbin2, GST_STATE_PLAYING);
#endif
break
;
}
case
GST_MESSAGE_CLOCK_LOST
:
{
printf
(
"Clock lost
\n
"
);
// Get a new clock
gst_element_set_state
(
strm
->
playbin2
,
GST_STATE_PAUSED
);
gst_element_set_state
(
strm
->
playbin2
,
GST_STATE_PLAYING
);
break
;
}
case
GST_MESSAGE_STATE_CHANGED
:
#if 0
GstState old_state, new_state, pending_state;
gst_message_parse_state_changed( msg, &old_state, &new_state, &pending_state);
printf( "State changed %s\n", gst_element_state_get_name( new_state));
#endif
break
;
default:
;
}
}
/* This function is called when an End-Of-Stream message is posted on the bus.
...
...
@@ -281,6 +351,7 @@ void XttStreamGtk::state_changed_cb( GstBus *bus, GstMessage *msg, void *data)
/* Extract metadata from all the streams and write it to the text widget in the GUI */
static
void
analyze_streams
(
void
*
data
)
{
printf
(
"Analyze stream
\n
"
);
#if 0
XttStreamGtk *strm = (XttStreamGtk *)data;
gint i;
...
...
@@ -526,7 +597,7 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const
int
width
,
int
height
,
int
x
,
int
y
,
double
scan_time
,
unsigned
int
st_options
,
int
st_embedded
,
pwr_tAttrRef
*
st_arp
,
pwr_tStatus
*
sts
)
:
XttStream
(
st_parent_ctx
,
name
,
st_uri
,
width
,
height
,
x
,
y
,
scan_time
,
st_options
,
st_embedded
,
st_arp
),
scroll_cnt
(
0
),
ptz_box_displayed
(
0
),
parent_wid
(
st_parent_wid
),
ptz_box
(
0
)
scroll_cnt
(
0
),
ptz_box_displayed
(
0
),
is_live
(
0
),
buftime
(
pwr_cNTime
),
parent_wid
(
st_parent_wid
),
ptz_box
(
0
)
{
GstStateChangeReturn
ret
;
GstBus
*
bus
;
...
...
@@ -956,7 +1027,7 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const
/* Instruct the bus to emit signals for each received message, and connect to the interesting signals */
bus
=
gst_element_get_bus
(
playbin2
);
gst_bus_add_signal_watch
(
bus
);
g_signal_connect
(
G_OBJECT
(
bus
),
"message
::error
"
,
(
GCallback
)
error_cb
,
this
);
g_signal_connect
(
G_OBJECT
(
bus
),
"message"
,
(
GCallback
)
error_cb
,
this
);
g_signal_connect
(
G_OBJECT
(
bus
),
"message::eos"
,
(
GCallback
)
eos_cb
,
this
);
g_signal_connect
(
G_OBJECT
(
bus
),
"message::state-changed"
,
(
GCallback
)
state_changed_cb
,
this
);
g_signal_connect
(
G_OBJECT
(
bus
),
"message::application"
,
(
GCallback
)
application_cb
,
this
);
...
...
@@ -972,6 +1043,9 @@ XttStreamGtk::XttStreamGtk( GtkWidget *st_parent_wid, void *st_parent_ctx, const
*
sts
=
0
;
return
;
}
else
if
(
ret
==
GST_STATE_CHANGE_NO_PREROLL
)
{
is_live
=
1
;
}
wow
=
new
CoWowGtk
(
toplevel
);
timerid
=
wow
->
timer_new
();
...
...
xtt/lib/xtt/gtk/xtt_stream_gtk.h
View file @
17a8f94e
...
...
@@ -66,6 +66,8 @@ class XttStreamGtk : public XttStream {
int
popupmenu_x
;
int
popupmenu_y
;
int
ptz_box_displayed
;
int
is_live
;
pwr_tTime
buftime
;
GtkWidget
*
slider
;
/* Slider widget to keep track of current position */
GtkWidget
*
parent_wid
;
...
...
xtt/lib/xtt/src/xtt_xnav_command.cpp
View file @
17a8f94e
...
...
@@ -3607,8 +3607,16 @@ static int xnav_open_func( void *client_data,
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
(
is_video
)
{
if
(
ODD
(
dcli_get_qualifier
(
"/VIDEOCONTROLPANEL"
,
0
,
0
)))
options
|=
strm_mOptions_VideoControlPanel
;
if
(
ODD
(
dcli_get_qualifier
(
"/VIDEOPROGRESSBAR"
,
0
,
0
)))
options
|=
strm_mOptions_VideoProgressBar
;
}
else
{
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
)
...
...
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