diff --git a/spice_auto.html b/spice_auto.html
index beb5b7a..2150e07 100644
--- a/spice_auto.html
+++ b/spice_auto.html
@@ -197,6 +197,20 @@
+
diff --git a/src/display.js b/src/display.js
index f20d6b4..a6647ca 100644
--- a/src/display.js
+++ b/src/display.js
@@ -1204,6 +1204,35 @@ function new_video_cluster(stream, msg)
function process_video_stream_data(stream, msg)
{
+ if (stream.start_time == 0) {
+ const context = document.querySelector("canvas").getContext("2d");
+ const decoder = stream.decoder = new VideoDecoder({
+ output(frame) {
+ context.drawImage(frame, 0, 0, frame.displayWidth, frame.displayHeight);
+ frame.close();
+ },
+ error(v) {
+ console.error(v);
+ },
+ });
+ decoder.configure({
+ codec: "avc1.640028",
+ codedWidth: 1920,
+ codedHeight: 1080,
+ optimizeForLatency: true,
+ avc: {
+ format: "annexb",
+ },
+ });
+ }
+ stream.decoder.decode(
+ new EncodedVideoChunk({
+ timestamp: stream.start_time,
+ type: "key",
+ data: msg.data,
+ })
+ );
+
if (stream.start_time == 0)
{
stream.start_time = msg.base.multi_media_time;
diff --git a/src/enums.js b/src/enums.js
index db13584..879999b 100644
--- a/src/enums.js
+++ b/src/enums.js
@@ -196,7 +196,7 @@ export var Constants = {
SPICE_DISPLAY_CAP_GL_SCANOUT : 7,
SPICE_DISPLAY_CAP_MULTI_CODEC : 8,
SPICE_DISPLAY_CAP_CODEC_MJPEG : 9,
- SPICE_DISPLAY_CAP_CODEC_VP8 : 10,
+ SPICE_DISPLAY_CAP_CODEC_VP8 : 11,
SPICE_AUDIO_DATA_MODE_INVALID : 0,
SPICE_AUDIO_DATA_MODE_RAW : 1,
@@ -332,7 +332,7 @@ export var Constants = {
SPICE_CURSOR_TYPE_COLOR32 : 6,
SPICE_VIDEO_CODEC_TYPE_MJPEG : 1,
- SPICE_VIDEO_CODEC_TYPE_VP8 : 2,
+ SPICE_VIDEO_CODEC_TYPE_VP8 : 3,
VD_AGENT_PROTOCOL : 1,
VD_AGENT_MAX_DATA_SIZE : 2048,