Commit Graph

13 Commits

Author SHA1 Message Date
Francois Gouget
2db59fef3a streaming: Let the video encoder manage the compressed buffer
This way the video encoder is not forced to use malloc()/free().
This also allows more flexibility in how the video encoder manages the
buffer which allows for a zero-copy implementation in both video
encoders.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2016-06-14 17:04:40 +02:00
Francois Gouget
497fcbb0a3 streaming: Let the administrator pick the video encoder and codec
The Spice server administrator can specify the encoder and codec
preferences to optimize for CPU or bandwidth usage. Preferences are
described in a semi-colon separated list of encoder:codec pairs.
The server has a default preference list which can explicitly be
selected by specifying 'auto'.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2016-06-14 17:04:40 +02:00
Francois Gouget
1b69198c4e streaming: Remove the width/height encode_frame() parameters
encode_frame() needs the QXL_DRAW_COPY operation's SpiceCopy.src_area
field anyway, so the width and height parameters were redundant.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2016-06-14 17:04:40 +02:00
Francois Gouget
032cb0ce85 mjpeg: Use src_area as the authoritative source for the frame dimensions
Video frames correspond to QXL_DRAW_COPY operations where the frame area
is defined by the SpiceCopy.src_area field.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2016-06-14 17:04:40 +02: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
Christophe Fergeau
26f874e738 mjpeg: Add missing space to debug string 2016-04-01 15:16:27 +02:00
Francois Gouget
aa5a5fa630 server: Store the opaque pointer in VideoEncoderRateControlCbs
It has the same lifetime as the corresponding structure so this
simplifies keeping track of it.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-03-03 11:47:49 +00: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
65b60250d0 server: Rename red_get_monotonic_time() to spice_get_monotonic_time_ns()
This is a generic function not tied to the red_xxx functionality and the
new name clarifies that it returns the time in nanoseconds (unlike
g_get_monotonic_time()).

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-12-11 12:43:26 +00:00
Francois Gouget
c8d5120ff0 server: Define the MJPEG encoder warmup time in nanoseconds
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-12-08 15:08:44 -06:00
Francois Gouget
4ce4c4a525 server: Simplify the MJPEG encoder's maximum framerate estimation
Note that if frame_size == bytes_per_sec == 0 this now returns
MJPEG_MAX_FPS but this should not happen anyway.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-12-08 16:22:41 +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