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
February 2022
----- 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
1495 discussions
Start a n
N
ew thread
Dmitry Timoshkov : comctl32/listview: Fix changed notification mask for inserted items.
by Alexandre Julliard
22 Feb '22
22 Feb '22
Module: wine Branch: master Commit: f1a3586f10135ce58e3343df8800b533698fe65b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f1a3586f10135ce58e3343df…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Feb 22 11:06:28 2022 +0300 comctl32/listview: Fix changed notification mask for inserted items. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/listview.c | 2 +- dlls/comctl32/tests/listview.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index d8abd8236eb..2cb96367551 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -4258,7 +4258,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL nmlv.uNewState = (item.state & ~stateMask) | (lpLVItem->state & stateMask); nmlv.uOldState = item.state; } - nmlv.uChanged = uChanged ? uChanged : lpLVItem->mask; + nmlv.uChanged = isNew ? LVIF_STATE : (uChanged ? uChanged : lpLVItem->mask); nmlv.lParam = item.lParam; /* Send change notification if the item is not being inserted, or inserted (selected|focused), diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 92e11685331..3810cd8f4bc 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -6023,7 +6023,7 @@ static void test_LVM_INSERTITEM(void) if ((insert_item[i].mask & LVIF_STATE) && (insert_item[i].state & (LVIS_FOCUSED | LVIS_SELECTED))) { sprintf(buf, "%d: insert focused", i); - ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_focused0_seq, buf, insert_item[i].mask != LVIF_STATE); + ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_focused0_seq, buf, FALSE); } else { @@ -6100,7 +6100,7 @@ static void test_insertitem(void) item.lParam = 0xdeadbeef; ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); ok(ret == 3, "got %d\n", ret); - ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_selected_seq, "insert selected", TRUE); + ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_selected_seq, "insert selected", FALSE); /* insert item 4 */ item.mask = LVIF_PARAM;
1
0
0
0
Dmitry Timoshkov : comctl32/listview: Send change notifications when inserting (LVIS_SELECTED|LVIS_FOCUSED) items.
by Alexandre Julliard
22 Feb '22
22 Feb '22
Module: wine Branch: master Commit: 3cd366eee620aca79d1008644525b01165aa84c3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3cd366eee620aca79d100864…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Feb 22 11:06:27 2022 +0300 comctl32/listview: Send change notifications when inserting (LVIS_SELECTED|LVIS_FOCUSED) items. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/listview.c | 22 +++++++++++++--------- dlls/comctl32/tests/listview.c | 6 +++--- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index cd7fec28e27..d8abd8236eb 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -4200,6 +4200,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL LVITEMW item; /* stateMask is ignored for LVM_INSERTITEM */ UINT stateMask = isNew ? ~0 : lpLVItem->stateMask; + BOOL send_change_notification; TRACE("()\n"); @@ -4260,11 +4261,16 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL nmlv.uChanged = uChanged ? uChanged : lpLVItem->mask; nmlv.lParam = item.lParam; - /* Send LVN_ITEMCHANGING notification, if the item is not being inserted + /* Send change notification if the item is not being inserted, or inserted (selected|focused), and we are _NOT_ virtual (LVS_OWNERDATA), and change notifications - are enabled. Even nothing really changed we still need to send this, + are enabled. Even if nothing really changed we still need to send this, in this case uChanged mask is just set to passed item mask. */ - if (lpItem && !isNew && (infoPtr->notify_mask & NOTIFY_MASK_ITEM_CHANGE)) + + send_change_notification = !isNew; + send_change_notification |= (uChanged & LVIF_STATE) && (lpLVItem->state & (LVIS_FOCUSED | LVIS_SELECTED)); + send_change_notification &= !!(infoPtr->notify_mask & NOTIFY_MASK_ITEM_CHANGE); + + if (lpItem && send_change_notification) { HWND hwndSelf = infoPtr->hwndSelf; @@ -4352,13 +4358,11 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL } } - /* if we're inserting the item, we're done */ - if (isNew) return TRUE; - - /* send LVN_ITEMCHANGED notification */ - if (lpLVItem->mask & LVIF_PARAM) nmlv.lParam = lpLVItem->lParam; - if (infoPtr->notify_mask & NOTIFY_MASK_ITEM_CHANGE) + if (send_change_notification) + { + if (lpLVItem->mask & LVIF_PARAM) nmlv.lParam = lpLVItem->lParam; notify_listview(infoPtr, LVN_ITEMCHANGED, &nmlv); + } return TRUE; } diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 4c2dd534dbd..92e11685331 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -6023,7 +6023,7 @@ static void test_LVM_INSERTITEM(void) if ((insert_item[i].mask & LVIF_STATE) && (insert_item[i].state & (LVIS_FOCUSED | LVIS_SELECTED))) { sprintf(buf, "%d: insert focused", i); - ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_focused0_seq, buf, TRUE); + ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_focused0_seq, buf, insert_item[i].mask != LVIF_STATE); } else { @@ -6060,7 +6060,7 @@ static void test_insertitem(void) item.iSubItem = 0; ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); ok(ret == 0, "got %d\n", ret); - ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_focused0_seq, "insert focused 0", TRUE); + ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_focused0_seq, "insert focused 0", FALSE); state = SendMessageA(hwnd, LVM_GETITEMSTATE, 0, LVIS_FOCUSED); ok(state == LVIS_FOCUSED, "got %x\n", state); @@ -6073,7 +6073,7 @@ static void test_insertitem(void) item.iSubItem = 0; ret = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); ok(ret == 1, "got %d\n", ret); - ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_focused1_seq, "insert focused 1", TRUE); + ok_sequence(sequences, PARENT_SEQ_INDEX, parent_insert_focused1_seq, "insert focused 1", FALSE); state = SendMessageA(hwnd, LVM_GETITEMSTATE, 1, LVIS_FOCUSED); ok(state == LVIS_FOCUSED, "got %x\n", state);
1
0
0
0
Zebediah Figura : winegstreamer: No longer queue WG_PARSER_EVENT_SEGMENT.
by Alexandre Julliard
22 Feb '22
22 Feb '22
Module: wine Branch: master Commit: f51b2ca8f7640dd0770a82c1e2c19caa65286eef URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f51b2ca8f7640dd0770a82c1…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 21 23:13:21 2022 -0600 winegstreamer: No longer queue WG_PARSER_EVENT_SEGMENT. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/media_source.c | 3 --- dlls/winegstreamer/quartz_parser.c | 3 --- dlls/winegstreamer/unixlib.h | 6 ------ dlls/winegstreamer/wg_parser.c | 7 ------- dlls/winegstreamer/wm_reader.c | 3 --- 5 files changed, 22 deletions(-) diff --git a/dlls/winegstreamer/media_source.c b/dlls/winegstreamer/media_source.c index bccbf888a4a..e40974bf73a 100644 --- a/dlls/winegstreamer/media_source.c +++ b/dlls/winegstreamer/media_source.c @@ -554,9 +554,6 @@ static void wait_on_sample(struct media_stream *stream, IUnknown *token) dispatch_end_of_presentation(stream->parent_source); return; - case WG_PARSER_EVENT_SEGMENT: - break; - case WG_PARSER_EVENT_NONE: assert(0); } diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index eab94aca004..4afd265bca7 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -841,9 +841,6 @@ static DWORD CALLBACK stream_thread(void *arg) IPin_EndOfStream(pin->pin.pin.peer); break; - case WG_PARSER_EVENT_SEGMENT: - break; - case WG_PARSER_EVENT_NONE: assert(0); } diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index 4adbb694766..f445fc7ac7e 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -108,7 +108,6 @@ enum wg_parser_event_type WG_PARSER_EVENT_NONE = 0, WG_PARSER_EVENT_BUFFER, WG_PARSER_EVENT_EOS, - WG_PARSER_EVENT_SEGMENT, }; struct wg_parser_event @@ -123,11 +122,6 @@ struct wg_parser_event uint32_t size; bool discontinuity, preroll, delta, has_pts, has_duration; } buffer; - struct - { - ULONGLONG position, stop; - DOUBLE rate; - } segment; } u; }; C_ASSERT(sizeof(struct wg_parser_event) == 40); diff --git a/dlls/winegstreamer/wg_parser.c b/dlls/winegstreamer/wg_parser.c index 5a2e970a4dd..d0883c4c024 100644 --- a/dlls/winegstreamer/wg_parser.c +++ b/dlls/winegstreamer/wg_parser.c @@ -500,7 +500,6 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) case GST_EVENT_SEGMENT: if (stream->enabled) { - struct wg_parser_event stream_event; const GstSegment *segment; gst_event_parse_segment(event, &segment); @@ -512,12 +511,6 @@ static gboolean sink_event_cb(GstPad *pad, GstObject *parent, GstEvent *event) } gst_segment_copy_into(segment, &stream->segment); - - stream_event.type = WG_PARSER_EVENT_SEGMENT; - stream_event.u.segment.position = segment->position / 100; - stream_event.u.segment.stop = segment->stop / 100; - stream_event.u.segment.rate = segment->rate * segment->applied_rate; - queue_stream_event(stream, &stream_event, NULL); } break; diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 01518c6b9a8..f49d99071e0 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1935,9 +1935,6 @@ HRESULT wm_reader_get_stream_sample(struct wm_stream *stream, TRACE("End of stream.\n"); return NS_E_NO_MORE_SAMPLES; - case WG_PARSER_EVENT_SEGMENT: - break; - case WG_PARSER_EVENT_NONE: assert(0); }
1
0
0
0
Zebediah Figura : winegstreamer: Manually send new segment events.
by Alexandre Julliard
22 Feb '22
22 Feb '22
Module: wine Branch: master Commit: f7a5bf7be1b43ff295723c15c296c94321e3a653 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f7a5bf7be1b43ff295723c15…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 21 23:13:20 2022 -0600 winegstreamer: Manually send new segment events. Instead of translating them from GST_EVENT_SEGMENT. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/quartz_parser.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/winegstreamer/quartz_parser.c b/dlls/winegstreamer/quartz_parser.c index e06c55ccfe0..eab94aca004 100644 --- a/dlls/winegstreamer/quartz_parser.c +++ b/dlls/winegstreamer/quartz_parser.c @@ -75,6 +75,12 @@ struct parser_source CRITICAL_SECTION flushing_cs; HANDLE thread; + + /* This variable is read and written by both the streaming thread and + * application threads. However, it is only written by the application + * thread when the streaming thread is not running, or when it is blocked + * by flushing_cs. */ + bool need_segment; }; static inline struct parser *impl_from_strmbase_filter(struct strmbase_filter *iface) @@ -750,6 +756,14 @@ static void send_buffer(struct parser_source *pin, const struct wg_parser_event HRESULT hr; IMediaSample *sample; + if (pin->need_segment) + { + if (FAILED(hr = IPin_NewSegment(pin->pin.pin.peer, + pin->seek.llCurrent, pin->seek.llStop, pin->seek.dRate))) + WARN("Failed to deliver new segment, hr %#lx.\n", hr); + pin->need_segment = false; + } + if (IsEqualGUID(&pin->pin.pin.mt.formattype, &FORMAT_WaveFormatEx) && (IsEqualGUID(&pin->pin.pin.mt.subtype, &MEDIASUBTYPE_PCM) || IsEqualGUID(&pin->pin.pin.mt.subtype, &MEDIASUBTYPE_IEEE_FLOAT))) @@ -828,8 +842,6 @@ static DWORD CALLBACK stream_thread(void *arg) break; case WG_PARSER_EVENT_SEGMENT: - IPin_NewSegment(pin->pin.pin.peer, event.u.segment.position, - event.u.segment.stop, event.u.segment.rate); break; case WG_PARSER_EVENT_NONE: @@ -972,6 +984,8 @@ static HRESULT parser_init_stream(struct strmbase_filter *iface) if (FAILED(hr = IMemAllocator_Commit(filter->sources[i]->pin.pAllocator))) ERR("Failed to commit allocator, hr %#lx.\n", hr); + filter->sources[i]->need_segment = true; + filter->sources[i]->thread = CreateThread(NULL, 0, stream_thread, filter->sources[i], 0, NULL); } @@ -1359,6 +1373,8 @@ static HRESULT WINAPI GST_Seeking_SetPositions(IMediaSeeking *iface, { struct parser_source *flush_pin = filter->sources[i]; + flush_pin->need_segment = true; + if (flush_pin->pin.pin.peer) LeaveCriticalSection(&flush_pin->flushing_cs); }
1
0
0
0
Zebediah Figura : quartz/tests: Test the timestamps associated with new segments.
by Alexandre Julliard
22 Feb '22
22 Feb '22
Module: wine Branch: master Commit: 3b29ef9e753339248b3a32b37a932501f927ac01 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3b29ef9e753339248b3a32b3…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 21 23:13:19 2022 -0600 quartz/tests: Test the timestamps associated with new segments. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/avisplit.c | 21 ++++++++++++++------- dlls/quartz/tests/mpegsplit.c | 21 ++++++++++++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c index f295c074d5a..0665fad3ad8 100644 --- a/dlls/quartz/tests/avisplit.c +++ b/dlls/quartz/tests/avisplit.c @@ -809,7 +809,7 @@ struct testfilter const AM_MEDIA_TYPE *mt; HANDLE eos_event; unsigned int sample_count, eos_count, new_segment_count; - REFERENCE_TIME seek_start, seek_end; + REFERENCE_TIME segment_start, segment_end, seek_start, seek_end; }; static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface) @@ -985,14 +985,20 @@ static HRESULT testsink_new_segment(struct strmbase_sink *iface, IMediaSeeking *seeking; HRESULT hr; + if (winetest_debug > 1) + trace("%04x: Got segment with timestamps %I64d-%I64d.\n", GetCurrentThreadId(), start, end); + ++filter->new_segment_count; IPin_QueryInterface(iface->pin.peer, &IID_IMediaSeeking, (void **)&seeking); hr = IMediaSeeking_GetPositions(seeking, &filter->seek_start, &filter->seek_end); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(rate == 1.0, "Got rate %.16e.\n", rate); IMediaSeeking_Release(seeking); + ok(start == filter->segment_start, "Expected start %I64d, got %I64d.\n", filter->segment_start, start); + ok(end == filter->segment_end, "Expected end %I64d, got %I64d.\n", filter->segment_end, end); + ok(rate == 1.0, "Got rate %.16e.\n", rate); + return S_OK; } @@ -1092,6 +1098,7 @@ static void testfilter_init(struct testfilter *filter) strmbase_sink_init(&filter->sink, &filter->filter, L"sink", &testsink_ops, NULL); filter->IAsyncReader_iface.lpVtbl = &async_reader_vtbl; filter->eos_event = CreateEventW(NULL, FALSE, FALSE, NULL); + filter->segment_end = 50000000; } static void test_filter_state(IMediaControl *control) @@ -1709,11 +1716,11 @@ static void test_streaming(void) ok(WaitForSingleObject(testsink.eos_event, 100) == WAIT_TIMEOUT, "Got more than one EOS.\n"); ok(testsink.sample_count, "Expected at least one sample.\n"); - testsink.sample_count = testsink.eos_count = 0; - start = 1500 * 10000; - end = 3500 * 10000; - hr = IMediaSeeking_SetPositions(seeking, &start, AM_SEEKING_AbsolutePositioning, - &end, AM_SEEKING_AbsolutePositioning); + testsink.new_segment_count = testsink.sample_count = testsink.eos_count = 0; + testsink.segment_start = 1500 * 10000; + testsink.segment_end = 3500 * 10000; + hr = IMediaSeeking_SetPositions(seeking, &testsink.segment_start, AM_SEEKING_AbsolutePositioning, + &testsink.segment_end, AM_SEEKING_AbsolutePositioning); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(!WaitForSingleObject(testsink.eos_event, 1000), "Did not receive EOS.\n"); diff --git a/dlls/quartz/tests/mpegsplit.c b/dlls/quartz/tests/mpegsplit.c index 5a9efe84551..5aae09b596d 100644 --- a/dlls/quartz/tests/mpegsplit.c +++ b/dlls/quartz/tests/mpegsplit.c @@ -1098,7 +1098,7 @@ struct testfilter const AM_MEDIA_TYPE *mt; HANDLE eos_event; unsigned int sample_count, eos_count, new_segment_count; - REFERENCE_TIME seek_start, seek_end; + REFERENCE_TIME segment_start, segment_end, seek_start, seek_end; }; static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface) @@ -1260,14 +1260,20 @@ static HRESULT testsink_new_segment(struct strmbase_sink *iface, IMediaSeeking *seeking; HRESULT hr; + if (winetest_debug > 1) + trace("%04x: Got segment with timestamps %I64d-%I64d.\n", GetCurrentThreadId(), start, end); + ++filter->new_segment_count; IPin_QueryInterface(iface->pin.peer, &IID_IMediaSeeking, (void **)&seeking); hr = IMediaSeeking_GetPositions(seeking, &filter->seek_start, &filter->seek_end); ok(hr == S_OK, "Got hr %#x.\n", hr); - ok(rate == 1.0, "Got rate %.16e.\n", rate); IMediaSeeking_Release(seeking); + ok(start == filter->segment_start, "Expected start %I64d, got %I64d.\n", filter->segment_start, start); + ok(end == filter->segment_end, "Expected end %I64d, got %I64d.\n", filter->segment_end, end); + ok(rate == 1.0, "Got rate %.16e.\n", rate); + return S_OK; } @@ -1367,6 +1373,7 @@ static void testfilter_init(struct testfilter *filter) strmbase_sink_init(&filter->sink, &filter->filter, L"sink", &testsink_ops, NULL); filter->IAsyncReader_iface.lpVtbl = &async_reader_vtbl; filter->eos_event = CreateEventW(NULL, FALSE, FALSE, NULL); + filter->segment_end = 5392500; } static void test_connect_pin(void) @@ -1862,11 +1869,11 @@ static void test_streaming(void) ok(WaitForSingleObject(testsink.eos_event, 100) == WAIT_TIMEOUT, "Got more than one EOS.\n"); ok(testsink.sample_count, "Expected at least one sample.\n"); - testsink.sample_count = testsink.eos_count = 0; - start = 100 * 10000; - end = 300 * 10000; - hr = IMediaSeeking_SetPositions(seeking, &start, AM_SEEKING_AbsolutePositioning, - &end, AM_SEEKING_AbsolutePositioning); + testsink.new_segment_count = testsink.sample_count = testsink.eos_count = 0; + testsink.segment_start = 100 * 10000; + testsink.segment_end = 300 * 10000; + hr = IMediaSeeking_SetPositions(seeking, &testsink.segment_start, AM_SEEKING_AbsolutePositioning, + &testsink.segment_end, AM_SEEKING_AbsolutePositioning); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(!WaitForSingleObject(testsink.eos_event, 1000), "Did not receive EOS.\n");
1
0
0
0
Zebediah Figura : quartz/tests: Reset sink event counters when initializing the stream.
by Alexandre Julliard
22 Feb '22
22 Feb '22
Module: wine Branch: master Commit: 7b5dd73c30c892f8c85ea294ce27f35dad8b008f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7b5dd73c30c892f8c85ea294…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 21 23:13:18 2022 -0600 quartz/tests: Reset sink event counters when initializing the stream. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/avisplit.c | 13 +++++++++++-- dlls/quartz/tests/mpegsplit.c | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c index 06c2f5fed3c..f295c074d5a 100644 --- a/dlls/quartz/tests/avisplit.c +++ b/dlls/quartz/tests/avisplit.c @@ -836,10 +836,21 @@ static void testfilter_destroy(struct strmbase_filter *iface) strmbase_filter_cleanup(&filter->filter); } +static HRESULT testfilter_init_stream(struct strmbase_filter *iface) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface); + + filter->new_segment_count = 0; + filter->eos_count = 0; + filter->sample_count = 0; + return S_OK; +} + static const struct strmbase_filter_ops testfilter_ops = { .filter_get_pin = testfilter_get_pin, .filter_destroy = testfilter_destroy, + .filter_init_stream = testfilter_init_stream, }; static HRESULT testsource_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) @@ -1689,7 +1700,6 @@ static void test_streaming(void) ok(WaitForSingleObject(testsink.eos_event, 100) == WAIT_TIMEOUT, "Got more than one EOS.\n"); ok(testsink.sample_count, "Expected at least one sample.\n"); - testsink.sample_count = testsink.eos_count = 0; hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IMediaControl_Pause(control); @@ -1716,7 +1726,6 @@ static void test_streaming(void) ok(start == testsink.seek_start, "Expected start position %I64u, got %I64u.\n", testsink.seek_start, start); ok(end == testsink.seek_end, "Expected end position %I64u, got %I64u.\n", testsink.seek_end, end); - testsink.sample_count = testsink.eos_count = 0; hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IMediaControl_Pause(control); diff --git a/dlls/quartz/tests/mpegsplit.c b/dlls/quartz/tests/mpegsplit.c index 0809c5f861f..5a9efe84551 100644 --- a/dlls/quartz/tests/mpegsplit.c +++ b/dlls/quartz/tests/mpegsplit.c @@ -1125,10 +1125,21 @@ static void testfilter_destroy(struct strmbase_filter *iface) CloseHandle(filter->eos_event); } +static HRESULT testfilter_init_stream(struct strmbase_filter *iface) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface); + + filter->new_segment_count = 0; + filter->eos_count = 0; + filter->sample_count = 0; + return S_OK; +} + static const struct strmbase_filter_ops testfilter_ops = { .filter_get_pin = testfilter_get_pin, .filter_destroy = testfilter_destroy, + .filter_init_stream = testfilter_init_stream, }; static HRESULT testsource_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) @@ -1842,7 +1853,6 @@ static void test_streaming(void) ok(WaitForSingleObject(testsink.eos_event, 100) == WAIT_TIMEOUT, "Got more than one EOS.\n"); ok(testsink.sample_count, "Expected at least one sample.\n"); - testsink.sample_count = testsink.eos_count = 0; hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IMediaControl_Pause(control); @@ -1869,7 +1879,6 @@ static void test_streaming(void) ok(start == testsink.seek_start, "Expected start position %I64u, got %I64u.\n", testsink.seek_start, start); ok(end == testsink.seek_end, "Expected end position %I64u, got %I64u.\n", testsink.seek_end, end); - testsink.sample_count = testsink.eos_count = 0; hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IMediaControl_Pause(control);
1
0
0
0
Michael Stefaniuc : dmusic: Forward GetFormat() to the corresponding synth & sink methods.
by Alexandre Julliard
22 Feb '22
22 Feb '22
Module: wine Branch: master Commit: 5815ba45481f8ec5f7b45652d22a131f8ae8ea21 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5815ba45481f8ec5f7b45652…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Feb 22 00:49:59 2022 +0100 dmusic: Forward GetFormat() to the corresponding synth & sink methods. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmusic/port.c | 59 ++++++++++++---------------------------------- dlls/dmusic/tests/dmusic.c | 21 +++++++++++++++++ 2 files changed, 36 insertions(+), 44 deletions(-) diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index d593d739a9e..8549c62c4b1 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -510,50 +510,21 @@ static HRESULT WINAPI synth_port_SetDirectSound(IDirectMusicPort *iface, IDirect return S_OK; } -static HRESULT WINAPI synth_port_GetFormat(IDirectMusicPort *iface, WAVEFORMATEX *pWaveFormatEx, - DWORD *pdwWaveFormatExSize, DWORD *pdwBufferSize) -{ - struct synth_port *This = synth_from_IDirectMusicPort(iface); - WAVEFORMATEX format; - FIXME("(%p, %p, %p, %p): stub\n", This, pWaveFormatEx, pdwWaveFormatExSize, pdwBufferSize); - - if (pWaveFormatEx == NULL) - { - if (pdwWaveFormatExSize) - *pdwWaveFormatExSize = sizeof(format); - else - return E_POINTER; - } - else - { - if (pdwWaveFormatExSize == NULL) - return E_POINTER; - - /* Just fill this in with something that will not crash Direct Sound for now. */ - /* It won't be used anyway until Performances are completed */ - format.wFormatTag = WAVE_FORMAT_PCM; - format.nChannels = 2; /* This->params.dwAudioChannels; */ - format.nSamplesPerSec = 44100; /* This->params.dwSampleRate; */ - format.wBitsPerSample = 16; /* FIXME: check this */ - format.nBlockAlign = (format.wBitsPerSample * format.nChannels) / 8; - format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign; - format.cbSize = 0; - - if (*pdwWaveFormatExSize >= sizeof(format)) - { - CopyMemory(pWaveFormatEx, &format, min(sizeof(format), *pdwWaveFormatExSize)); - *pdwWaveFormatExSize = sizeof(format); /* FIXME check if this is set */ - } - else - return E_POINTER; /* FIXME find right error */ - } - - if (pdwBufferSize) - *pdwBufferSize = 44100 * 2 * 2; - else - return E_POINTER; - - return S_OK; +static HRESULT WINAPI synth_port_GetFormat(IDirectMusicPort *iface, WAVEFORMATEX *format, + DWORD *fmtsize, DWORD *bufsize) +{ + struct synth_port *This = synth_from_IDirectMusicPort(iface); + HRESULT hr; + + TRACE("(%p, %p, %p, %p)\n", This, format, fmtsize, bufsize); + + if (FAILED(hr = IDirectMusicSynth_GetFormat(This->synth, format, fmtsize))) + return hr; + + if (bufsize) + hr = IDirectMusicSynthSink_GetDesiredBufferSize(This->synth_sink, bufsize); + + return hr; } static const IDirectMusicPortVtbl synth_port_vtbl = { diff --git a/dlls/dmusic/tests/dmusic.c b/dlls/dmusic/tests/dmusic.c index d8fc6affd9b..37b517fe0ca 100644 --- a/dlls/dmusic/tests/dmusic.c +++ b/dlls/dmusic/tests/dmusic.c @@ -877,6 +877,9 @@ static void test_synthport(void) IDirectMusicPort *port; DMUS_BUFFERDESC desc; DMUS_PORTCAPS caps; + WAVEFORMATEX fmt; + DWORD fmtsize, bufsize; + HRESULT hr; port = create_synth_port(&dmusic); @@ -922,6 +925,24 @@ static void test_synthport(void) ok(caps.dwEffectFlags == DMUS_EFFECT_REVERB, "Unexpected dwEffectFlags returned: %#lx\n", caps.dwEffectFlags); trace("Port wszDescription: %s\n", wine_dbgstr_w(caps.wszDescription)); + /* GetFormat */ + hr = IDirectMusicPort_GetFormat(port, NULL, NULL, NULL); + ok(hr == E_POINTER, "GetFormat failed: %#lx\n", hr); + hr = IDirectMusicPort_GetFormat(port, NULL, &fmtsize, NULL); + ok(hr == S_OK, "GetFormat failed: %#lx\n", hr); + ok(fmtsize == sizeof(fmt), "format size; %ld\n", fmtsize); + fmtsize = 0; + hr = IDirectMusicPort_GetFormat(port, &fmt, &fmtsize, NULL); + ok(hr == S_OK, "GetFormat failed: %#lx\n", hr); + ok(fmtsize == sizeof(fmt), "format size; %ld\n", fmtsize); + hr = IDirectMusicPort_GetFormat(port, NULL, NULL, &bufsize); + ok(hr == E_POINTER, "GetFormat failed: %#lx\n", hr); + hr = IDirectMusicPort_GetFormat(port, NULL, &fmtsize, &bufsize); + ok(hr == S_OK, "GetFormat failed: %#lx\n", hr); + hr = IDirectMusicPort_GetFormat(port, &fmt, &fmtsize, &bufsize); + ok(hr == S_OK, "GetFormat failed: %#lx\n", hr); + ok(bufsize == fmt.nSamplesPerSec * fmt.nChannels * 4, "buffer size: %ld\n", bufsize); + IDirectMusicPort_Release(port); IDirectMusic_Release(dmusic); }
1
0
0
0
Michael Stefaniuc : dmsynth: Implement the sink GetDesiredBufferSize method.
by Alexandre Julliard
22 Feb '22
22 Feb '22
Module: wine Branch: master Commit: ec69d69f2a24b887f97abc4ff6af1ae7582b5ef2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ec69d69f2a24b887f97abc4f…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Feb 22 00:49:58 2022 +0100 dmsynth: Implement the sink GetDesiredBufferSize method. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmsynth/synthsink.c | 15 +++++++++++++-- dlls/dmsynth/tests/dmsynth.c | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c index fe578086a23..d34bcf9df5e 100644 --- a/dlls/dmsynth/synthsink.c +++ b/dlls/dmsynth/synthsink.c @@ -180,11 +180,22 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_SetDirectSound(IDirectMusicSynth } static HRESULT WINAPI IDirectMusicSynthSinkImpl_GetDesiredBufferSize(IDirectMusicSynthSink *iface, - DWORD *buffer_size_in_samples) + DWORD *size) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); + WAVEFORMATEX format; + DWORD fmtsize = sizeof(format); - FIXME("(%p)->(%p): stub\n", This, buffer_size_in_samples); + TRACE("(%p, %p)\n", This, size); + + if (!size) + return E_POINTER; + if (!This->synth) + return DMUS_E_SYNTHNOTCONFIGURED; + + if (FAILED(IDirectMusicSynth_GetFormat(This->synth, &format, &fmtsize))) + return E_UNEXPECTED; + *size = format.nSamplesPerSec * format.nChannels * 4; return S_OK; } diff --git a/dlls/dmsynth/tests/dmsynth.c b/dlls/dmsynth/tests/dmsynth.c index ab3349f666b..a8bf65cd73e 100644 --- a/dlls/dmsynth/tests/dmsynth.c +++ b/dlls/dmsynth/tests/dmsynth.c @@ -149,6 +149,8 @@ static void test_dmsynth(void) /* Synth isn't fully initialized yet */ hr = IDirectMusicSynth_Activate(dmsynth, TRUE); ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_Activate returned: %#lx\n", hr); + hr = IDirectMusicSynthSink_GetDesiredBufferSize(dmsynth_sink, &size); + ok(hr == DMUS_E_SYNTHNOTCONFIGURED, "IDirectMusicSynthSink_GetDesiredBufferSize returned: %#lx\n", hr); /* Open / Close */ hr = IDirectMusicSynth_Open(dmsynth, NULL); @@ -274,6 +276,28 @@ static void test_dmsynth(void) hr = IDirectMusicSynth_GetFormat(dmsynth, &format, &size); ok(hr == S_OK, "GetFormat failed: %#lx\n", hr); ok(size == sizeof(format), "GetFormat size mismatch, got %ld\n", size); + IDirectMusicSynth_Close(dmsynth); + + /* GetDesiredBufferSize */ + hr = IDirectMusicSynthSink_GetDesiredBufferSize(dmsynth_sink, NULL); + ok(hr == E_POINTER, "IDirectMusicSynthSink_GetDesiredBufferSize returned: %#lx\n", hr); + hr = IDirectMusicSynthSink_GetDesiredBufferSize(dmsynth_sink, &size); + ok(hr == E_UNEXPECTED, "IDirectMusicSynthSink_GetDesiredBufferSize returned: %#lx\n", hr); + params.dwValidParams = 0; + hr = IDirectMusicSynth_Open(dmsynth, ¶ms); + ok(hr == S_OK, "Open failed: %#lx\n", hr); + hr = IDirectMusicSynthSink_GetDesiredBufferSize(dmsynth_sink, &size); + ok(hr == S_OK, "IDirectMusicSynthSink_GetDesiredBufferSize returned: %#lx\n", hr); + ok(size == params.dwSampleRate * params.dwAudioChannels * 4, "size: %ld\n", size); + IDirectMusicSynth_Close(dmsynth); + params.dwValidParams = DMUS_PORTPARAMS_AUDIOCHANNELS; + params.dwAudioChannels = 1; + hr = IDirectMusicSynth_Open(dmsynth, ¶ms); + ok(hr == S_OK, "Open failed: %#lx\n", hr); + hr = IDirectMusicSynthSink_GetDesiredBufferSize(dmsynth_sink, &size); + ok(hr == S_OK, "IDirectMusicSynthSink_GetDesiredBufferSize returned: %#lx\n", hr); + ok(size == params.dwSampleRate * params.dwAudioChannels * 4, "size: %ld\n", size); + IDirectMusicSynth_Close(dmsynth); if (control_synth) IDirectMusicSynth_Release(control_synth);
1
0
0
0
Michael Stefaniuc : dmsynth/tests: Add synth GetFormat tests.
by Alexandre Julliard
22 Feb '22
22 Feb '22
Module: wine Branch: master Commit: a0addfe38d06eebab72b740d56ff7fe3d055875c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a0addfe38d06eebab72b740d…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Feb 22 00:49:57 2022 +0100 dmsynth/tests: Add synth GetFormat tests. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmsynth/tests/dmsynth.c | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/dlls/dmsynth/tests/dmsynth.c b/dlls/dmsynth/tests/dmsynth.c index 93212c0ae9f..ab3349f666b 100644 --- a/dlls/dmsynth/tests/dmsynth.c +++ b/dlls/dmsynth/tests/dmsynth.c @@ -51,6 +51,30 @@ static ULONG get_refcount(void *iface) return IUnknown_Release(unknown); } +static void test_synth_getformat(IDirectMusicSynth *synth, DMUS_PORTPARAMS *params, const char *context) +{ + WAVEFORMATEX format; + DWORD size; + HRESULT hr; + + winetest_push_context(context); + + size = sizeof(format); + hr = IDirectMusicSynth_GetFormat(synth, &format, &size); + ok(hr == S_OK, "GetFormat failed: %#lx\n", hr); + ok(format.wFormatTag == WAVE_FORMAT_PCM, "wFormatTag: %#x\n", format.wFormatTag); + ok(format.nChannels == params->dwAudioChannels, "nChannels: %d\n", format.nChannels); + ok(format.nSamplesPerSec == params->dwSampleRate, "nSamplesPerSec: %ld\n", format.nSamplesPerSec); + ok(format.wBitsPerSample == 16, "wBitsPerSample: %d\n", format.wBitsPerSample); + ok(format.nBlockAlign == params->dwAudioChannels * format.wBitsPerSample / 8, "nBlockAlign: %d\n", + format.nBlockAlign); + ok(format.nAvgBytesPerSec == params->dwSampleRate * format.nBlockAlign, "nAvgBytesPerSec: %ld\n", + format.nAvgBytesPerSec); + ok(format.cbSize == 0, "cbSize: %d\n", format.cbSize); + + winetest_pop_context(); +} + static void test_dmsynth(void) { IDirectMusicSynth *dmsynth = NULL; @@ -68,6 +92,8 @@ static void test_dmsynth(void) DMUS_PORTPARAMS params; const DWORD all_params = DMUS_PORTPARAMS_VOICES|DMUS_PORTPARAMS_CHANNELGROUPS|DMUS_PORTPARAMS_AUDIOCHANNELS| DMUS_PORTPARAMS_SAMPLERATE|DMUS_PORTPARAMS_EFFECTS|DMUS_PORTPARAMS_SHARE|DMUS_PORTPARAMS_FEATURES; + WAVEFORMATEX format; + DWORD size; hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth, (LPVOID*)&dmsynth); ok(hr == S_OK, "CoCreateInstance returned: %#lx\n", hr); @@ -154,6 +180,7 @@ static void test_dmsynth(void) ok(params.dwEffectFlags == DMUS_EFFECT_REVERB, "params.dwEffectFlags: %#lx\n", params.dwEffectFlags); ok(params.fShare == FALSE, "fShare: %d\n", params.fShare); ok(params.dwFeatures == 0, "dwFeatures: %#lx\n", params.dwFeatures); + test_synth_getformat(dmsynth, ¶ms, "defaults"); IDirectMusicSynth_Close(dmsynth); /* Requesting more than supported */ params.dwValidParams = DMUS_PORTPARAMS_SAMPLERATE; @@ -162,6 +189,7 @@ static void test_dmsynth(void) ok(hr == S_FALSE, "Open failed: %#lx\n", hr); ok(params.dwValidParams == all_params, "dwValidParams: %#lx\n", params.dwValidParams); ok(params.dwSampleRate == 96000, "dwSampleRate: %ld\n", params.dwSampleRate); + test_synth_getformat(dmsynth, ¶ms, "max"); IDirectMusicSynth_Close(dmsynth); /* Minimums */ params.dwValidParams = DMUS_PORTPARAMS_VOICES|DMUS_PORTPARAMS_CHANNELGROUPS|DMUS_PORTPARAMS_AUDIOCHANNELS| @@ -177,6 +205,7 @@ static void test_dmsynth(void) ok(params.dwChannelGroups == 1, "dwChannelGroups: %ld\n", params.dwChannelGroups); ok(params.dwAudioChannels == 1, "dwAudioChannels: %ld\n", params.dwAudioChannels); ok(params.dwSampleRate == 11025, "dwSampleRate: %ld\n", params.dwSampleRate); + test_synth_getformat(dmsynth, ¶ms, "min"); IDirectMusicSynth_Close(dmsynth); /* Test share and features */ params.dwValidParams = DMUS_PORTPARAMS_SHARE|DMUS_PORTPARAMS_FEATURES; @@ -188,6 +217,7 @@ static void test_dmsynth(void) ok(params.fShare == FALSE, "fShare: %d\n", params.fShare); ok(params.dwFeatures == (DMUS_PORT_FEATURE_AUDIOPATH|DMUS_PORT_FEATURE_STREAMING), "dwFeatures: %#lx\n", params.dwFeatures); + test_synth_getformat(dmsynth, ¶ms, "features"); IDirectMusicSynth_Close(dmsynth); /* Synth has no default clock */ @@ -226,6 +256,25 @@ static void test_dmsynth(void) hr = IDirectMusicSynth_GetPortCaps(dmsynth, &caps); ok(hr == S_OK, "GetPortCaps failed: %#lx\n", hr); + /* GetFormat */ + hr = IDirectMusicSynth_GetFormat(dmsynth, NULL, NULL); + ok(hr == E_POINTER, "GetFormat failed: %#lx\n", hr); + hr = IDirectMusicSynth_GetFormat(dmsynth, NULL, &size); + ok(hr == DMUS_E_SYNTHNOTCONFIGURED, "GetFormat failed: %#lx\n", hr); + hr = IDirectMusicSynth_Open(dmsynth, NULL); + ok(hr == S_OK, "Open failed: %#lx\n", hr); + hr = IDirectMusicSynth_GetFormat(dmsynth, NULL, &size); + ok(hr == S_OK, "GetFormat failed: %#lx\n", hr); + ok(size == sizeof(format), "GetFormat size mismatch, got %ld\n", size); + size = 1; + hr = IDirectMusicSynth_GetFormat(dmsynth, &format, &size); + ok(hr == S_OK, "GetFormat failed: %#lx\n", hr); + ok(size == sizeof(format), "GetFormat size mismatch, got %ld\n", size); + size = sizeof(format) + 1; + hr = IDirectMusicSynth_GetFormat(dmsynth, &format, &size); + ok(hr == S_OK, "GetFormat failed: %#lx\n", hr); + ok(size == sizeof(format), "GetFormat size mismatch, got %ld\n", size); + if (control_synth) IDirectMusicSynth_Release(control_synth); if (control_sink)
1
0
0
0
Michael Stefaniuc : dmsynth: Implement the synth GetFormat method.
by Alexandre Julliard
22 Feb '22
22 Feb '22
Module: wine Branch: master Commit: 5715d2b5b2019deaa145f48f951ec0c6c94cb281 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5715d2b5b2019deaa145f48f…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Feb 22 00:49:56 2022 +0100 dmsynth: Implement the synth GetFormat method. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmsynth/synth.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 2db80726408..d96ee943a5e 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -505,11 +505,29 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_GetChannelPriority(IDirectMusicSynt } static HRESULT WINAPI IDirectMusicSynth8Impl_GetFormat(IDirectMusicSynth8 *iface, - WAVEFORMATEX *wave_format, DWORD *wave_format_size) + WAVEFORMATEX *format, DWORD *size) { IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface); + WAVEFORMATEX fmt; - FIXME("(%p)->(%p, %p): stub\n", This, wave_format, wave_format_size); + TRACE("(%p, %p, %p)\n", This, format, size); + + if (!size) + return E_POINTER; + if (!This->open) + return DMUS_E_SYNTHNOTCONFIGURED; + + if (format) { + fmt.wFormatTag = WAVE_FORMAT_PCM; + fmt.nChannels = This->params.dwAudioChannels; + fmt.nSamplesPerSec = This->params.dwSampleRate; + fmt.wBitsPerSample = 16; + fmt.nBlockAlign = This->params.dwAudioChannels * fmt.wBitsPerSample / 8; + fmt.nAvgBytesPerSec = This->params.dwSampleRate * fmt.nBlockAlign; + fmt.cbSize = 0; + memcpy(format, &fmt, min(*size, sizeof(fmt))); + } + *size = sizeof(fmt); return S_OK; }
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
150
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Results per page:
10
25
50
100
200