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

Unified Diff: webrtc/audio/audio_send_stream.h

Issue 2546493002: Update smoothed bitrate. (Closed)
Patch Set: Fix thread safety problem and changed smoothing filter. Created 4 years 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
« no previous file with comments | « no previous file | webrtc/audio/audio_send_stream.cc » ('j') | webrtc/common_audio/smoothing_filter.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/audio/audio_send_stream.h
diff --git a/webrtc/audio/audio_send_stream.h b/webrtc/audio/audio_send_stream.h
index af0513ccf776fd5513f7b10ca17bb0960d1d2ec4..532dbdfa32a54c19d9e78f7bf96132e993e9ad85 100644
--- a/webrtc/audio/audio_send_stream.h
+++ b/webrtc/audio/audio_send_stream.h
@@ -16,7 +16,9 @@
#include "webrtc/api/call/audio_send_stream.h"
#include "webrtc/api/call/audio_state.h"
#include "webrtc/base/constructormagic.h"
+#include "webrtc/base/onetimeevent.h"
#include "webrtc/base/thread_checker.h"
+#include "webrtc/base/weak_ptr.h"
#include "webrtc/call/bitrate_allocator.h"
namespace webrtc {
@@ -60,9 +62,12 @@ class AudioSendStream final : public webrtc::AudioSendStream,
void SetTransportOverhead(int transport_overhead_per_packet);
private:
+ class AdaptCodecTask;
+
VoiceEngine* voice_engine() const;
bool SetupSendCodec();
+ void AdaptCodec();
rtc::ThreadChecker thread_checker_;
rtc::TaskQueue* worker_queue_;
@@ -71,6 +76,15 @@ class AudioSendStream final : public webrtc::AudioSendStream,
std::unique_ptr<voe::ChannelProxy> channel_proxy_;
BitrateAllocator* const bitrate_allocator_;
+ OneTimeEvent first_update_bitrate_;
+
+ // |weak_ptr_| to our self. This is used since we can not call
+ // |weak_ptr_factory_.GetWeakPtr| from multiple sequences but it is ok to copy
+ // an existing WeakPtr.
+ rtc::WeakPtr<AudioSendStream> weak_ptr_;
+ // |weak_ptr_factory_| must be declared last to make sure all WeakPtr's are
+ // invalidated before any other members are destroyed.
+ std::unique_ptr<rtc::WeakPtrFactory<AudioSendStream>> weak_ptr_factory_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream);
};
« no previous file with comments | « no previous file | webrtc/audio/audio_send_stream.cc » ('j') | webrtc/common_audio/smoothing_filter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698