Commit graph

110 commits

Author SHA1 Message Date
Danil Chapovalov
6f1d4e74cc Update FakeVideoEncoderFactory to rely on webrtc::Environment
Bug: webrtc:15860
Change-Id: I6bc2246892400a0656c672b122455040488be3a8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343788
Reviewed-by: Erik Språng <sprang@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41964}
2024-03-25 18:52:03 +00:00
Per K
0fa90887c5 Deprecate VideoFrame::timestamp() and set_timestamp
Instead, add rtp_timestamp and set_rtp_timestamp.

Bug: webrtc:13756
Change-Id: Ic4266394003e0d49e525d71f4d830f5e518299cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342781
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41894}
2024-03-13 11:08:37 +00:00
Danil Chapovalov
2725317b1f Propagate Environment through SimulcastEncoderAdapter when provided
Bug: webrtc:15860
Change-Id: Iabd7752ada2f8f774de1e2adc02a4157004bf43c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342720
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41893}
2024-03-13 10:32:31 +00:00
Philipp Hancke
bbff58d935 Introduce "well-known" SdpVideoFormat codecs
describing video codecs with their parameters as static members of SdpVideoFormat:
  static const SdpVideoFormat VP8();
  static const SdpVideoFormat H264();
  static const SdpVideoFormat VP9Profile0();
  static const SdpVideoFormat VP9Profile1();
  static const SdpVideoFormat VP9Profile2();
  static const SdpVideoFormat VP9Profile3();
  static const SdpVideoFormat AV1Profile0();
  static const SdpVideoFormat AV1Profile1();
This removes the need to craft instances of these by hand.

BUG=webrtc:15703

Change-Id: I2171e08b48ec98f18424f53f3b5d6d148130532e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337441
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41833}
2024-02-28 06:57:10 +00:00
Danil Chapovalov
4f63ea423f Deprecate VP8Decoder::Create
Migrate remaining usages inside webrtc (all are test only) to CreateVp8Decoder

Bug: webrtc:15791
Change-Id: I6a8317a8761953208ba746ac785fa1606217e6f5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340300
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41792}
2024-02-23 13:31:53 +00:00
Philipp Hancke
de17252e8e Reland "Unify access to SDP codec parameters"
This is a reland of commit 63d03f586b

Original change's description:
> Unify access to SDP codec parameters
>
> which come from the a=fmtp:<pt> lines in the SDP and were used as either
>   std::map<std::string, std:string>
> with three aliases,
>   cricket::CodecParameterMap
>   SdpAudioFormat::Parameters
>   SdpVideoFormat::Parameters
>
> Use webrtc::CodecParameterMap in all places.
>
> BUG=None
>
> Change-Id: If47692bde7347834c349c6539b43309d8770e67b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#41375}

Bug: None
Change-Id: I5f8f45688df232eb37b12fa3e56a893a1c754e17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331402
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41467}
2024-01-03 12:03:11 +00:00
Mirko Bonadei
6c9c958c69 Revert "Unify access to SDP codec parameters"
This reverts commit 63d03f586b.

Reason for revert: Breaks downstream project (not backwards compatible API change)

Original change's description:
> Unify access to SDP codec parameters
>
> which come from the a=fmtp:<pt> lines in the SDP and were used as either
>   std::map<std::string, std:string>
> with three aliases,
>   cricket::CodecParameterMap
>   SdpAudioFormat::Parameters
>   SdpVideoFormat::Parameters
>
> Use webrtc::CodecParameterMap in all places.
>
> BUG=None
>
> Change-Id: If47692bde7347834c349c6539b43309d8770e67b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#41375}

Bug: None
Change-Id: I841735d98533d3b66850b9cfcf7ee0a99ddde078
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331400
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#41377}
2023-12-13 16:28:44 +00:00
Philipp Hancke
63d03f586b Unify access to SDP codec parameters
which come from the a=fmtp:<pt> lines in the SDP and were used as either
  std::map<std::string, std:string>
with three aliases,
  cricket::CodecParameterMap
  SdpAudioFormat::Parameters
  SdpVideoFormat::Parameters

