Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2010-03-08 Philippe Normand <pnormand@igalia.com>
        Reviewed by Gustavo Noronha.

        [GStreamer] soften dependency on libsoup in the http src element
        https://bugs.webkit.org/show_bug.cgi?id=35864

        Replaced SoupURI calls with KURL and pause/resume internal soup
        messages only if the element is compiled for a port depending on
        libsoup.

        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (webkit_web_src_init):
        (webKitWebSrcSetUri):
        (webKitWebSrcNeedDataMainCb):
        (webKitWebSrcEnoughDataMainCb):

Canonical link: https://commits.webkit.org/47909@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@56615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
philn committed Mar 26, 2010
1 parent 9316ae4 commit 4afe0cf
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
17 changes: 17 additions & 0 deletions WebCore/ChangeLog
@@ -1,3 +1,20 @@
2010-03-08 Philippe Normand <pnormand@igalia.com>

Reviewed by Gustavo Noronha.

[GStreamer] soften dependency on libsoup in the http src element
https://bugs.webkit.org/show_bug.cgi?id=35864

Replaced SoupURI calls with KURL and pause/resume internal soup
messages only if the element is compiled for a port depending on
libsoup.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init):
(webKitWebSrcSetUri):
(webKitWebSrcNeedDataMainCb):
(webKitWebSrcEnoughDataMainCb):

2010-03-25 Ilya Tikhonovsky <loislo@chromium.org>

Reviewed by Pavel Feldman.
Expand Down
20 changes: 13 additions & 7 deletions WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
Expand Up @@ -255,6 +255,7 @@ static void webkit_web_src_init(WebKitWebSrc* src,
// already if the queue is 20% empty, it's much more
// likely that libsoup already provides new data before
// the queue is really empty.
// This might need tweaking for ports not using libsoup.
if (priv->haveAppSrc27)
g_object_set(priv->appsrc, "min-percent", 20, NULL);

Expand Down Expand Up @@ -505,17 +506,14 @@ static gboolean webKitWebSrcSetUri(GstURIHandler* handler, const gchar* uri)
if (!uri)
return TRUE;

SoupURI* soupUri = soup_uri_new(uri);
KURL url(KURL(), uri);

if (!soupUri || !SOUP_URI_VALID_FOR_HTTP(soupUri)) {
if (!url.isValid() || !url.protocolInHTTPFamily()) {
GST_ERROR_OBJECT(src, "Invalid URI '%s'", uri);
soup_uri_free(soupUri);
return FALSE;
}

priv->uri = soup_uri_to_string(soupUri, FALSE);
soup_uri_free(soupUri);

priv->uri = g_strdup(url.string().utf8().data());
return TRUE;
}

Expand All @@ -535,9 +533,13 @@ static gboolean webKitWebSrcNeedDataMainCb(WebKitWebSrc* src)
{
WebKitWebSrcPrivate* priv = src->priv;

#if USE(NETWORK_SOUP)
ResourceHandleInternal* d = priv->resourceHandle->getInternal();
if (d->m_msg)
soup_session_unpause_message(ResourceHandle::defaultSession(), d->m_msg);
#endif
// Ports not using libsoup need to call the unpause/schedule API of their
// underlying network implementation here.

priv->paused = FALSE;
priv->needDataID = 0;
Expand All @@ -560,9 +562,13 @@ static gboolean webKitWebSrcEnoughDataMainCb(WebKitWebSrc* src)
{
WebKitWebSrcPrivate* priv = src->priv;

#if USE(NETWORK_SOUP)
ResourceHandleInternal* d = priv->resourceHandle->getInternal();
soup_session_pause_message(ResourceHandle::defaultSession(), d->m_msg);

#endif
// Ports not using libsoup need to call the pause/unschedule API of their
// underlying network implementation here.

priv->paused = TRUE;
priv->enoughDataID = 0;
return FALSE;
Expand Down

0 comments on commit 4afe0cf

Please sign in to comment.