winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
October 2019
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
614 discussions
Start a n
N
ew thread
Sven Baars : wbemprox/tests: Fix a memory leak (Valgrind).
by Alexandre Julliard
07 Oct '19
07 Oct '19
Module: wine Branch: master Commit: ffb9bd9e6c99677572b695d453c9b5c87a7162f4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ffb9bd9e6c99677572b695d4…
Author: Sven Baars <sven.wine(a)gmail.com> Date: Fri Oct 4 21:58:40 2019 +0200 wbemprox/tests: Fix a memory leak (Valgrind). Signed-off-by: Sven Baars <sven.wine(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/tests/query.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index cdbbc02820..1c6ffcaf8d 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1654,6 +1654,7 @@ static void test_Win32_PnPEntity( IWbemServices *services ) VariantClear( &val ); } } + IWbemClassObject_Release( obj ); } SysFreeString( bstr );
1
0
0
0
Sven Baars : wbemprox: Fix a string leak (Valgrind).
by Alexandre Julliard
07 Oct '19
07 Oct '19
Module: wine Branch: master Commit: e4f078681668b0f393eb756472682e9b3a25622f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e4f078681668b0f393eb7564…
Author: Sven Baars <sven.wine(a)gmail.com> Date: Fri Oct 4 21:58:39 2019 +0200 wbemprox: Fix a string leak (Valgrind). Signed-off-by: Sven Baars <sven.wine(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/query.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c index 0f43412473..0f7eada9af 100644 --- a/dlls/wbemprox/query.c +++ b/dlls/wbemprox/query.c @@ -632,6 +632,7 @@ done: if (query) release_query( query ); free_path( path ); SysFreeString( antecedent ); + heap_free( str ); return hr; }
1
0
0
0
Alexandre Julliard : make_unicode: Avoid duplicate lead bytes.
by Alexandre Julliard
07 Oct '19
07 Oct '19
Module: wine Branch: master Commit: a9285c51315d5c669349697148155769a37b126a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a9285c51315d5c6693496971…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sun Oct 6 13:39:53 2019 +0200 make_unicode: Avoid duplicate lead bytes. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/port/c_10001.c | 1503 +-------------------------------------------------- tools/make_unicode | 6 +- 2 files changed, 11 insertions(+), 1498 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=a9285c51315d5c669349…
1
0
0
0
Jeremy Newman : fix outdated ereg() calls
by Jeremy Newman
07 Oct '19
07 Oct '19
Module: appdb Branch: master Commit: ba9f80fe7c014fcbefb7fdbd9d6a77bbd0289b77 URL:
https://source.winehq.org/git/appdb.git/?a=commit;h=ba9f80fe7c014fcbefb7fdb…
Author: Jeremy Newman <jnewman(a)codeweavers.com> Date: Mon Oct 7 09:22:38 2019 -0500 fix outdated ereg() calls --- include/tableve.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/include/tableve.php b/include/tableve.php index f9828c6..4ca7c36 100644 --- a/include/tableve.php +++ b/include/tableve.php @@ -100,7 +100,7 @@ class TableVE { { $field = query_fetch_field($hResult, $i); - if(ereg("^impl_(.+)$", $field->table, $arr)) + if(preg_match("/^impl_(.+)$/", $field->table, $arr)) { if($cur_impl != $arr[1]) echo "<tr><th class='box-label' colspan=2> ".ucfirst($arr[1])." Implementation </th></tr>\n"; @@ -154,7 +154,7 @@ class TableVE { $field = query_fetch_field($hResult, $i); $len = query_field_len($hResult, $i); - if(ereg("^impl_(.+)$", $field->table, $arr)) + if(preg_match("/^impl_(.+)$/", $field->table, $arr)) { if($cur_impl != $arr[1]) echo "<tr><th class='box-label' colspan=2> ".ucfirst($arr[1])." Implementation </th></tr>\n"; @@ -339,11 +339,8 @@ class TableVE { reset($this->table_ids); foreach ($this->table_ids as $table => $id) { - $r = "^$table$"; - //echo "Checking $r against $name <br>\n"; - if(ereg($r, $name)) + if(preg_match("/^$table$/", $name)) { - //echo "ID for $name -> $id <br>\n"; return $id; } } @@ -363,7 +360,7 @@ class TableVE { foreach ($vars as $varname => $arr) { - if(!ereg("^FIELD_([a-zA-Z_]+)___(.+)$", $varname, $regs)) + if(!preg_match("/^FIELD_([a-zA-Z_]+)___(.+)$/", $varname, $regs)) continue; $tables[$regs[1]][] = $regs[2]; @@ -424,7 +421,7 @@ class TableVE { addmsg("Database Operation Complete!","green"); } - if(ereg("^impl_.+$", $table)) + if(preg_match("/^impl_.+$/", $table)) { $value = $fieldnames["apiid"][$i]; query_parameters("UPDATE ? SET lastmodby = '?' WHERE apiid = '?'",
1
0
0
0
Jeremy Newman : fix outdatded ereg()
by Jeremy Newman
07 Oct '19
07 Oct '19
Module: appdb Branch: master Commit: fa06b308139f1acc99b6bd293593b5647dc9785d URL:
https://source.winehq.org/git/appdb.git/?a=commit;h=fa06b308139f1acc99b6bd2…
Author: Jeremy Newman <jnewman(a)codeweavers.com> Date: Mon Oct 7 09:18:20 2019 -0500 fix outdatded ereg() --- preferences.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preferences.php b/preferences.php index 5481a09..b1f3236 100644 --- a/preferences.php +++ b/preferences.php @@ -46,7 +46,7 @@ if(isset($aClean['sSubmit']) && $aClean['sSubmit'] == "Update") { /* if a parameter lacks 'pref_' at its head it isn't a */ /* preference so skip over processing it */ - if(!ereg("^pref_(.+)$", $sKey, $arr)) + if(!preg_match("/^pref_(.+)$/", $sKey, $arr)) continue; $oUser->setPref($arr[1], $sValue); }
1
0
0
0
Alistair Leslie-Hughes : dmime/tests: Break out of loop if we fail to get segment pointer.
by Alexandre Julliard
04 Oct '19
04 Oct '19
Module: wine Branch: master Commit: 7d954f23356f0aaf49b1ef0c4bed83041cb41c08 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7d954f23356f0aaf49b1ef0c…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Fri Oct 4 21:30:48 2019 +0200 dmime/tests: Break out of loop if we fail to get segment pointer. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmime/tests/performance.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/dmime/tests/performance.c b/dlls/dmime/tests/performance.c index 4433846f9b..073625f04b 100644 --- a/dlls/dmime/tests/performance.c +++ b/dlls/dmime/tests/performance.c @@ -454,6 +454,10 @@ static void test_notification_type(void) hr = IDirectMusicSegmentState8_GetSegment(segmentstate, &segment); ok(hr == S_OK, "Failed: %08x\n", hr); + if (FAILED(hr)) { + IDirectMusicSegmentState8_Release(segmentstate); + break; + } hr = IDirectMusicSegment_QueryInterface(segment, &IID_IDirectMusicSegment8, (void**)&segment8); ok(hr == S_OK, "Failed: %08x\n", hr);
1
0
0
0
Zebediah Figura : quartz/vmr9: Implement IOverlay::GetWindowHandle().
by Alexandre Julliard
04 Oct '19
04 Oct '19
Module: wine Branch: master Commit: c6f818e9a6a484d4c7df6c64027804de19524ee2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c6f818e9a6a484d4c7df6c64…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Oct 4 10:02:49 2019 -0500 quartz/vmr9: Implement IOverlay::GetWindowHandle(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/vmr7.c | 26 ++++++++++++++++++++++++++ dlls/quartz/tests/vmr9.c | 26 ++++++++++++++++++++++++++ dlls/quartz/vmr9.c | 8 ++++++-- 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 0228e0c249..0d72689078 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -1097,6 +1097,31 @@ static void test_connect_pin(void) ok(!ref, "Got outstanding refcount %d.\n", ref); } +static void test_overlay(void) +{ + IBaseFilter *filter = create_vmr7(0); + IOverlay *overlay; + HRESULT hr; + ULONG ref; + IPin *pin; + HWND hwnd; + + IBaseFilter_FindPin(filter, L"VMR Input0", &pin); + + hr = IPin_QueryInterface(pin, &IID_IOverlay, (void **)&overlay); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hwnd = (HWND)0xdeadbeef; + hr = IOverlay_GetWindowHandle(overlay, &hwnd); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(hwnd && hwnd != (HWND)0xdeadbeef, "Got invalid window %p.\n", hwnd); + + IOverlay_Release(overlay); + IPin_Release(pin); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(vmr7) { CoInitialize(NULL); @@ -1111,6 +1136,7 @@ START_TEST(vmr7) test_enum_media_types(); test_unconnected_filter_state(); test_connect_pin(); + test_overlay(); CoUninitialize(); } diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index d3001727d4..928484ccb6 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -1096,6 +1096,31 @@ static void test_connect_pin(void) ok(!ref, "Got outstanding refcount %d.\n", ref); } +static void test_overlay(void) +{ + IBaseFilter *filter = create_vmr9(0); + IOverlay *overlay; + HRESULT hr; + ULONG ref; + IPin *pin; + HWND hwnd; + + IBaseFilter_FindPin(filter, L"VMR Input0", &pin); + + hr = IPin_QueryInterface(pin, &IID_IOverlay, (void **)&overlay); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hwnd = (HWND)0xdeadbeef; + hr = IOverlay_GetWindowHandle(overlay, &hwnd); + ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(hwnd && hwnd != (HWND)0xdeadbeef, "Got invalid window %p.\n", hwnd); + + IOverlay_Release(overlay); + IPin_Release(pin); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(vmr9) { IBaseFilter *filter; @@ -1121,6 +1146,7 @@ START_TEST(vmr9) test_enum_media_types(); test_unconnected_filter_state(); test_connect_pin(); + test_overlay(); CoUninitialize(); } diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 5a1d248dde..600e75945a 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -2183,8 +2183,12 @@ static HRESULT WINAPI overlay_SetColorKey(IOverlay *iface, COLORKEY *key) static HRESULT WINAPI overlay_GetWindowHandle(IOverlay *iface, HWND *window) { - FIXME("iface %p, window %p, stub!\n", iface, window); - return E_NOTIMPL; + struct quartz_vmr *filter = impl_from_IOverlay(iface); + + TRACE("filter %p, window %p.\n", filter, window); + + *window = filter->baseControlWindow.baseWindow.hWnd; + return S_OK; } static HRESULT WINAPI overlay_GetClipList(IOverlay *iface, RECT *source, RECT *dest, RGNDATA **region)
1
0
0
0
Zebediah Figura : quartz/vmr9: Add a stub IOverlay interface to the sink pin.
by Alexandre Julliard
04 Oct '19
04 Oct '19
Module: wine Branch: master Commit: af162fad4f63b78f7e5bdbc3226677329d2d2ff2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=af162fad4f63b78f7e5bdbc3…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Oct 4 10:02:48 2019 -0500 quartz/vmr9: Add a stub IOverlay interface to the sink pin. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/vmr7.c | 6 +-- dlls/quartz/tests/vmr9.c | 6 +-- dlls/quartz/vmr9.c | 117 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+), 6 deletions(-) diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index c0d2574d16..0228e0c249 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -248,7 +248,7 @@ static void test_interfaces(void) IBaseFilter_FindPin(filter, sink_id, &pin); check_interface(pin, &IID_IMemInputPin, TRUE); - todo_wine check_interface(pin, &IID_IOverlay, TRUE); + check_interface(pin, &IID_IOverlay, TRUE); check_interface(pin, &IID_IPin, TRUE); todo_wine check_interface(pin, &IID_IQualityControl, TRUE); check_interface(pin, &IID_IUnknown, TRUE); @@ -278,7 +278,7 @@ static void test_interfaces(void) IBaseFilter_FindPin(filter, sink_id, &pin); check_interface(pin, &IID_IMemInputPin, TRUE); - todo_wine check_interface(pin, &IID_IOverlay, TRUE); + check_interface(pin, &IID_IOverlay, TRUE); check_interface(pin, &IID_IPin, TRUE); todo_wine check_interface(pin, &IID_IQualityControl, TRUE); check_interface(pin, &IID_IUnknown, TRUE); @@ -307,7 +307,7 @@ static void test_interfaces(void) IBaseFilter_FindPin(filter, sink_id, &pin); check_interface(pin, &IID_IMemInputPin, TRUE); - todo_wine check_interface(pin, &IID_IOverlay, TRUE); + check_interface(pin, &IID_IOverlay, TRUE); check_interface(pin, &IID_IPin, TRUE); todo_wine check_interface(pin, &IID_IQualityControl, TRUE); check_interface(pin, &IID_IUnknown, TRUE); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index f65ddc2278..d3001727d4 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -241,7 +241,7 @@ static void test_interfaces(void) IBaseFilter_FindPin(filter, sink_id, &pin); check_interface(pin, &IID_IMemInputPin, TRUE); - todo_wine check_interface(pin, &IID_IOverlay, TRUE); + check_interface(pin, &IID_IOverlay, TRUE); check_interface(pin, &IID_IPin, TRUE); todo_wine check_interface(pin, &IID_IQualityControl, TRUE); check_interface(pin, &IID_IUnknown, TRUE); @@ -271,7 +271,7 @@ static void test_interfaces(void) IBaseFilter_FindPin(filter, sink_id, &pin); check_interface(pin, &IID_IMemInputPin, TRUE); - todo_wine check_interface(pin, &IID_IOverlay, TRUE); + check_interface(pin, &IID_IOverlay, TRUE); check_interface(pin, &IID_IPin, TRUE); todo_wine check_interface(pin, &IID_IQualityControl, TRUE); check_interface(pin, &IID_IUnknown, TRUE); @@ -300,7 +300,7 @@ static void test_interfaces(void) IBaseFilter_FindPin(filter, sink_id, &pin); check_interface(pin, &IID_IMemInputPin, TRUE); - todo_wine check_interface(pin, &IID_IOverlay, TRUE); + check_interface(pin, &IID_IOverlay, TRUE); check_interface(pin, &IID_IPin, TRUE); todo_wine check_interface(pin, &IID_IQualityControl, TRUE); check_interface(pin, &IID_IUnknown, TRUE); diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index cc7ef69810..5a1d248dde 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -56,6 +56,8 @@ struct quartz_vmr IVMRWindowlessControl IVMRWindowlessControl_iface; IVMRWindowlessControl9 IVMRWindowlessControl9_iface; + IOverlay IOverlay_iface; + IVMRSurfaceAllocatorEx9 *allocator; IVMRImagePresenter9 *presenter; BOOL allocator_is_ex; @@ -550,6 +552,19 @@ static HRESULT vmr_query_interface(BaseRenderer *iface, REFIID iid, void **out) return S_OK; } +static HRESULT vmr_pin_query_interface(BaseRenderer *iface, REFIID iid, void **out) +{ + struct quartz_vmr *filter = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface); + + if (IsEqualGUID(iid, &IID_IOverlay)) + *out = &filter->IOverlay_iface; + else + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + static const BaseRendererFuncTable BaseFuncTable = { .pfnCheckMediaType = VMR9_CheckMediaType, @@ -561,6 +576,7 @@ static const BaseRendererFuncTable BaseFuncTable = .pfnBreakConnect = VMR9_BreakConnect, .renderer_destroy = vmr_destroy, .renderer_query_interface = vmr_query_interface, + .renderer_pin_query_interface = vmr_pin_query_interface, }; static LPWSTR WINAPI VMR9_GetClassWindowStyles(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx) @@ -2112,6 +2128,106 @@ static const IVMRSurfaceAllocatorNotify9Vtbl VMR9_SurfaceAllocatorNotify_Vtbl = VMR9SurfaceAllocatorNotify_NotifyEvent }; +static inline struct quartz_vmr *impl_from_IOverlay(IOverlay *iface) +{ + return CONTAINING_RECORD(iface, struct quartz_vmr, IOverlay_iface); +} + +static HRESULT WINAPI overlay_QueryInterface(IOverlay *iface, REFIID iid, void **out) +{ + struct quartz_vmr *filter = impl_from_IOverlay(iface); + return IPin_QueryInterface(&filter->renderer.sink.pin.IPin_iface, iid, out); +} + +static ULONG WINAPI overlay_AddRef(IOverlay *iface) +{ + struct quartz_vmr *filter = impl_from_IOverlay(iface); + return IPin_AddRef(&filter->renderer.sink.pin.IPin_iface); +} + +static ULONG WINAPI overlay_Release(IOverlay *iface) +{ + struct quartz_vmr *filter = impl_from_IOverlay(iface); + return IPin_Release(&filter->renderer.sink.pin.IPin_iface); +} + +static HRESULT WINAPI overlay_GetPalette(IOverlay *iface, DWORD *count, PALETTEENTRY **palette) +{ + FIXME("iface %p, count %p, palette %p, stub!\n", iface, count, palette); + return E_NOTIMPL; +} + +static HRESULT WINAPI overlay_SetPalette(IOverlay *iface, DWORD count, PALETTEENTRY *palette) +{ + FIXME("iface %p, count %u, palette %p, stub!\n", iface, count, palette); + return E_NOTIMPL; +} + +static HRESULT WINAPI overlay_GetDefaultColorKey(IOverlay *iface, COLORKEY *key) +{ + FIXME("iface %p, key %p, stub!\n", iface, key); + return E_NOTIMPL; +} + +static HRESULT WINAPI overlay_GetColorKey(IOverlay *iface, COLORKEY *key) +{ + FIXME("iface %p, key %p, stub!\n", iface, key); + return E_NOTIMPL; +} + +static HRESULT WINAPI overlay_SetColorKey(IOverlay *iface, COLORKEY *key) +{ + FIXME("iface %p, key %p, stub!\n", iface, key); + return E_NOTIMPL; +} + +static HRESULT WINAPI overlay_GetWindowHandle(IOverlay *iface, HWND *window) +{ + FIXME("iface %p, window %p, stub!\n", iface, window); + return E_NOTIMPL; +} + +static HRESULT WINAPI overlay_GetClipList(IOverlay *iface, RECT *source, RECT *dest, RGNDATA **region) +{ + FIXME("iface %p, source %p, dest %p, region %p, stub!\n", iface, source, dest, region); + return E_NOTIMPL; +} + +static HRESULT WINAPI overlay_GetVideoPosition(IOverlay *iface, RECT *source, RECT *dest) +{ + FIXME("iface %p, source %p, dest %p, stub!\n", iface, source, dest); + return E_NOTIMPL; +} + +static HRESULT WINAPI overlay_Advise(IOverlay *iface, IOverlayNotify *sink, DWORD flags) +{ + FIXME("iface %p, sink %p, flags %#x, stub!\n", iface, sink, flags); + return E_NOTIMPL; +} + +static HRESULT WINAPI overlay_Unadvise(IOverlay *iface) +{ + FIXME("iface %p, stub!\n", iface); + return E_NOTIMPL; +} + +static const IOverlayVtbl overlay_vtbl = +{ + overlay_QueryInterface, + overlay_AddRef, + overlay_Release, + overlay_GetPalette, + overlay_SetPalette, + overlay_GetDefaultColorKey, + overlay_GetColorKey, + overlay_SetColorKey, + overlay_GetWindowHandle, + overlay_GetClipList, + overlay_GetVideoPosition, + overlay_Advise, + overlay_Unadvise, +}; + static HRESULT vmr_create(IUnknown *outer, void **out, const CLSID *clsid) { static const WCHAR sink_name[] = {'V','M','R',' ','I','n','p','u','t','0',0}; @@ -2149,6 +2265,7 @@ static HRESULT vmr_create(IUnknown *outer, void **out, const CLSID *clsid) pVMR->IVMRSurfaceAllocatorNotify9_iface.lpVtbl = &VMR9_SurfaceAllocatorNotify_Vtbl; pVMR->IVMRWindowlessControl_iface.lpVtbl = &VMR7_WindowlessControl_Vtbl; pVMR->IVMRWindowlessControl9_iface.lpVtbl = &VMR9_WindowlessControl_Vtbl; + pVMR->IOverlay_iface.lpVtbl = &overlay_vtbl; hr = strmbase_renderer_init(&pVMR->renderer, &VMR_Vtbl, outer, clsid, sink_name, &BaseFuncTable); if (FAILED(hr))
1
0
0
0
Zebediah Figura : quartz/tests: Add some tests for VMR9 pin connection.
by Alexandre Julliard
04 Oct '19
04 Oct '19
Module: wine Branch: master Commit: 35788e301e69ca96d60ac585b8d0bc7c3f1e0b58 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=35788e301e69ca96d60ac585…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Oct 4 10:02:47 2019 -0500 quartz/tests: Add some tests for VMR9 pin connection. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/vmr9.c | 261 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 261 insertions(+) diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 80bb930378..f65ddc2278 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -22,6 +22,7 @@ #include "dshow.h" #include "d3d9.h" #include "vmr9.h" +#include "wine/strmbase.h" #include "wine/test.h" static IBaseFilter *create_vmr9(DWORD mode) @@ -42,6 +43,21 @@ static IBaseFilter *create_vmr9(DWORD mode) return filter; } +static inline BOOL compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TYPE *b) +{ + return !memcmp(a, b, offsetof(AM_MEDIA_TYPE, pbFormat)) + && !memcmp(a->pbFormat, b->pbFormat, a->cbFormat); +} + +static IFilterGraph2 *create_graph(void) +{ + IFilterGraph2 *ret; + HRESULT hr; + hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterGraph2, (void **)&ret); + ok(hr == S_OK, "Failed to create FilterGraph: %#x\n", hr); + return ret; +} + static ULONG get_refcount(void *iface) { IUnknown *unknown = iface; @@ -836,6 +852,250 @@ static void test_unconnected_filter_state(void) ok(!ref, "Got outstanding refcount %d.\n", ref); } +struct testfilter +{ + struct strmbase_filter filter; + struct strmbase_source source; +}; + +static const IBaseFilterVtbl testfilter_vtbl = +{ + BaseFilterImpl_QueryInterface, + BaseFilterImpl_AddRef, + BaseFilterImpl_Release, + BaseFilterImpl_GetClassID, + BaseFilterImpl_Stop, + BaseFilterImpl_Pause, + BaseFilterImpl_Run, + BaseFilterImpl_GetState, + BaseFilterImpl_SetSyncSource, + BaseFilterImpl_GetSyncSource, + BaseFilterImpl_EnumPins, + BaseFilterImpl_FindPin, + BaseFilterImpl_QueryFilterInfo, + BaseFilterImpl_JoinFilterGraph, + BaseFilterImpl_QueryVendorInfo, +}; + +static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface) +{ + return CONTAINING_RECORD(iface, struct testfilter, filter); +} + +static IPin *testfilter_get_pin(struct strmbase_filter *iface, unsigned int index) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface); + if (!index) + return &filter->source.pin.IPin_iface; + return NULL; +} + +static void testfilter_destroy(struct strmbase_filter *iface) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface); + strmbase_source_cleanup(&filter->source); + strmbase_filter_cleanup(&filter->filter); +} + +static const struct strmbase_filter_ops testfilter_ops = +{ + .filter_get_pin = testfilter_get_pin, + .filter_destroy = testfilter_destroy, +}; + +static const IPinVtbl testsource_vtbl = +{ + BasePinImpl_QueryInterface, + BasePinImpl_AddRef, + BasePinImpl_Release, + BaseOutputPinImpl_Connect, + BaseOutputPinImpl_ReceiveConnection, + BasePinImpl_Disconnect, + BasePinImpl_ConnectedTo, + BasePinImpl_ConnectionMediaType, + BasePinImpl_QueryPinInfo, + BasePinImpl_QueryDirection, + BasePinImpl_QueryId, + BasePinImpl_QueryAccept, + BasePinImpl_EnumMediaTypes, + BasePinImpl_QueryInternalConnections, + BaseOutputPinImpl_EndOfStream, + BaseOutputPinImpl_BeginFlush, + BaseOutputPinImpl_EndFlush, + BasePinImpl_NewSegment, +}; + +static HRESULT testsource_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) +{ + return S_OK; +} + +static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface, + IPin *peer, const AM_MEDIA_TYPE *mt) +{ + HRESULT hr; + + iface->pin.peer = peer; + IPin_AddRef(peer); + CopyMediaType(&iface->pin.mtCurrent, mt); + + if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt))) + { + ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + IPin_Release(peer); + iface->pin.peer = NULL; + FreeMediaType(&iface->pin.mtCurrent); + } + + return hr; +} + +static const struct strmbase_source_ops testsource_ops = +{ + .base.pin_query_accept = testsource_query_accept, + .base.pin_get_media_type = strmbase_pin_get_media_type, + .pfnAttemptConnection = testsource_AttemptConnection, +}; + +static void testfilter_init(struct testfilter *filter) +{ + static const GUID clsid = {0xabacab}; + strmbase_filter_init(&filter->filter, &testfilter_vtbl, NULL, &clsid, &testfilter_ops); + strmbase_source_init(&filter->source, &testsource_vtbl, &filter->filter, L"", &testsource_ops); +} + +static void test_connect_pin(void) +{ + VIDEOINFOHEADER vih = + { + .bmiHeader.biSize = sizeof(BITMAPINFOHEADER), + .bmiHeader.biBitCount = 32, + .bmiHeader.biWidth = 32, + .bmiHeader.biHeight = 16, + .bmiHeader.biPlanes = 1, + .bmiHeader.biCompression = BI_RGB, + }; + AM_MEDIA_TYPE req_mt = + { + .majortype = MEDIATYPE_Video, + .formattype = FORMAT_VideoInfo, + .cbFormat = sizeof(vih), + .pbFormat = (BYTE *)&vih, + }; + IBaseFilter *filter = create_vmr9(VMR9Mode_Windowed); + IFilterGraph2 *graph = create_graph(); + struct testfilter source; + unsigned int i, j; + AM_MEDIA_TYPE mt; + IPin *pin, *peer; + HRESULT hr; + ULONG ref; + + static const GUID *subtype_tests[] = + { + &MEDIASUBTYPE_RGB555, + &MEDIASUBTYPE_RGB565, + &MEDIASUBTYPE_RGB24, + &MEDIASUBTYPE_RGB32, + }; + static const WORD bpp_tests[] = {15, 16, 24, 32}; + + testfilter_init(&source); + + IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, NULL); + IFilterGraph2_AddFilter(graph, filter, NULL); + + IBaseFilter_FindPin(filter, L"VMR Input0", &pin); + + for (i = 0; i < ARRAY_SIZE(subtype_tests); ++i) + { + req_mt.subtype = *subtype_tests[i]; + + for (j = 0; j < ARRAY_SIZE(bpp_tests); ++j) + { + vih.bmiHeader.biBitCount = bpp_tests[j]; + + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == S_OK, "Got hr %#x for subtype %s and bpp %u.\n", hr, + wine_dbgstr_guid(subtype_tests[i]), bpp_tests[j]); + + hr = IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + } + } + + req_mt.formattype = FORMAT_None; + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + req_mt.formattype = GUID_NULL; + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + req_mt.formattype = FORMAT_VideoInfo; + + req_mt.subtype = MEDIASUBTYPE_RGB8; + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + todo_wine ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + if (hr == S_OK) + { + IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface); + IFilterGraph2_Disconnect(graph, pin); + } + req_mt.subtype = MEDIASUBTYPE_WAVE; + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + todo_wine ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + if (hr == S_OK) + { + IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface); + IFilterGraph2_Disconnect(graph, pin); + } + req_mt.subtype = MEDIASUBTYPE_RGB32; + + peer = (IPin *)0xdeadbeef; + hr = IPin_ConnectedTo(pin, &peer); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + ok(!peer, "Got peer %p.\n", peer); + + hr = IPin_ConnectionMediaType(pin, &mt); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IPin_ConnectedTo(pin, &peer); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(peer == &source.source.pin.IPin_iface, "Got peer %p.\n", peer); + IPin_Release(peer); + + hr = IPin_ConnectionMediaType(pin, &mt); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n"); + + hr = IFilterGraph2_Disconnect(graph, pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, pin); + todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr); + ok(source.source.pin.peer == pin, "Got peer %p.\n", source.source.pin.peer); + IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface); + + peer = (IPin *)0xdeadbeef; + hr = IPin_ConnectedTo(pin, &peer); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + ok(!peer, "Got peer %p.\n", peer); + + hr = IPin_ConnectionMediaType(pin, &mt); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + + IPin_Release(pin); + ref = IFilterGraph2_Release(graph); + ok(!ref, "Got outstanding refcount %d.\n", ref); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); + ref = IBaseFilter_Release(&source.filter.IBaseFilter_iface); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(vmr9) { IBaseFilter *filter; @@ -860,6 +1120,7 @@ START_TEST(vmr9) test_media_types(); test_enum_media_types(); test_unconnected_filter_state(); + test_connect_pin(); CoUninitialize(); }
1
0
0
0
Zebediah Figura : quartz/tests: Add some tests for VMR7 pin connection.
by Alexandre Julliard
04 Oct '19
04 Oct '19
Module: wine Branch: master Commit: 64b1a5ef4880c84341253e01eaa2751b33de4659 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=64b1a5ef4880c84341253e01…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Oct 4 10:02:46 2019 -0500 quartz/tests: Add some tests for VMR7 pin connection. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/vmr7.c | 266 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 266 insertions(+) diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 53f979601e..c0d2574d16 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -22,6 +22,7 @@ #include "dshow.h" #include "d3d9.h" #include "vmr9.h" +#include "wine/strmbase.h" #include "wine/test.h" static IBaseFilter *create_vmr7(DWORD mode) @@ -57,6 +58,21 @@ static HRESULT set_mixing_mode(IBaseFilter *filter) return hr; } +static inline BOOL compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TYPE *b) +{ + return !memcmp(a, b, offsetof(AM_MEDIA_TYPE, pbFormat)) + && !memcmp(a->pbFormat, b->pbFormat, a->cbFormat); +} + +static IFilterGraph2 *create_graph(void) +{ + IFilterGraph2 *ret; + HRESULT hr; + hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterGraph2, (void **)&ret); + ok(hr == S_OK, "Failed to create FilterGraph: %#x\n", hr); + return ret; +} + static ULONG get_refcount(void *iface) { IUnknown *unknown = iface; @@ -832,6 +848,255 @@ static void test_unconnected_filter_state(void) ok(!ref, "Got outstanding refcount %d.\n", ref); } +struct testfilter +{ + struct strmbase_filter filter; + struct strmbase_source source; +}; + +static const IBaseFilterVtbl testfilter_vtbl = +{ + BaseFilterImpl_QueryInterface, + BaseFilterImpl_AddRef, + BaseFilterImpl_Release, + BaseFilterImpl_GetClassID, + BaseFilterImpl_Stop, + BaseFilterImpl_Pause, + BaseFilterImpl_Run, + BaseFilterImpl_GetState, + BaseFilterImpl_SetSyncSource, + BaseFilterImpl_GetSyncSource, + BaseFilterImpl_EnumPins, + BaseFilterImpl_FindPin, + BaseFilterImpl_QueryFilterInfo, + BaseFilterImpl_JoinFilterGraph, + BaseFilterImpl_QueryVendorInfo, +}; + +static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface) +{ + return CONTAINING_RECORD(iface, struct testfilter, filter); +} + +static IPin *testfilter_get_pin(struct strmbase_filter *iface, unsigned int index) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface); + if (!index) + return &filter->source.pin.IPin_iface; + return NULL; +} + +static void testfilter_destroy(struct strmbase_filter *iface) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface); + strmbase_source_cleanup(&filter->source); + strmbase_filter_cleanup(&filter->filter); +} + +static const struct strmbase_filter_ops testfilter_ops = +{ + .filter_get_pin = testfilter_get_pin, + .filter_destroy = testfilter_destroy, +}; + +static const IPinVtbl testsource_vtbl = +{ + BasePinImpl_QueryInterface, + BasePinImpl_AddRef, + BasePinImpl_Release, + BaseOutputPinImpl_Connect, + BaseOutputPinImpl_ReceiveConnection, + BasePinImpl_Disconnect, + BasePinImpl_ConnectedTo, + BasePinImpl_ConnectionMediaType, + BasePinImpl_QueryPinInfo, + BasePinImpl_QueryDirection, + BasePinImpl_QueryId, + BasePinImpl_QueryAccept, + BasePinImpl_EnumMediaTypes, + BasePinImpl_QueryInternalConnections, + BaseOutputPinImpl_EndOfStream, + BaseOutputPinImpl_BeginFlush, + BaseOutputPinImpl_EndFlush, + BasePinImpl_NewSegment, +}; + +static HRESULT testsource_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) +{ + return S_OK; +} + +static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface, + IPin *peer, const AM_MEDIA_TYPE *mt) +{ + HRESULT hr; + + iface->pin.peer = peer; + IPin_AddRef(peer); + CopyMediaType(&iface->pin.mtCurrent, mt); + + if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt))) + { + ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + IPin_Release(peer); + iface->pin.peer = NULL; + FreeMediaType(&iface->pin.mtCurrent); + } + + return hr; +} + +static const struct strmbase_source_ops testsource_ops = +{ + .base.pin_query_accept = testsource_query_accept, + .base.pin_get_media_type = strmbase_pin_get_media_type, + .pfnAttemptConnection = testsource_AttemptConnection, +}; + +static void testfilter_init(struct testfilter *filter) +{ + static const GUID clsid = {0xabacab}; + strmbase_filter_init(&filter->filter, &testfilter_vtbl, NULL, &clsid, &testfilter_ops); + strmbase_source_init(&filter->source, &testsource_vtbl, &filter->filter, L"", &testsource_ops); +} + +static void test_connect_pin(void) +{ + VIDEOINFOHEADER vih = + { + .bmiHeader.biSize = sizeof(BITMAPINFOHEADER), + .bmiHeader.biWidth = 32, + .bmiHeader.biHeight = 16, + .bmiHeader.biPlanes = 1, + .bmiHeader.biCompression = BI_RGB, + }; + AM_MEDIA_TYPE req_mt = + { + .majortype = MEDIATYPE_Video, + .subtype = MEDIASUBTYPE_WAVE, + .formattype = FORMAT_VideoInfo, + .cbFormat = sizeof(vih), + .pbFormat = (BYTE *)&vih, + }; + IBaseFilter *filter = create_vmr7(VMRMode_Windowed); + IFilterGraph2 *graph = create_graph(); + struct testfilter source; + AM_MEDIA_TYPE mt; + IPin *pin, *peer; + unsigned int i; + HRESULT hr; + ULONG ref; + + static const GUID *subtype_tests[] = + { + &MEDIASUBTYPE_RGB565, + &MEDIASUBTYPE_RGB24, + &MEDIASUBTYPE_RGB32, + &MEDIASUBTYPE_WAVE, + }; + + testfilter_init(&source); + + IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, NULL); + IFilterGraph2_AddFilter(graph, filter, NULL); + + IBaseFilter_FindPin(filter, L"VMR Input0", &pin); + + vih.bmiHeader.biBitCount = 16; + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + todo_wine ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + if (hr == S_OK) + { + IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface); + IFilterGraph2_Disconnect(graph, pin); + } + vih.bmiHeader.biBitCount = 32; + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + if (hr == VFW_E_TYPE_NOT_ACCEPTED) /* w7u */ + { + vih.bmiHeader.biBitCount = 24; + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + } + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + for (i = 0; i < ARRAY_SIZE(subtype_tests); ++i) + { + req_mt.subtype = *subtype_tests[i]; + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == S_OK, "Got hr %#x for subtype %s.\n", hr, wine_dbgstr_guid(subtype_tests[i])); + + hr = IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + } + + req_mt.formattype = FORMAT_None; + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + req_mt.formattype = GUID_NULL; + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + req_mt.formattype = FORMAT_VideoInfo; + + req_mt.subtype = MEDIASUBTYPE_RGB8; + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + todo_wine ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + if (hr == S_OK) + { + IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface); + IFilterGraph2_Disconnect(graph, pin); + } + req_mt.subtype = MEDIASUBTYPE_RGB32; + + peer = (IPin *)0xdeadbeef; + hr = IPin_ConnectedTo(pin, &peer); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + ok(!peer, "Got peer %p.\n", peer); + + hr = IPin_ConnectionMediaType(pin, &mt); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IPin_ConnectedTo(pin, &peer); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(peer == &source.source.pin.IPin_iface, "Got peer %p.\n", peer); + IPin_Release(peer); + + hr = IPin_ConnectionMediaType(pin, &mt); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n"); + + hr = IFilterGraph2_Disconnect(graph, pin); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, pin); + todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr); + ok(source.source.pin.peer == pin, "Got peer %p.\n", peer); + IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface); + + peer = (IPin *)0xdeadbeef; + hr = IPin_ConnectedTo(pin, &peer); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + ok(!peer, "Got peer %p.\n", peer); + + hr = IPin_ConnectionMediaType(pin, &mt); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + + IPin_Release(pin); + ref = IFilterGraph2_Release(graph); + ok(!ref, "Got outstanding refcount %d.\n", ref); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); + ref = IBaseFilter_Release(&source.filter.IBaseFilter_iface); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(vmr7) { CoInitialize(NULL); @@ -845,6 +1110,7 @@ START_TEST(vmr7) test_media_types(); test_enum_media_types(); test_unconnected_filter_state(); + test_connect_pin(); CoUninitialize(); }
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
62
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Results per page:
10
25
50
100
200