https://bugs.webkit.org/show_bug.cgi?id=173655
Reviewed by Xabier Rodriguez-Calvar.
The FIXME in GStreamerUtilities.cpp asks to pass the command line
parameters to the GStreamer initialization function.
Based on initial patch by: Vanessa Chipirrás Navalón <vchipirras@igalia.com>
Source/WebCore:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::constructCommon): Removes the call to the method
that GStreamer initializes. It is no longer necessary.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Ditto
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::initializeGStreamerAndRegisterWebKitMSEElement): Ditto
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::initializeGStreamer): Receive the GStreamer options and initialize GStreamer.
* platform/graphics/gstreamer/GStreamerUtilities.h: Add vector which contains
GStreamer options as the input parameter of the initializeGStreamer() method.
Source/WebKit:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h: Define the vector which contains the GStreamer options.
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Read from cmdline file
the GStreamer options written by console.
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): Call initializeGStreamer() method passing
the vector which contains the options.
Tools:
* MiniBrowser/gtk/main.c:
(main): Add the group containing the Gstreamer options that the console displays.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228818
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2018-02-20 Philippe Normand <pnormand@igalia.com>
+
+ [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=173655
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ The FIXME in GStreamerUtilities.cpp asks to pass the command line
+ parameters to the GStreamer initialization function.
+
+ Based on initial patch by: Vanessa Chipirrás Navalón <vchipirras@igalia.com>
+
+ * Modules/webaudio/AudioContext.cpp:
+ (WebCore::AudioContext::constructCommon): Removes the call to the method
+ that GStreamer initializes. It is no longer necessary.
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+ (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): Ditto
+ * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
+ (WebCore::initializeGStreamerAndRegisterWebKitMSEElement): Ditto
+ * platform/graphics/gstreamer/GStreamerUtilities.cpp:
+ (WebCore::initializeGStreamer): Receive the GStreamer options and initialize GStreamer.
+ * platform/graphics/gstreamer/GStreamerUtilities.h: Add vector which contains
+ GStreamer options as the input parameter of the initializeGStreamer() method.
+
2018-02-20 Miguel Gomez <magomez@igalia.com>
[GTK] whatsapp web blurry in some parts, sharp on others
// Lets mark it as ActiveDOMObject with pending activity and unmark it in clear method.
setPendingActivity(this);
-#if USE(GSTREAMER)
- initializeGStreamer();
-#endif
-
FFTFrame::initialize();
m_listener = AudioListener::create();
fastFree(mapInfo);
}
-bool initializeGStreamer()
+bool initializeGStreamer(Vector<String>& parameters)
{
- if (gst_is_initialized())
- return true;
-
GUniqueOutPtr<GError> error;
- // FIXME: We should probably pass the arguments from the command line.
- bool gstInitialized = gst_init_check(nullptr, nullptr, &error.outPtr());
- ASSERT_WITH_MESSAGE(gstInitialized, "GStreamer initialization failed: %s", error ? error->message : "unknown error occurred");
+ bool isGStreamerInitialized = false;
+
+#if ENABLE(VIDEO) || ENABLE(WEB_AUDIO)
+ char** argv = g_new0(char*, parameters.size() + 2);
+ argv[0] = g_strdup("WebProcess");
+ for (unsigned i = 1; i < parameters.size(); i++)
+ argv[i] = g_strdup(parameters[i].utf8().data());
+
+ int size = g_strv_length(argv);
+ isGStreamerInitialized = gst_init_check(&size, &argv, &error.outPtr());
+ g_strfreev(argv);
+ ASSERT_WITH_MESSAGE(isGStreamerInitialized, "GStreamer initialization failed: %s", error ? error->message : "unknown error occurred");
if (isFastMallocEnabled()) {
const char* disableFastMalloc = getenv("WEBKIT_GST_DISABLE_FAST_MALLOC");
}
#if ENABLE(VIDEO_TRACK) && USE(GSTREAMER_MPEGTS)
- if (gstInitialized)
+ if (isGStreamerInitialized)
gst_mpegts_initialize();
#endif
+#endif
- return gstInitialized;
+ return isGStreamerInitialized;
}
unsigned getGstPlayFlag(const char* nick)
bool areEncryptedCaps(const GstCaps*);
void mapGstBuffer(GstBuffer*, uint32_t);
void unmapGstBuffer(GstBuffer*);
-bool initializeGStreamer();
+bool initializeGStreamer(Vector<String>& parameters);
unsigned getGstPlayFlag(const char* nick);
uint64_t toGstUnsigned64Time(const MediaTime&);
bool MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements()
{
- if (!initializeGStreamer())
- return false;
-
registerWebKitGStreamerElements();
GRefPtr<GstElementFactory> srcFactory = adoptGRef(gst_element_factory_find("webkitwebsrc"));
bool initializeGStreamerAndRegisterWebKitMSEElement()
{
- if (UNLIKELY(!initializeGStreamer()))
- return false;
-
registerWebKitGStreamerElements();
GST_DEBUG_CATEGORY_INIT(webkit_mse_debug, "webkitmse", 0, "WebKit MSE media player");
+2018-02-20 Philippe Normand <pnormand@igalia.com>
+
+ [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=173655
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ The FIXME in GStreamerUtilities.cpp asks to pass the command line
+ parameters to the GStreamer initialization function.
+
+ Based on initial patch by: Vanessa Chipirrás Navalón <vchipirras@igalia.com>
+
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::encode const):
+ (WebKit::WebProcessCreationParameters::decode):
+ * Shared/WebProcessCreationParameters.h: Define the vector which contains the GStreamer options.
+ * UIProcess/gtk/WebProcessPoolGtk.cpp:
+ (WebKit::WebProcessPool::platformInitializeWebProcess): Read from cmdline file
+ the GStreamer options written by console.
+ * WebProcess/soup/WebProcessSoup.cpp:
+ (WebKit::WebProcess::platformInitializeWebProcess): Call initializeGStreamer() method passing
+ the vector which contains the options.
+
2018-02-20 Yousuke Kimoto <yousuke.kimoto@sony.com>
[Win] Fix MSVC's treating __attribute__((warn_unused_result))
encoder << fontWhitelist;
encoder << terminationTimeout;
encoder << languages;
+#if USE(GSTREAMER)
+ encoder << gstreamerOptions;
+#endif
encoder << textCheckerState;
encoder << fullKeyboardAccessEnabled;
encoder << defaultRequestTimeoutInterval;
return false;
if (!decoder.decode(parameters.languages))
return false;
+#if USE(GSTREAMER)
+ if (!decoder.decode(parameters.gstreamerOptions))
+ return false;
+#endif
if (!decoder.decode(parameters.textCheckerState))
return false;
if (!decoder.decode(parameters.fullKeyboardAccessEnabled))
Vector<String> fontWhitelist;
Vector<String> languages;
+#if USE(GSTREAMER)
+ Vector<String> gstreamerOptions;
+#endif
CacheModel cacheModel;
{
parameters.memoryCacheDisabled = m_memoryCacheDisabled || cacheModel() == CacheModelDocumentViewer;
parameters.proxySettings = m_networkProxySettings;
+
+#if USE(GSTREAMER)
+ GUniqueOutPtr<gchar> contents;
+ gsize length;
+ if (g_file_get_contents("/proc/self/cmdline", &contents.outPtr(), &length, nullptr))
+ parameters.gstreamerOptions.append(String::fromUTF8(contents.get()));
+#endif
}
void WebProcessPool::platformInvalidateContext()
#include "WebProcess.h"
#include "WebProcessCreationParameters.h"
+#include <WebCore/GStreamerUtilities.h>
#include <WebCore/MemoryCache.h>
#include <WebCore/NetworkStorageSession.h>
#include <WebCore/SoupNetworkSession.h>
#if PLATFORM(WAYLAND)
m_waylandCompositorDisplay = WaylandCompositorDisplay::create(parameters.waylandCompositorDisplayName);
#endif
+#if USE(GSTREAMER)
+ WebCore::initializeGStreamer(parameters.gstreamerOptions);
+#endif
}
void WebProcess::platformTerminate()
+2018-02-20 Philippe Normand <pnormand@igalia.com>
+
+ [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=173655
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ The FIXME in GStreamerUtilities.cpp asks to pass the command line
+ parameters to the GStreamer initialization function.
+
+ Based on initial patch by: Vanessa Chipirrás Navalón <vchipirras@igalia.com>
+
+ * MiniBrowser/gtk/main.c:
+ (main): Add the group containing the Gstreamer options that the console displays.
2018-02-19 Fujii Hironori <Hironori.Fujii@sony.com>
[WTR][GTK] crash log backtrace doesn't show symbol names for DatabaseProcess and NetworkProcess
${GTK3_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${LIBSOUP_INCLUDE_DIRS}
+ ${GSTREAMER_INCLUDE_DIRS}
)
set(MiniBrowser_LIBRARIES
${GTK3_LIBRARIES}
${GLIB_LIBRARIES}
${LIBSOUP_LIBRARIES}
+ ${GSTREAMER_LIBRARIES}
)
add_custom_command(
#include "BrowserWindow.h"
#include <JavaScriptCore/JavaScript.h>
#include <errno.h>
+#include <gst/gst.h>
#include <gtk/gtk.h>
#include <string.h>
#include <webkit2/webkit2.h>
GOptionContext *context = g_option_context_new(NULL);
g_option_context_add_main_entries(context, commandLineOptions, 0);
g_option_context_add_group(context, gtk_get_option_group(TRUE));
+ g_option_context_add_group(context, gst_init_get_option_group());
WebKitSettings *webkitSettings = webkit_settings_new();
webkit_settings_set_enable_developer_extras(webkitSettings, TRUE);