Skip to content
Snippets Groups Projects
Commit 993766a9 authored by Philippe Gorley's avatar Philippe Gorley Committed by Philippe Gorley
Browse files

recorder: use deque


std::queue<T> uses std::deque<T> as a container, so use it directly
since the interface offers better tools for debugging and manipulation.

Change-Id: I2785fc13bab6cda4704488408cad1459ae1b2395
Reviewed-by: default avatarSebastien Blin <sebastien.blin@savoirfairelinux.com>
parent 30af80e8
No related branches found
No related tags found
No related merge requests found
...@@ -161,7 +161,7 @@ MediaRecorder::startRecording() ...@@ -161,7 +161,7 @@ MediaRecorder::startRecording()
while (!frames_.empty()) { while (!frames_.empty()) {
auto f = frames_.front(); auto f = frames_.front();
av_frame_unref(f.frame); av_frame_unref(f.frame);
frames_.pop(); frames_.pop_front();
} }
} }
...@@ -228,7 +228,7 @@ MediaRecorder::recordData(AVFrame* frame, bool isVideo, bool fromPeer) ...@@ -228,7 +228,7 @@ MediaRecorder::recordData(AVFrame* frame, bool isVideo, bool fromPeer)
{ {
std::lock_guard<std::mutex> q(qLock_); std::lock_guard<std::mutex> q(qLock_);
frames_.emplace(input, isVideo, fromPeer); frames_.emplace_back(input, isVideo, fromPeer);
} }
loop_.interrupt(); loop_.interrupt();
return 0; return 0;
...@@ -510,7 +510,7 @@ MediaRecorder::process() ...@@ -510,7 +510,7 @@ MediaRecorder::process()
std::lock_guard<std::mutex> q(qLock_); std::lock_guard<std::mutex> q(qLock_);
if (!frames_.empty()) { if (!frames_.empty()) {
recframe = frames_.front(); recframe = frames_.front();
frames_.pop(); frames_.pop_front();
} else { } else {
return; return;
} }
......
...@@ -129,7 +129,7 @@ class MediaRecorder { ...@@ -129,7 +129,7 @@ class MediaRecorder {
InterruptedThreadLoop loop_; InterruptedThreadLoop loop_;
void process(); void process();
std::mutex qLock_; std::mutex qLock_;
std::queue<RecordFrame> frames_; std::deque<RecordFrame> frames_;
}; };
}; // namespace ring }; // namespace ring
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment