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 2021
----- 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
1165 discussions
Start a n
N
ew thread
Alistair Leslie-Hughes : msdasql: Add IOpenRowset support to session.
by Alexandre Julliard
28 Oct '21
28 Oct '21
Module: wine Branch: master Commit: 4ba940afaab85d4f5ca68612bef59358bf0cc69f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4ba940afaab85d4f5ca68612…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Thu Oct 28 16:27:35 2021 +1100 msdasql: Add IOpenRowset support to session. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msdasql/session.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/dlls/msdasql/session.c b/dlls/msdasql/session.c index b79a80389ff..465a89d199a 100644 --- a/dlls/msdasql/session.c +++ b/dlls/msdasql/session.c @@ -38,6 +38,7 @@ struct msdasql_session { IUnknown session_iface; IGetDataSource IGetDataSource_iface; + IOpenRowset IOpenRowset_iface; LONG refs; }; @@ -51,6 +52,11 @@ static inline struct msdasql_session *impl_from_IGetDataSource( IGetDataSource * return CONTAINING_RECORD( iface, struct msdasql_session, IGetDataSource_iface ); } +static inline struct msdasql_session *impl_from_IOpenRowset( IOpenRowset *iface ) +{ + return CONTAINING_RECORD( iface, struct msdasql_session, IOpenRowset_iface ); +} + static HRESULT WINAPI session_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) { struct msdasql_session *session = impl_from_IUnknown( iface ); @@ -68,6 +74,11 @@ static HRESULT WINAPI session_QueryInterface(IUnknown *iface, REFIID riid, void TRACE("(%p)->(IID_IGetDataSource %p)\n", iface, ppv); *ppv = &session->IGetDataSource_iface; } + else if(IsEqualGUID(&IID_IOpenRowset, riid)) + { + TRACE("(%p)->(IID_IOpenRowset %p)\n", iface, ppv); + *ppv = &session->IOpenRowset_iface; + } if(*ppv) { @@ -142,6 +153,42 @@ static const IGetDataSourceVtbl datasourceVtbl = datasource_GetDataSource }; +HRESULT WINAPI openrowset_QueryInterface(IOpenRowset *iface, REFIID riid, void **out) +{ + struct msdasql_session *session = impl_from_IOpenRowset( iface ); + return IUnknown_QueryInterface(&session->session_iface, riid, out); +} + +ULONG WINAPI openrowset_AddRef(IOpenRowset *iface) +{ + struct msdasql_session *session = impl_from_IOpenRowset( iface ); + return IUnknown_AddRef(&session->session_iface); +} + +ULONG WINAPI openrowset_Release(IOpenRowset *iface) +{ + struct msdasql_session *session = impl_from_IOpenRowset( iface ); + return IUnknown_Release(&session->session_iface); +} + +HRESULT WINAPI openrowset_OpenRowset(IOpenRowset *iface, IUnknown *pUnkOuter, DBID *table, + DBID *index, REFIID riid, ULONG count, DBPROPSET propertysets[], IUnknown **rowset) +{ + struct msdasql_session *session = impl_from_IOpenRowset( iface ); + FIXME("%p, %p, %p %p %s, %d %p %p stub\n", session, pUnkOuter, table, index, debugstr_guid(riid), + count, propertysets, rowset); + + return E_NOTIMPL; +} + +static const IOpenRowsetVtbl openrowsetVtbl = +{ + openrowset_QueryInterface, + openrowset_AddRef, + openrowset_Release, + openrowset_OpenRowset +}; + HRESULT create_db_session(REFIID riid, void **unk) { struct msdasql_session *session; @@ -153,6 +200,7 @@ HRESULT create_db_session(REFIID riid, void **unk) session->session_iface.lpVtbl = &unkfactoryVtbl; session->IGetDataSource_iface.lpVtbl = &datasourceVtbl; + session->IOpenRowset_iface.lpVtbl = &openrowsetVtbl; session->refs = 1; hr = IUnknown_QueryInterface(&session->session_iface, riid, unk);
1
0
0
0
Alistair Leslie-Hughes : msdasql: Add IGetDataSource support to session.
by Alexandre Julliard
28 Oct '21
28 Oct '21
Module: wine Branch: master Commit: 33563cf16f5e122a1800612ddc214aee3da30d6d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=33563cf16f5e122a1800612d…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Thu Oct 28 16:27:34 2021 +1100 msdasql: Add IGetDataSource support to session. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msdasql/session.c | 47 +++++++++++++++++++++++++++++++++++++++++++ dlls/msdasql/tests/provider.c | 5 +++++ 2 files changed, 52 insertions(+) diff --git a/dlls/msdasql/session.c b/dlls/msdasql/session.c index 57174be40f8..b79a80389ff 100644 --- a/dlls/msdasql/session.c +++ b/dlls/msdasql/session.c @@ -37,6 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msdasql); struct msdasql_session { IUnknown session_iface; + IGetDataSource IGetDataSource_iface; LONG refs; }; @@ -45,6 +46,11 @@ static inline struct msdasql_session *impl_from_IUnknown( IUnknown *iface ) return CONTAINING_RECORD( iface, struct msdasql_session, session_iface ); } +static inline struct msdasql_session *impl_from_IGetDataSource( IGetDataSource *iface ) +{ + return CONTAINING_RECORD( iface, struct msdasql_session, IGetDataSource_iface ); +} + static HRESULT WINAPI session_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) { struct msdasql_session *session = impl_from_IUnknown( iface ); @@ -57,6 +63,11 @@ static HRESULT WINAPI session_QueryInterface(IUnknown *iface, REFIID riid, void TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv); *ppv = &session->session_iface; } + else if(IsEqualGUID(&IID_IGetDataSource, riid)) + { + TRACE("(%p)->(IID_IGetDataSource %p)\n", iface, ppv); + *ppv = &session->IGetDataSource_iface; + } if(*ppv) { @@ -96,6 +107,41 @@ static const IUnknownVtbl unkfactoryVtbl = session_Release, }; + +HRESULT WINAPI datasource_QueryInterface(IGetDataSource *iface, REFIID riid, void **out) +{ + struct msdasql_session *session = impl_from_IGetDataSource( iface ); + return IUnknown_QueryInterface(&session->session_iface, riid, out); +} + +ULONG WINAPI datasource_AddRef(IGetDataSource *iface) +{ + struct msdasql_session *session = impl_from_IGetDataSource( iface ); + return IUnknown_AddRef(&session->session_iface); +} + +ULONG WINAPI datasource_Release(IGetDataSource *iface) +{ + struct msdasql_session *session = impl_from_IGetDataSource( iface ); + return IUnknown_Release(&session->session_iface); +} + +HRESULT WINAPI datasource_GetDataSource(IGetDataSource *iface, REFIID riid, IUnknown **datasource) +{ + struct msdasql_session *session = impl_from_IGetDataSource( iface ); + FIXME("%p, %s, %p stub\n", session, debugstr_guid(riid), datasource); + + return E_NOTIMPL; +} + +static const IGetDataSourceVtbl datasourceVtbl = +{ + datasource_QueryInterface, + datasource_AddRef, + datasource_Release, + datasource_GetDataSource +}; + HRESULT create_db_session(REFIID riid, void **unk) { struct msdasql_session *session; @@ -106,6 +152,7 @@ HRESULT create_db_session(REFIID riid, void **unk) return E_OUTOFMEMORY; session->session_iface.lpVtbl = &unkfactoryVtbl; + session->IGetDataSource_iface.lpVtbl = &datasourceVtbl; session->refs = 1; hr = IUnknown_QueryInterface(&session->session_iface, riid, unk); diff --git a/dlls/msdasql/tests/provider.c b/dlls/msdasql/tests/provider.c index 4cab6a24daf..4eaf6c07355 100644 --- a/dlls/msdasql/tests/provider.c +++ b/dlls/msdasql/tests/provider.c @@ -159,6 +159,7 @@ static void test_sessions(void) IUnknown *session = NULL; IOpenRowset *openrowset = NULL; IDBCreateCommand *create_command = NULL; + IGetDataSource *datasource = NULL; IUnknown *cmd = NULL; HRESULT hr; BSTR connect_str; @@ -203,6 +204,10 @@ static void test_sessions(void) hr = IDBCreateSession_CreateSession( dbsession, NULL, &IID_IUnknown, &session ); ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IUnknown_QueryInterface(session, &IID_IGetDataSource, (void**)&datasource); + ok(hr == S_OK, "got 0x%08x\n", hr); + IGetDataSource_Release(datasource); + hr = IUnknown_QueryInterface(session, &IID_IOpenRowset, (void**)&openrowset); ok(hr == S_OK, "got 0x%08x\n", hr);
1
0
0
0
Zebediah Figura : winegstreamer: Implement IWMSyncReader::GetOutputFormatCount().
by Alexandre Julliard
28 Oct '21
28 Oct '21
Module: wine Branch: master Commit: bc52edc19d8a45b9062d9568652403251872026e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bc52edc19d8a45b9062d9568…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Oct 28 11:46:00 2021 -0500 winegstreamer: Implement IWMSyncReader::GetOutputFormatCount(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/gst_private.h | 1 + dlls/winegstreamer/wm_reader.c | 30 ++++++++++++++++++++++++++++++ dlls/winegstreamer/wm_syncreader.c | 10 ++++++---- dlls/wmvcore/tests/wmvcore.c | 8 ++++---- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index da36d53abff..9219a86c094 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -155,6 +155,7 @@ void wm_reader_cleanup(struct wm_reader *reader); HRESULT wm_reader_close(struct wm_reader *reader); HRESULT wm_reader_get_output_format(struct wm_reader *reader, DWORD output, DWORD index, IWMOutputMediaProps **props); +HRESULT wm_reader_get_output_format_count(struct wm_reader *reader, DWORD output, DWORD *count); HRESULT wm_reader_get_output_props(struct wm_reader *reader, DWORD output, IWMOutputMediaProps **props); void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops); diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index f6820121bf0..79a89c9a332 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1306,6 +1306,36 @@ static const enum wg_video_format video_formats[] = WG_VIDEO_FORMAT_RGB15, }; +HRESULT wm_reader_get_output_format_count(struct wm_reader *reader, DWORD output, DWORD *count) +{ + struct wm_stream *stream; + struct wg_format format; + + EnterCriticalSection(&reader->cs); + + if (!(stream = get_stream_by_output_number(reader, output))) + { + LeaveCriticalSection(&reader->cs); + return E_INVALIDARG; + } + + wg_parser_stream_get_preferred_format(stream->wg_stream, &format); + switch (format.major_type) + { + case WG_MAJOR_TYPE_VIDEO: + *count = ARRAY_SIZE(video_formats); + break; + + case WG_MAJOR_TYPE_AUDIO: + case WG_MAJOR_TYPE_UNKNOWN: + *count = 1; + break; + } + + LeaveCriticalSection(&reader->cs); + return S_OK; +} + HRESULT wm_reader_get_output_format(struct wm_reader *reader, DWORD output, DWORD index, IWMOutputMediaProps **props) { diff --git a/dlls/winegstreamer/wm_syncreader.c b/dlls/winegstreamer/wm_syncreader.c index 7becd88b63e..54c53dee3bd 100644 --- a/dlls/winegstreamer/wm_syncreader.c +++ b/dlls/winegstreamer/wm_syncreader.c @@ -107,11 +107,13 @@ static HRESULT WINAPI WMSyncReader_GetOutputFormat(IWMSyncReader2 *iface, return wm_reader_get_output_format(&reader->reader, output, index, props); } -static HRESULT WINAPI WMSyncReader_GetOutputFormatCount(IWMSyncReader2 *iface, DWORD output_num, DWORD *formats) +static HRESULT WINAPI WMSyncReader_GetOutputFormatCount(IWMSyncReader2 *iface, DWORD output, DWORD *count) { - struct sync_reader *This = impl_from_IWMSyncReader2(iface); - FIXME("(%p)->(%u %p): stub!\n", This, output_num, formats); - return E_NOTIMPL; + struct sync_reader *reader = impl_from_IWMSyncReader2(iface); + + TRACE("reader %p, output %u, count %p.\n", reader, output, count); + + return wm_reader_get_output_format_count(&reader->reader, output, count); } static HRESULT WINAPI WMSyncReader_GetOutputNumberForStream(IWMSyncReader2 *iface, diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 5c1a47b65d1..ebfdfdf0107 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -747,8 +747,8 @@ static void test_sync_reader_types(void) count = 0; hr = IWMSyncReader_GetOutputFormatCount(reader, output_number, &count); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(count > 0, "Got count %u.\n", count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count > 0, "Got count %u.\n", count); for (j = 0; j < count; ++j) { @@ -824,7 +824,7 @@ static void test_sync_reader_types(void) } hr = IWMSyncReader_GetOutputFormat(reader, output_number, count, &output_props); - todo_wine ok(hr == NS_E_INVALID_OUTPUT_FORMAT, "Got hr %#x.\n", hr); + ok(hr == NS_E_INVALID_OUTPUT_FORMAT, "Got hr %#x.\n", hr); hr = IWMSyncReader_GetOutputProps(reader, output_number, &output_props); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -846,7 +846,7 @@ static void test_sync_reader_types(void) count = 0xdeadbeef; hr = IWMSyncReader_GetOutputFormatCount(reader, 2, &count); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); ok(count == 0xdeadbeef, "Got count %#x.\n", count); output_props = (void *)0xdeadbeef;
1
0
0
0
Zebediah Figura : winegstreamer: Implement IWMSyncReader::GetOutputFormat().
by Alexandre Julliard
28 Oct '21
28 Oct '21
Module: wine Branch: master Commit: b3655b5be5f137281e8757db4e6985018b21c296 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b3655b5be5f137281e8757db…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Oct 28 11:45:59 2021 -0500 winegstreamer: Implement IWMSyncReader::GetOutputFormat(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/gst_private.h | 2 ++ dlls/winegstreamer/wm_reader.c | 62 ++++++++++++++++++++++++++++++++++++++ dlls/winegstreamer/wm_syncreader.c | 12 +++++--- dlls/wmvcore/tests/wmvcore.c | 2 +- 4 files changed, 72 insertions(+), 6 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index db715a9ad70..da36d53abff 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -153,6 +153,8 @@ struct wm_reader_ops void wm_reader_cleanup(struct wm_reader *reader); HRESULT wm_reader_close(struct wm_reader *reader); +HRESULT wm_reader_get_output_format(struct wm_reader *reader, DWORD output, + DWORD index, IWMOutputMediaProps **props); HRESULT wm_reader_get_output_props(struct wm_reader *reader, DWORD output, IWMOutputMediaProps **props); void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops); diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index cd08bc96869..f6820121bf0 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1290,6 +1290,68 @@ HRESULT wm_reader_get_output_props(struct wm_reader *reader, DWORD output, IWMOu return *props ? S_OK : E_OUTOFMEMORY; } +static const enum wg_video_format video_formats[] = +{ + /* Try to prefer YUV formats over RGB ones. Most decoders output in the + * YUV color space, and it's generally much less expensive for + * videoconvert to do YUV -> YUV transformations. */ + WG_VIDEO_FORMAT_NV12, + WG_VIDEO_FORMAT_YV12, + WG_VIDEO_FORMAT_YUY2, + WG_VIDEO_FORMAT_UYVY, + WG_VIDEO_FORMAT_YVYU, + WG_VIDEO_FORMAT_BGRx, + WG_VIDEO_FORMAT_BGR, + WG_VIDEO_FORMAT_RGB16, + WG_VIDEO_FORMAT_RGB15, +}; + +HRESULT wm_reader_get_output_format(struct wm_reader *reader, DWORD output, + DWORD index, IWMOutputMediaProps **props) +{ + struct wm_stream *stream; + struct wg_format format; + + EnterCriticalSection(&reader->cs); + + if (!(stream = get_stream_by_output_number(reader, output))) + { + LeaveCriticalSection(&reader->cs); + return E_INVALIDARG; + } + + wg_parser_stream_get_preferred_format(stream->wg_stream, &format); + + switch (format.major_type) + { + case WG_MAJOR_TYPE_VIDEO: + if (index >= ARRAY_SIZE(video_formats)) + { + LeaveCriticalSection(&reader->cs); + return NS_E_INVALID_OUTPUT_FORMAT; + } + format.u.video.format = video_formats[index]; + break; + + case WG_MAJOR_TYPE_AUDIO: + if (index) + { + LeaveCriticalSection(&reader->cs); + return NS_E_INVALID_OUTPUT_FORMAT; + } + format.u.audio.format = WG_AUDIO_FORMAT_S16LE; + break; + + case WG_MAJOR_TYPE_UNKNOWN: + break; + } + + LeaveCriticalSection(&reader->cs); + + *props = output_props_create(&format); + return *props ? S_OK : E_OUTOFMEMORY; +} + void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops) { reader->IWMHeaderInfo3_iface.lpVtbl = &header_info_vtbl; diff --git a/dlls/winegstreamer/wm_syncreader.c b/dlls/winegstreamer/wm_syncreader.c index c89fb782a11..7becd88b63e 100644 --- a/dlls/winegstreamer/wm_syncreader.c +++ b/dlls/winegstreamer/wm_syncreader.c @@ -97,12 +97,14 @@ static HRESULT WINAPI WMSyncReader_GetOutputCount(IWMSyncReader2 *iface, DWORD * return S_OK; } -static HRESULT WINAPI WMSyncReader_GetOutputFormat(IWMSyncReader2 *iface, DWORD output_num, DWORD format_num, - IWMOutputMediaProps **props) +static HRESULT WINAPI WMSyncReader_GetOutputFormat(IWMSyncReader2 *iface, + DWORD output, DWORD index, IWMOutputMediaProps **props) { - struct sync_reader *This = impl_from_IWMSyncReader2(iface); - FIXME("(%p)->(%u %u %p): stub!\n", This, output_num, format_num, props); - return E_NOTIMPL; + struct sync_reader *reader = impl_from_IWMSyncReader2(iface); + + TRACE("reader %p, output %u, index %u, props %p.\n", reader, output, index, props); + + return wm_reader_get_output_format(&reader->reader, output, index, props); } static HRESULT WINAPI WMSyncReader_GetOutputFormatCount(IWMSyncReader2 *iface, DWORD output_num, DWORD *formats) diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 6fc74b62dba..5c1a47b65d1 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -856,7 +856,7 @@ static void test_sync_reader_types(void) output_props = (void *)0xdeadbeef; hr = IWMSyncReader_GetOutputFormat(reader, 2, 0, &output_props); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); ok(output_props == (void *)0xdeadbeef, "Got output props %p.\n", output_props); IWMProfile_Release(profile);
1
0
0
0
Zebediah Figura : winegstreamer: Implement IWMOutputMediaProps::GetMediaType().
by Alexandre Julliard
28 Oct '21
28 Oct '21
Module: wine Branch: master Commit: 95ffc879882fdedaf9fdf40eb1c556a025ae5bfd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=95ffc879882fdedaf9fdf40e…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Oct 28 11:45:58 2021 -0500 winegstreamer: Implement IWMOutputMediaProps::GetMediaType(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/wm_reader.c | 49 ++++++++++++++++++++++++++++++++++++++---- dlls/wmvcore/tests/wmvcore.c | 27 +++++++++++------------ 2 files changed, 57 insertions(+), 19 deletions(-) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 2a93e6e1d35..cd08bc96869 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -32,6 +32,8 @@ struct output_props { IWMOutputMediaProps IWMOutputMediaProps_iface; LONG refcount; + + AM_MEDIA_TYPE mt; }; static inline struct output_props *impl_from_IWMOutputMediaProps(IWMOutputMediaProps *iface) @@ -89,8 +91,23 @@ static HRESULT WINAPI output_props_GetType(IWMOutputMediaProps *iface, GUID *maj static HRESULT WINAPI output_props_GetMediaType(IWMOutputMediaProps *iface, WM_MEDIA_TYPE *mt, DWORD *size) { - FIXME("iface %p, mt %p, size %p, stub!\n", iface, mt, size); - return E_NOTIMPL; + const struct output_props *props = impl_from_IWMOutputMediaProps(iface); + const DWORD req_size = *size; + + TRACE("iface %p, mt %p, size %p.\n", iface, mt, size); + + *size = sizeof(*mt) + props->mt.cbFormat; + if (!mt) + return S_OK; + if (req_size < *size) + return ASF_E_BUFFERTOOSMALL; + + strmbase_dump_media_type(&props->mt); + + memcpy(mt, &props->mt, sizeof(*mt)); + memcpy(mt + 1, props->mt.pbFormat, props->mt.cbFormat); + mt->pbFormat = (BYTE *)(mt + 1); + return S_OK; } static HRESULT WINAPI output_props_SetMediaType(IWMOutputMediaProps *iface, WM_MEDIA_TYPE *mt) @@ -123,7 +140,7 @@ static const struct IWMOutputMediaPropsVtbl output_props_vtbl = output_props_GetConnectionName, }; -static IWMOutputMediaProps *output_props_create(void) +static IWMOutputMediaProps *output_props_create(const struct wg_format *format) { struct output_props *object; @@ -132,6 +149,12 @@ static IWMOutputMediaProps *output_props_create(void) object->IWMOutputMediaProps_iface.lpVtbl = &output_props_vtbl; object->refcount = 1; + if (!amt_from_wg_format(&object->mt, format)) + { + free(object); + return NULL; + } + TRACE("Created output properties %p.\n", object); return &object->IWMOutputMediaProps_iface; } @@ -1182,6 +1205,24 @@ HRESULT wm_reader_open_stream(struct wm_reader *reader, IStream *stream) stream->reader = reader; stream->index = i; wg_parser_stream_get_preferred_format(stream->wg_stream, &stream->format); + if (stream->format.major_type == WG_MAJOR_TYPE_AUDIO) + { + /* R.U.S.E enumerates available audio types, picks the first one it + * likes, and then sets the wrong stream to that type. libav might + * give us WG_AUDIO_FORMAT_F32LE by default, which will result in + * the game incorrectly interpreting float data as integer. + * Therefore just match native and always set our default format to + * S16LE. */ + stream->format.u.audio.format = WG_AUDIO_FORMAT_S16LE; + } + else if (stream->format.major_type == WG_MAJOR_TYPE_VIDEO) + { + /* Call of Juarez: Bound in Blood breaks if I420 is enumerated. + * Some native decoders output I420, but the msmpeg4v3 decoder + * never does. */ + if (stream->format.u.video.format == WG_VIDEO_FORMAT_I420) + stream->format.u.video.format = WG_VIDEO_FORMAT_YV12; + } } LeaveCriticalSection(&reader->cs); @@ -1244,7 +1285,7 @@ HRESULT wm_reader_get_output_props(struct wm_reader *reader, DWORD output, IWMOu return E_INVALIDARG; } - *props = output_props_create(); + *props = output_props_create(&stream->format); LeaveCriticalSection(&reader->cs); return *props ? S_OK : E_OUTOFMEMORY; } diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 22184c98dc5..6fc74b62dba 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -728,24 +728,21 @@ static void test_sync_reader_types(void) ret_size = sizeof(mt_buffer); hr = IWMOutputMediaProps_GetMediaType(output_props, mt, &ret_size); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr); ref = IWMOutputMediaProps_Release(output_props); ok(!ref, "Got outstanding refcount %d.\n", ref); - if (hr == S_OK) + if (IsEqualGUID(&majortype, &MEDIATYPE_Audio)) { - if (IsEqualGUID(&majortype, &MEDIATYPE_Audio)) - { - got_audio = true; - check_audio_type(mt); - } - else - { - ok(IsEqualGUID(&majortype, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&majortype)); - got_video = true; - check_video_type(mt); - } + got_audio = true; + check_audio_type(mt); + } + else + { + ok(IsEqualGUID(&majortype, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&majortype)); + got_video = true; + check_video_type(mt); } count = 0; @@ -844,8 +841,8 @@ static void test_sync_reader_types(void) winetest_pop_context(); } - todo_wine ok(got_audio, "No audio stream was enumerated.\n"); - todo_wine ok(got_video, "No video stream was enumerated.\n"); + ok(got_audio, "No audio stream was enumerated.\n"); + ok(got_video, "No video stream was enumerated.\n"); count = 0xdeadbeef; hr = IWMSyncReader_GetOutputFormatCount(reader, 2, &count);
1
0
0
0
Zebediah Figura : winegstreamer: Implement IWMSyncReader::GetOutputProps().
by Alexandre Julliard
28 Oct '21
28 Oct '21
Module: wine Branch: master Commit: 0dc309ef6ac54484d92f6558d6ca2f8e50eb28e2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0dc309ef6ac54484d92f6558…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Oct 28 11:45:57 2021 -0500 winegstreamer: Implement IWMSyncReader::GetOutputProps(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/gst_private.h | 2 + dlls/winegstreamer/wm_reader.c | 133 +++++++++++++++++++++++++++++++++++++ dlls/winegstreamer/wm_syncreader.c | 11 +-- dlls/wmvcore/tests/wmvcore.c | 51 +++++++------- 4 files changed, 165 insertions(+), 32 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 7d5828a15d6..db715a9ad70 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -153,6 +153,8 @@ struct wm_reader_ops void wm_reader_cleanup(struct wm_reader *reader); HRESULT wm_reader_close(struct wm_reader *reader); +HRESULT wm_reader_get_output_props(struct wm_reader *reader, DWORD output, + IWMOutputMediaProps **props); void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops); HRESULT wm_reader_open_stream(struct wm_reader *reader, IStream *stream); diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index feb000c96ed..2a93e6e1d35 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -20,6 +20,122 @@ WINE_DEFAULT_DEBUG_CHANNEL(wmvcore); +static struct wm_stream *get_stream_by_output_number(struct wm_reader *reader, DWORD output) +{ + if (output < reader->stream_count) + return &reader->streams[output]; + WARN("Invalid output number %u.\n", output); + return NULL; +} + +struct output_props +{ + IWMOutputMediaProps IWMOutputMediaProps_iface; + LONG refcount; +}; + +static inline struct output_props *impl_from_IWMOutputMediaProps(IWMOutputMediaProps *iface) +{ + return CONTAINING_RECORD(iface, struct output_props, IWMOutputMediaProps_iface); +} + +static HRESULT WINAPI output_props_QueryInterface(IWMOutputMediaProps *iface, REFIID iid, void **out) +{ + struct output_props *props = impl_from_IWMOutputMediaProps(iface); + + TRACE("props %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IWMOutputMediaProps)) + *out = &props->IWMOutputMediaProps_iface; + else + { + *out = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI output_props_AddRef(IWMOutputMediaProps *iface) +{ + struct output_props *props = impl_from_IWMOutputMediaProps(iface); + ULONG refcount = InterlockedIncrement(&props->refcount); + + TRACE("%p increasing refcount to %u.\n", props, refcount); + + return refcount; +} + +static ULONG WINAPI output_props_Release(IWMOutputMediaProps *iface) +{ + struct output_props *props = impl_from_IWMOutputMediaProps(iface); + ULONG refcount = InterlockedDecrement(&props->refcount); + + TRACE("%p decreasing refcount to %u.\n", props, refcount); + + if (!refcount) + free(props); + + return refcount; +} + +static HRESULT WINAPI output_props_GetType(IWMOutputMediaProps *iface, GUID *major_type) +{ + FIXME("iface %p, major_type %p, stub!\n", iface, major_type); + return E_NOTIMPL; +} + +static HRESULT WINAPI output_props_GetMediaType(IWMOutputMediaProps *iface, WM_MEDIA_TYPE *mt, DWORD *size) +{ + FIXME("iface %p, mt %p, size %p, stub!\n", iface, mt, size); + return E_NOTIMPL; +} + +static HRESULT WINAPI output_props_SetMediaType(IWMOutputMediaProps *iface, WM_MEDIA_TYPE *mt) +{ + FIXME("iface %p, mt %p, stub!\n", iface, mt); + return E_NOTIMPL; +} + +static HRESULT WINAPI output_props_GetStreamGroupName(IWMOutputMediaProps *iface, WCHAR *name, WORD *len) +{ + FIXME("iface %p, name %p, len %p, stub!\n", iface, name, len); + return E_NOTIMPL; +} + +static HRESULT WINAPI output_props_GetConnectionName(IWMOutputMediaProps *iface, WCHAR *name, WORD *len) +{ + FIXME("iface %p, name %p, len %p, stub!\n", iface, name, len); + return E_NOTIMPL; +} + +static const struct IWMOutputMediaPropsVtbl output_props_vtbl = +{ + output_props_QueryInterface, + output_props_AddRef, + output_props_Release, + output_props_GetType, + output_props_GetMediaType, + output_props_SetMediaType, + output_props_GetStreamGroupName, + output_props_GetConnectionName, +}; + +static IWMOutputMediaProps *output_props_create(void) +{ + struct output_props *object; + + if (!(object = calloc(1, sizeof(*object)))) + return NULL; + object->IWMOutputMediaProps_iface.lpVtbl = &output_props_vtbl; + object->refcount = 1; + + TRACE("Created output properties %p.\n", object); + return &object->IWMOutputMediaProps_iface; +} + struct stream_config { IWMStreamConfig IWMStreamConfig_iface; @@ -1116,6 +1232,23 @@ HRESULT wm_reader_close(struct wm_reader *reader) return S_OK; } +HRESULT wm_reader_get_output_props(struct wm_reader *reader, DWORD output, IWMOutputMediaProps **props) +{ + struct wm_stream *stream; + + EnterCriticalSection(&reader->cs); + + if (!(stream = get_stream_by_output_number(reader, output))) + { + LeaveCriticalSection(&reader->cs); + return E_INVALIDARG; + } + + *props = output_props_create(); + LeaveCriticalSection(&reader->cs); + return *props ? S_OK : E_OUTOFMEMORY; +} + void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops) { reader->IWMHeaderInfo3_iface.lpVtbl = &header_info_vtbl; diff --git a/dlls/winegstreamer/wm_syncreader.c b/dlls/winegstreamer/wm_syncreader.c index cb2e61a25bc..c89fb782a11 100644 --- a/dlls/winegstreamer/wm_syncreader.c +++ b/dlls/winegstreamer/wm_syncreader.c @@ -123,11 +123,14 @@ static HRESULT WINAPI WMSyncReader_GetOutputNumberForStream(IWMSyncReader2 *ifac return S_OK; } -static HRESULT WINAPI WMSyncReader_GetOutputProps(IWMSyncReader2 *iface, DWORD output_num, IWMOutputMediaProps **output) +static HRESULT WINAPI WMSyncReader_GetOutputProps(IWMSyncReader2 *iface, + DWORD output, IWMOutputMediaProps **props) { - struct sync_reader *This = impl_from_IWMSyncReader2(iface); - FIXME("(%p)->(%u %p): stub!\n", This, output_num, output); - return E_NOTIMPL; + struct sync_reader *reader = impl_from_IWMSyncReader2(iface); + + TRACE("reader %p, output %u, props %p.\n", reader, output, props); + + return wm_reader_get_output_props(&reader->reader, output, props); } static HRESULT WINAPI WMSyncReader_GetOutputSetting(IWMSyncReader2 *iface, DWORD output_num, const WCHAR *name, diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 031a1841360..22184c98dc5 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -724,30 +724,28 @@ static void test_sync_reader_types(void) ok(stream_number2 == stream_number, "Expected stream number %u, got %u.\n", stream_number, stream_number2); hr = IWMSyncReader_GetOutputProps(reader, output_number, &output_props); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); - if (hr != S_OK) - { - winetest_pop_context(); - continue; - } + ok(hr == S_OK, "Got hr %#x.\n", hr); ret_size = sizeof(mt_buffer); hr = IWMOutputMediaProps_GetMediaType(output_props, mt, &ret_size); - ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); ref = IWMOutputMediaProps_Release(output_props); ok(!ref, "Got outstanding refcount %d.\n", ref); - if (IsEqualGUID(&majortype, &MEDIATYPE_Audio)) - { - got_audio = true; - check_audio_type(mt); - } - else + if (hr == S_OK) { - ok(IsEqualGUID(&majortype, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&majortype)); - got_video = true; - check_video_type(mt); + if (IsEqualGUID(&majortype, &MEDIATYPE_Audio)) + { + got_audio = true; + check_audio_type(mt); + } + else + { + ok(IsEqualGUID(&majortype, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&majortype)); + got_video = true; + check_video_type(mt); + } } count = 0; @@ -832,19 +830,16 @@ static void test_sync_reader_types(void) todo_wine ok(hr == NS_E_INVALID_OUTPUT_FORMAT, "Got hr %#x.\n", hr); hr = IWMSyncReader_GetOutputProps(reader, output_number, &output_props); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr); - if (hr == S_OK) - { - hr = IWMSyncReader_GetOutputProps(reader, output_number, &output_props2); - ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(output_props2 != output_props, "Expected different objects.\n"); + hr = IWMSyncReader_GetOutputProps(reader, output_number, &output_props2); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(output_props2 != output_props, "Expected different objects.\n"); - ref = IWMOutputMediaProps_Release(output_props2); - ok(!ref, "Got outstanding refcount %d.\n", ref); - ref = IWMOutputMediaProps_Release(output_props); - ok(!ref, "Got outstanding refcount %d.\n", ref); - } + ref = IWMOutputMediaProps_Release(output_props2); + ok(!ref, "Got outstanding refcount %d.\n", ref); + ref = IWMOutputMediaProps_Release(output_props); + ok(!ref, "Got outstanding refcount %d.\n", ref); winetest_pop_context(); } @@ -859,7 +854,7 @@ static void test_sync_reader_types(void) output_props = (void *)0xdeadbeef; hr = IWMSyncReader_GetOutputProps(reader, 2, &output_props); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); ok(output_props == (void *)0xdeadbeef, "Got output props %p.\n", output_props); output_props = (void *)0xdeadbeef;
1
0
0
0
Zebediah Figura : winegstreamer: Implement IWMStreamConfig::GetStreamType().
by Alexandre Julliard
28 Oct '21
28 Oct '21
Module: wine Branch: master Commit: 25948222129fe48ac4c65a4cf093477d19d25f18 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=25948222129fe48ac4c65a4c…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Oct 28 11:45:56 2021 -0500 winegstreamer: Implement IWMStreamConfig::GetStreamType(). Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/gst_private.h | 3 +++ dlls/winegstreamer/quartz_parser.c | 2 +- dlls/winegstreamer/wm_reader.c | 23 +++++++++++++++++++++-- dlls/wmvcore/tests/wmvcore.c | 6 +++--- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 8b5183a95ee..7d5828a15d6 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -101,6 +101,8 @@ HRESULT decodebin_parser_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN HRESULT mpeg_splitter_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; HRESULT wave_parser_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN; +bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format); + BOOL init_gstreamer(void) DECLSPEC_HIDDEN; extern HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) DECLSPEC_HIDDEN; @@ -118,6 +120,7 @@ struct wm_stream struct wm_reader *reader; struct wg_parser_stream *wg_stream; WORD index; + struct wg_format format; }; struct wm_reader diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index 6d79d2ef129..0862a75b7ef 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -343,7 +343,7 @@ static bool amt_from_wg_format_video(AM_MEDIA_TYPE *mt, const struct wg_format * return true; } -static bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format) +bool amt_from_wg_format(AM_MEDIA_TYPE *mt, const struct wg_format *format) { memset(mt, 0, sizeof(*mt)); diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 682f9a2ae50..feb000c96ed 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -80,8 +80,26 @@ static ULONG WINAPI stream_config_Release(IWMStreamConfig *iface) static HRESULT WINAPI stream_config_GetStreamType(IWMStreamConfig *iface, GUID *type) { - FIXME("iface %p, type %p, stub!\n", iface, type); - return E_NOTIMPL; + struct stream_config *config = impl_from_IWMStreamConfig(iface); + struct wm_reader *reader = config->stream->reader; + AM_MEDIA_TYPE mt; + + TRACE("config %p, type %p.\n", config, type); + + EnterCriticalSection(&reader->cs); + + if (!amt_from_wg_format(&mt, &config->stream->format)) + { + LeaveCriticalSection(&reader->cs); + return E_OUTOFMEMORY; + } + + *type = mt.majortype; + FreeMediaType(&mt); + + LeaveCriticalSection(&reader->cs); + + return S_OK; } static HRESULT WINAPI stream_config_GetStreamNumber(IWMStreamConfig *iface, WORD *number) @@ -1047,6 +1065,7 @@ HRESULT wm_reader_open_stream(struct wm_reader *reader, IStream *stream) stream->wg_stream = wg_parser_get_stream(reader->wg_parser, i); stream->reader = reader; stream->index = i; + wg_parser_stream_get_preferred_format(stream->wg_stream, &stream->format); } LeaveCriticalSection(&reader->cs); diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 385cda74aba..031a1841360 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -704,11 +704,11 @@ static void test_sync_reader_types(void) ok(stream_number == i + 1, "Got stream number %u.\n", stream_number); hr = IWMStreamConfig_GetStreamType(config, &majortype); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr); if (!i) - todo_wine ok(IsEqualGUID(&majortype, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&majortype)); + ok(IsEqualGUID(&majortype, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&majortype)); else - todo_wine ok(IsEqualGUID(&majortype, &MEDIATYPE_Audio), "Got major type %s.\n", debugstr_guid(&majortype)); + ok(IsEqualGUID(&majortype, &MEDIATYPE_Audio), "Got major type %s.\n", debugstr_guid(&majortype)); ref = IWMStreamConfig_Release(config); ok(!ref, "Got outstanding refcount %d.\n", ref);
1
0
0
0
Eric Pouech : dbghelp: Implement SymSetScopeFromInlineContext for inlined frames.
by Alexandre Julliard
28 Oct '21
28 Oct '21
Module: wine Branch: master Commit: 232681da9617300959090a354bbaec8ea67cb01a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=232681da9617300959090a35…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Thu Oct 28 08:58:44 2021 +0200 dbghelp: Implement SymSetScopeFromInlineContext for inlined frames. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dbghelp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index 0b1e20e93c0..844ef00b8e9 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -677,6 +677,9 @@ BOOL WINAPI SymSetScopeFromIndex(HANDLE hProcess, ULONG64 addr, DWORD index) */ BOOL WINAPI SymSetScopeFromInlineContext(HANDLE hProcess, ULONG64 addr, DWORD inlinectx) { + struct module_pair pair; + struct symt_inlinesite* inlined; + TRACE("(%p %I64x %x)\n", hProcess, addr, inlinectx); switch (IFC_MODE(inlinectx)) @@ -684,6 +687,15 @@ BOOL WINAPI SymSetScopeFromInlineContext(HANDLE hProcess, ULONG64 addr, DWORD in case IFC_MODE_IGNORE: case IFC_MODE_REGULAR: return SymSetScopeFromAddr(hProcess, addr); case IFC_MODE_INLINE: + if (!module_init_pair(&pair, hProcess, addr)) return FALSE; + inlined = symt_find_inlined_site(pair.effective, addr, inlinectx); + if (inlined) + { + pair.pcs->localscope_pc = addr; + pair.pcs->localscope_symt = &inlined->func.symt; + return TRUE; + } + return FALSE; default: SetLastError(ERROR_INVALID_PARAMETER); return FALSE;
1
0
0
0
Eric Pouech : dbghelp: Implement SymFromInlineContext for inlined frames.
by Alexandre Julliard
28 Oct '21
28 Oct '21
Module: wine Branch: master Commit: eee701ad52b31b3484734c8c259e628475ce9842 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=eee701ad52b31b3484734c8c…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Thu Oct 28 08:58:31 2021 +0200 dbghelp: Implement SymFromInlineContext for inlined frames. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dbghelp_private.h | 3 +++ dlls/dbghelp/symbol.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 014e793b6a1..7a0f089877e 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -927,6 +927,9 @@ static inline struct symt_function* inlined = (struct symt_inlinesite*)symt_get_upper_inlined(inlined); return &inlined->func; } +extern struct symt_inlinesite* + symt_find_inlined_site(struct module* module, + DWORD64 addr, DWORD inline_ctx) DECLSPEC_HIDDEN; extern DWORD symt_get_inlinesite_depth(HANDLE hProcess, DWORD64 addr) DECLSPEC_HIDDEN; /* Inline context encoding (different from what native does): diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 5dd989b5489..503432e461f 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -1250,6 +1250,24 @@ struct symt* symt_get_upper_inlined(struct symt_inlinesite* inlined) return symt; } +/* lookup in module for an inline site (from addr and inline_ctx) */ +struct symt_inlinesite* symt_find_inlined_site(struct module* module, DWORD64 addr, DWORD inline_ctx) +{ + struct symt_ht* symt = symt_find_nearest(module, addr); + + if (symt_check_tag(&symt->symt, SymTagFunction)) + { + struct symt_function* func = (struct symt_function*)symt; + struct symt_inlinesite* curr = symt_find_lowest_inlined(func, addr); + DWORD depth = IFC_DEPTH(inline_ctx); + + if (curr) + for ( ; &curr->func != func; curr = (struct symt_inlinesite*)symt_get_upper_inlined(curr)) + if (depth-- == 0) return curr; + } + return NULL; +} + DWORD symt_get_inlinesite_depth(HANDLE hProcess, DWORD64 addr) { struct module_pair pair; @@ -2626,6 +2644,9 @@ PWSTR WINAPI SymSetHomeDirectoryW(HANDLE hProcess, PCWSTR dir) */ BOOL WINAPI SymFromInlineContext(HANDLE hProcess, DWORD64 addr, ULONG inline_ctx, PDWORD64 disp, PSYMBOL_INFO si) { + struct module_pair pair; + struct symt_inlinesite* inlined; + TRACE("(%p, %#I64x, 0x%x, %p, %p)\n", hProcess, addr, inline_ctx, disp, si); switch (IFC_MODE(inline_ctx)) @@ -2634,6 +2655,15 @@ BOOL WINAPI SymFromInlineContext(HANDLE hProcess, DWORD64 addr, ULONG inline_ctx case IFC_MODE_REGULAR: return SymFromAddr(hProcess, addr, disp, si); case IFC_MODE_INLINE: + if (!module_init_pair(&pair, hProcess, addr)) return FALSE; + inlined = symt_find_inlined_site(pair.effective, addr, inline_ctx); + if (inlined) + { + symt_fill_sym_info(&pair, NULL, &inlined->func.symt, si); + *disp = addr - inlined->func.address; + return TRUE; + } + /* fall through */ default: SetLastError(ERROR_INVALID_PARAMETER); return FALSE;
1
0
0
0
Eric Pouech : dbghelp: Implement StackWalkEx for inlined frames.
by Alexandre Julliard
28 Oct '21
28 Oct '21
Module: wine Branch: master Commit: 82bac5d080af67d90b3ad81d6caafe8f8ac87b26 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=82bac5d080af67d90b3ad81d…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Thu Oct 28 08:58:17 2021 +0200 dbghelp: Implement StackWalkEx for inlined frames. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dbghelp_private.h | 3 +++ dlls/dbghelp/stack.c | 38 +++++++++++++++++++++++++++----------- dlls/dbghelp/symbol.c | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 11 deletions(-) diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 2a277a14751..014e793b6a1 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -916,6 +916,8 @@ extern struct symt_pointer* extern struct symt_typedef* symt_new_typedef(struct module* module, struct symt* ref, const char* name) DECLSPEC_HIDDEN; +extern struct symt_inlinesite* + symt_find_lowest_inlined(struct symt_function* func, DWORD64 addr) DECLSPEC_HIDDEN; extern struct symt* symt_get_upper_inlined(struct symt_inlinesite* inlined) DECLSPEC_HIDDEN; static inline struct symt_function* @@ -925,6 +927,7 @@ static inline struct symt_function* inlined = (struct symt_inlinesite*)symt_get_upper_inlined(inlined); return &inlined->func; } +extern DWORD symt_get_inlinesite_depth(HANDLE hProcess, DWORD64 addr) DECLSPEC_HIDDEN; /* Inline context encoding (different from what native does): * bits 31:30: 3 ignore (includes INLINE_FRAME_CONTEXT_IGNORE=0xFFFFFFFF) diff --git a/dlls/dbghelp/stack.c b/dlls/dbghelp/stack.c index a93c454036c..2271612bdd1 100644 --- a/dlls/dbghelp/stack.c +++ b/dlls/dbghelp/stack.c @@ -274,6 +274,7 @@ BOOL WINAPI StackWalkEx(DWORD MachineType, HANDLE hProcess, HANDLE hThread, { struct cpu_stack_walk csw; struct cpu* cpu; + DWORD64 addr; TRACE("(%d, %p, %p, %p, %p, %p, %p, %p, %p, 0x%x)\n", MachineType, hProcess, hThread, frame, ctx, @@ -296,16 +297,6 @@ BOOL WINAPI StackWalkEx(DWORD MachineType, HANDLE hProcess, HANDLE hThread, SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - if (frame->InlineFrameContext != INLINE_FRAME_CONTEXT_IGNORE) - { - static BOOL once; - if (!once) - { - FIXME("Inlined contexts are not supported yet\n"); - once = TRUE; - } - frame->InlineFrameContext = INLINE_FRAME_CONTEXT_IGNORE; - } csw.hProcess = hProcess; csw.hThread = hThread; @@ -317,7 +308,32 @@ BOOL WINAPI StackWalkEx(DWORD MachineType, HANDLE hProcess, HANDLE hThread, csw.u.s64.f_tabl_acs = (FunctionTableAccessRoutine) ? FunctionTableAccessRoutine : SymFunctionTableAccess64; csw.u.s64.f_modl_bas = (GetModuleBaseRoutine) ? GetModuleBaseRoutine : SymGetModuleBase64; - if (!cpu->stack_walk(&csw, (STACKFRAME64*)frame, ctx)) return FALSE; + addr = sw_xlat_addr(&csw, &frame->AddrPC); + + if (IFC_MODE(frame->InlineFrameContext) == IFC_MODE_INLINE) + { + DWORD depth = symt_get_inlinesite_depth(hProcess, addr); + if (IFC_DEPTH(frame->InlineFrameContext) + 1 < depth) /* move to next inlined function? */ + { + TRACE("found inline ctx: depth=%u current=%u++\n", + depth, frame->InlineFrameContext); + frame->InlineFrameContext++; /* just increase index, FIXME detect overflow */ + } + else + { + frame->InlineFrameContext = IFC_MODE_REGULAR; /* move to next top level function */ + } + } + else + { + if (!cpu->stack_walk(&csw, (STACKFRAME64*)frame, ctx)) return FALSE; + if (frame->InlineFrameContext != INLINE_FRAME_CONTEXT_IGNORE) + { + addr = sw_xlat_addr(&csw, &frame->AddrPC); + frame->InlineFrameContext = symt_get_inlinesite_depth(hProcess, addr) == 0 ? IFC_MODE_REGULAR : IFC_MODE_INLINE; + TRACE("setting IFC mode to %x\n", frame->InlineFrameContext); + } + } /* we don't handle KdHelp */ diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 9b7c5f3078e..5dd989b5489 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -1213,6 +1213,26 @@ void copy_symbolW(SYMBOL_INFOW* siw, const SYMBOL_INFO* si) MultiByteToWideChar(CP_ACP, 0, si->Name, -1, siw->Name, siw->MaxNameLen); } +/* return the lowest inline site inside a function */ +struct symt_inlinesite* symt_find_lowest_inlined(struct symt_function* func, DWORD64 addr) +{ + struct symt_inlinesite* current; + int i; + + assert(func->symt.tag == SymTagFunction); + for (current = func->next_inlinesite; current; current = current->func.next_inlinesite) + { + for (i = 0; i < current->vranges.num_elts; ++i) + { + struct addr_range* ar = (struct addr_range*)vector_at(¤t->vranges, i); + /* first matching range gives the lowest inline site; see dbghelp_private.h for details */ + if (ar->low <= addr && addr < ar->high) + return current; + } + } + return NULL; +} + /* from an inline function, get either the enclosing inlined function, or the top function when no inlined */ struct symt* symt_get_upper_inlined(struct symt_inlinesite* inlined) { @@ -1230,6 +1250,27 @@ struct symt* symt_get_upper_inlined(struct symt_inlinesite* inlined) return symt; } +DWORD symt_get_inlinesite_depth(HANDLE hProcess, DWORD64 addr) +{ + struct module_pair pair; + DWORD depth = 0; + + if (module_init_pair(&pair, hProcess, addr)) + { + struct symt_ht* symt = symt_find_nearest(pair.effective, addr); + if (symt_check_tag(&symt->symt, SymTagFunction)) + { + struct symt_inlinesite* inlined = symt_find_lowest_inlined((struct symt_function*)symt, addr); + if (inlined) + { + for ( ; &inlined->func.symt != &symt->symt; inlined = (struct symt_inlinesite*)symt_get_upper_inlined(inlined)) + ++depth; + } + } + } + return depth; +} + /****************************************************************** * sym_enum *
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
117
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200