Commit graph

17 commits

Author SHA1 Message Date
Jonas Oreland
1d3452f31b RequestedResolution - Bug fix
Change default value of is_active to false,
this means that VideoRenderer or other VideoSinks
added with default rtc::VideoSinkWants() does not
block usage of RequestedResolution, e.g JNI_VideoTrack_AddSink.

This problem occurs when attaching a VideoRenderer directly to
the sending VideoTrack (which is a great solution!). But the
VideoRenderer is "passive" and should not block adaptations
from RequestedResolution.

Bug: webrtc:14451
Change-Id: I2ab02596245c7b82bf94fe86f8788f458c7ea286
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305024
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40105}
2023-05-22 13:58:50 +00:00
Jonas Oreland
43f0f29d30 RtpEncodingParameters::request_resolution patch 4
This patch

1) modifies VideoAdapter to use requested_resolution
instead on OnOutputFormatRequest, iff there are no active encoders
that is not using requested_resolution (i.e all "old" encoder(s) are
not active).

2) modifies VideoBroadcaster to not broadcast wants from
encoders that are not active (iff there is an active encoder
using requested_resolution).

3) fixes a bug in encoder_stream_factor in that the
requested_resolution was not propagated to return value
(must have been lost in merge?).

Bug: webrtc:14451
Change-Id: I00e0907f0fe9329141ed169576fa46cdc5384886
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278360
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38323}
2022-10-07 14:57:29 +00:00
Jonas Oreland
0deda15c96 Reland "RtpEncodingParameters::request_resolution patch 1"
This reverts commit b625101da8.

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 ef7359e679.
>
> 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 11:48:19 +00:00
Björn Terelius
b625101da8 Revert "RtpEncodingParameters::request_resolution patch 1"
This reverts commit ef7359e679.

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}
2022-09-23 08:27:47 +00:00
Jonas Oreland
ef7359e679 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}
2022-09-22 14:16:20 +00:00
Markus Handell
2e0f4f0f37 ZeroHertzAdapterMode: handle key frame requests.
Under zero-hertz mode, provided that a frame arrived to the
VideoStreamEncoder, the receiver may experience up to a second
between incoming frames. This results in key frame requests getting
serviced with that delay, which is undesired.

What's worse is also the fact that if no frame ever arrived to the
VideoStreamEncoder, it will not service the keyframe requests at all
until the first frame comes.

This change introduces VideoSourceInterface::RequestRefreshFrame
which results in a refresh frame being sent from complying sources.
The method is used under zero-hertz mode from the VideoStreamEncoder
when frames didn't arrive to it yet (with changes to the zero-hertz
adapter).

With this change, when the frame adapter has received at least one
frame, it will conditionally repeat the last frame in response to the
key frame request.

go/rtc-0hz-present

Bug: chromium:1255737
Change-Id: I6f97813b3a938747357d45e5dda54f759129b44d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/242361
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35562}
2021-12-21 19:52:56 +00:00
Artem Titov
0e61fdd27c Use backticks not vertical bars to denote variables in comments for /api
Bug: webrtc:12338
Change-Id: Ib97b2c3d64dbd895f261ffa76a2e885bd934a87f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226940
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34554}
2021-07-26 18:27:34 +00:00
Henrik Boström
1124ed1ab2 Communicate encoder resolutions via rtc::VideoSinkWants.
This will allow us to optimize the internal buffers of
webrtc::VideoFrame for the resolution(s) that we actually want to
encode.

Bug: webrtc:12469, chromium:1157072
Change-Id: If378b52b5e35aa9a9800c1f7dfe189437ce43253
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208540
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33342}
2021-02-25 11:10:55 +00:00
Rasmus Brandt
5cad55b240 Signal requested resolution alignment requirements from sinks to sources.
Bug: webrtc:11218
Change-Id: I593b0515ea389bece472234a3c4082ccc5321ea5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162400
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30113}
2019-12-19 10:39:04 +00:00
Ilya Nikolaevskiy
871e144132 Revert "Reland "Partial frame capture API part 1""
This reverts commit 12e5d392cc.

Reason for revert: Partial Capture API is not needed, according to new info from the Chrome team.

Original change's description:
> Reland "Partial frame capture API part 1"
>
> Reland with fixes to undefined behavior.
>
> Define new optional struct in VideoFrame to signal that the frame is a
> changed part of a whole picture and add a flag to signal that partial
> update may be issued by the VideoFrame source.
>
> Also, fix too strict assumptions in FrameBuffers PasteFrom methods.
> Also, add ability to set a new buffer in video frame.
>
> Original Reviewed-on: https://webrtc-review.googlesource.com/c/120405
>
> Bug: webrtc:10152
> Change-Id: I85790dfc7cec2f23abfe9d6cd18dc76a0c343bc0
> Reviewed-on: https://webrtc-review.googlesource.com/c/120780
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26493}

