WMF: report the surface's supported formats in the correct order.
authorYoann Lopes <yoann.lopes@theqtcompany.com>
Thu, 12 Mar 2015 14:56:01 +0000 (15:56 +0100)
committerYoann Lopes <yoann.lopes@theqtcompany.com>
Tue, 24 Mar 2015 16:03:13 +0000 (16:03 +0000)
QAbstractVideoSurface::supportedFormats() returns the formats in
descending order of preference while IMFMediaTypeHandler expects the
list to be in ascending order.

Change-Id: I0ecb5a3b228c0cad78c1a84091e3c3cf272f7ebc
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
src/plugins/wmf/player/mfvideorenderercontrol.cpp

index b22db19..1172fe5 100644 (file)
@@ -842,8 +842,11 @@ namespace
                         mediaType->Release();
                         continue;
                 }
-                m_pixelFormats.push_back(format);
-                m_mediaTypes.push_back(mediaType);
+                // QAbstractVideoSurface::supportedPixelFormats() returns formats in descending
+                // order of preference, while IMFMediaTypeHandler is supposed to return supported
+                // formats in ascending order of preference. We need to reverse the list.
+                m_pixelFormats.prepend(format);
+                m_mediaTypes.prepend(mediaType);
             }
         }