Niels Möller d738071e63 Refactor FakeEncoder to avoid writing to a const EncodedImage
Subclasses of FakeEncoder need to fill out the CodecSpecificInfo and
RTPFragmentationHeader, and they also write to the encoded data of the
EncodedImage. This used to be done by subclasses chaining onto the
parent's OnEncodedImage callback, but that's not so nice, since the
EncodedImage argument is passed as a const ref there.

This change introduces a protected method EncodeHook for this purpose.
FakeEncoder calls this prior to calling OnEncodedImage, with non-const
pointers.

In addition, change FakeEncoder to use EncodedImage::Allocate, rather
than explicit new and delete.

Bug: webrtc:9378
Change-Id: Ie8182d1d5224aa3b7f15905612f6dbcebef0a555
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125880
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26988}
2019-03-06 11:11:48 +00:00
..
2018-08-21 17:10:05 +00:00
2019-01-25 20:29:58 +00:00
2018-06-19 14:00:39 +00:00
2018-06-19 14:00:39 +00:00
2019-01-14 10:55:37 +00:00
2018-06-19 14:00:39 +00:00
2018-06-19 14:00:39 +00:00