Use webrtc::CodecParameterMap in all places.

BUG=None

Change-Id: If47692bde7347834c349c6539b43309d8770e67b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41375}
2023-12-13 14:22:15 +00:00
Jeremy Leconte
1a8d5292c2 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 19/inf
Convert most field trials used in PCLF tests.

Change-Id: I26c0c4b1164bb0870aae1a488942cde888cb459d
Bug: webrtc:10335
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/322703
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40909}
2023-10-11 11:09:35 +00:00
Danil Chapovalov
9c58483b5a Rename EncodedImage property Timetamp to RtpTimestamp
To avoid name collision with Timestamp type,
To avoid confusion with capture time represented as Timestamp

Bug: webrtc:9378
Change-Id: I8438a9cf4316e5f81d98c2af9dc9454c21c78e70
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320601
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40796}
2023-09-24 20:06:48 +00:00
Henrik Boström
880f1d5ab9 Update simulcast_encoder_adapter_unittest.cc to use absl::optional<>.
Instead of int and magic value -1.

Bug: webrtc:14884
Change-Id: Ieec148a66956aa763c7c5cd2c9519e36a4bea01b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293346
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39324}
2023-02-16 08:35:53 +00:00
Henrik Boström
2e540a28c0 Introduce EncodedImage.SimulcastIndex().
As part of go/unblocking-vp9-simulcast (Step 1), EncodedImage is being
upgraded to be able to differentiate between what is a simulcast index
and what is a spatial index.

In order not to break existing code assuming that "if codec != VP9,
SpatialIndex() is the simulcast index", SimulcastIndex() has fallback
logic to return the value of spatial_index_ in the event that
SetSimulcastIndex() has not been called. This allows migrating external
code from (Set)SpatialIndex() to (Set)SimulcastIndex(). During this
intermediate time, codec gates are still necessary in some places of
the code, see TODOs added.

In a follow-up CL, after having fixed dependencies, we'll be able to
remove the fallback logic and rely on SimulcastIndex() and
SpatialIndex() actually being the advertised index and "if codec..."
hacks will be a thing of the past!

Bug: webrtc:14884
Change-Id: I70095c091d0ce2336640451150888a3c3841df80
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293343
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39318}
2023-02-15 15:02:57 +00:00
Chunbo Hua
46ad25119c Make requested_resolution_alignment of webrtc::EncoderInfo as uint32_t.
At the same time, proper names of some parameters are refactored in SimulcastEncoderAdapter.

Bug: None
Change-Id: Ia036e3f362d1394e90aa26b79953c1ffe75e2fe0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284961
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Chunbo Hua <chunbo.hua@intel.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38870}
2022-12-12 06:02:59 +00:00
Philipp Hancke
e862da376f generatekeyframe: allow simulcast_encoder_adapter to request per-layer
in the case of separate encoders.

drive-by: add helper function to expect per-layer keyframes

BUG=chromium:1354101

Change-Id: Ib645a621add899f035bea319f035dcb0b2617510
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281002
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#38734}
2022-11-25 12:12:05 +00:00
Erik Språng
fcc3d9aea4 Populate ScalabilityMode of subcodecs in SimulcastEncoderAdapter.
Bug: webrtc:14511
Change-Id: I2c20ececa7c1e20c7c1e7be4ce7196edf702c833
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277623
Auto-Submit: Erik Språng <sprang@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38265}
2022-10-01 17:59:54 +00:00
Niels Möller
c8152fe4a8 Update/delete old TODOs
Bug: webrtc:10198
Change-Id: I226768c2a6bd97ffcd0638e5bc6a1c286b71815f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267704
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37435}
2022-07-05 09:44:53 +00:00
Niels Möller
807328fec7 Move frame drop config to VideoCodec and VideoEncoderConfig.
Intend to delete corresponding codec-specific settings in a followup.

