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

Unified Diff: media/formats/mp4/track_run_iterator.cc

Issue 1874413003: Convert media/formats to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: media/formats/mp4/track_run_iterator.cc
diff --git a/media/formats/mp4/track_run_iterator.cc b/media/formats/mp4/track_run_iterator.cc
index 7dae93801c8e4c2c4418b7219950fa4725756a15..7193b3d26dd9d5eb03b47ef298bc8d4d99ec11c6 100644
--- a/media/formats/mp4/track_run_iterator.cc
+++ b/media/formats/mp4/track_run_iterator.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <iomanip>
#include <limits>
+#include <memory>
#include "base/macros.h"
#include "media/formats/mp4/rcheck.h"
@@ -280,7 +281,7 @@ bool TrackRunIterator::Init(const MovieFragment& moof) {
const std::vector<uint8_t>& sample_encryption_data =
traf.sample_encryption.sample_encryption_data;
- scoped_ptr<BufferReader> sample_encryption_reader;
+ std::unique_ptr<BufferReader> sample_encryption_reader;
uint32_t sample_encrytion_entries_count = 0;
if (!sample_encryption_data.empty()) {
sample_encryption_reader.reset(new BufferReader(
@@ -589,13 +590,13 @@ const TrackEncryption& TrackRunIterator::track_encryption() const {
return video_description().sinf.info.track_encryption;
}
-scoped_ptr<DecryptConfig> TrackRunIterator::GetDecryptConfig() {
+std::unique_ptr<DecryptConfig> TrackRunIterator::GetDecryptConfig() {
DCHECK(is_encrypted());
if (run_itr_->sample_encryption_entries.empty()) {
DCHECK_EQ(0, aux_info_size());
MEDIA_LOG(ERROR, media_log_) << "Sample encryption info is not available.";
- return scoped_ptr<DecryptConfig>();
+ return std::unique_ptr<DecryptConfig>();
}
size_t sample_idx = sample_itr_ - run_itr_->samples.begin();
@@ -608,11 +609,11 @@ scoped_ptr<DecryptConfig> TrackRunIterator::GetDecryptConfig() {
(!sample_encryption_entry.GetTotalSizeOfSubsamples(&total_size) ||
total_size != static_cast<size_t>(sample_size()))) {
MEDIA_LOG(ERROR, media_log_) << "Incorrect CENC subsample size.";
- return scoped_ptr<DecryptConfig>();
+ return std::unique_ptr<DecryptConfig>();
}
const std::vector<uint8_t>& kid = GetKeyId(sample_idx);
- return scoped_ptr<DecryptConfig>(new DecryptConfig(
+ return std::unique_ptr<DecryptConfig>(new DecryptConfig(
std::string(reinterpret_cast<const char*>(&kid[0]), kid.size()),
std::string(reinterpret_cast<const char*>(
sample_encryption_entry.initialization_vector),

Powered by Google App Engine
This is Rietveld 408576698