spice: server: avoid video streaming of small images

I added a lower limit to the size of images that are being streamed.
The limit is only active in "filter" video streaming mode.
This will prevent blurry animated icons.
This commit is contained in:
Yonit Halperin 2010-02-02 16:05:44 +02:00 committed by Alexander Larsson
parent fa3dddc0db
commit d2edac47cd

View File

@ -76,6 +76,7 @@
#define RED_STREAM_FRAMES_START_CONDITION 20
#define RED_STREAM_GRADUAL_FRAMES_START_CONDITION 0.2
#define RED_STREAM_FRAMES_RESET_CONDITION 100
#define RED_STREAM_MIN_SIZE (96 * 96)
#define FPS_TEST_INTERVAL 1
#define MAX_FPS 30
@ -3460,6 +3461,17 @@ static inline void red_update_streamable(RedWorker *worker, Drawable *drawable,
return;
}
if (worker->streaming_video == STREAM_VIDEO_FILTER) {
SpiceRect* rect;
int size;
rect = &drawable->qxl_drawable->u.copy.src_area;
size = (rect->right - rect->left) * (rect->bottom - rect->top);
if (size < RED_STREAM_MIN_SIZE) {
return;
}
}
drawable->streamable = TRUE;
}