TBR=ilnik@webrtc.org,nisse@webrtc.org,sprang@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:10152
Change-Id: I1c1dd51a8b5a09f743f212336beb01447f60f26e
Reviewed-on: https://webrtc-review.googlesource.com/c/122092
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26638}
2019-02-11 14:20:37 +00:00
Ilya Nikolaevskiy
12e5d392cc Reland "Partial frame capture API part 1"
Reland with fixes to undefined behavior.

Define new optional struct in VideoFrame to signal that the frame is a
changed part of a whole picture and add a flag to signal that partial
update may be issued by the VideoFrame source.

Also, fix too strict assumptions in FrameBuffers PasteFrom methods.
Also, add ability to set a new buffer in video frame.

Original Reviewed-on: https://webrtc-review.googlesource.com/c/120405

Bug: webrtc:10152
Change-Id: I85790dfc7cec2f23abfe9d6cd18dc76a0c343bc0
Reviewed-on: https://webrtc-review.googlesource.com/c/120780
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26493}
2019-01-31 13:03:31 +00:00
Ilya Nikolaevskiy
8102a1a8ea Revert "Partial frame capture API part 1"
This reverts commit 8a21e1c9c9.

Reason for revert: breaks buildbots

Original change's description:
> Partial frame capture API part 1
> 
> Define new optional struct in VideoFrame to signal that the frame is a
> changed part of a whole picture and add a flag to signal that partial
> update may be issued by the VideoFrame source.
> 
> Also, fix too strict assumptions in FrameBuffers PasteFrom methods.
> Also, add ability to set a new buffer in video frame.
> 
> 
> Bug: webrtc:10152
> Change-Id: Ie0da418fd60bc7a34334329292e0b860ec388788
> Reviewed-on: https://webrtc-review.googlesource.com/c/120405
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26489}

TBR=ilnik@webrtc.org,nisse@webrtc.org,sprang@webrtc.org

Change-Id: Ibf61f28e529a444882962b984474d4849bb44e4b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10152
Reviewed-on: https://webrtc-review.googlesource.com/c/120760
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26490}
2019-01-31 11:57:37 +00:00
Ilya Nikolaevskiy
8a21e1c9c9 Partial frame capture API part 1
Define new optional struct in VideoFrame to signal that the frame is a
changed part of a whole picture and add a flag to signal that partial
update may be issued by the VideoFrame source.

Also, fix too strict assumptions in FrameBuffers PasteFrom methods.
Also, add ability to set a new buffer in video frame.


Bug: webrtc:10152
Change-Id: Ie0da418fd60bc7a34334329292e0b860ec388788
Reviewed-on: https://webrtc-review.googlesource.com/c/120405
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26489}
2019-01-31 11:34:15 +00:00
Niels Möller
1c931c4f00 Use VideoSourceInterface for owning test video sources
CallTest, VideoQualityTest and VideoAnalyzer used test::TestVideoCapturer
as an interface for video sources. Change to use VideoSourceInterface instead,
since that's all they need.

This is a preparation for making test::VcmCapturer usable as a
VideoTrackSource, and replace use of cricket::VideoCapturer in example code.

Bug: webrtc:6353
Change-Id: I445f5f6f9b7342230b89f53a5722df9c9e92834f
Reviewed-on: https://webrtc-review.googlesource.com/c/114881
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26047}
2018-12-18 15:43:55 +00:00
Mirko Bonadei
ac19414512 Export symbols needed by the Chromium component build (part 6).
This CL uses RTC_EXPORT (defined in rtc_base/system/rtc_export.h)
to mark WebRTC symbols as visible from a shared library, this doesn't
mean these symbols are part of the public API (please continue to refer
to [1] for info about what is considered public WebRTC API).

[1] - https://webrtc.googlesource.com/src/+/HEAD/native-api.md

Bug: webrtc:9419
Change-Id: I67a4d016a11deca5ac5459826741dd2d3f7931d5
Reviewed-on: https://webrtc-review.googlesource.com/c/107400
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25298}
2018-10-23 06:48:51 +00:00
Danil Chapovalov
0bc58cf876 Replace rtc::Optional with absl::optional in api
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated by running script with parameter 'api'
Then undo changes to optional target itself and optional_unittests

find $@ -type f \( -name \*.h -o -name \*.cc \) \
-exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+

find $@ -type f -name BUILD.gn \
-exec sed -r -i 's|"[\./api]*:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+;

git cl format

Bug: webrtc:9078
Change-Id: I44093da213369d6a502e33792c694f620f53b779
Reviewed-on: https://webrtc-review.googlesource.com/84621
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23707}
2018-06-21 12:50:03 +00:00
Niels Möller
0327c2ddc1 Move VideoStreamEncoderInterface to api/.
Bug: webrtc:8830
Change-Id: I17908b4ef6a043acf22e2110b9672012d5fa7fc0
Reviewed-on: https://webrtc-review.googlesource.com/74481
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23334}
2018-05-21 19:50:37 +00:00