Bug 1404997 - P3. Rename some VideoFrameConverter members per coding style. r?pehrsons
MozReview-Commit-ID: Dsi5ZdD3Tay
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -117,17 +117,17 @@ class VideoFrameConverter
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoFrameConverter)
VideoFrameConverter()
: mLength(0)
, mTaskQueue(new AutoTaskQueue(
SharedThreadPool::Get(NS_LITERAL_CSTRING("VideoFrameConverter"))))
- , last_img_(-1) // -1 is not a guaranteed invalid serial. See bug 1262134.
+ , mLastImage(-1) // -1 is not a guaranteed invalid serial. See bug 1262134.
#ifdef DEBUG
, mThrottleCount(0)
, mThrottleRecord(0)
#endif
, mMutex("VideoFrameConverter")
{
MOZ_COUNT_CTOR(VideoFrameConverter);
}
@@ -135,20 +135,20 @@ public:
void QueueVideoChunk(VideoChunk& aChunk, bool aForceBlack)
{
if (aChunk.IsNull()) {
return;
}
// We get passed duplicate frames every ~10ms even with no frame change.
int32_t serial = aChunk.mFrame.GetImage()->GetSerial();
- if (serial == last_img_) {
+ if (serial == mLastImage) {
return;
}
- last_img_ = serial;
+ mLastImage = serial;
// A throttling limit of 1 allows us to convert 2 frames concurrently.
// It's short enough to not build up too significant a delay, while
// giving us a margin to not cause some machines to drop every other frame.
const int32_t queueThrottlingLimit = 1;
if (mLength > queueThrottlingLimit) {
CSFLogDebug(LOGTAG,
"VideoFrameConverter %p queue is full. Throttling by "
@@ -183,34 +183,33 @@ public:
}
#endif
bool forceBlack = aForceBlack || aChunk.mFrame.GetForceBlack();
if (forceBlack) {
// Reset the last-img check.
// -1 is not a guaranteed invalid serial. See bug 1262134.
- last_img_ = -1;
+ mLastImage = -1;
// After disabling, we still want *some* frames to flow to the other side.
// It could happen that we drop the packet that carried the first disabled
// frame, for instance. Note that this still requires the application to
// send a frame, or it doesn't trigger at all.
const double disabledMinFps = 1.0;
TimeStamp t = aChunk.mTimeStamp;
MOZ_ASSERT(!t.IsNull());
- if (!disabled_frame_sent_.IsNull() &&
- (t - disabled_frame_sent_).ToSeconds() < (1.0 / disabledMinFps)) {
+ if (!mDisabledFrameSent.IsNull() &&
+ (t - mDisabledFrameSent).ToSeconds() < (1.0 / disabledMinFps)) {
return;
}
-
- disabled_frame_sent_ = t;
+ mDisabledFrameSent = t;
} else {
// This sets it to the Null time.
- disabled_frame_sent_ = TimeStamp();
+ mDisabledFrameSent = TimeStamp();
}
++mLength; // Atomic
nsCOMPtr<nsIRunnable> runnable =
NewRunnableMethod<StoreRefPtrPassByPtr<Image>, bool>(
"VideoFrameConverter::ProcessVideoFrame",
this,
@@ -471,18 +470,18 @@ protected:
mozilla::kVideoI420,
0);
}
Atomic<int32_t, Relaxed> mLength;
RefPtr<AutoTaskQueue> mTaskQueue;
// Written and read from the queueing thread (normally MSG).
- int32_t last_img_; // serial number of last Image
- TimeStamp disabled_frame_sent_; // The time we sent the last disabled frame.
+ int32_t mLastImage; // serial number of last Image
+ TimeStamp mDisabledFrameSent; // The time we sent the last disabled frame.
#ifdef DEBUG
uint32_t mThrottleCount;
uint32_t mThrottleRecord;
#endif
// mMutex guards the below variables.
Mutex mMutex;
nsTArray<RefPtr<VideoConverterListener>> mListeners;