Bug 1404992 - Initialize VideoConduit members in declarations. r=dminor

--HG--
extra : rebase_source : e552430cc47444800c06d445b2e49941c488057c
extra : source : 7a06d3a9341ada35c1336f5bdf899c3817baff61
This commit is contained in:
Andreas Pehrson 2018-09-11 14:51:24 +02:00
parent 793fde35a0
commit 8865bbcbfe
2 changed files with 28 additions and 56 deletions

View File

@ -233,43 +233,15 @@ VideoSessionConduit::Create(RefPtr<WebRtcCallWrapper> aCall)
WebrtcVideoConduit::WebrtcVideoConduit(RefPtr<WebRtcCallWrapper> aCall,
UniquePtr<cricket::VideoAdapter>&& aVideoAdapter)
: mTransportMonitor("WebrtcVideoConduit")
, mRenderer(nullptr)
, mVideoAdapter(std::move(aVideoAdapter))
, mVideoBroadcaster()
, mEngineTransmitting(false)
, mEngineReceiving(false)
, mCapId(-1)
, mCodecMutex("VideoConduit codec db")
, mRecvStream(nullptr)
, mSendStream(nullptr)
, mLastWidth(0)
, mLastHeight(0) // initializing as 0 forces a check for reconfig at start
, mSendingWidth(0)
, mSendingHeight(0)
, mReceivingWidth(0)
, mReceivingHeight(0)
, mSendingFramerate(DEFAULT_VIDEO_MAX_FRAMERATE)
, mVideoLatencyTestEnable(false)
, mVideoLatencyAvg(0)
, mMinBitrate(0)
, mStartBitrate(0)
, mPrefMaxBitrate(0)
, mNegotiatedMaxBitrate(0)
, mMinBitrateEstimate(0)
, mDenoising(false)
, mLockScaling(false)
, mSpatialLayers(1)
, mTemporalLayers(1)
, mCodecMode(webrtc::kRealtimeVideo)
, mCall(aCall) // refcounted store of the call object
, mSendStreamConfig(this) // 'this' is stored but not dereferenced in the constructor.
, mRecvStreamConfig(this) // 'this' is stored but not dereferenced in the constructor.
, mAllowSsrcChange(true)
, mWaitingForInitialSsrc(true)
, mRecvSSRC(0)
, mRecvSSRCSetInProgress(false)
, mSendCodecPlugin(nullptr)
, mRecvCodecPlugin(nullptr)
, mSendStreamConfig(this) // 'this' is stored but not dereferenced in the constructor.
, mRecvStreamConfig(this) // 'this' is stored but not dereferenced in the constructor.
, mVideoStatsTimer(NS_NewTimer())
{
mCall->RegisterConduit(this);

View File

@ -471,7 +471,7 @@ private:
mozilla::Atomic<bool> mEngineTransmitting; // If true ==> Transmit Subsystem is up and running
mozilla::Atomic<bool> mEngineReceiving; // if true ==> Receive Subsystem up and running
int mCapId; // Capturer for this conduit
int mCapId = -1; // Capturer for this conduit
//Local database of currently applied receive codecs
nsTArray<UniquePtr<VideoCodecConfig>> mRecvCodecList;
@ -484,28 +484,28 @@ private:
webrtc::RtcpPacketTypeCounter mRecvPacketCounts;
// Must call webrtc::Call::DestroyVideoReceive/SendStream to delete these:
webrtc::VideoReceiveStream* mRecvStream;
webrtc::VideoSendStream* mSendStream;
webrtc::VideoReceiveStream* mRecvStream = nullptr;
webrtc::VideoSendStream* mSendStream = nullptr;
unsigned short mLastWidth;
unsigned short mLastHeight;
unsigned short mSendingWidth;
unsigned short mSendingHeight;
unsigned short mReceivingWidth;
unsigned short mReceivingHeight;
unsigned short mLastWidth = 0;
unsigned short mLastHeight = 0;
unsigned short mSendingWidth = 0;
unsigned short mSendingHeight = 0;
unsigned short mReceivingWidth = 0;
unsigned short mReceivingHeight = 0;
unsigned int mSendingFramerate;
bool mVideoLatencyTestEnable;
uint64_t mVideoLatencyAvg;
bool mVideoLatencyTestEnable = false;
uint64_t mVideoLatencyAvg = 0;
// all in bps!
int mMinBitrate;
int mStartBitrate;
int mPrefMaxBitrate;
int mNegotiatedMaxBitrate;
int mMinBitrateEstimate;
bool mDenoising;
bool mLockScaling; // for tests that care about output resolution
uint8_t mSpatialLayers;
uint8_t mTemporalLayers;
int mMinBitrate = 0;
int mStartBitrate = 0;
int mPrefMaxBitrate = 0;
int mNegotiatedMaxBitrate = 0;
int mMinBitrateEstimate = 0;
bool mDenoising = false;
bool mLockScaling = false; // for tests that care about output resolution
uint8_t mSpatialLayers = 1;
uint8_t mTemporalLayers = 1;
rtc::VideoSinkWants mLastSinkWanted;
@ -526,14 +526,14 @@ private:
webrtc::VideoReceiveStream::Config mRecvStreamConfig;
// Are SSRC changes without signaling allowed or not
bool mAllowSsrcChange;
bool mWaitingForInitialSsrc;
bool mAllowSsrcChange = true;
bool mWaitingForInitialSsrc = true;
// accessed on creation, and when receiving packets
uint32_t mRecvSSRC; // this can change during a stream!
uint32_t mRecvSSRC = 0; // this can change during a stream!
// The runnable to set the SSRC is in-flight; queue packets until it's done.
bool mRecvSSRCSetInProgress;
bool mRecvSSRCSetInProgress = false;
struct QueuedPacket {
int mLen;
uint8_t mData[1];
@ -545,8 +545,8 @@ private:
// on construction.
nsAutoPtr<webrtc::VideoEncoder> mEncoder; // only one encoder for now
std::vector<std::unique_ptr<webrtc::VideoDecoder>> mDecoders;
WebrtcVideoEncoder* mSendCodecPlugin;
WebrtcVideoDecoder* mRecvCodecPlugin;
WebrtcVideoEncoder* mSendCodecPlugin = nullptr;
WebrtcVideoDecoder* mRecvCodecPlugin = nullptr;
nsCOMPtr<nsITimer> mVideoStatsTimer;