Maarten Lankhorst : winegstreamer: Add support for qos to demuxer.

Alexandre Julliard julliard at winehq.org
Wed Nov 10 11:09:39 CST 2010


Module: wine
Branch: master
Commit: 46f4011ec4d3f7882b053244be133e271d59015d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=46f4011ec4d3f7882b053244be133e271d59015d

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Tue Nov  9 23:42:48 2010 +0100

winegstreamer: Add support for qos to demuxer.

---

 dlls/winegstreamer/gstdemux.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index c1d485d..1c4b796 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -80,6 +80,7 @@ struct GSTOutPin {
     AM_MEDIA_TYPE * pmt;
     HANDLE caps_event;
     GstSegment *segment;
+    QualityControlImpl qcimpl;
     SourceSeeking seek;
 };
 
@@ -88,6 +89,7 @@ static const IMediaSeekingVtbl GST_Seeking_Vtbl;
 static const IPinVtbl GST_OutputPin_Vtbl;
 static const IPinVtbl GST_InputPin_Vtbl;
 static const IBaseFilterVtbl GST_Vtbl;
+static const IQualityControlVtbl GSTOutPin_QualityControl_Vtbl;
 
 static HRESULT GST_AddPin(GSTImpl *This, const PIN_INFO *piOutput, const AM_MEDIA_TYPE *amt);
 static HRESULT GST_RemoveOutputPins(GSTImpl *This);
@@ -1282,6 +1284,21 @@ static const IMediaSeekingVtbl GST_Seeking_Vtbl =
     SourceSeekingImpl_GetPreroll
 };
 
+static HRESULT WINAPI GST_QualityControl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm) {
+    QualityControlImpl *This = (QualityControlImpl*)iface;
+    GSTOutPin *pin = (GSTOutPin*)This->self;
+    gst_pad_push_event(pin->my_sink, gst_event_new_qos(1000./qm.Proportion, qm.Late*100, qm.TimeStamp*100));
+    return S_OK;
+}
+
+static const IQualityControlVtbl GSTOutPin_QualityControl_Vtbl = {
+    QualityControlImpl_QueryInterface,
+    QualityControlImpl_AddRef,
+    QualityControlImpl_Release,
+    GST_QualityControl_Notify,
+    QualityControlImpl_SetSink
+};
+
 static HRESULT WINAPI GSTOutPin_QueryInterface(IPin *iface, REFIID riid, void **ppv) {
     GSTOutPin *This = (GSTOutPin *)iface;
 
@@ -1295,6 +1312,8 @@ static HRESULT WINAPI GSTOutPin_QueryInterface(IPin *iface, REFIID riid, void **
         *ppv = iface;
     else if (IsEqualIID(riid, &IID_IMediaSeeking))
         *ppv = &This->seek;
+    else if (IsEqualIID(riid, &IID_IQualityControl))
+        *ppv = &This->qcimpl;
 
     if (*ppv) {
         IUnknown_AddRef((IUnknown *)(*ppv));
@@ -1422,6 +1441,8 @@ static HRESULT GST_AddPin(GSTImpl *This, const PIN_INFO *piOutput, const AM_MEDI
         pin->caps_event = CreateEventW(NULL, 0, 0, NULL);
         pin->segment = gst_segment_new();
         This->cStreams++;
+        QualityControlImpl_init(&pin->qcimpl, NULL, (IBaseFilter*)pin);
+        pin->qcimpl.lpVtbl = &GSTOutPin_QualityControl_Vtbl;
         SourceSeeking_Init(&pin->seek, &GST_Seeking_Vtbl, GST_ChangeStop, GST_ChangeCurrent, GST_ChangeRate, &This->filter.csFilter);
         BaseFilterImpl_IncrementPinVersion((BaseFilter*)This);
     } else




More information about the wine-cvs mailing list