File: 0142.patch

package info (click to toggle)
firefox-esr 140.5.0esr-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,538,920 kB
  • sloc: cpp: 7,381,527; javascript: 6,388,905; ansic: 3,710,087; python: 1,393,776; xml: 628,165; asm: 426,916; java: 184,004; sh: 65,744; makefile: 19,302; objc: 13,059; perl: 12,912; yacc: 4,583; cs: 3,846; pascal: 3,352; lex: 1,720; ruby: 1,226; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (49 lines) | stat: -rw-r--r-- 2,148 bytes parent folder | download | duplicates (9)
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 59ee866f53..b062ca6563 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 9db694119e..621b3db3d2 100644
--- a/video/video_stream_encoder.cc
+++ b/video/video_stream_encoder.cc
@@ -1030,6 +1030,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_);