Commit Graph

132 Commits

Author SHA1 Message Date
Jeremy White
fa63a5392d Generate package.json from the Makefile.
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:46:44 -06:00
Cédric Bosdonnat
8ab92d030e resize_helper: round sizes down
If we round up, we may end up with a display slightly bigger than what
the window can have, thus adding scroll bars. When rounding down we
avoid this problems.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:46:13 -06:00
Cédric Bosdonnat
7b8f595b8f resize_helper, no message box case
The resize_handler need to check for the existence of the message box
before computing it's size.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:46:11 -06:00
Cédric Bosdonnat
ee0ec7c24f Document onsuccess callback
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:46:10 -06:00
Cédric Bosdonnat
dfa40a73ff Prompt password in spice_auto.html
In case the user didn't provide any password, we want to prompt him for
it. Try once and if we get an permission denied error, then ask the
password and retry to connect.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:46:09 -06:00
Cédric Bosdonnat
df374203dd Fix disconnect() code
The disconnect() function were not checking the existence of the file
transfer area element, leading to stop the disconnect() before its end.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:46:08 -06:00
Cédric Bosdonnat
ef82543195 Move sources into their own folder
To add some more order to the folder, move the JS files into their own
src folder.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:46:07 -06:00
Cédric Bosdonnat
77e448a72d Prepare publishing on npmjs
Add package.json needed to publish on npmjs.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:46:06 -06:00
Cédric Bosdonnat
7f5b9f54a5 Expose all needed pieces in main.js
We don't want the users to rely on anything else than main.js. All the
helper functions from the other files are thus imported in main and
exported there too.

This way all the user needs to import is:

    import * as SpiceHtml5 from './main.js';

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:46:05 -06:00
Cédric Bosdonnat
c5e9fe00e9 Remove duplicated enums
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:46:04 -06:00
Cédric Bosdonnat
2c08f20c25 Introduce ES6 modules
Avoid cluttering the global namespace. Use ES6 modules in order to
to this.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:46:02 -06:00
Jeremy White
2fe0aed39d Convert sha1.js line endings to Unix.
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:46:01 -06:00
Cédric Bosdonnat
629edd57b6 CSS: don't force the background color or inputs
When forcing the background of the input fields, this makes them
unreadable for dark themed browsers.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2019-02-14 12:45:57 -06:00
Christophe Fergeau
f9f700ee54 display: Only use display channel with id 0
spice-html5 does not support multiple display channels, and will only
use the first one offered by spice-server, and ignore the others. This
can cause issues when using a VM with a configured but unused
org.spice-space.stream.0 spice port as this will create a 'fake' display
channel which is offered by spice-server before the usual qxl display
channel.
This commit favours the display channel with id 0 rather than picking
the first one.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-07-19 14:43:39 +02:00
Christophe Fergeau
969fe1fb68 display: Dump bitmap metadata in log_draw()
log_draw() is used to debug drawing commands by dumping drawing
information to the JS console. This commit adds dumping of missing data
for uncompressed bitmaps. The 'stride' parameter is important, as
spice-html5 currently does not deal properly with such bitmaps.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Jeremy White <jwhite@codeweavers.com>
2018-07-18 09:12:43 +01:00
Tomáš Bohdálek
fb21664f6b Add checkbox to toggle debug console
This allows show or hide debug console under spice screen.
2017-06-22 12:54:20 +02:00
Tomáš Bohdálek
556ed82aa4 Always show debug console
Make sure to show both screen and console.
2017-06-02 09:45:35 -05:00
Pavel Grunt
7ba763feb5 Handle non topdown bitmaps 2017-03-07 15:11:44 -06:00
Vincent Desprez
bfa85a7117 Handling non-topdown lz_rgb
Signed-off-by: Vincent Desprez <vincent.desprez@apwise.com>
2017-03-07 15:11:15 -06:00
Jeremy White
2fa7c65144 When offered multiple heads, generate a warning, rather than failing in subtle ways. 2017-03-07 13:29:25 -06:00
Jeremy White
4ea12e87a2 Only drop an mjpeg frame if we are not currently processing one. 2017-01-20 09:58:03 -06:00
Jeremy White
368fdaf51d Disable the onload function when clearing the image source.
This fixes a bug introduced by my commit 42134d3e, which would
lead to an infinite recursion of onload statements.
2017-01-20 09:55:12 -06:00
Jeremy White
d83dc14e15 Detect video underrun and advance the current time.
This helps us avoid stalled video streams.
2017-01-20 09:50:45 -06:00
Jeremy White
001bcc830f Add more stream information in high debug situations at an updateend event. 2017-01-20 09:50:42 -06:00
Jeremy White
aa8e9ecb79 Catch and note updateend messages after video destruction. 2017-01-20 09:50:35 -06:00
Jeremy White
564461259f Condense the playback queue before adding to the Media Buffer.
This helps Firefox in situations where the incoming traffic
is preventing the audio element from processing data quickly enough.
2017-01-10 11:24:29 -06:00
Jeremy White
a770272e7d Include the codec type in the stream creation message. 2016-12-15 10:45:58 -06:00
Jeremy White
b3a3a20d15 Move the queue length debug up to stream level 2.
It's a fair amount of noise, and not useful at level 1.
2016-12-15 10:45:57 -06:00
Jeremy White
f29dcf4350 Display stream creation and destruction at debug level 1.
They are low frequency, useful messages and should be seen
more readily.
2016-12-15 10:45:56 -06:00
Jeremy White
ef3807908d Show the timeupdate events at stream debug level 2, not level 1.
They are fairly noisy, and more appropriate to the
more detailed level.
2016-12-15 10:45:23 -06:00
Jeremy White
bed406adf3 Protect against an mjpeg stream image draw occuring after stream destruction. 2016-10-10 11:31:04 -05:00
Jeremy White
42134d3e56 Use empty image instead of null to avoid warnings 2016-10-10 11:30:28 -05:00
Jeremy White
dd3fb12678 If MediaSource is not available, do not report the vp8 or opus caps. 2016-10-10 11:29:57 -05:00
Jeremy White
b474c300a8 Improve stream debug messages slightly. 2016-10-10 11:29:51 -05:00
Jeremy White
57134818c3 Do not wait for the source buffer open callback to start stream creation.
Otherwise, we end up discarding stream data messages, and our decode
can become corrupted, notably on Chrome.

