WebKit Bugzilla
Attachment 372245 Details for
Bug 198916
: [GStreamer] Identify elements with monotonically increasing counters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198916-20190617155923.patch (text/plain), 4.92 KB, created by
Philippe Normand
on 2019-06-17 07:59:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Philippe Normand
Created:
2019-06-17 07:59:24 PDT
Size:
4.92 KB
patch
obsolete
>Subversion Revision: 246495 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 4de04ad71fdb3e85823afea2d51e62a8dba7e448..1d4bf68f2a553ea68e993630f9f31080eb0a8e48 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2019-06-17 Philippe Normand <pnormand@igalia.com> >+ >+ [GStreamer] Identify elements with monotonically increasing counters >+ https://bugs.webkit.org/show_bug.cgi?id=198916 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Those ids tend to be shorter, easier to read for humans and for >+ diff tools :) Underscores were also replaced by dashes, for >+ consistency with the usual GStreamer element naming untold >+ conventions. >+ >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: >+ (WebCore::MediaPlayerPrivateGStreamer::load): >+ (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): >+ * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: >+ (WebCore::GStreamerVideoEncoder::makeElement): >+ (WebCore::GStreamerVideoEncoder::InitEncode): >+ > 2019-06-17 Carlos Garcia Campos <cgarcia@igalia.com> > > Unreviewed, rolling out r246467. >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >index 0e0835b01f8acd9d03300520686f05a270e13b2d..d87bbba09ae6266bf365c1c71b434f5c9101df88 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >@@ -43,7 +43,6 @@ > #include <gst/pbutils/missing-plugins.h> > #include <limits> > #include <wtf/FileSystem.h> >-#include <wtf/HexNumber.h> > #include <wtf/MediaTime.h> > #include <wtf/NeverDestroyed.h> > #include <wtf/StringPrintStream.h> >@@ -327,9 +326,10 @@ void MediaPlayerPrivateGStreamer::load(MediaStreamPrivate& stream) > { > #if GST_CHECK_VERSION(1, 10, 0) > m_streamPrivate = &stream; >- auto pipelineName = makeString("mediastream_", >- (stream.hasCaptureVideoSource() || stream.hasCaptureAudioSource()) ? "Local" : "Remote", >- "_0x", hex(reinterpret_cast<uintptr_t>(this), Lowercase)); >+ static Atomic<uint32_t> pipelineId; >+ auto pipelineName = makeString("mediastream-", >+ (stream.hasCaptureVideoSource() || stream.hasCaptureAudioSource()) ? "local" : "remote", >+ "-", pipelineId.exchangeAdd(1)); > > loadFull(String("mediastream://") + stream.id(), pipelineName); > syncOnClock(false); >@@ -2386,8 +2386,9 @@ void MediaPlayerPrivateGStreamer::createGSTPlayBin(const URL& url, const String& > > // gst_element_factory_make() returns a floating reference so > // we should not adopt. >+ static Atomic<uint32_t> pipelineId = 0; > setPipeline(gst_element_factory_make(playbinName, >- (pipelineName.isEmpty() ? makeString("play_0x", hex(reinterpret_cast<uintptr_t>(this), Lowercase)) : pipelineName).utf8().data())); >+ (pipelineName.isEmpty() ? makeString("media-player-", pipelineId.exchangeAdd(1)) : pipelineName).utf8().data())); > setStreamVolumeElement(GST_STREAM_VOLUME(m_pipeline.get())); > > GST_INFO_OBJECT(pipeline(), "Using legacy playbin element: %s", boolForPrinting(m_isLegacyPlaybin)); >diff --git a/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp b/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp >index 59dbffa72d74c281645832c3ea9d4129a44be0a1..7919bcc13f1523357e6c27715225e781fcbd3007 100644 >--- a/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp >+++ b/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp >@@ -41,10 +41,11 @@ > #undef GST_USE_UNSTABLE_API > #include <gst/pbutils/encoding-profile.h> > #include <gst/video/video.h> >+#include <wtf/Atomics.h> > #include <wtf/HashMap.h> >-#include <wtf/HexNumber.h> > #include <wtf/Lock.h> > #include <wtf/StdMap.h> >+#include <wtf/text/StringConcatenateNumbers.h> > > // Required for unified builds > #ifdef GST_CAT_DEFAULT >@@ -95,7 +96,8 @@ public: > > GstElement* makeElement(const gchar* factoryName) > { >- auto name = makeString(Name(), "_enc_", factoryName, "_0x", hex(reinterpret_cast<uintptr_t>(this))); >+ static Atomic<uint32_t> elementId; >+ auto name = makeString(Name(), "-enc-", factoryName, "-", elementId.exchangeAdd(1)); > auto elem = gst_element_factory_make(factoryName, name.utf8().data()); > > return elem; >@@ -136,8 +138,7 @@ public: > m_sink = makeElement("appsink"); > g_object_set(m_sink, "sync", FALSE, nullptr); > >- auto name = makeString(Name(), "_enc_rawcapsfilter_0x", hex(reinterpret_cast<uintptr_t>(this))); >- m_capsFilter = gst_element_factory_make("capsfilter", name.utf8().data()); >+ m_capsFilter = makeElement("capsfilter"); > if (m_restrictionCaps) > g_object_set(m_capsFilter, "caps", m_restrictionCaps.get(), nullptr); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
calvaris
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198916
: 372245