webrtc/api/video_codecs
Erik Språng 157b7814b9 Remove deprecated SetRates/SetRateAllocation from VideoEncoder.
This CL removes two deprecated methods from the VideoEncoder interface:
* int32_t SetRates(uint32_t, uint32_t);
* int32_t SetRateAllocation(const VideoBitrateAllocation&, uint32_t);

These are no longer used, instead the new version must be implemented:
  void SetRates(const RateControlParameters&) = 0;

Migrating is straight forward. For the old SetRates, simple replace:
  int32_t MyEncoder::SetRates(uint32_t bitrate, uint32_t framerate) {
with
  void MyEncoder::SetRates(const RateControlParameters& parameters) {
    uint32_t bitrate = parameters.bitrate.get_sum_kbps();
    uint32_t framerate =
      static_cast<uint32_t>(parameters.framerate_fps + 0.5);

For SetRateAllocation, replace:
  int32_t MyEncoder::SetRateAllocation(
      const VideoBitrateAllocation& allocation,
      uint32_t framerate) {
with
  void MyEncoder::SetRates(const RateControlParameters& parameters) {
    const VideoBitrateAllocation& allocation = parameters.bitrate;
    uint32_t framerate =
      static_cast<uint32_t>(parameters.framerate_fps + 0.5);

Two more things to note:
1. The new method is void. Previously the only use of the return value
   in production code was to log a more or less generic error message.
   Instead, log the actual error from the encoder when it happens,
   then just return.

2. The new method is pure virtual; it must be overriden even in test.

This CL is intended to be landed two weeks after creation, on Thursday
May 9th 2019.

Bug: webrtc:10481
Change-Id: I61349571a280bd40cd100ca9f93c4aa7748ed30d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134214
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27926}
2019-05-13 11:42:59 +00:00
..
test Removes TimeMicros interface from ThreadProcessingFakeClock. 2019-04-17 15:37:48 +00:00
bitstream_parser.h Add interface class for bitstream parser. 2019-03-22 12:14:41 +00:00
BUILD.gn Export symbols needed by the Chromium component build (part 8). 2019-04-02 10:13:36 +00:00
builtin_video_decoder_factory.cc (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries 2019-01-11 17:11:39 +00:00
builtin_video_decoder_factory.h Export symbols needed by the Chromium component build (part 6). 2018-10-23 06:48:51 +00:00
builtin_video_encoder_factory.cc Use EncoderSimulcastProxy for all codecs 2019-01-23 15:59:54 +00:00
builtin_video_encoder_factory.h Export symbols needed by the Chromium component build (part 6). 2018-10-23 06:48:51 +00:00
OWNERS Add magjed/nisse/sprang/brandtr as api/video_codecs owners 2018-11-08 15:43:03 +00:00
sdp_video_format.cc Add copy and move operations to SdpVideoFormat. 2018-03-28 09:46:26 +00:00
sdp_video_format.h Export symbols needed by the Chromium component build (part 8). 2019-04-02 10:13:36 +00:00
video_codec.cc Delete unused members of VideoCodecH264. 2019-04-11 15:32:48 +00:00
video_codec.h Delete unused members of VideoCodecH264. 2019-04-11 15:32:48 +00:00
video_decoder.cc Delete DecodedImageCallback::ReceivedDecodedFrame 2019-04-25 08:09:29 +00:00
video_decoder.h Delete DecodedImageCallback::ReceivedDecodedFrame 2019-04-25 08:09:29 +00:00
video_decoder_factory.cc Add receive stream id argument to CreateDecoder() method 2018-09-11 08:47:04 +00:00
video_decoder_factory.h Export symbols needed by the Chromium component build (part 8). 2019-04-02 10:13:36 +00:00
video_decoder_software_fallback_wrapper.cc Reland "Delete CodecSpecificInfo argument from VideoDecoder::Decode" 2019-04-11 13:03:52 +00:00
video_decoder_software_fallback_wrapper.h Export symbols needed by the Chromium component build (part 8). 2019-04-02 10:13:36 +00:00
video_encoder.cc Remove deprecated SetRates/SetRateAllocation from VideoEncoder. 2019-05-13 11:42:59 +00:00
video_encoder.h Remove deprecated SetRates/SetRateAllocation from VideoEncoder. 2019-05-13 11:42:59 +00:00
video_encoder_config.cc Implement the encoding RtpParameter scaleResolutionDownBy 2019-01-29 14:32:17 +00:00
video_encoder_config.h Implement the encoding RtpParameter scaleResolutionDownBy 2019-01-29 14:32:17 +00:00
video_encoder_factory.h Revert "Replace VideoEncoderFactory::QueryVideoEncoder with VideoEncoder::GetEncoderInfo" 2018-12-10 10:36:00 +00:00
video_encoder_software_fallback_wrapper.cc Reland "Replace usage of old SetRates/SetRateAllocation methods" 2019-04-12 13:37:32 +00:00
video_encoder_software_fallback_wrapper.h Export symbols needed by the Chromium component build (part 8). 2019-04-02 10:13:36 +00:00
vp8_frame_buffer_controller.h Reland "Refactor handling of configuration overrides from Vp8FrameBufferController" 2019-05-10 08:44:02 +00:00
vp8_frame_config.cc Break FrameConfig out of Vp8TemporalLayers 2019-01-29 14:13:55 +00:00
vp8_frame_config.h Add Vp8FrameConfig::IntraFrame() 2019-04-23 11:58:18 +00:00
vp8_temporal_layers.cc Reland "Refactor handling of configuration overrides from Vp8FrameBufferController" 2019-05-10 08:44:02 +00:00
vp8_temporal_layers.h Reland "Refactor handling of configuration overrides from Vp8FrameBufferController" 2019-05-10 08:44:02 +00:00
vp8_temporal_layers_factory.cc Use single FrameBufferController in VP8, created by a factory. 2019-03-20 11:54:02 +00:00
vp8_temporal_layers_factory.h Use single FrameBufferController in VP8, created by a factory. 2019-03-20 11:54:02 +00:00