Clean up clang compilation errors.
Clang from Chromium enforces Chromium styles: http://www.chromium.org/developers/coding-style, http://www.chromium.org/developers/coding-style/chromium-style-checker-errors. Change-Id: I8070739489a8109380578d1797801e981d119793
This commit is contained in:
parent
3da90d8bad
commit
8095e21c96
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <sstream>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "media/base/limits.h"
|
||||
|
||||
|
@ -66,8 +67,10 @@ std::string AudioStreamInfo::GetCodecString(AudioCodec codec,
|
|||
return "opus";
|
||||
case kCodecAAC:
|
||||
return "mp4a.40." + base::UintToString(audio_object_type);
|
||||
}
|
||||
default:
|
||||
NOTIMPLEMENTED() << "Codec: " << codec;
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace media
|
||||
|
|
|
@ -47,8 +47,6 @@ class AudioStreamInfo : public StreamInfo {
|
|||
size_t extra_data_size,
|
||||
bool is_encrypted);
|
||||
|
||||
virtual ~AudioStreamInfo();
|
||||
|
||||
// Returns true if this object has appropriate configuration values, false
|
||||
// otherwise.
|
||||
virtual bool IsValidConfig() const OVERRIDE;
|
||||
|
@ -69,6 +67,8 @@ class AudioStreamInfo : public StreamInfo {
|
|||
static std::string GetCodecString(AudioCodec codec, uint8 audio_object_type);
|
||||
|
||||
private:
|
||||
virtual ~AudioStreamInfo();
|
||||
|
||||
AudioCodec codec_;
|
||||
uint8 sample_bits_;
|
||||
uint8 num_channels_;
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (c) 2013 Google Inc. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "media/base/muxer_options.h"
|
||||
|
||||
namespace media {
|
||||
|
||||
MuxerOptions::MuxerOptions()
|
||||
: single_segment(false),
|
||||
segment_duration(0),
|
||||
fragment_duration(0),
|
||||
segment_sap_aligned(false),
|
||||
fragment_sap_aligned(false),
|
||||
num_subsegments_per_sidx(0) {}
|
||||
MuxerOptions::~MuxerOptions() {}
|
||||
|
||||
} // namespace media
|
|
@ -10,6 +10,9 @@
|
|||
namespace media {
|
||||
|
||||
struct MuxerOptions {
|
||||
MuxerOptions();
|
||||
~MuxerOptions();
|
||||
|
||||
// Generate a single segment for each media presentation. This option
|
||||
// should be set for on demand profile.
|
||||
bool single_segment;
|
||||
|
|
|
@ -443,6 +443,9 @@ const uint8 kTestSignature_2048[] = {
|
|||
|
||||
namespace media {
|
||||
|
||||
RsaTestSet::RsaTestSet() {}
|
||||
RsaTestSet::~RsaTestSet() {}
|
||||
|
||||
RsaTestData::RsaTestData() {
|
||||
test_set_3072_bits_.test_message = kTestMessage;
|
||||
test_set_3072_bits_.public_key.assign(
|
||||
|
|
|
@ -15,6 +15,9 @@ namespace media {
|
|||
|
||||
// Self generated test vector to verify algorithm stability.
|
||||
struct RsaTestSet {
|
||||
RsaTestSet();
|
||||
~RsaTestSet();
|
||||
|
||||
std::string public_key;
|
||||
std::string private_key;
|
||||
std::string test_message;
|
||||
|
|
|
@ -28,7 +28,6 @@ class StreamInfo : public base::RefCountedThreadSafe<StreamInfo> {
|
|||
const uint8* extra_data,
|
||||
size_t extra_data_size,
|
||||
bool is_encrypted);
|
||||
virtual ~StreamInfo();
|
||||
|
||||
// Returns true if this object has appropriate configuration values, false
|
||||
// otherwise.
|
||||
|
@ -50,6 +49,10 @@ class StreamInfo : public base::RefCountedThreadSafe<StreamInfo> {
|
|||
|
||||
void set_duration(int duration) { duration_ = duration; }
|
||||
|
||||
protected:
|
||||
friend class base::RefCountedThreadSafe<StreamInfo>;
|
||||
virtual ~StreamInfo();
|
||||
|
||||
private:
|
||||
// Whether the stream is Audio or Video.
|
||||
StreamType stream_type_;
|
||||
|
|
|
@ -38,8 +38,6 @@ class VideoStreamInfo : public StreamInfo {
|
|||
size_t extra_data_size,
|
||||
bool is_encrypted);
|
||||
|
||||
virtual ~VideoStreamInfo();
|
||||
|
||||
// Returns true if this object has appropriate configuration values, false
|
||||
// otherwise.
|
||||
virtual bool IsValidConfig() const OVERRIDE;
|
||||
|
@ -60,6 +58,8 @@ class VideoStreamInfo : public StreamInfo {
|
|||
uint8 level);
|
||||
|
||||
private:
|
||||
virtual ~VideoStreamInfo();
|
||||
|
||||
VideoCodec codec_;
|
||||
uint16 width_;
|
||||
uint16 height_;
|
||||
|
|
|
@ -538,19 +538,20 @@ bool CompactSampleSize::ReadWrite(BoxBuffer* buffer) {
|
|||
buffer->ReadWriteUInt32(&sample_count));
|
||||
|
||||
// Reserve one more entry if field size is 4 bits.
|
||||
sizes.resize(sample_count + (field_size == 4 ? 1 : 0));
|
||||
sizes.resize(sample_count + (field_size == 4 ? 1 : 0), 0);
|
||||
switch (field_size) {
|
||||
case 4:
|
||||
for (uint32 i = 0; i < sample_count; ++i) {
|
||||
uint8 size;
|
||||
if (!buffer->Reading()) {
|
||||
DCHECK(sizes[i] < 16 && sizes[i+1] < 16);
|
||||
size = (sizes[i] << 4) | (++i < sample_count ? sizes[i] : 0);
|
||||
}
|
||||
RCHECK(buffer->ReadWriteUInt8(&size));
|
||||
for (uint32 i = 0; i < sample_count; i += 2) {
|
||||
if (buffer->Reading()) {
|
||||
uint8 size = 0;
|
||||
RCHECK(buffer->ReadWriteUInt8(&size));
|
||||
sizes[i] = size >> 4;
|
||||
sizes[++i] = size & 0x0F;
|
||||
sizes[i + 1] = size & 0x0F;
|
||||
} else {
|
||||
DCHECK_LT(sizes[i], 16);
|
||||
DCHECK_LT(sizes[i + 1], 16);
|
||||
uint8 size = (sizes[i] << 4) | sizes[i + 1];
|
||||
RCHECK(buffer->ReadWriteUInt8(&size));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -752,39 +752,39 @@ TYPED_TEST_CASE(BoxDefinitionsTestGeneral, Boxes);
|
|||
TYPED_TEST(BoxDefinitionsTestGeneral, WriteReadbackCompare) {
|
||||
TypeParam box;
|
||||
LOG(INFO) << "Processing " << FourCCToString(box.BoxType());
|
||||
Fill(&box);
|
||||
this->Fill(&box);
|
||||
box.Write(this->buffer_.get());
|
||||
|
||||
TypeParam box_readback;
|
||||
ASSERT_TRUE(ReadBack(&box_readback));
|
||||
ASSERT_TRUE(this->ReadBack(&box_readback));
|
||||
ASSERT_EQ(box, box_readback);
|
||||
}
|
||||
|
||||
TYPED_TEST(BoxDefinitionsTestGeneral, WriteModifyWrite) {
|
||||
TypeParam box;
|
||||
LOG(INFO) << "Processing " << FourCCToString(box.BoxType());
|
||||
Fill(&box);
|
||||
this->Fill(&box);
|
||||
// Save the expected version set earlier in function |Fill|, then clear
|
||||
// the version, expecting box.Write set version as expected.
|
||||
uint8 version = GetAndClearVersion(&box);
|
||||
uint8 version = this->GetAndClearVersion(&box);
|
||||
box.Write(this->buffer_.get());
|
||||
EXPECT_EQ(version, GetAndClearVersion(&box));
|
||||
EXPECT_EQ(version, this->GetAndClearVersion(&box));
|
||||
|
||||
this->buffer_->Clear();
|
||||
Modify(&box);
|
||||
version = GetAndClearVersion(&box);
|
||||
this->Modify(&box);
|
||||
version = this->GetAndClearVersion(&box);
|
||||
box.Write(this->buffer_.get());
|
||||
EXPECT_EQ(version, GetAndClearVersion(&box));
|
||||
EXPECT_EQ(version, this->GetAndClearVersion(&box));
|
||||
|
||||
TypeParam box_readback;
|
||||
ASSERT_TRUE(ReadBack(&box_readback));
|
||||
ASSERT_TRUE(this->ReadBack(&box_readback));
|
||||
ASSERT_EQ(box, box_readback);
|
||||
}
|
||||
|
||||
TYPED_TEST(BoxDefinitionsTestGeneral, Empty) {
|
||||
TypeParam box;
|
||||
LOG(INFO) << "Processing " << FourCCToString(box.BoxType());
|
||||
if (IsOptional(&box)) {
|
||||
if (this->IsOptional(&box)) {
|
||||
ASSERT_EQ(0, box.ComputeSize());
|
||||
} else {
|
||||
ASSERT_NE(0, box.ComputeSize());
|
||||
|
|
|
@ -33,7 +33,7 @@ struct FreeBox : Box {
|
|||
return true;
|
||||
}
|
||||
virtual FourCC BoxType() const OVERRIDE { return FOURCC_FREE; }
|
||||
virtual uint32 ComputeSize() {
|
||||
virtual uint32 ComputeSize() OVERRIDE {
|
||||
NOTIMPLEMENTED();
|
||||
return 0;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ struct PsshBox : Box {
|
|||
return buffer->ReadWriteUInt32(&val);
|
||||
}
|
||||
virtual FourCC BoxType() const OVERRIDE { return FOURCC_PSSH; }
|
||||
virtual uint32 ComputeSize() {
|
||||
virtual uint32 ComputeSize() OVERRIDE {
|
||||
NOTIMPLEMENTED();
|
||||
return 0;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ struct SkipBox : FullBox {
|
|||
return buffer->TryReadWriteChild(&empty);
|
||||
}
|
||||
virtual FourCC BoxType() const OVERRIDE { return FOURCC_SKIP; }
|
||||
virtual uint32 ComputeSize() {
|
||||
virtual uint32 ComputeSize() OVERRIDE {
|
||||
NOTIMPLEMENTED();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ class MP4GeneralSegmenter : public MP4Segmenter {
|
|||
MP4GeneralSegmenter(const MuxerOptions& options,
|
||||
scoped_ptr<FileType> ftyp,
|
||||
scoped_ptr<Movie> moov);
|
||||
~MP4GeneralSegmenter();
|
||||
virtual ~MP4GeneralSegmenter();
|
||||
|
||||
// MP4Segmenter implementations.
|
||||
virtual Status Initialize(EncryptorSource* encryptor_source,
|
||||
|
|
|
@ -29,7 +29,7 @@ class MP4VODSegmenter : public MP4Segmenter {
|
|||
MP4VODSegmenter(const MuxerOptions& options,
|
||||
scoped_ptr<FileType> ftyp,
|
||||
scoped_ptr<Movie> moov);
|
||||
~MP4VODSegmenter();
|
||||
virtual ~MP4VODSegmenter();
|
||||
|
||||
// MP4Segmenter implementations.
|
||||
virtual Status Initialize(EncryptorSource* encryptor_source,
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
'media/base/media_stream.h',
|
||||
'media/base/muxer.cc',
|
||||
'media/base/muxer.h',
|
||||
'media/base/muxer_options.cc',
|
||||
'media/base/muxer_options.h',
|
||||
'media/base/rsa_key.cc',
|
||||
'media/base/rsa_key.h',
|
||||
'media/base/status.cc',
|
||||
|
|
Loading…
Reference in New Issue