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

Side by Side Diff: media/formats/mp4/box_definitions.cc

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 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 unified diff | Download patch
« no previous file with comments | « media/formats/mp4/box_definitions.h ('k') | media/formats/mp4/box_reader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/formats/mp4/box_definitions.h" 5 #include "media/formats/mp4/box_definitions.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 const AVCDecoderConfigurationRecord& other) = default; 580 const AVCDecoderConfigurationRecord& other) = default;
581 AVCDecoderConfigurationRecord::~AVCDecoderConfigurationRecord() {} 581 AVCDecoderConfigurationRecord::~AVCDecoderConfigurationRecord() {}
582 FourCC AVCDecoderConfigurationRecord::BoxType() const { return FOURCC_AVCC; } 582 FourCC AVCDecoderConfigurationRecord::BoxType() const { return FOURCC_AVCC; }
583 583
584 bool AVCDecoderConfigurationRecord::Parse(BoxReader* reader) { 584 bool AVCDecoderConfigurationRecord::Parse(BoxReader* reader) {
585 return ParseInternal(reader, reader->media_log()); 585 return ParseInternal(reader, reader->media_log());
586 } 586 }
587 587
588 bool AVCDecoderConfigurationRecord::Parse(const uint8_t* data, int data_size) { 588 bool AVCDecoderConfigurationRecord::Parse(const uint8_t* data, int data_size) {
589 BufferReader reader(data, data_size); 589 BufferReader reader(data, data_size);
590 return ParseInternal(&reader, new MediaLog()); 590 // TODO(wolenetz): Questionable MediaLog usage, http://crbug.com/712310
591 MediaLog media_log;
592 return ParseInternal(&reader, &media_log);
591 } 593 }
592 594
593 bool AVCDecoderConfigurationRecord::ParseInternal( 595 bool AVCDecoderConfigurationRecord::ParseInternal(BufferReader* reader,
594 BufferReader* reader, 596 MediaLog* media_log) {
595 const scoped_refptr<MediaLog>& media_log) {
596 RCHECK(reader->Read1(&version) && version == 1 && 597 RCHECK(reader->Read1(&version) && version == 1 &&
597 reader->Read1(&profile_indication) && 598 reader->Read1(&profile_indication) &&
598 reader->Read1(&profile_compatibility) && 599 reader->Read1(&profile_compatibility) &&
599 reader->Read1(&avc_level)); 600 reader->Read1(&avc_level));
600 601
601 uint8_t length_size_minus_one; 602 uint8_t length_size_minus_one;
602 RCHECK(reader->Read1(&length_size_minus_one)); 603 RCHECK(reader->Read1(&length_size_minus_one));
603 length_size = (length_size_minus_one & 0x3) + 1; 604 length_size = (length_size_minus_one & 0x3) + 1;
604 605
605 RCHECK(length_size != 3); // Only values of 1, 2, and 4 are valid. 606 RCHECK(length_size != 3); // Only values of 1, 2, and 4 are valid.
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( 1462 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on(
1462 size_t i) const { 1463 size_t i) const {
1463 if (i >= sample_depends_on_.size()) 1464 if (i >= sample_depends_on_.size())
1464 return kSampleDependsOnUnknown; 1465 return kSampleDependsOnUnknown;
1465 1466
1466 return sample_depends_on_[i]; 1467 return sample_depends_on_[i];
1467 } 1468 }
1468 1469
1469 } // namespace mp4 1470 } // namespace mp4
1470 } // namespace media 1471 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp4/box_definitions.h ('k') | media/formats/mp4/box_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698