From 636427b614d8c23e5182dcc87883eae1d9d1c6ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 7 Jun 2008 15:14:00 +0000 Subject: [PATCH] Axel!! Since _Thursday_ I am trying to track this down. "MediaPlayer wouldn't play any more clips." Of course I was searching in my own commits. In the end, I resorted to binary searching revisions for when this broke. Turns out it is your change r25793/r25794, in which you forgot to attach the colorspace to the app_server message. Which of course makes it lock up. Another of those instances where you think passing data structures between client and app_server instead of this "protocol" would be the better idea... * Fixed bitmaps_support_space() retrieving the currently supported overlay flags for a given color space. This makes MediaPlayer play files again, the media node connection would time out because of the broken app_server communication. (I have not tested this change yet, but I will in a minute, on a different computer.) * Also retrieve the overlay supported flag for YCbCr colorspaces. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25847 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/GraphicsDefs.cpp | 32 +++++++++++++++++++---------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/kits/interface/GraphicsDefs.cpp b/src/kits/interface/GraphicsDefs.cpp index 9be9186b70..db59bd596f 100644 --- a/src/kits/interface/GraphicsDefs.cpp +++ b/src/kits/interface/GraphicsDefs.cpp @@ -129,6 +129,23 @@ get_pixel_size_for(color_space space, size_t *pixelChunk, size_t *rowAlignment, } +static uint32 +get_overlay_flags(color_space space) +{ + BPrivate::AppServerLink link; + link.StartMessage(AS_GET_BITMAP_SUPPORT_FLAGS); + link.Attach((uint32)space); + + uint32 flags = 0; + int32 code; + if (link.FlushWithReply(code) == B_OK && code == B_OK) { + if (link.Read(&flags) < B_OK) + flags = 0; + } + return flags; +} + + bool bitmaps_support_space(color_space space, uint32 *supportFlags) { @@ -142,17 +159,8 @@ bitmaps_support_space(color_space space, uint32 *supportFlags) case B_CMAP8: case B_GRAY8: case B_GRAY1: if (supportFlags != NULL) { *supportFlags = B_VIEWS_SUPPORT_DRAW_BITMAP - | B_BITMAPS_SUPPORT_ATTACHED_VIEWS; - - BPrivate::AppServerLink link; - link.StartMessage(AS_GET_BITMAP_SUPPORT_FLAGS); - - int32 code; - if (link.FlushWithReply(code) == B_OK && code == B_OK) { - uint32 flags = 0; - if (link.Read(&flags) == B_OK) - *supportFlags |= flags; - } + | B_BITMAPS_SUPPORT_ATTACHED_VIEWS + | get_overlay_flags(space); } break; @@ -165,6 +173,8 @@ bitmaps_support_space(color_space space, uint32 *supportFlags) case B_HSV24: case B_HSV32: case B_HSVA32: case B_HLS24: case B_HLS32: case B_HLSA32: case B_CMY24: case B_CMY32: case B_CMYA32: case B_CMYK32: + if (supportFlags != NULL) + *supportFlags = get_overlay_flags(space); break; // unsupported case B_NO_COLOR_SPACE: