[1/2] winegstreamer: Use appropriate types for return values of GStreamer calls

Frédéric Delanoy frederic.delanoy at gmail.com
Sat Oct 26 06:58:13 CDT 2013


---
 dlls/winegstreamer/gst_private.h |  2 +-
 dlls/winegstreamer/gstdemux.c    | 11 ++++++-----
 dlls/winegstreamer/gsttffilter.c | 17 +++++++++--------
 dlls/winegstreamer/main.c        |  4 ++--
 4 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h
index d041d64..15324c9 100644
--- a/dlls/winegstreamer/gst_private.h
+++ b/dlls/winegstreamer/gst_private.h
@@ -43,5 +43,5 @@ IUnknown * CALLBACK Gstreamer_YUV_create(IUnknown *pUnkOuter, HRESULT *phr);
 IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *pUnkOuter, HRESULT *phr);
 
 void g_thread_impl_init(void);
-DWORD Gstreamer_init(void);
+gboolean Gstreamer_init(void);
 #endif /* __GST_PRIVATE_INCLUDED__ */
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 52935d0..8bbbad1 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -436,7 +436,7 @@ static DWORD CALLBACK push_data(LPVOID iface) {
         ULONG len;
         GstBuffer *gstbuf;
         BYTE *data;
-        int ret;
+        GstFlowReturn ret;
 
         hr = IMemAllocator_GetBuffer(This->pInputPin.pAlloc, &buf, NULL, NULL, 0);
         if (FAILED(hr))
@@ -599,7 +599,7 @@ static GstFlowReturn request_buffer_sink(GstPad *pad, guint64 ofs, guint size, G
 
     TRACE("Requesting buffer\n");
     if (This->initial) {
-        int ret;
+        gboolean ret;
         ret = setcaps_sink(pad, caps);
         if (!ret)
             return GST_FLOW_NOT_NEGOTIATED;
@@ -633,7 +633,7 @@ static GstFlowReturn request_buffer_sink(GstPad *pad, guint64 ofs, guint size, G
 
 static GstFlowReturn request_buffer_src(GstPad *pad, guint64 ofs, guint len, GstBuffer **buf) {
     GSTImpl *This = gst_pad_get_element_private(pad);
-    int ret;
+    GstFlowReturn ret;
 
     *buf = NULL;
     TRACE("Requesting %s %u\n", wine_dbgstr_longlong(ofs), len);
@@ -803,7 +803,7 @@ static gboolean check_get_range(GstPad *pad) {
 static gboolean query_function(GstPad *pad, GstQuery *query) {
     GSTImpl *This = gst_pad_get_element_private(pad);
     GstFormat format;
-    int ret;
+    gboolean ret;
     LONGLONG duration;
 
     switch (GST_QUERY_TYPE(query)) {
@@ -913,7 +913,8 @@ static void unknown_type(GstElement *bin, GstPad *pad, GstCaps *caps, GSTImpl *T
 static HRESULT GST_Connect(GSTInPin *pPin, IPin *pConnectPin, ALLOCATOR_PROPERTIES *props) {
     GSTImpl *This = (GSTImpl*)pPin->pin.pinInfo.pFilter;
     HRESULT hr;
-    int ret, i;
+    GstPadLinkReturn ret;
+    int i;
     LONGLONG avail, duration;
     GstFormat format = GST_FORMAT_TIME;
     GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE(
diff --git a/dlls/winegstreamer/gsttffilter.c b/dlls/winegstreamer/gsttffilter.c
index 28f5d5d..2935fb2 100644
--- a/dlls/winegstreamer/gsttffilter.c
+++ b/dlls/winegstreamer/gsttffilter.c
@@ -123,7 +123,7 @@ typedef struct GstTfImpl {
 
 static HRESULT WINAPI Gstreamer_transform_ProcessBegin(TransformFilter *iface) {
     GstTfImpl *This = (GstTfImpl*)iface;
-    int ret;
+    GstStateChangeReturn ret;
 
     ret = gst_element_set_state(This->filter, GST_STATE_PLAYING);
     TRACE("Returned: %i\n", ret);
@@ -221,7 +221,7 @@ static HRESULT WINAPI Gstreamer_transform_ProcessData(TransformFilter *iface, IM
     BYTE *data;
     GstBuffer *buf;
     HRESULT hr;
-    int ret;
+    GstFlowReturn ret;
     TRACE("Reading %p\n", sample);
 
     EnterCriticalSection(&This->tf.csReceive);
@@ -265,7 +265,7 @@ static HRESULT WINAPI Gstreamer_transform_ProcessData(TransformFilter *iface, IM
 
 static HRESULT WINAPI Gstreamer_transform_ProcessEnd(TransformFilter *iface) {
     GstTfImpl *This = (GstTfImpl*)iface;
-    int ret;
+    GstStateChangeReturn ret;
 
     LeaveCriticalSection(&This->tf.csReceive);
     ret = gst_element_set_state(This->filter, GST_STATE_READY);
@@ -276,7 +276,7 @@ static HRESULT WINAPI Gstreamer_transform_ProcessEnd(TransformFilter *iface) {
 
 static void Gstreamer_transform_pad_added(GstElement *filter, GstPad *pad, GstTfImpl *This)
 {
-    int ret;
+    GstPadLinkReturn ret;
     if (!GST_PAD_IS_SRC(pad))
         return;
 
@@ -292,7 +292,8 @@ static void Gstreamer_transform_pad_added(GstElement *filter, GstPad *pad, GstTf
 static HRESULT Gstreamer_transform_ConnectInput(GstTfImpl *This, const AM_MEDIA_TYPE *amt, GstCaps *capsin, GstCaps *capsout) {
     GstIterator *it;
     BOOL done = FALSE, found = FALSE;
-    int ret;
+    gboolean ret;
+    GstPadLinkReturn res;
 
     This->filter = gst_element_factory_make(This->gstreamer_name, NULL);
     if (!This->filter) {
@@ -363,9 +364,9 @@ static HRESULT Gstreamer_transform_ConnectInput(GstTfImpl *This, const AM_MEDIA_
     found = !!This->their_src;
     if (!found)
         g_signal_connect(This->filter, "pad-added", G_CALLBACK(Gstreamer_transform_pad_added), This);
-    ret = gst_pad_link(This->my_src, This->their_sink);
-    if (ret < 0) {
-        WARN("Failed to link with %i\n", ret);
+    res = gst_pad_link(This->my_src, This->their_sink);
+    if (res < 0) {
+        WARN("Failed to link with %i\n", res);
         return E_FAIL;
     }
 
diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c
index 4f0e84f..5aa6524 100644
--- a/dlls/winegstreamer/main.c
+++ b/dlls/winegstreamer/main.c
@@ -242,8 +242,8 @@ void dump_AM_MEDIA_TYPE(const AM_MEDIA_TYPE * pmt)
     TRACE("\t%s\n\t%s\n\t...\n\t%s\n", debugstr_guid(&pmt->majortype), debugstr_guid(&pmt->subtype), debugstr_guid(&pmt->formattype));
 }
 
-DWORD Gstreamer_init(void) {
-    static int inited;
+gboolean Gstreamer_init(void) {
+    static gboolean inited;
 
     if (!inited) {
         char argv0[] = "wine";
-- 
1.8.4.1




More information about the wine-patches mailing list