Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MSE] Bring back some useful SourceBuffer logs #5854

Merged
merged 1 commit into from Nov 2, 2022

Conversation

eocanha
Copy link
Contributor

@eocanha eocanha commented Oct 27, 2022

e5e73c6

[MSE] Bring back some useful SourceBuffer logs
https://bugs.webkit.org/show_bug.cgi?id=247122

Reviewed by Xabier Rodriguez-Calvar.

Changeset https://trac.webkit.org/changeset/241148/webkit from
https://bugs.webkit.org/show_bug.cgi?id=194348 removed line
cd4e7eb#diff-78280e252e732edbf1f9b6517bd2f98eb1475f16fc781a5f3e2e2e6bf9b2a9beL710
, which was very useful when debugging MSE append problems.

This patch is bringing that line back and adding a similar one
to appendBufferInternal(), which will be helpful to track how
the buffered ranges evolve as the append is processed.

Original author: Pawel Lampe <pawel.lampe@gmail.com>
See: WebPlatformForEmbedded/WPEWebKit#955

* Source/WebCore/Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBufferInternal): Added log line.
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Ditto.

Canonical link: https://commits.webkit.org/256224@main

2f68c2c

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  πŸ§ͺ win
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-debug βœ… πŸ›  gtk βœ… πŸ›  wincairo
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk1
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch-sim βœ… πŸ§ͺ mac-wk2-stress

@eocanha eocanha self-assigned this Oct 27, 2022
@eocanha eocanha added Media Bugs related to the HTML 5 Media elements. WebKit Nightly Build labels Oct 27, 2022
@@ -492,6 +493,10 @@ ExceptionOr<void> SourceBuffer::appendBufferInternal(const unsigned char* data,
if (isRemoved() || m_updating)
return Exception { InvalidStateError };

StringPrintStream message;
message.printf("SourceBuffer::appendBufferInternal(%p) - append size = %u, buffered = %s\n", this, size, toString(m_private->buffered()->ranges()).utf8().data());
DEBUG_LOG(LOGIDENTIFIER, message.toString());
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't DEBUG_LOG take printf-like parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. It takes a list of parameters that are converted to String and joined. The problem with that is that it doesn't know how to convert all the types. Specifically, it doesn't know how to convert the (SourceBuffer*)this (or any other pointer).
I wish there was something like a String::format() method that generated a String from a printf-like template, but I haven't found it. The closest I found was makeString(), which uses the same conversion and joining strategy that DEBUG_LOG() uses, and has the same problems.

@eocanha eocanha added the merge-queue Applied to send a pull request to merge-queue label Nov 2, 2022
https://bugs.webkit.org/show_bug.cgi?id=247122

Reviewed by Xabier Rodriguez-Calvar.

Changeset https://trac.webkit.org/changeset/241148/webkit from
https://bugs.webkit.org/show_bug.cgi?id=194348 removed line
WebKit@cd4e7eb#diff-78280e252e732edbf1f9b6517bd2f98eb1475f16fc781a5f3e2e2e6bf9b2a9beL710
, which was very useful when debugging MSE append problems.

This patch is bringing that line back and adding a similar one
to appendBufferInternal(), which will be helpful to track how
the buffered ranges evolve as the append is processed.

Original author: Pawel Lampe <pawel.lampe@gmail.com>
See: WebPlatformForEmbedded/WPEWebKit#955

* Source/WebCore/Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBufferInternal): Added log line.
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Ditto.

Canonical link: https://commits.webkit.org/256224@main
@webkit-commit-queue
Copy link
Collaborator

Committed 256224@main (e5e73c6): https://commits.webkit.org/256224@main

Reviewed commits have been landed. Closing PR #5854 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system merged commit e5e73c6 into WebKit:main Nov 2, 2022
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Media Bugs related to the HTML 5 Media elements.
Projects
None yet
4 participants