From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winegstreamer/gst_private.h | 2 ++ dlls/winegstreamer/quartz_transform.c | 19 ++++------------ dlls/winegstreamer/wg_sample.c | 32 +++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 15 deletions(-)
diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index cc799b51090..10d0497ba3e 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -132,6 +132,8 @@ void wg_sample_release(struct wg_sample *wg_sample);
HRESULT wg_transform_push_mf(struct wg_transform *transform, struct wg_sample *sample, struct wg_sample_queue *queue); +HRESULT wg_transform_push_qz(struct wg_transform *transform, struct wg_sample *sample, + struct wg_sample_queue *queue); HRESULT wg_transform_read_mf(struct wg_transform *transform, struct wg_sample *sample, struct wg_format *format);
diff --git a/dlls/winegstreamer/quartz_transform.c b/dlls/winegstreamer/quartz_transform.c index 715d7c2747b..0adad9b4c6c 100644 --- a/dlls/winegstreamer/quartz_transform.c +++ b/dlls/winegstreamer/quartz_transform.c @@ -315,23 +315,10 @@ static HRESULT WINAPI transform_sink_receive(struct strmbase_sink *pin, IMediaSa if (FAILED(hr)) return hr;
- hr = IMediaSample_GetTime(sample, &start_time, &end_time); - if (SUCCEEDED(hr)) - { - wg_sample->pts = start_time; - wg_sample->flags |= WG_SAMPLE_FLAG_HAS_PTS; - } - if (hr == S_OK) - { - wg_sample->duration = end_time - start_time; - wg_sample->flags |= WG_SAMPLE_FLAG_HAS_DURATION; - } - - hr = wg_transform_push_data(filter->transform, wg_sample); - wg_sample_release(wg_sample); - + hr = wg_transform_push_qz(filter->transform, wg_sample, filter->sample_queue); if (FAILED(hr)) return hr; + wg_sample_queue_flush(filter->sample_queue, false);
for (;;) { @@ -364,6 +351,8 @@ static HRESULT WINAPI transform_sink_receive(struct strmbase_sink *pin, IMediaSa return hr; }
+ wg_sample_queue_flush(filter->sample_queue, false); + hr = IMediaSample_SetActualDataLength(output_sample, wg_sample->size); if (FAILED(hr)) { diff --git a/dlls/winegstreamer/wg_sample.c b/dlls/winegstreamer/wg_sample.c index 40af112db39..4a0be9460a7 100644 --- a/dlls/winegstreamer/wg_sample.c +++ b/dlls/winegstreamer/wg_sample.c @@ -246,6 +246,38 @@ HRESULT wg_transform_push_mf(struct wg_transform *transform, struct wg_sample *w return hr; }
+HRESULT wg_transform_push_qz(struct wg_transform *transform, struct wg_sample *wg_sample, + struct wg_sample_queue *queue) +{ + struct sample *sample = CONTAINING_RECORD(wg_sample, struct sample, wg_sample); + REFERENCE_TIME start_pts, end_pts; + HRESULT hr; + + if (sample->type != WG_SAMPLE_TYPE_QZ) + return E_INVALIDARG; + + hr = IMediaSample_GetTime(sample->u.qz.sample, &start_pts, &end_pts); + if (SUCCEEDED(hr)) + { + wg_sample->pts = start_pts; + wg_sample->flags |= WG_SAMPLE_FLAG_HAS_PTS; + } + if (hr == S_OK) + { + wg_sample->duration = end_pts - start_pts; + wg_sample->flags |= WG_SAMPLE_FLAG_HAS_DURATION; + } + + if (IMediaSample_IsSyncPoint(sample->u.qz.sample) == S_OK) + wg_sample->flags |= WG_SAMPLE_FLAG_SYNC_POINT; + + wg_sample_queue_begin_append(queue, wg_sample); + hr = wg_transform_push_data(transform, wg_sample); + wg_sample_queue_end_append(queue, wg_sample); + + return hr; +} + HRESULT wg_transform_read_mf(struct wg_transform *transform, struct wg_sample *wg_sample, struct wg_format *format) {