Bug: webrtc:6883
Change-Id: I78ab07729a5aee1055f80d39d8f7289beb6721e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262244
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36882}
2022-05-13 13:40:14 +00:00
Peter Hanspers
ac2dd12d84 Don't override resolution bitrate limits in singlecast mode if they're already set.
Bug: webrtc:13872
Change-Id: I966c744a13cf74336d62d96c72eb37ebf96de71f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256803
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Peter Hanspers <peterhanspers@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36342}
2022-03-25 15:05:16 +00:00
“Michael
3147e29c4e Refactor encoder-complexity param in VideoCodec w/backward compatibility
Move complexity parameter to the main VideoCodec class to enable
additional video codecs to use the parameter without creating a new
codec-specific structure.

Bug: webrtc:13694
Change-Id: Icb7cf640b178875d799f39ade8b5084e3222bb1c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251921
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Michael Horowitz <mhoro@google.com>
Cr-Commit-Position: refs/heads/main@{#36040}
2022-02-21 19:40:44 +00:00
Niels Möller
13d163654a Delete support for has_internal_source
Bug: webrtc:12875
Change-Id: I9683e71e1fe5b24802033ffcb32a531ca685fc6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179220
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35353}
2021-11-16 11:29:40 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Sergey Silkin
9b2a7461f0 Use fallback encoder if primary can't be created
In case if primary encoder can't be instantiated (max number of
instances has reached, for example), use fallback encoder.

Bug: none
Change-Id: I477bdeb7af4dcce50e36b1804ffc6ad2ab004dfd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234500
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35161}
2021-10-07 11:42:26 +00:00
Artem Titov
cfea2182f8 Use backticks not vertical bars to denote variables in comments
Bug: webrtc:12338
Change-Id: I89c8b3a328d04203177522cbdfd9e606fd4bce4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228246
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34696}
2021-08-10 10:40:03 +00:00
Qiu Jianlin
b54cfdebfe Add optional is_qp_trusted property for EncoderInfo.
Some hardware H.264 encoders does not place average QP delta in
slice_qp_delta field. Adding an optional flag in EncoderInfo to notify
quality scaler about this.

Bug: webrtc:12942
Change-Id: I3ee29c5ae9bd7bb34d26eba7e6bede3798ca44b4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226921
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34627}
2021-08-02 13:49:21 +00:00
Artem Titov
37f664f6d5 Use backticks not vertical bars to denote variables in comments for /media
Bug: webrtc:12338
Change-Id: Ia800a4017ede1f647b36f809ef3c5b37a2616fdd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226949
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34567}
2021-07-27 17:11:33 +00:00
Ilya Nikolaevskiy
c98aebbbef Change how alignment requirements are processed
Software fallback wrapper now reports least common multiple of requirements
for two encoders.

SimulcastEncoderAdapter queries actual encoder before InitEncode call
and requests alignment for all layers if simulcast is not supported by
any of the encoders.

Bug: chromium:1084702
Change-Id: Iaed8190737125d447036b6c664b863be72556a5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225881
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34466}
2021-07-13 16:49:13 +00:00
Tomas Gunnarsson
c1d589146b Replace new rtc::RefCountedObject with rtc::make_ref_counted in a few files
Bug: webrtc:12701
Change-Id: Ie50225374f811424faf20caf4cf454b2fd1c4dc9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215930
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33818}
2021-04-23 12:04:39 +00:00
Sergey Silkin
0e3cb9fb20 Create and initialize encoders only for active streams
Bug: webrtc:12407
Change-Id: Id30fcb84dcbfffa30c7a34b15564ab5049cec96c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204066
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33141}
2021-02-03 09:25:30 +00:00
Åsa Persson
a7e34d33fe Add resolution_bitrate_limits to EncoderInfo field trial.
Added class EncoderInfoSettings for parsing settings.
Added use of class to SimulcastEncoderAdapter.

Bug: none
Change-Id: I8182b2ab43f0c330ebdf077e9f7cbc79247da90e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202246
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33050}
2021-01-21 07:53:57 +00:00
Åsa Persson
2397b6e75d SimulcastEncoderAdapter: Add field trial for EncoderInfo settings.
Allowed settings:
- requested_resolution_alignment
- apply_alignment_to_all_simulcast_layers


