Commit Graph

28 Commits

Author SHA1 Message Date
Francois Gouget
618255168e streaming: Simplify is_next_stream_frame()
After the removal of Drawable::sized_stream, we no longer need to detect
if the stream changes size in is_next_stream_frame() so it can return a
boolean rather than a value from an enum.
2016-06-14 17:04:40 +02:00
Francois Gouget
47509b1e6e streaming: Remove unused detach_stream() argument
After the removal of Drawable::sized_stream, the last argument to
detach_stream() is no longer used.
2016-06-14 17:04:40 +02:00
Frediano Ziglio
8782bb3211 Make some function static
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-05-24 13:39:48 +01:00
Frediano Ziglio
767818da66 Handle STREAM_CREATE and STREAM_DESTROY pipe items more coherently
The items of these pipe items were allocated staticaly inside the
StreamAgent structure. All others RedPipeItem are allocated dynamically.
This could solve possible future maintenance as the life of these
item is more easier to understand.
It's more easier to understand why reference where incremented.
It also make the StreamAgent structure a bit smaller.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-17 23:52:06 +01:00
Frediano Ziglio
4585fa9cbd unify header include order
Use this style for include headers inside headers:

  #include <system_headers.h>
  #include <no_spice_no_system_libraries.h>
  #include <spice_protocol.h>
  #include <spice_common.h>

  #include "spice_server.h"

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-05-12 11:02:54 +01:00
Frediano Ziglio
1e4800507b use #include<> style for spice-common header inclusions.
The include directory is specified with the -I which is the directory
used directly by #include<>.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-09 12:45:27 +01:00
Francois Gouget
0e10629d70 server: Enable adding alternative MJPEG video encoders
This replaces the original mjpeg_encoder API with a VideoEncoder base
class which can be reimplemented by other encoders.
This also renames the members and enums from mjpeg_* to video_*.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-05-04 10:51:55 +01:00
Jonathon Jongsma
920e117c24 Rename all RedPipeItem subclasses
Use 'Red' prefix to match internal type naming convention

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-04-27 10:22:26 -05:00
Jonathon Jongsma
b9720d80e0 Rename PipeItem to RedPipeItem
Following internal type naming conventions

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-04-27 10:22:01 -05:00
Jonathon Jongsma
e09598ec75 StreamClipItem: use base class refcounting
PipeItem already implements refcounting. Use it.
2016-04-15 09:59:10 -05:00
Francois Gouget
8bddb1444e server: Add time constants to go with spice_get_monotonic_time_ms()
They clarify the time unit being used and simplify calculations.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2015-12-14 11:24:47 +00:00
Francois Gouget
5c9fb9a0f3 server: Add time constants to go with spice_get_monotonic_time_ns()
They clarify the time unit being used, reduce the need for casts and
simplify calculations.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2015-12-14 11:24:34 +00:00
Francois Gouget
0ad7f71e24 server: Provide a framerate estimate based on the initial frames
This way the video encoder can actually count on a real estimate when
it is initializing.
Note that the server only creates a video stream if at least 20 bitmap
'blits' of the same size and type arrive, each within a maximum time
interval from the previous one. So it was only keeping track of the
frame to frame interval. Thus to get an average frame rate over all the
20 frames it's necessary to also keep track of the first_frame_time.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-12-11 12:43:44 +01:00
Frediano Ziglio
525cd67be7 server: rename files
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-12-03 23:54:32 +00:00
Marc-André Lureau
5161132ec7 display: rename detach_streams_behind
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-12-02 12:44:46 +00:00
Marc-André Lureau
4ca383b261 worker: move current_remove*
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-26 15:27:24 +00:00
Marc-André Lureau
d9b17bbebb worker: move more stream functions
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-26 15:19:03 +00:00
Marc-André Lureau
acba59bb9b worker: move attach_stream
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-24 08:57:01 +00:00
Marc-André Lureau
d78b44ec26 stream: remove dcc parameter from stream_agent_stop()
Author:    Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-21 13:41:12 +00:00
Marc-André Lureau
ff070be68f worker: move stream_clip_item_unref()
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-20 10:22:00 +00:00
Jonathon Jongsma
b12b248cae Move stream creation and maintenance functions to stream.[ch]
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-18 14:21:45 +00:00
Marc-André Lureau
8c750746f3 worker: move stream_agent_stop and friends
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-18 14:10:45 +00:00
Jonathon Jongsma
ac2a854fbf worker: Move stream functions to stream.c
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-18 08:37:21 +00:00
Marc-André Lureau
4987df8e67 worker: move stream to display channel
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-10 17:38:39 +00:00
Marc-André Lureau
885557f117 worker: move stream functions to a new stream.c file
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-10 16:09:28 +00:00
Marc-André Lureau
1e4abdc15d worker: move stream definitions to a new stream.h file
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-10 16:06:08 +00:00
Frediano Ziglio
1763e7ebf2 remove server/stream.h file added by mistake in previous commit
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2015-11-10 15:42:08 +00:00
Marc-André Lureau
face40e19e worker: move image cache to display
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-10 10:02:08 +00:00