tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 02112e2b30efe7dd22204b91636fe66f05fe32ae
parent 9fb52632dd9c2ba20ead6294bf7e94e5d85b3f46
Author: Michael Froman <mfroman@mozilla.com>
Date:   Wed,  8 Oct 2025 22:02:14 -0500

Bug 1993083 - Vendor libwebrtc from 5004d269dc

Upstream commit: https://webrtc.googlesource.com/src/+/5004d269dc2c2ade1a1a9a1253457e49796c0d40
    Add file based encoder, which encodes a video to a file.

    This is a preparation to be able to use FFmpeg and hence, the hardware encoder and decoders.

    Bug: webrtc:358039777
    Change-Id: I0bf57b495fc3a9efbe23ca037ff41845950764ab
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/398120
    Reviewed-by: Erik Språng <sprang@webrtc.org>
    Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
    Reviewed-by: Fanny Linderborg <linderborg@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45093}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/video/corruption_detection/evaluation/BUILD.gn | 10++++++++++
Athird_party/libwebrtc/video/corruption_detection/evaluation/file_based_encoder.h | 42++++++++++++++++++++++++++++++++++++++++++
3 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T03:01:02.231323+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T03:02:06.197963+00:00. # base of lastest vendoring -d72cc2ffde +5004d269dc diff --git a/third_party/libwebrtc/video/corruption_detection/evaluation/BUILD.gn b/third_party/libwebrtc/video/corruption_detection/evaluation/BUILD.gn @@ -8,6 +8,16 @@ import("../../../webrtc.gni") +rtc_library("file_based_encoder") { + testonly = true + sources = [ "file_based_encoder.h" ] + deps = [ + ":test_clip", + "../../../api/units:data_rate", + "../../../api/video:video_frame", + ] +} + rtc_library("picture_pair_provider") { testonly = true sources = [ "picture_pair_provider.h" ] diff --git a/third_party/libwebrtc/video/corruption_detection/evaluation/file_based_encoder.h b/third_party/libwebrtc/video/corruption_detection/evaluation/file_based_encoder.h @@ -0,0 +1,42 @@ +/* + * Copyright 2025 The WebRTC project authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef VIDEO_CORRUPTION_DETECTION_EVALUATION_FILE_BASED_ENCODER_H_ +#define VIDEO_CORRUPTION_DETECTION_EVALUATION_FILE_BASED_ENCODER_H_ + +#include <string> + +#include "api/units/data_rate.h" +#include "api/video/video_codec_type.h" +#include "video/corruption_detection/evaluation/test_clip.h" + +namespace webrtc { + +// An encoder that encodes a raw video clip specified by `clip` given in a Y4M +// or YUV file. The user cannot reach individual frames. However, the user +// should be able to reach the encoded file from the encoded file path returned +// by `Encode` if successful. +class FileBasedEncoder { + public: + FileBasedEncoder() = default; + virtual ~FileBasedEncoder() = default; + + // Encodes the raw video clip specified by `clip` given in a Y4M or YUV file. + // Creates an encoded file where the encoded frames are stored. The encoded + // path is returned if successful. + virtual std::string Encode(const TestClip& clip, DataRate bitrate) = 0; + + // Returns the used codec for encoding. + virtual VideoCodecType GetCodec() const = 0; +}; + +} // namespace webrtc + +#endif // VIDEO_CORRUPTION_DETECTION_EVALUATION_FILE_BASED_ENCODER_H_