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

Unified Diff: media/filters/frame_processor.cc

Issue 2371783002: Remove stl_util's deletion functions from media/. (Closed)
Patch Set: wolenetz Created 4 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
« no previous file with comments | « media/filters/frame_processor.h ('k') | media/filters/h264_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/frame_processor.cc
diff --git a/media/filters/frame_processor.cc b/media/filters/frame_processor.cc
index c6b1bc04d063854ba80fdd2c064dd819b1002cee..0430c08f9dd757741ec7179e0800b0340b4ab8e6 100644
--- a/media/filters/frame_processor.cc
+++ b/media/filters/frame_processor.cc
@@ -9,7 +9,7 @@
#include <cstdlib>
#include "base/macros.h"
-#include "base/stl_util.h"
+#include "base/memory/ptr_util.h"
#include "media/base/stream_parser_buffer.h"
#include "media/base/timestamp_constants.h"
@@ -172,7 +172,6 @@ FrameProcessor::FrameProcessor(const UpdateDurationCB& update_duration_cb,
FrameProcessor::~FrameProcessor() {
DVLOG(2) << __func__ << "()";
- base::STLDeleteValues(&track_buffers_);
}
void FrameProcessor::SetSequenceMode(bool sequence_mode) {
@@ -260,7 +259,7 @@ bool FrameProcessor::AddTrack(StreamParser::TrackId id,
return false;
}
- track_buffers_[id] = new MseTrackBuffer(stream);
+ track_buffers_[id] = base::MakeUnique<MseTrackBuffer>(stream);
return true;
}
@@ -274,30 +273,27 @@ bool FrameProcessor::UpdateTrack(StreamParser::TrackId old_id,
return false;
}
- track_buffers_[new_id] = track_buffers_[old_id];
+ track_buffers_[new_id] = std::move(track_buffers_[old_id]);
CHECK_EQ(1u, track_buffers_.erase(old_id));
return true;
}
void FrameProcessor::SetAllTrackBuffersNeedRandomAccessPoint() {
- for (TrackBufferMap::iterator itr = track_buffers_.begin();
- itr != track_buffers_.end();
- ++itr) {
+ for (auto itr = track_buffers_.begin(); itr != track_buffers_.end(); ++itr) {
itr->second->set_needs_random_access_point(true);
}
}
void FrameProcessor::Reset() {
DVLOG(2) << __func__ << "()";
- for (TrackBufferMap::iterator itr = track_buffers_.begin();
- itr != track_buffers_.end(); ++itr) {
+ for (auto itr = track_buffers_.begin(); itr != track_buffers_.end(); ++itr) {
itr->second->Reset();
}
// Maintain current |coded_frame_group_last_dts_| state for Reset() during
// sequence mode. Reset it here only if in segments mode. In sequence mode,
// the current coded frame group may be continued across Reset() operations to
- // allow the stream to coaelesce what might otherwise be gaps in the buffered
+ // allow the stream to coalesce what might otherwise be gaps in the buffered
// ranges. See also the declaration for |coded_frame_group_last_dts_|.
if (!sequence_mode_) {
coded_frame_group_last_dts_ = kNoDecodeTimestamp();
@@ -325,20 +321,18 @@ void FrameProcessor::OnPossibleAudioConfigUpdate(
}
MseTrackBuffer* FrameProcessor::FindTrack(StreamParser::TrackId id) {
- TrackBufferMap::iterator itr = track_buffers_.find(id);
+ auto itr = track_buffers_.find(id);
if (itr == track_buffers_.end())
return NULL;
- return itr->second;
+ return itr->second.get();
}
void FrameProcessor::NotifyStartOfCodedFrameGroup(
DecodeTimestamp start_timestamp) {
DVLOG(2) << __func__ << "(" << start_timestamp.InSecondsF() << ")";
- for (TrackBufferMap::iterator itr = track_buffers_.begin();
- itr != track_buffers_.end();
- ++itr) {
+ for (auto itr = track_buffers_.begin(); itr != track_buffers_.end(); ++itr) {
itr->second->stream()->OnStartOfCodedFrameGroup(start_timestamp);
}
}
@@ -347,9 +341,7 @@ bool FrameProcessor::FlushProcessedFrames() {
DVLOG(2) << __func__ << "()";
bool result = true;
- for (TrackBufferMap::iterator itr = track_buffers_.begin();
- itr != track_buffers_.end();
- ++itr) {
+ for (auto itr = track_buffers_.begin(); itr != track_buffers_.end(); ++itr) {
if (!itr->second->FlushProcessedFrames())
result = false;
}
« no previous file with comments | « media/filters/frame_processor.h ('k') | media/filters/h264_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698