[GStreamer] Use smart pointers and modernize code in WebKitWebAudioSourceGStreamer
[WebKit-https.git] / Source / WebCore / platform / graphics / gstreamer / WebKitWebSourceGStreamer.cpp
index d2a7c6b..2a7f89e 100644 (file)
@@ -580,7 +580,8 @@ static void webKitWebSrcStart(WebKitWebSrc* src)
         PlatformMediaResourceLoader::LoadOptions loadOptions = 0;
         if (request.url().protocolIsBlob())
             loadOptions |= PlatformMediaResourceLoader::LoadOption::BufferData;
-        priv->resource = priv->loader->requestResource(request, loadOptions);
+        // FIXME: request should be moved for efficiency
+        priv->resource = priv->loader->requestResource(ResourceRequest(request), loadOptions);
         if (priv->resource) {
             priv->resource->setClient(std::make_unique<CachedResourceStreamingClient>(protector.get()));
             GST_DEBUG_OBJECT(protector.get(), "Started request");
@@ -864,7 +865,7 @@ char* StreamingClient::createReadBuffer(size_t requestedSize, size_t& actualSize
 
     GstBuffer* buffer = gst_buffer_new_and_alloc(requestedSize);
 
-    mapGstBuffer(buffer);
+    mapGstBuffer(buffer, GST_MAP_WRITE);
 
     WTF::GMutexLocker<GMutex> locker(*GST_OBJECT_GET_LOCK(src));
     priv->buffer = adoptGRef(buffer);