Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Unified Diff: media/cast/sender/audio_sender.h

Issue 545593002: [Cast] Track audio queued in encoder; account for it in ShouldDropNextFrame(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/cast/sender/audio_sender.h
diff --git a/media/cast/sender/audio_sender.h b/media/cast/sender/audio_sender.h
index bef042a24246154d6b3df9a70c3f0db9afa620e7..b307bf84e4c7cbd0fcebca214656c976373d7fe7 100644
--- a/media/cast/sender/audio_sender.h
+++ b/media/cast/sender/audio_sender.h
@@ -55,19 +55,21 @@ class AudioSender : public FrameSender,
void OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback);
private:
- // Returns true if there are too many frames in flight, or if the media
- // duration of the frames in flight would be too high by sending the next
- // frame. The latter metric is determined from the given |capture_time|
- // for the next frame to be encoded and sent.
- bool ShouldDropNextFrame(base::TimeTicks capture_time) const;
+ // Recompute |samples_in_encoder_| as well as the duration and number of
+ // frames enqueued in the encoder.
+ void UpdateEncoderBacklogStats(int samples_added);
// Called by the |audio_encoder_| with the next EncodedFrame to send.
- void SendEncodedAudioFrame(scoped_ptr<EncodedFrame> audio_frame);
+ void SendEncodedAudioFrame(scoped_ptr<EncodedFrame> audio_frame,
+ int samples_skipped);
// Encodes AudioBuses into EncodedFrames.
scoped_ptr<AudioEncoder> audio_encoder_;
const int configured_encoder_bitrate_;
+ // The number of audio samples enqueued in |audio_encoder_|.
+ int samples_in_encoder_;
+
// NOTE: Weak pointers must be invalidated before all other member variables.
base::WeakPtrFactory<AudioSender> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698