Zebediah Figura : quartz/tests: Test the timestamps associated with new segments.

Alexandre Julliard julliard at winehq.org
Tue Feb 22 16:06:49 CST 2022


Module: wine
Branch: master
Commit: 3b29ef9e753339248b3a32b37a932501f927ac01
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3b29ef9e753339248b3a32b37a932501f927ac01

Author: Zebediah Figura <z.figura12 at 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 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at 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");




More information about the wine-cvs mailing list