This way, we should not lose any messages while we are waiting for
source buffer creation.
2016-10-10 11:29:44 -05:00
Oliver Gutierrez
fc0a664e7e Basic SPICE port implementation 2016-10-10 13:52:41 +02:00
Jeremy White
9468cf2a9b Implement support for the playback stop message.
This allows audio processing to be more robust in Firefox.
2016-10-03 09:38:52 -05:00
Jeremy White
3633675e4b Rely on the auto play attribute.
Browsers now reliably autoplay, and issuing play prematurely
can generate an error in both Firefox and Chrome.

Hence we can simply remove this call and audio seems to work fine.
2016-10-03 09:38:31 -05:00
Jeremy White
dc5fd91f0c Revise sound packet time sequencing for a more recent Firefox.
Around version 45, Firefox started being very particular about the
time stamps put into the Opus stream.  The time stamps from the Spice server are
somewhat irregular.  They mostly arrive every 10 ms, but sometimes it is 11, or sometimes
with two time stamps the same in a row.  The previous logic resulted in fuzzy and/or
distorted audio streams in Firefox in a row.

Thus, we end up with an inelegant hack.  Essentially, we force every packet to have
a 10ms time delta, unless there is an obvious gap in time stream, in which case we
will resync.

This replaces logic that mitigated only the duplicated time packets.

The long term solution would appear to be 'sequence' mode, but I cannot get
Firefox to use that mode (and MDN suggests that for codecs such as VP8 with time
stamps in line, that Firefox will not accept it).
2016-10-03 09:37:56 -05:00
Jeremy White
245a476bd9 Use modern browser information to detect underrun.
We previously had a fairly crude 'gap detection', but browsers
are largely supporting the modern buffer semantics, and we can
now rely on them to detect under runs for us.

This improves audio in Chrome while playing large videos.
2016-10-03 09:37:16 -05:00
Oliver Gutierrez
1f4959e3c2 Fixed trailing whitespaces in several files 2016-09-28 15:03:48 -05:00
Oliver Gutierrez
411cdc5dfd Fixed syntax error in debugger command.
Debugger is not an object or command. It is a reserved word and
"DEBUG > 0 &&" syntax does not work with it
2016-09-08 14:57:33 +02:00
Oliver Gutierrez
53b6063f51 Added debug filtering to avoid debugger to start when using in production 2016-09-06 18:13:03 +02:00
Pavel Grunt
579f2bfb27 spiceconn: Set channel id
Allow to work with more channels of one type

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=97575

Acked-by: Victor Toso <victortoso@redhat.com>
2016-09-06 18:12:08 +02:00
Jeremy White
36b8ad3615 Prepare for the 0.17 release 2016-08-17 14:44:46 -05:00
Oliver Gutierrez
667f16c2a4 playback: Don't try to access undefined source buffer
The playback code first tries to access this.source_buffer and then
would check whether it's defined.

This was causing unwanted exception to be thrown in the cockpit
spice-html5 plugin.
2016-08-03 12:29:51 +02:00
Jeremy White
a8c406377e Send stream process reports after we have processed them.
Previously, we sent them strictly upon receipt.  However, receiving
is fast; by adding in some of the processing time (i.e. queueing and
so on), we encourage the adaptive rate control to slow down.
2016-07-13 10:41:08 -05:00
Jeremy White
3778053138 Add support for the vp8 codec type. 2016-07-13 10:41:07 -05:00
Jeremy White
5b2e795bf6 Revise the webm files to more correctly identify audio tracks. 2016-07-13 10:41:06 -05:00
Jeremy White
275850f7e6 Track and make note of requests that take an unusual amount of time. 2016-07-13 10:41:04 -05:00