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

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

Issue 1319813002: Fix mp4 keyframe parsing, removing unused stss parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix sizeof nit Created 5 years, 4 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/formats/mp4/box_definitions.h ('k') | media/formats/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp4/box_definitions.cc
diff --git a/media/formats/mp4/box_definitions.cc b/media/formats/mp4/box_definitions.cc
index 7e9c612d61bc02c88ede0068cca6bef58b09ca43..9b4613882081b3e8bcb393e1c1120e442c23a67a 100644
--- a/media/formats/mp4/box_definitions.cc
+++ b/media/formats/mp4/box_definitions.cc
@@ -300,55 +300,13 @@ bool SampleDescription::Parse(BoxReader* reader) {
return true;
}
-SyncSample::SyncSample() : is_present(false) {}
-SyncSample::~SyncSample() {}
-FourCC SyncSample::BoxType() const { return FOURCC_STSS; }
-
-bool SyncSample::Parse(BoxReader* reader) {
- uint32 entry_count;
- RCHECK(reader->ReadFullBoxHeader() &&
- reader->Read4(&entry_count));
-
- is_present = true;
-
- entries.resize(entry_count);
-
- if (entry_count == 0)
- return true;
-
- for (size_t i = 0; i < entry_count; ++i)
- RCHECK(reader->Read4(&entries[i]));
-
- return true;
-}
-
-bool SyncSample::IsSyncSample(size_t k) const {
- // ISO/IEC 14496-12 Section 8.6.2.1 : If the sync sample box is not present,
- // every sample is a sync sample.
- if (!is_present)
- return true;
-
- // ISO/IEC 14496-12 Section 8.6.2.3 : If entry_count is zero, there are no
- // sync samples within the stream.
- if (entries.size() == 0u)
- return false;
-
- for (size_t i = 0; i < entries.size(); ++i) {
- if (entries[i] == k)
- return true;
- }
-
- return false;
-}
-
SampleTable::SampleTable() {}
SampleTable::~SampleTable() {}
FourCC SampleTable::BoxType() const { return FOURCC_STBL; }
bool SampleTable::Parse(BoxReader* reader) {
RCHECK(reader->ScanChildren() &&
- reader->ReadChild(&description) &&
- reader->MaybeReadChild(&sync_sample));
+ reader->ReadChild(&description));
// There could be multiple SampleGroupDescription boxes with different
// grouping types. For common encryption, the relevant grouping type is
// 'seig'. Continue reading until 'seig' is found, or until running out of
« no previous file with comments | « media/formats/mp4/box_definitions.h ('k') | media/formats/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698