Changeset 141695 in webkit
- Timestamp:
- Feb 2, 2013 8:00:53 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r141694 r141695 1 2013-02-01 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] webkitwebsrc is exposed to application-side 4 https://bugs.webkit.org/show_bug.cgi?id=108088 5 6 Reviewed by Martin Robinson. 7 8 Switch the webkitwebsrc to handle webkit+http(s) uris so it is now 9 explicit that this element is meant to be used preferrably inside 10 WebKit. This change is internal to the player. 11 12 No new tests, covered by existing http/tests/media tests. 13 14 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 15 (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): 16 (WebCore): 17 (WebCore::MediaPlayerPrivateGStreamer::load): 18 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 19 (MediaPlayerPrivateGStreamer): 20 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: 21 (webKitWebSrcGetProtocols): 22 (webKitWebSrcSetUri): 23 1 24 2013-02-02 Simon Hausmann <simon.hausmann@digia.com> 2 25 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r141566 r141695 305 305 } 306 306 307 KURL MediaPlayerPrivateGStreamer::convertPlaybinURL(const gchar* uri) 308 { 309 KURL url(KURL(), uri); 310 311 ASSERT(url.protocol().substring(0, 7) == "webkit+"); 312 url.setProtocol(url.protocol().substring(7)); 313 return url; 314 } 315 316 void MediaPlayerPrivateGStreamer::setPlaybinURL(KURL& url) 317 { 318 // Clean out everything after file:// url path. 319 if (url.isLocalFile()) 320 url.removeFragmentIdentifier(); 321 322 m_url = url; 323 324 if (url.protocolIsInHTTPFamily()) 325 url.setProtocol("webkit+" + url.protocol()); 326 327 LOG_MEDIA_MESSAGE("Load %s", url.string().utf8().data()); 328 g_object_set(m_playBin.get(), "uri", url.string().utf8().data(), NULL); 329 } 330 307 331 void MediaPlayerPrivateGStreamer::load(const String& url) 308 332 { 309 333 if (!initializeGStreamerAndRegisterWebKitElements()) 310 334 return; 311 312 KURL kurl(KURL(), url);313 String cleanUrl(url);314 315 // Clean out everything after file:// url path.316 if (kurl.isLocalFile())317 cleanUrl = cleanUrl.substring(0, kurl.pathEnd());318 335 319 336 if (!m_playBin) { … … 324 341 ASSERT(m_playBin); 325 342 326 m_url = KURL(KURL(), cleanUrl); 327 g_object_set(m_playBin.get(), "uri", cleanUrl.utf8().data(), NULL); 328 329 LOG_MEDIA_MESSAGE("Load %s", cleanUrl.utf8().data()); 343 KURL kurl(KURL(), url); 344 setPlaybinURL(kurl); 330 345 331 346 if (m_preload == MediaPlayer::None) { … … 1416 1431 // append the value of new-location to it. 1417 1432 1418 gchar* currentLocation = 0;1419 g_object_get(m_playBin.get(), "uri", ¤tLocation, NULL);1420 1421 KURL currentUrl(KURL(), currentLocation);1422 g_free(currentLocation);1423 1424 1433 KURL newUrl; 1425 1426 1434 if (gst_uri_is_valid(newLocation)) 1427 1435 newUrl = KURL(KURL(), newLocation); 1428 1436 else 1429 newUrl = KURL(KURL(), currentUrl.baseAsString() + newLocation);1430 1431 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create( currentUrl);1437 newUrl = KURL(KURL(), m_url.baseAsString() + newLocation); 1438 1439 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(m_url); 1432 1440 if (securityOrigin->canRequest(newUrl)) { 1433 1441 LOG_MEDIA_MESSAGE("New media url: %s", newUrl.string().utf8().data()); … … 1447 1455 if (state <= GST_STATE_READY) { 1448 1456 // Set the new uri and start playing. 1449 g_object_set(m_playBin.get(), "uri", newUrl.string().utf8().data(), NULL);1457 setPlaybinURL(newUrl); 1450 1458 gst_element_set_state(m_playBin.get(), GST_STATE_PLAYING); 1451 1459 return true; -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
r141566 r141695 140 140 MediaPlayer* mediaPlayer() const { return m_player; } 141 141 142 static KURL convertPlaybinURL(const gchar* uri); 143 142 144 private: 143 145 MediaPlayerPrivateGStreamer(MediaPlayer*); … … 147 149 static void getSupportedTypes(HashSet<String>&); 148 150 static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs, const KURL&); 151 152 void setPlaybinURL(KURL&); 149 153 150 154 static bool isAvailable(); -
trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
r140425 r141695 27 27 #include "GStreamerVersioning.h" 28 28 #include "MediaPlayer.h" 29 #include "MediaPlayerPrivateGStreamer.h" 29 30 #include "NetworkingContext.h" 30 31 #include "NotImplemented.h" … … 549 550 const gchar* const* webKitWebSrcGetProtocols(GType) 550 551 { 551 static const char* protocols[] = {"http", "https", 0 };552 static const char* const protocols[] = {"webkit+http", "webkit+https", 0 }; 552 553 return protocols; 553 554 } … … 574 575 return TRUE; 575 576 576 KURL url (KURL(),uri);577 KURL url = WebCore::MediaPlayerPrivateGStreamer::convertPlaybinURL(uri); 577 578 578 579 if (!url.isValid() || !url.protocolIsInHTTPFamily()) { … … 593 594 static gchar** webKitWebSrcGetProtocols(void) 594 595 { 595 static gchar* protocols[] = {(gchar*) " http", (gchar*) "https", 0 };596 static gchar* protocols[] = {(gchar*) "webkit+http", (gchar*) "webkit+https", 0 }; 596 597 return protocols; 597 598 } … … 618 619 return TRUE; 619 620 620 KURL url (KURL(),uri);621 KURL url = WebCore::MediaPlayerPrivateGStreamer::convertPlaybinURL(uri); 621 622 622 623 if (!url.isValid() || !url.protocolIsInHTTPFamily()) {
Note: See TracChangeset
for help on using the changeset viewer.