Bug: none
Change-Id: Ic4c733fd1134b9d097a2d19963eef1b676058f49
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201626
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33010}
2021-01-16 13:04:59 +00:00
Åsa Persson
c5a74ffba4 Add support so requested resolution alignment also apply to scaled layers.
Bug: webrtc:11872
Change-Id: I7f904e2765330ee93270b66b0102ce57f336f9a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181883
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32146}
2020-09-21 09:23:22 +00:00
Danil Chapovalov
2549f174b5 Remove RTPFragmentationHeader creation and propagation through webrtc
Bug: webrtc:6471
Change-Id: I5cb1e10088aaecb5981888082b87ae9957bbaaef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181541
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31955}
2020-08-17 16:37:33 +00:00
Niels Möller
5401bad701 Prepare for deleting VideoCodec::plType
Deletes all webrtc usage of this member. Next step is to delete
any downstream references, and when that's done, the member can be
deleted.

Bug: None
Change-Id: I3f3a94a063dccf56468a1069653efd3809875b01
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181201
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31911}
2020-08-11 14:20:59 +00:00
Niels Möller
2b781bf908 Deprecate write-only member CodecInfo::is_hardware_accelerated
This member of the CodecInfo struct was set in several places, but not
used for anything. To aid deletion, this cl defines a default implementation
of VideoEncoderFactory::QueryVideoEncoder.

The next step is to delete almost all downstream implementations of that method,
since the only classes that have to implement it are the few factories that
produce "internal source" encoders, e.g., for Chromium remoting.

Bug: None
Change-Id: I1f0dbf0d302933004ebdc779460cb2cb3a894e02
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179520
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31844}
2020-08-04 07:56:49 +00:00
Niels Möller
e51d6ac5d2 Fix override declarations and delete related TODOs
Bug: webrtc:10198, chromium:428099
Change-Id: Ic7b0dd3c58c3daa5ade4d2c503b77a51b29c716e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179380
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31739}
2020-07-16 07:42:02 +00:00
Danil Chapovalov
f2c0f15282 In media/ and modules/video_coding replace mock macros with unified MOCK_METHOD macro
Bug: webrtc:11564
Change-Id: I5c7f5dc99e62619403ed726c23201ab4fbd37cbe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175647
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31340}
2020-05-25 08:46:30 +00:00
Erik Språng
01611ed3ac Fix potential divide by zero in SimulcastEncoderAdapter
Bug: webrtc:11453
Change-Id: I4119955d7a3cdc4099b8f0ab013e5e33ec38715f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171511
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30866}
2020-03-24 12:29:05 +00:00
Erik Språng
f0276c5d0f Lazy conversion to i420 buffer in SimulcastEncoderAdapter
This CL makes native the preferred buffer type, and if any of the
encoders in the adapter do not support native, the input frame will
be converted to I420 and used as input to encoders that require it,
along with any needed downscaling.

Bug: chromium:1052352
Change-Id: Iff43d6dc56793037a6164729b9e6c69797b6f8cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168609
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30565}
2020-02-20 10:50:15 +00:00
Danil Chapovalov
cad3e0e2fa Replace DataSize and DataRate factories with newer versions
This is search and replace change:
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataSize::Bytes<\(.*\)>()/DataSize::Bytes(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataSize::bytes/DataSize::Bytes/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::BitsPerSec<\(.*\)>()/DataRate::BitsPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::BytesPerSec<\(.*\)>()/DataRate::BytesPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::KilobitsPerSec<\(.*\)>()/DataRate::KilobitsPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::bps/DataRate::BitsPerSec/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::kbps/DataRate::KilobitsPerSec/g"
git cl format

Bug: webrtc:9709
Change-Id: I65aaca69474ba038c1fe2dd8dc30d3f8e7b94c29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168647
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30545}
2020-02-18 16:09:50 +00:00
Sergey Silkin
897776e36c Pass SDP video parameters to encoder.
Bug: webrtc:11265
Change-Id: I4f3373793de697e9d89c22ba2d9be4bfe571beea
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167201
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30359}
2020-01-23 12:33:10 +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
Florent Castelli
6fd58b3388 Add maxFramerate support to SimulcastEncoderAdapter
Bug: webrtc:11117
Change-Id: I134964e669804e1a3c5acb9b9c7ddb6c911cf610
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162203
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30107}
2019-12-17 14:08:47 +00:00
Erik Språng
7968530418 Removes caching SimulcastEncoderAdapter::GetEncoderInfo()
There are edge cases where the caching of encoder info will cause
issues. For instance if a sub-encoder fails en Encode call and falls
back to some other implementation, or if the fps targets shift due to
SetRates() triggering new layers to be enabled.

