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

Unified Diff: media/mp4/avc.cc

Issue 10651006: Add Common Encryption support to BMFF, including subsample decryption. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Satisfy mac_rel buildbot Created 8 years, 5 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/mp4/avc.h ('k') | media/mp4/avc_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mp4/avc.cc
diff --git a/media/mp4/avc.cc b/media/mp4/avc.cc
index 29994661387e3448af446958842323bfd09553a2..ae28ffd256eead2c91f2ddf692993c3b8ce87600 100644
--- a/media/mp4/avc.cc
+++ b/media/mp4/avc.cc
@@ -32,7 +32,7 @@ static bool ConvertAVCToAnnexBInPlaceForLengthSize4(std::vector<uint8>* buf) {
}
// static
-bool AVC::ConvertToAnnexB(int length_size, std::vector<uint8>* buffer) {
+bool AVC::ConvertFrameToAnnexB(int length_size, std::vector<uint8>* buffer) {
RCHECK(length_size == 1 || length_size == 2 || length_size == 4);
if (length_size == 4)
@@ -59,32 +59,31 @@ bool AVC::ConvertToAnnexB(int length_size, std::vector<uint8>* buffer) {
}
// static
-bool AVC::InsertParameterSets(const AVCDecoderConfigurationRecord& avc_config,
- std::vector<uint8>* buffer) {
+bool AVC::ConvertConfigToAnnexB(
+ const AVCDecoderConfigurationRecord& avc_config,
+ std::vector<uint8>* buffer) {
+ DCHECK(buffer->empty());
+ buffer->clear();
int total_size = 0;
for (size_t i = 0; i < avc_config.sps_list.size(); i++)
total_size += avc_config.sps_list[i].size() + kAnnexBStartCodeSize;
for (size_t i = 0; i < avc_config.pps_list.size(); i++)
total_size += avc_config.pps_list[i].size() + kAnnexBStartCodeSize;
-
- std::vector<uint8> temp;
- temp.reserve(total_size);
+ buffer->reserve(total_size);
for (size_t i = 0; i < avc_config.sps_list.size(); i++) {
- temp.insert(temp.end(), kAnnexBStartCode,
+ buffer->insert(buffer->end(), kAnnexBStartCode,
kAnnexBStartCode + kAnnexBStartCodeSize);
- temp.insert(temp.end(), avc_config.sps_list[i].begin(),
+ buffer->insert(buffer->end(), avc_config.sps_list[i].begin(),
avc_config.sps_list[i].end());
}
for (size_t i = 0; i < avc_config.pps_list.size(); i++) {
- temp.insert(temp.end(), kAnnexBStartCode,
- kAnnexBStartCode + kAnnexBStartCodeSize);
- temp.insert(temp.end(), avc_config.pps_list[i].begin(),
- avc_config.pps_list[i].end());
+ buffer->insert(buffer->end(), kAnnexBStartCode,
+ kAnnexBStartCode + kAnnexBStartCodeSize);
+ buffer->insert(buffer->end(), avc_config.pps_list[i].begin(),
+ avc_config.pps_list[i].end());
}
-
- buffer->insert(buffer->begin(), temp.begin(), temp.end());
return true;
}
« no previous file with comments | « media/mp4/avc.h ('k') | media/mp4/avc_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698