Skip to content

Commit

Permalink
Add logging when MediaStreamTrackProcessor drops a video frame
Browse files Browse the repository at this point in the history
rdar://121832444
https://bugs.webkit.org/show_bug.cgi?id=268276

Reviewed by Eric Carlson.

* Source/WebCore/Modules/mediastream/MediaStreamTrackProcessor.cpp:
(WebCore::MediaStreamTrackProcessor::VideoFrameObserver::videoFrameAvailable):

Canonical link: https://commits.webkit.org/273662@main
  • Loading branch information
youennf committed Jan 29, 2024
1 parent 56d6a84 commit 9c4f469
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#if ENABLE(MEDIA_STREAM) && ENABLE(WEB_CODECS)

#include "JSWebCodecsVideoFrame.h"
#include "Logging.h"
#include "ReadableStream.h"
#include <wtf/Seconds.h>

Expand Down Expand Up @@ -169,8 +170,10 @@ void MediaStreamTrackProcessor::VideoFrameObserver::videoFrameAvailable(VideoFra
{
Locker lock(m_videoFramesLock);
m_videoFrames.append(frame);
if (m_videoFrames.size() > m_maxVideoFramesCount)
if (m_videoFrames.size() > m_maxVideoFramesCount) {
RELEASE_LOG_DEBUG(WebRTC, "MediaStreamTrackProcessor::VideoFrameObserver::videoFrameAvailable buffer is full");
m_videoFrames.takeFirst();
}
}
ScriptExecutionContext::postTaskTo(m_contextIdentifier, [processor = m_processor] (auto&) mutable {
if (RefPtr protectedProcessor = processor.get())
Expand Down

0 comments on commit 9c4f469

Please sign in to comment.