Files
Michael Froman ee7a181293 Bug 2029247 - Vendor libwebrtc from 4a51622705
Upstream commit: https://webrtc.googlesource.com/src/+/4a5162270501ed2f93d036300bdeadc3a4d03d13
    TaskQueueFactory: Add kAudio and kVideo priorities

    This change introduces specific priority levels for audio and
    video tasks within the TaskQueueFactory to allow for better
    platform-specific thread scheduling.

    Changes:

    * New field trial WebRTC-MediaTaskQueuePriorities that activates the
      priority change.

    * New Priority Enums: Added kVideo and kAudio to
    TaskQueueFactory::Priority and corresponding kVideo and
    kAudio to ThreadPriority.

    * WebRTC platform thread implementation:
    - Video priority initially maps to high priority.
    - On Mac/iOS (GCD), both audio and video map to
      DISPATCH_QUEUE_PRIORITY_HIGH because of API limitation.

    * Task queue updates:
    - Updated the audio encoder queue to use kAudio priority.
    - Updated the video encoder & decoder, incoming video
      stream, and video frame transformer queues to use kVideo priority.

    * Queue renaming: Standardized several task queue names by
       appending "Queue" (e.g., "AudioEncoder" became "AudioEncoderQueue").

    Bug: chromium:470337728
    Change-Id: I4790990340a72a54945750c2c4e1f97314edf375
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/436580
    Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
    Commit-Queue: Markus Handell <handellm@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#46744}
2026-04-08 13:28:30 +00:00

36 lines
1.1 KiB
Diff

From: Michael Froman <mfroman@mozilla.com>
Date: Fri, 25 Jun 2021 15:12:00 -0500
Subject: Bug 1654112 - Mirror Bug 1714577 - Part 3 - Register WebRTC threads
with the Gecko Profiler. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D119412
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/d881b16dd8a6813feb5ce1516c2a7ebe0270e72d
---
rtc_base/platform_thread.cc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/rtc_base/platform_thread.cc b/rtc_base/platform_thread.cc
index 1b2e289779..62ac4844ac 100644
--- a/rtc_base/platform_thread.cc
+++ b/rtc_base/platform_thread.cc
@@ -25,6 +25,8 @@
#include "rtc_base/checks.h"
+#include "MicroGeckoProfiler.h"
+
namespace webrtc {
namespace {
@@ -196,6 +198,10 @@ PlatformThread PlatformThread::SpawnThread(
[thread_function = std::move(thread_function), name = std::string(name),
attributes]() mutable {
SetCurrentThreadName(name.c_str());
+
+ char stacktop;
+ AutoRegisterProfiler profiler(name.c_str(), &stacktop);
+
SetPriority(attributes.priority);
std::move(thread_function)();
});