summaryrefslogtreecommitdiffstats
path: root/server/mjpeg_encoder.h
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2013-02-15 15:40:20 -0500
committerYonit Halperin <yhalperi@redhat.com>2013-04-22 16:30:51 -0400
commitb490635130c87e418a3b35c0d7a1335d4377e975 (patch)
tree647e8cb53ebb6f17743831785a52c97affae0c36 /server/mjpeg_encoder.h
parent2025494af50d14ff92ef9a67787c9c46a4b23c33 (diff)
downloadspice-b490635130c87e418a3b35c0d7a1335d4377e975.tar.gz
spice-b490635130c87e418a3b35c0d7a1335d4377e975.tar.xz
spice-b490635130c87e418a3b35c0d7a1335d4377e975.zip
mjpeg_encoder: adjust the stream bit rate based on periodic client feedback
mjpeg_encoder can receive periodic reports about the playback status on the client side. Then, mjpeg_encoder analyses the report and can increase or decrease the stream bit rate, depending on the report. When the bit rate is changed, the quality and frame rate of the stream are re-evaluated.
Diffstat (limited to 'server/mjpeg_encoder.h')
-rw-r--r--server/mjpeg_encoder.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/server/mjpeg_encoder.h b/server/mjpeg_encoder.h
index 902dcbe7..cc49edfb 100644
--- a/server/mjpeg_encoder.h
+++ b/server/mjpeg_encoder.h
@@ -48,7 +48,8 @@ uint8_t mjpeg_encoder_get_bytes_per_pixel(MJpegEncoder *encoder);
*/
int mjpeg_encoder_start_frame(MJpegEncoder *encoder, SpiceBitmapFmt format,
int width, int height,
- uint8_t **dest, size_t *dest_len);
+ uint8_t **dest, size_t *dest_len,
+ uint32_t frame_mm_time);
int mjpeg_encoder_encode_scanline(MJpegEncoder *encoder, uint8_t *src_pixels,
size_t image_width);
size_t mjpeg_encoder_end_frame(MJpegEncoder *encoder);
@@ -63,5 +64,24 @@ size_t mjpeg_encoder_end_frame(MJpegEncoder *encoder);
*/
uint32_t mjpeg_encoder_get_fps(MJpegEncoder *encoder);
-
+/*
+ * Data that should be periodically obtained from the client. The report contains:
+ * num_frames : the number of frames that reached the client during the time
+ * the report is referring to.
+ * num_drops : the part of the above frames that was dropped by the client due to
+ * late arrival time.
+ * start_frame_mm_time: the mm_time of the first frame included in the report
+ * end_frame_mm_time : the mm_time of the last_frame included in the report
+ * end_frame_delay : (end_frame_mm_time - client_mm_time)
+ * audio delay : the latency of the audio playback.
+ * If there is no audio playback, set it to MAX_UINT.
+ *
+ */
+void mjpeg_encoder_client_stream_report(MJpegEncoder *encoder,
+ uint32_t num_frames,
+ uint32_t num_drops,
+ uint32_t start_frame_mm_time,
+ uint32_t end_frame_mm_time,
+ int32_t end_frame_delay,
+ uint32_t audio_delay);
#endif