Reland In GenericEncoder enable timing frames for encoders with internal source

The original cl broke some downstream project because some internal source
encoders do not call OnBitrateChanged on GenericEncoder.

Bug: webrtc:9058
Change-Id: I7841c65059fb4fc9e1ab9754bb1d232ce660a990
Reviewed-on: https://webrtc-review.googlesource.com/66342
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22733}
This commit is contained in:
Ilya Nikolaevskiy
2018-04-03 10:01:52 +02:00
committed by Commit Bot
parent 9917c4a780
commit 764aeb7758
4 changed files with 183 additions and 104 deletions

View File

@ -77,6 +77,14 @@ class VCMEncodedFrameCallback : public EncodedImageCallback {
}
private:
// For non-internal-source encoders, returns encode started time and fixes
// capture timestamp for the frame, if corrupted by the encoder.
rtc::Optional<int64_t> ExtractEncodeStartTime(size_t simulcast_svc_idx,
EncodedImage* encoded_image)
RTC_EXCLUSIVE_LOCKS_REQUIRED(timing_params_lock_);
void FillTimingInfo(size_t simulcast_svc_idx, EncodedImage* encoded_image);
rtc::CriticalSection timing_params_lock_;
bool internal_source_;
EncodedImageCallback* const post_encode_callback_;