This CL forces a complete rebuild on every call to GetEncoderInfo().

It also adds new logging of when the info changes, as debugging issues
can be very time consuming if we can't tell that happened.

Bug: webrtc:11000
Change-Id: I7ec7962a589ccba0e188e60a11f851c9de874fab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160960
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29938}
2019-11-27 17:06:54 +00:00
Erik Språng
f4e0c29ed1 SimulcastEncoderAdapter: support per layer fallback and single encoder proxying
This CL adds an optional second encoder factory to SimulcastEncoderAdapter,
that can be used to create software fallback adapter per simulcast layer.

It also adds logic to check if the encoder supports simulcast natively, if so
it only allocates a single instance and delegates the simulcast logic to that
encoder instead. This means we will be able to remove EncoderSimulcastProxy.

Bug: webrtc:11000
Change-Id: Ifd5f029cc281ee2cedf9d18efa5e7e460884d6ff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155171
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29364}
2019-10-01 17:31:44 +00:00
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
Florent Castelli
8bbdb5b9bd Update VideoBitrateAllocator allocate to take a struct with more fields
We want to evaluate more data in order to make better choices in the
bitrate allocators.
In order to freely update the parameter list without
breaking the API many times for projects customizing them, we'll use a
struct instead.

Bug: webrtc:10126
Change-Id: I443f86781c5134950294cdd1e3197a47447cf973
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141418
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28748}
2019-08-02 13:52:54 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Elad Alon
8f01c4e1b6 Define FecControllerOverride and plumb it down to VideoEncoder
The purpose of this interface is to allow VideoEncoder to override
the bandwidth allocation set by FecController in RtpVideoSender.

This CL defines the interface and sends it down to VideoSender.
Two upcoming CLs will:
1. Make LibvpxVp8Encoder pass it on to the (injectable)
   FrameBufferController, where it might be put to good use.
2. Modify RtpVideoSender to respond to the message sent to it
   via this API.

TBR=kwiberg@webrtc.org

Bug: webrtc:10769
Change-Id: I2ef82f0ddcde7fd078e32d8aabf6efe43e0f7f8a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143962
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28416}
2019-06-28 15:57:22 +00:00
Elad Alon
a9952cb0c4 Uncomment "override" in simulcast_encoder_adapter_unittest.cc
Bug: None
Change-Id: I4f07bb27d08ccac43adb59c90823e487fa0cced3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140951
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28246}
2019-06-12 08:18:28 +00:00
Elad Alon
370f93a34a Reland "Inform VideoEncoder of negotiated capabilities"
This is a reland of 11dfff0878

Now that I am sure that WebRTC code is not calling the obsolete
versions, I will just remove the NOT_REACHED and call the
new version from the old ones, so as not to trip up downstream
projects.

Original change's description:
> Inform VideoEncoder of negotiated capabilities
>
> After this CL lands, an announcement will be made to
> discuss-webrtc about the deprecation of one version
> of InitEncode().
>
> Bug: webrtc:10720
> Change-Id: Ib992af0272bbb16ae16ef7e69491f365702d179e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140884
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Elad Alon <eladalon@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28224}

TBR=sakal@webrtc.org,kwiberg@webrtc.org,sprang@webrtc.org

Bug: webrtc:10720
Change-Id: I46c69e45c190805c07f7e51acbe277d7eebd1600
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141412
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28236}
2019-06-11 14:49:37 +00:00