mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
xvimagesink: scale the colorkey components in case of 16bit visuals
Use a default that won't be scales to 0,0,0
This commit is contained in:
parent
0267e79778
commit
492b8861c4
1 changed files with 11 additions and 4 deletions
|
@ -1427,11 +1427,14 @@ gst_xvimagesink_get_xv_support (GstXvImageSink * xvimagesink,
|
|||
cr = (xvimagesink->colorkey >> 16);
|
||||
cg = (xvimagesink->colorkey >> 8) & 0xFF;
|
||||
cb = (xvimagesink->colorkey) & 0xFF;
|
||||
if (bits == 16)
|
||||
if (bits == 16) { /* RGB 565 */
|
||||
cr >>= 3;
|
||||
cg >>= 2;
|
||||
cb >>= 3;
|
||||
ckey = (cr << 11) | (cg << 5) | cb;
|
||||
else if (bits == 24 || bits == 32)
|
||||
} else if (bits == 24 || bits == 32) { /* RGB 888 / ARGB 8888 */
|
||||
ckey = (cr << 16) | (cg << 8) | cb;
|
||||
else
|
||||
} else
|
||||
set_attr = FALSE;
|
||||
|
||||
if (set_attr) {
|
||||
|
@ -3264,7 +3267,11 @@ gst_xvimagesink_init (GstXvImageSink * xvimagesink)
|
|||
xvimagesink->handle_expose = TRUE;
|
||||
xvimagesink->autopaint_colorkey = TRUE;
|
||||
|
||||
xvimagesink->colorkey = (1 << 16) | (2 << 8) | 3;
|
||||
/* on 16bit displays this becomes r,g,b = 1,2,3
|
||||
* on 24bit displays this becomes r,g,b = 8,8,16
|
||||
* as a port atom value
|
||||
*/
|
||||
xvimagesink->colorkey = (8 << 16) | (8 << 8) | 16;
|
||||
xvimagesink->draw_borders = TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue