File: 0132.patch

package info (click to toggle)
thunderbird 1%3A143.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,703,968 kB
  • sloc: cpp: 7,770,492; javascript: 5,943,842; ansic: 3,918,754; python: 1,418,263; xml: 653,354; asm: 474,045; java: 183,079; sh: 111,238; makefile: 20,410; perl: 14,359; objc: 13,059; yacc: 4,583; pascal: 3,405; lex: 1,720; ruby: 999; exp: 762; sql: 715; awk: 580; php: 436; lisp: 430; sed: 69; csh: 10
file content (49 lines) | stat: -rw-r--r-- 2,148 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From: Andreas Pehrson <apehrson@mozilla.com>
Date: Tue, 28 Jan 2025 21:45:00 +0000
Subject: Bug 1938047 - Hook up VideoStreamFactory with EncoderInfo like the
 libwebrtc factory. r=webrtc-reviewers,dbaker

This is necessary for the factory to factor in the encoder's resolution
alignment requirements when calculating stream resolutions.

Differential Revision: https://phabricator.services.mozilla.com/D235702
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/8b5653392e88ccd0c2b0675c761bb22733364225
---
 video/config/video_encoder_config.h | 4 ++++
 video/video_stream_encoder.cc       | 1 +
 2 files changed, 5 insertions(+)

diff --git a/video/config/video_encoder_config.h b/video/config/video_encoder_config.h
index adb78c7706..11e7999057 100644
--- a/video/config/video_encoder_config.h
+++ b/video/config/video_encoder_config.h
@@ -23,6 +23,7 @@
 #include "api/video_codecs/scalability_mode.h"
 #include "api/video_codecs/sdp_video_format.h"
 #include "api/video_codecs/video_codec.h"
+#include "api/video_codecs/video_encoder.h"
 #include "rtc_base/ref_count.h"
 
 namespace webrtc {
@@ -151,6 +152,9 @@ class VideoEncoderConfig {
         int frame_height,
         const VideoEncoderConfig& encoder_config) = 0;
 
+    // Mozilla: Patching in necessary info our custom VideoStreamFactory will need to know.
+    virtual void SetEncoderInfo(const VideoEncoder::EncoderInfo& info) {}
+
    protected:
     ~VideoStreamFactoryInterface() override {}
   };
diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc
index e2812978af..bf710e58b6 100644
--- a/video/video_stream_encoder.cc
+++ b/video/video_stream_encoder.cc
@@ -1061,6 +1061,7 @@ void VideoStreamEncoder::ReconfigureEncoder() {
   std::vector<VideoStream> streams;
   if (encoder_config_.video_stream_factory) {
     // Note: only tests set their own EncoderStreamFactory...
+    encoder_config_.video_stream_factory->SetEncoderInfo(encoder_->GetEncoderInfo());
     streams = encoder_config_.video_stream_factory->CreateEncoderStreams(
         env_.field_trials(), last_frame_info_->width, last_frame_info_->height,
         encoder_config_);