[PATCH] quartz: Add a filtergraph test for mpeg files. (try 2)

Lei Zhang thestig at google.com
Wed Jan 14 12:57:38 CST 2009


Hi,

I cleaned up dlls/quartz/tests/filtergraph.c a bit so we can drop in a
'test.mpg' file and test the rendering of MPEG files.

This version uses CreateFileA() so it works on win9x. I ran the tests
on WinXP and Win98SE.
-------------- next part --------------
From a5cd3293af59b0d084552b1931d30bfae41cf5f1 Mon Sep 17 00:00:00 2001
From: Lei Zhang <thestig at google.com>
Date: Wed, 14 Jan 2009 10:48:19 -0800
Subject: [PATCH] [PATCH] quartz: Add a filtergraph test for mpeg files.

---
 dlls/quartz/tests/filtergraph.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index f56e722..53f39d5 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -27,8 +27,9 @@
 #include "dshow.h"
 #include "control.h"
 
-static const CHAR fileA[] = "test.avi";
-static const WCHAR file[] = {'t','e','s','t','.','a','v','i',0};
+#define FILE_LEN 9
+static const char avifileA[FILE_LEN] = "test.avi";
+static const char mpegfileA[FILE_LEN] = "test.mpg";
 
 IGraphBuilder* pgraph;
 
@@ -38,11 +39,14 @@ static int createfiltergraph(void)
         &CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IGraphBuilder, (LPVOID*)&pgraph);
 }
 
-static void renderfile(void)
+static void renderfile(const char * fileA)
 {
     HRESULT hr;
+    WCHAR fileW[FILE_LEN];
 
-    hr = IGraphBuilder_RenderFile(pgraph, file, NULL);
+    MultiByteToWideChar(CP_ACP, 0, fileA, -1, fileW, FILE_LEN);
+
+    hr = IGraphBuilder_RenderFile(pgraph, fileW, NULL);
     ok(hr==S_OK, "RenderFile returned: %x\n", hr);
 }
 
@@ -137,7 +141,7 @@ static void releasefiltergraph(void)
     ok(hr==0, "Releasing filtergraph returned: %x\n", hr);
 }
 
-static void test_render_run(void)
+static void test_render_run(const char * fileA)
 {
     HANDLE h;
 
@@ -147,7 +151,7 @@ static void test_render_run(void)
     h = CreateFileA(fileA, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
     if (h != INVALID_HANDLE_VALUE) {
         CloseHandle(h);
-        renderfile();
+        renderfile(fileA);
         rungraph();
     }
 
@@ -1822,7 +1826,8 @@ static void test_render_filter_priority(void)
 START_TEST(filtergraph)
 {
     CoInitializeEx(NULL, COINIT_MULTITHREADED);
-    test_render_run();
+    test_render_run(avifileA);
+    test_render_run(mpegfileA);
     test_graph_builder();
     test_graph_builder_addfilter();
     test_mediacontrol();
-- 
1.5.4.3


More information about the wine-patches mailing list