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
Conversation
EWS run on current version of this PR (hash 2f68c2c) |
@@ -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()); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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
2f68c2c
to
e5e73c6
Compare
Committed 256224@main (e5e73c6): https://commits.webkit.org/256224@main Reviewed commits have been landed. Closing PR #5854 and removing active labels. |
e5e73c6
2f68c2c