Skip to content

Conversation

@emutavchi
Copy link
Collaborator

The default 200'000 is not enough and leads to frame drops during pipeline buildup.

Also, this PR adds an explicit type cast for max-buffers/max-bytes arguments set in GStreamerVideoDecoderFactory.cpp

The default 200'000 is not enough and leads to frame drops during
pipeline buildup.
@eocanha
Copy link
Member

eocanha commented Jan 15, 2026

Reviewing this...

{
m_src = makeElement("appsrc");
g_object_set(m_src, "is-live", TRUE, "do-timestamp", TRUE, "max-buffers", 2, "max-bytes", 0, nullptr);
g_object_set(m_src, "is-live", TRUE, "do-timestamp", TRUE, "max-buffers", static_cast<gint64>(2), "max-bytes", static_cast<guint64>(0), nullptr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this isn't actually increasing anything, just tidying up the argument types. Is this intended?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, both casts should be done to guint64, since that's the type used both for max-buffers and for max-bytes in appsrc.

I'm already correcting this in the version that I'm submitting for review upstream.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @eocanha , this is intentional. It is needed on arm32, or it might pick up random data from the stack.

The increase is needed on the media stream source side only.

Also, both casts should be done to guint64

Yes, you're right. I guess I confused it with the type of 'max-latency'.

eocanha added a commit to eocanha/WebKit that referenced this pull request Jan 15, 2026
https://bugs.webkit.org/show_bug.cgi?id=305576

Reviewed by NOBODY (OOPS!).

The default value for max-bytes in 200000 is not enough and leads to
frame drops during pipeline buildup.

See: WebPlatformForEmbedded/WPEWebKit#1595

This patch increases the buffering size of the appsrc element used for
video tracks in GStreamerMediaStreamSource so that it can handle enough
buffering to allow for the rest of the pipeline to be built before
buffers start to be lost.

Types fo max-buffer/max-bytes args in GStreamerVideoDecoderFactory are
also enforced as guint64. This seems to be the recommended way to do it
according to the GObject documentation[1],

[1] https://docs.gtk.org/gobject/method.Object.set.html#description

Original author: Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>

* Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Increase buffering size for video tracks.
* Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp: Properly type guint64 parameters.
@eocanha eocanha added the upstream Related to an upstream bug (or should be at some point) label Jan 15, 2026
@eocanha
Copy link
Member

eocanha commented Jan 15, 2026

Submitted for review upstream as https://bugs.webkit.org/show_bug.cgi?id=305576
/ WebKit/WebKit#56646

eocanha added a commit to eocanha/WebKit that referenced this pull request Jan 16, 2026
https://bugs.webkit.org/show_bug.cgi?id=305576

Reviewed by NOBODY (OOPS!).

The default value for max-bytes in 200000 is not enough and leads to
frame drops during pipeline buildup.

See: WebPlatformForEmbedded/WPEWebKit#1595

This patch increases the buffering size of the appsrc element used for
video tracks in GStreamerMediaStreamSource so that it can handle enough
buffering to allow for the rest of the pipeline to be built before
buffers start to be lost. The right types are used for the parameters,
according to GObject best practices[1].

Aa an opportunistic cleanup task, types for max-buffer/max-bytes
arguments in GStreamerVideoDecoderFactory are also enforced as guint64.
This seems to be the recommended way to do it according to the GObject
documentation[1],

[1] https://docs.gtk.org/gobject/method.Object.set.html#description

Original author: Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>

* Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Increase buffering size for video tracks and use proper types for the parameters.
* Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp: Cleanup by properly typing guint64 parameters.
webkit-commit-queue pushed a commit to eocanha/WebKit that referenced this pull request Jan 16, 2026
https://bugs.webkit.org/show_bug.cgi?id=305576

Reviewed by Xabier Rodriguez-Calvar.

The default value for max-bytes in 200000 is not enough and leads to
frame drops during pipeline buildup.

See: WebPlatformForEmbedded/WPEWebKit#1595

This patch increases the buffering size of the appsrc element used for
video tracks in GStreamerMediaStreamSource so that it can handle enough
buffering to allow for the rest of the pipeline to be built before
buffers start to be lost. The right types are used for the parameters,
according to GObject best practices[1].

Aa an opportunistic cleanup task, types for max-buffer/max-bytes
arguments in GStreamerVideoDecoderFactory are also enforced as guint64.
This seems to be the recommended way to do it according to the GObject
documentation[1],

[1] https://docs.gtk.org/gobject/method.Object.set.html#description

Original author: Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>

* Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Increase buffering size for video tracks and use proper types for the parameters.
* Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp: Cleanup by properly typing guint64 parameters.

Canonical link: https://commits.webkit.org/305705@main
eocanha pushed a commit that referenced this pull request Jan 16, 2026
https://bugs.webkit.org/show_bug.cgi?id=305576

Reviewed by Xabier Rodriguez-Calvar.

The default value for max-bytes in 200000 is not enough and leads to
frame drops during pipeline buildup.

See: #1595

This patch increases the buffering size of the appsrc element used for
video tracks in GStreamerMediaStreamSource so that it can handle enough
buffering to allow for the rest of the pipeline to be built before
buffers start to be lost. The right types are used for the parameters,
according to GObject best practices[1].

Aa an opportunistic cleanup task, types for max-buffer/max-bytes
arguments in GStreamerVideoDecoderFactory are also enforced as guint64.
This seems to be the recommended way to do it according to the GObject
documentation[1],

[1] https://docs.gtk.org/gobject/method.Object.set.html#description

Original author: Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>

* Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Increase buffering size for video tracks and use proper types for the parameters.
* Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp: Cleanup by properly typing guint64 parameters.

Canonical link: https://commits.webkit.org/305705@main
@eocanha
Copy link
Member

eocanha commented Jan 16, 2026

Landed upstream as WebKit/WebKit@7a0c687 and backported to wpe-2.46 as 6dc7dda. Closing PR.

@eocanha eocanha closed this Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream Related to an upstream bug (or should be at some point) wpe-2.46

Development

Successfully merging this pull request may close these issues.

3 participants