webrtc_m130/api/video/video_source_interface.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

137 lines
5.7 KiB
C
Raw Normal View History

/*
* Copyright (c) 2016 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 API_VIDEO_VIDEO_SOURCE_INTERFACE_H_
#define API_VIDEO_VIDEO_SOURCE_INTERFACE_H_
#include <limits>
#include <optional>
#include <vector>
#include "api/video/video_sink_interface.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc {
// VideoSinkWants is used for notifying the source of properties a video frame
// should have when it is delivered to a certain sink.
struct RTC_EXPORT VideoSinkWants {
struct FrameSize {
FrameSize(int width, int height) : width(width), height(height) {}
FrameSize(const FrameSize&) = default;
~FrameSize() = default;
int width;
int height;
};
VideoSinkWants();
VideoSinkWants(const VideoSinkWants&);
~VideoSinkWants();
// Tells the source whether the sink wants frames with rotation applied.
// By default, any rotation must be applied by the sink.
bool rotation_applied = false;
// Tells the source that the sink only wants black frames.
bool black_frames = false;
// Tells the source the maximum number of pixels the sink wants.
int max_pixel_count = std::numeric_limits<int>::max();
// Tells the source the desired number of pixels the sinks wants. This will
// typically be used when stepping the resolution up again when conditions
// have improved after an earlier downgrade. The source should select the
// closest resolution to this pixel count, but if max_pixel_count is set, it
// still sets the absolute upper bound.
std::optional<int> target_pixel_count;
// Tells the source the maximum framerate the sink wants.
int max_framerate_fps = std::numeric_limits<int>::max();
// Tells the source that the sink wants width and height of the video frames
// to be divisible by `resolution_alignment`.
// For example: With I420, this value would be a multiple of 2.
// Note that this field is unrelated to any horizontal or vertical stride
// requirements the encoder has on the incoming video frame buffers.
int resolution_alignment = 1;
// The resolutions that sink is configured to consume. If the sink is an
// encoder this is what the encoder is configured to encode. In singlecast we
// only encode one resolution, but in simulcast and SVC this can mean multiple
// resolutions per frame.
//
// The sink is always configured to consume a subset of the
// webrtc::VideoFrame's resolution. In the case of encoding, we usually encode
// at webrtc::VideoFrame's resolution but this may not always be the case due
// to scaleResolutionDownBy or turning off simulcast or SVC layers.
//
// For example, we may capture at 720p and due to adaptation (e.g. applying
// `max_pixel_count` constraints) create webrtc::VideoFrames of size 480p, but
// if we do scaleResolutionDownBy:2 then the only resolution we end up
// encoding is 240p. In this case we still need to provide webrtc::VideoFrames
// of size 480p but we can optimize internal buffers for 240p, avoiding
// downsampling to 480p if possible.
//
// Note that the `resolutions` can change while frames are in flight and
// should only be used as a hint when constructing the webrtc::VideoFrame.
std::vector<FrameSize> resolutions;
Reland "RtpEncodingParameters::request_resolution patch 1" This reverts commit b625101da8d798c936cfd695505a5514644158b0. Reason for revert: Found problem that was specific how configuration is handled for VP9. A 1-line change in webrtc_video_engine.cc line 3715. Thanks Rasmus and great that this was tested! Original change's description: > Revert "RtpEncodingParameters::request_resolution patch 1" > > This reverts commit ef7359e679e579ccb79afacf5c42e8c6020124e2. > > Reason for revert: Breaks downstream test > > Original change's description: > > RtpEncodingParameters::request_resolution patch 1 > > > > This patch adds RtpEncodingParameters::request_resolution > > with documentation and plumming. No behaviour is changed yet. > > > > Bug: webrtc:14451 > > Change-Id: I1f4f83a312ee8c293e3d8f02b950751e62048304 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276262 > > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > > Reviewed-by: Henrik Boström <hbos@webrtc.org> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> > > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> > > Commit-Queue: Jonas Oreland <jonaso@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#38172} > > Bug: webrtc:14451 > Change-Id: I4b9590e23ec38e9e1c2e51a4600ef96b129439f2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276541 > Commit-Queue: Björn Terelius <terelius@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Reviewed-by: Jonas Oreland <jonaso@webrtc.org> > Owners-Override: Björn Terelius <terelius@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#38176} Bug: webrtc:14451 Change-Id: Ica9b74180bce22d09bf289126bb5ac137bf9eb70 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276543 Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38178}
2022-09-23 12:08:57 +02:00
Reland "Rename `requested_resolution` to `scale_resolution_down_to`." This is a reland of commit 82617ac51e7825db53451818f4d1ad52b69761fd The reason for the revert was a downstream use of `rtc::VideoSinkWants::requested_resolution`, so in this reland we don't rename this field, it's fine just to rename the one in RtpEncodingParameters for now. Original change's description: > Rename `requested_resolution` to `scale_resolution_down_to`. > > This is a pure refactor/rename CL without any changes in behavior. > > This field is called scaleResolutionDownTo in the spec and JavaScript. > Let's make C++ match to avoid confusion. > > In order not to break downstream during the transition a variable with > the old name being a pure reference to the renamed attribute is added. > This means we have to add custom constructors, but we can change this > back to "= default" when the transition is completed, which should only > be a couple of CLs away. > > Bug: webrtc:375048799 > Change-Id: If755102ccd79d46020ce5b33acd3dfcc29799e47 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366560 > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > Reviewed-by: Henrik Andreassson <henrika@webrtc.org> > Commit-Queue: Henrik Boström <hbos@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#43300} NOTRY=True Bug: webrtc:375048799 Change-Id: Ic4ee156c1d50aa36070a8d84059870791dcbbe5e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366660 Commit-Queue: Henrik Boström <hbos@webrtc.org> Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43304}
2024-10-25 09:51:44 +02:00
// This is the resolution requested by the user using RtpEncodingParameters,
// which is the maximum `scale_resolution_down_by` value of any encoding.
Revert "Rename `requested_resolution` to `scale_resolution_down_to`." This reverts commit 82617ac51e7825db53451818f4d1ad52b69761fd. Reason for revert: Break downstream projects Original change's description: > Rename `requested_resolution` to `scale_resolution_down_to`. > > This is a pure refactor/rename CL without any changes in behavior. > > This field is called scaleResolutionDownTo in the spec and JavaScript. > Let's make C++ match to avoid confusion. > > In order not to break downstream during the transition a variable with > the old name being a pure reference to the renamed attribute is added. > This means we have to add custom constructors, but we can change this > back to "= default" when the transition is completed, which should only > be a couple of CLs away. > > Bug: webrtc:375048799 > Change-Id: If755102ccd79d46020ce5b33acd3dfcc29799e47 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366560 > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > Reviewed-by: Henrik Andreassson <henrika@webrtc.org> > Commit-Queue: Henrik Boström <hbos@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#43300} Bug: webrtc:375048799 Change-Id: Ie41723a39420e12e7b5b681d3d00ccd14f66b4b1 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366642 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Florent Castelli <orphis@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#43301}
2024-10-24 14:36:27 +00:00
std::optional<FrameSize> requested_resolution;
Reland "RtpEncodingParameters::request_resolution patch 1" This reverts commit b625101da8d798c936cfd695505a5514644158b0. Reason for revert: Found problem that was specific how configuration is handled for VP9. A 1-line change in webrtc_video_engine.cc line 3715. Thanks Rasmus and great that this was tested! Original change's description: > Revert "RtpEncodingParameters::request_resolution patch 1" > > This reverts commit ef7359e679e579ccb79afacf5c42e8c6020124e2. > > Reason for revert: Breaks downstream test > > Original change's description: > > RtpEncodingParameters::request_resolution patch 1 > > > > This patch adds RtpEncodingParameters::request_resolution > > with documentation and plumming. No behaviour is changed yet. > > > > Bug: webrtc:14451 > > Change-Id: I1f4f83a312ee8c293e3d8f02b950751e62048304 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276262 > > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > > Reviewed-by: Henrik Boström <hbos@webrtc.org> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> > > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> > > Commit-Queue: Jonas Oreland <jonaso@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#38172} > > Bug: webrtc:14451 > Change-Id: I4b9590e23ec38e9e1c2e51a4600ef96b129439f2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276541 > Commit-Queue: Björn Terelius <terelius@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Reviewed-by: Jonas Oreland <jonaso@webrtc.org> > Owners-Override: Björn Terelius <terelius@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#38176} Bug: webrtc:14451 Change-Id: Ica9b74180bce22d09bf289126bb5ac137bf9eb70 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276543 Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38178}
2022-09-23 12:08:57 +02:00
// `is_active` : Is this VideoSinkWants from an encoder that is encoding any
// layer. IF YES, it will affect how the VideoAdapter will choose to
Revert "Rename `requested_resolution` to `scale_resolution_down_to`." This reverts commit 82617ac51e7825db53451818f4d1ad52b69761fd. Reason for revert: Break downstream projects Original change's description: > Rename `requested_resolution` to `scale_resolution_down_to`. > > This is a pure refactor/rename CL without any changes in behavior. > > This field is called scaleResolutionDownTo in the spec and JavaScript. > Let's make C++ match to avoid confusion. > > In order not to break downstream during the transition a variable with > the old name being a pure reference to the renamed attribute is added. > This means we have to add custom constructors, but we can change this > back to "= default" when the transition is completed, which should only > be a couple of CLs away. > > Bug: webrtc:375048799 > Change-Id: If755102ccd79d46020ce5b33acd3dfcc29799e47 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366560 > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > Reviewed-by: Henrik Andreassson <henrika@webrtc.org> > Commit-Queue: Henrik Boström <hbos@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#43300} Bug: webrtc:375048799 Change-Id: Ie41723a39420e12e7b5b681d3d00ccd14f66b4b1 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366642 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Florent Castelli <orphis@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#43301}
2024-10-24 14:36:27 +00:00
// prioritize the OnOutputFormatRequest vs. requested_resolution. IF NO,
// VideoAdapter consider this VideoSinkWants as a passive listener (e.g a
// VideoRenderer or a VideoEncoder that is not currently actively encoding).
bool is_active = false;
Reland "RtpEncodingParameters::request_resolution patch 1" This reverts commit b625101da8d798c936cfd695505a5514644158b0. Reason for revert: Found problem that was specific how configuration is handled for VP9. A 1-line change in webrtc_video_engine.cc line 3715. Thanks Rasmus and great that this was tested! Original change's description: > Revert "RtpEncodingParameters::request_resolution patch 1" > > This reverts commit ef7359e679e579ccb79afacf5c42e8c6020124e2. > > Reason for revert: Breaks downstream test > > Original change's description: > > RtpEncodingParameters::request_resolution patch 1 > > > > This patch adds RtpEncodingParameters::request_resolution > > with documentation and plumming. No behaviour is changed yet. > > > > Bug: webrtc:14451 > > Change-Id: I1f4f83a312ee8c293e3d8f02b950751e62048304 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276262 > > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > > Reviewed-by: Henrik Boström <hbos@webrtc.org> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> > > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> > > Commit-Queue: Jonas Oreland <jonaso@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#38172} > > Bug: webrtc:14451 > Change-Id: I4b9590e23ec38e9e1c2e51a4600ef96b129439f2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276541 > Commit-Queue: Björn Terelius <terelius@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Reviewed-by: Jonas Oreland <jonaso@webrtc.org> > Owners-Override: Björn Terelius <terelius@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#38176} Bug: webrtc:14451 Change-Id: Ica9b74180bce22d09bf289126bb5ac137bf9eb70 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276543 Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38178}
2022-09-23 12:08:57 +02:00
// This sub-struct contains information computed by VideoBroadcaster
// that aggregates several VideoSinkWants (and sends them to
// AdaptedVideoTrackSource).
struct Aggregates {
Reland "Rename `requested_resolution` to `scale_resolution_down_to`." This is a reland of commit 82617ac51e7825db53451818f4d1ad52b69761fd The reason for the revert was a downstream use of `rtc::VideoSinkWants::requested_resolution`, so in this reland we don't rename this field, it's fine just to rename the one in RtpEncodingParameters for now. Original change's description: > Rename `requested_resolution` to `scale_resolution_down_to`. > > This is a pure refactor/rename CL without any changes in behavior. > > This field is called scaleResolutionDownTo in the spec and JavaScript. > Let's make C++ match to avoid confusion. > > In order not to break downstream during the transition a variable with > the old name being a pure reference to the renamed attribute is added. > This means we have to add custom constructors, but we can change this > back to "= default" when the transition is completed, which should only > be a couple of CLs away. > > Bug: webrtc:375048799 > Change-Id: If755102ccd79d46020ce5b33acd3dfcc29799e47 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366560 > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > Reviewed-by: Henrik Andreassson <henrika@webrtc.org> > Commit-Queue: Henrik Boström <hbos@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#43300} NOTRY=True Bug: webrtc:375048799 Change-Id: Ic4ee156c1d50aa36070a8d84059870791dcbbe5e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366660 Commit-Queue: Henrik Boström <hbos@webrtc.org> Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43304}
2024-10-25 09:51:44 +02:00
// `any_active_without_requested_resolution` is set by VideoBroadcaster
Reland "RtpEncodingParameters::request_resolution patch 1" This reverts commit b625101da8d798c936cfd695505a5514644158b0. Reason for revert: Found problem that was specific how configuration is handled for VP9. A 1-line change in webrtc_video_engine.cc line 3715. Thanks Rasmus and great that this was tested! Original change's description: > Revert "RtpEncodingParameters::request_resolution patch 1" > > This reverts commit ef7359e679e579ccb79afacf5c42e8c6020124e2. > > Reason for revert: Breaks downstream test > > Original change's description: > > RtpEncodingParameters::request_resolution patch 1 > > > > This patch adds RtpEncodingParameters::request_resolution > > with documentation and plumming. No behaviour is changed yet. > > > > Bug: webrtc:14451 > > Change-Id: I1f4f83a312ee8c293e3d8f02b950751e62048304 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276262 > > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > > Reviewed-by: Henrik Boström <hbos@webrtc.org> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> > > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> > > Commit-Queue: Jonas Oreland <jonaso@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#38172} > > Bug: webrtc:14451 > Change-Id: I4b9590e23ec38e9e1c2e51a4600ef96b129439f2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276541 > Commit-Queue: Björn Terelius <terelius@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Reviewed-by: Jonas Oreland <jonaso@webrtc.org> > Owners-Override: Björn Terelius <terelius@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#38176} Bug: webrtc:14451 Change-Id: Ica9b74180bce22d09bf289126bb5ac137bf9eb70 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276543 Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38178}
2022-09-23 12:08:57 +02:00
// when aggregating sink wants if there exists any sink (encoder) that is
Revert "Rename `requested_resolution` to `scale_resolution_down_to`." This reverts commit 82617ac51e7825db53451818f4d1ad52b69761fd. Reason for revert: Break downstream projects Original change's description: > Rename `requested_resolution` to `scale_resolution_down_to`. > > This is a pure refactor/rename CL without any changes in behavior. > > This field is called scaleResolutionDownTo in the spec and JavaScript. > Let's make C++ match to avoid confusion. > > In order not to break downstream during the transition a variable with > the old name being a pure reference to the renamed attribute is added. > This means we have to add custom constructors, but we can change this > back to "= default" when the transition is completed, which should only > be a couple of CLs away. > > Bug: webrtc:375048799 > Change-Id: If755102ccd79d46020ce5b33acd3dfcc29799e47 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366560 > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > Reviewed-by: Henrik Andreassson <henrika@webrtc.org> > Commit-Queue: Henrik Boström <hbos@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#43300} Bug: webrtc:375048799 Change-Id: Ie41723a39420e12e7b5b681d3d00ccd14f66b4b1 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366642 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Florent Castelli <orphis@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#43301}
2024-10-24 14:36:27 +00:00
// active but has not set the `requested_resolution`, i.e is relying on
Reland "RtpEncodingParameters::request_resolution patch 1" This reverts commit b625101da8d798c936cfd695505a5514644158b0. Reason for revert: Found problem that was specific how configuration is handled for VP9. A 1-line change in webrtc_video_engine.cc line 3715. Thanks Rasmus and great that this was tested! Original change's description: > Revert "RtpEncodingParameters::request_resolution patch 1" > > This reverts commit ef7359e679e579ccb79afacf5c42e8c6020124e2. > > Reason for revert: Breaks downstream test > > Original change's description: > > RtpEncodingParameters::request_resolution patch 1 > > > > This patch adds RtpEncodingParameters::request_resolution > > with documentation and plumming. No behaviour is changed yet. > > > > Bug: webrtc:14451 > > Change-Id: I1f4f83a312ee8c293e3d8f02b950751e62048304 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276262 > > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > > Reviewed-by: Henrik Boström <hbos@webrtc.org> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> > > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> > > Commit-Queue: Jonas Oreland <jonaso@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#38172} > > Bug: webrtc:14451 > Change-Id: I4b9590e23ec38e9e1c2e51a4600ef96b129439f2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276541 > Commit-Queue: Björn Terelius <terelius@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Reviewed-by: Jonas Oreland <jonaso@webrtc.org> > Owners-Override: Björn Terelius <terelius@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#38176} Bug: webrtc:14451 Change-Id: Ica9b74180bce22d09bf289126bb5ac137bf9eb70 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276543 Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38178}
2022-09-23 12:08:57 +02:00
// OnOutputFormatRequest to handle encode resolution.
Revert "Rename `requested_resolution` to `scale_resolution_down_to`." This reverts commit 82617ac51e7825db53451818f4d1ad52b69761fd. Reason for revert: Break downstream projects Original change's description: > Rename `requested_resolution` to `scale_resolution_down_to`. > > This is a pure refactor/rename CL without any changes in behavior. > > This field is called scaleResolutionDownTo in the spec and JavaScript. > Let's make C++ match to avoid confusion. > > In order not to break downstream during the transition a variable with > the old name being a pure reference to the renamed attribute is added. > This means we have to add custom constructors, but we can change this > back to "= default" when the transition is completed, which should only > be a couple of CLs away. > > Bug: webrtc:375048799 > Change-Id: If755102ccd79d46020ce5b33acd3dfcc29799e47 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366560 > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > Reviewed-by: Henrik Andreassson <henrika@webrtc.org> > Commit-Queue: Henrik Boström <hbos@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#43300} Bug: webrtc:375048799 Change-Id: Ie41723a39420e12e7b5b681d3d00ccd14f66b4b1 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366642 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Florent Castelli <orphis@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#43301}
2024-10-24 14:36:27 +00:00
bool any_active_without_requested_resolution = false;
Reland "RtpEncodingParameters::request_resolution patch 1" This reverts commit b625101da8d798c936cfd695505a5514644158b0. Reason for revert: Found problem that was specific how configuration is handled for VP9. A 1-line change in webrtc_video_engine.cc line 3715. Thanks Rasmus and great that this was tested! Original change's description: > Revert "RtpEncodingParameters::request_resolution patch 1" > > This reverts commit ef7359e679e579ccb79afacf5c42e8c6020124e2. > > Reason for revert: Breaks downstream test > > Original change's description: > > RtpEncodingParameters::request_resolution patch 1 > > > > This patch adds RtpEncodingParameters::request_resolution > > with documentation and plumming. No behaviour is changed yet. > > > > Bug: webrtc:14451 > > Change-Id: I1f4f83a312ee8c293e3d8f02b950751e62048304 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276262 > > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > > Reviewed-by: Henrik Boström <hbos@webrtc.org> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> > > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> > > Commit-Queue: Jonas Oreland <jonaso@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#38172} > > Bug: webrtc:14451 > Change-Id: I4b9590e23ec38e9e1c2e51a4600ef96b129439f2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276541 > Commit-Queue: Björn Terelius <terelius@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Reviewed-by: Jonas Oreland <jonaso@webrtc.org> > Owners-Override: Björn Terelius <terelius@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#38176} Bug: webrtc:14451 Change-Id: Ica9b74180bce22d09bf289126bb5ac137bf9eb70 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276543 Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38178}
2022-09-23 12:08:57 +02:00
};
std::optional<Aggregates> aggregates;
};
inline bool operator==(const VideoSinkWants::FrameSize& a,
const VideoSinkWants::FrameSize& b) {
return a.width == b.width && a.height == b.height;
}
Reland "RtpEncodingParameters::request_resolution patch 1" This reverts commit b625101da8d798c936cfd695505a5514644158b0. Reason for revert: Found problem that was specific how configuration is handled for VP9. A 1-line change in webrtc_video_engine.cc line 3715. Thanks Rasmus and great that this was tested! Original change's description: > Revert "RtpEncodingParameters::request_resolution patch 1" > > This reverts commit ef7359e679e579ccb79afacf5c42e8c6020124e2. > > Reason for revert: Breaks downstream test > > Original change's description: > > RtpEncodingParameters::request_resolution patch 1 > > > > This patch adds RtpEncodingParameters::request_resolution > > with documentation and plumming. No behaviour is changed yet. > > > > Bug: webrtc:14451 > > Change-Id: I1f4f83a312ee8c293e3d8f02b950751e62048304 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276262 > > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > > Reviewed-by: Henrik Boström <hbos@webrtc.org> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> > > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> > > Commit-Queue: Jonas Oreland <jonaso@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#38172} > > Bug: webrtc:14451 > Change-Id: I4b9590e23ec38e9e1c2e51a4600ef96b129439f2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276541 > Commit-Queue: Björn Terelius <terelius@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Reviewed-by: Jonas Oreland <jonaso@webrtc.org> > Owners-Override: Björn Terelius <terelius@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#38176} Bug: webrtc:14451 Change-Id: Ica9b74180bce22d09bf289126bb5ac137bf9eb70 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276543 Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38178}
2022-09-23 12:08:57 +02:00
inline bool operator!=(const VideoSinkWants::FrameSize& a,
const VideoSinkWants::FrameSize& b) {
return !(a == b);
}
template <typename VideoFrameT>
class VideoSourceInterface {
public:
virtual ~VideoSourceInterface() = default;
virtual void AddOrUpdateSink(VideoSinkInterface<VideoFrameT>* sink,
const VideoSinkWants& wants) = 0;
// RemoveSink must guarantee that at the time the method returns,
// there is no current and no future calls to VideoSinkInterface::OnFrame.
virtual void RemoveSink(VideoSinkInterface<VideoFrameT>* sink) = 0;
// Request underlying source to capture a new frame.
// TODO(crbug/1255737): make pure virtual once downstream projects adapt.
virtual void RequestRefreshFrame() {}
};
} // namespace rtc
#endif // API_VIDEO_VIDEO_SOURCE_INTERFACE_H_