Bug 1867099 - Vendor libwebrtc from ba97eec127

Upstream commit: https://webrtc.googlesource.com/src/+/ba97eec1275dc6d5a867e644283d24264703f2db
    Add string_view overload for Wrap method

    FileWrapper API is WebRTC private, so exposing absl::string_view overload for thrid-party users.

    Bug: b/301228802
    Change-Id: Id81775c8078e61eafe9bee53a4cba6ac476b11d6
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321460
    Commit-Queue: Artem Titov <titovartem@webrtc.org>
    Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#40798}
This commit is contained in:
Michael Froman 2023-11-29 17:10:05 -06:00
parent 6f05fb2c4e
commit d27f74365e
4 changed files with 21 additions and 0 deletions

View File

@ -26109,3 +26109,6 @@ bbf27e0081
# MOZ_LIBWEBRTC_SRC=/home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
b4d4bbcebd
# MOZ_LIBWEBRTC_SRC=/home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
ba97eec127

View File

@ -17430,3 +17430,5 @@ libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc
libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2023-11-29T23:07:25.113950.
# ./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 2023-11-29T23:08:50.681670.
# ./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 2023-11-29T23:09:52.300597.

View File

@ -10,13 +10,20 @@
#include "modules/video_coding/utility/ivf_file_writer.h"
#include <cstddef>
#include <cstdint>
#include <memory>
#include <utility>
#include "absl/strings/string_view.h"
#include "api/video/encoded_image.h"
#include "api/video/video_codec_type.h"
#include "api/video_codecs/video_codec.h"
#include "modules/rtp_rtcp/source/byte_io.h"
#include "modules/video_coding/utility/ivf_defines.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/system/file_wrapper.h"
// TODO(palmkvist): make logging more informative in the absence of a file name
// (or get one)
@ -53,6 +60,12 @@ std::unique_ptr<IvfFileWriter> IvfFileWriter::Wrap(FileWrapper file,
new IvfFileWriter(std::move(file), byte_limit));
}
std::unique_ptr<IvfFileWriter> IvfFileWriter::Wrap(absl::string_view filename,
size_t byte_limit) {
return std::unique_ptr<IvfFileWriter>(
new IvfFileWriter(FileWrapper::OpenWriteOnly(filename), byte_limit));
}
bool IvfFileWriter::WriteHeader() {
if (!file_.Rewind()) {
RTC_LOG(LS_WARNING) << "Unable to rewind ivf output file.";

View File

@ -16,6 +16,7 @@
#include <memory>
#include "absl/strings/string_view.h"
#include "api/video/encoded_image.h"
#include "api/video/video_codec_type.h"
#include "rtc_base/numerics/sequence_number_unwrapper.h"
@ -31,6 +32,8 @@ class IvfFileWriter {
// will fail. A `byte_limit` of 0 is equivalent to no limit.
static std::unique_ptr<IvfFileWriter> Wrap(FileWrapper file,
size_t byte_limit);
static std::unique_ptr<IvfFileWriter> Wrap(absl::string_view filename,
size_t byte_limit);
~IvfFileWriter();
IvfFileWriter(const IvfFileWriter&) = delete;