From 5b869fb4fbd2ce02e6cd56634ab99048e35b787b Mon Sep 17 00:00:00 2001 From: Ramji Chandramouli Date: Tue, 16 Sep 2014 12:55:49 -0700 Subject: [PATCH] Build break fixes for issues found using clang. Change-Id: Id9e74f03ec27b25cdac22c43394ecc0ec9007d19 --- media/base/media_sample.cc | 4 ++++ media/base/media_sample.h | 9 ++------- media/formats/wvm/wvm_media_parser.cc | 21 ++++++++++++++++++++- media/formats/wvm/wvm_media_parser.h | 14 +++++++------- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/media/base/media_sample.cc b/media/base/media_sample.cc index 3af8f5b7d9..dd484e0fee 100644 --- a/media/base/media_sample.cc +++ b/media/base/media_sample.cc @@ -30,6 +30,10 @@ MediaSample::MediaSample(const uint8* data, side_data_.assign(side_data, side_data + side_data_size); } +MediaSample::MediaSample() : dts_(0), pts_(0), + duration_(0), + is_key_frame_(false) {} + MediaSample::~MediaSample() {} // static diff --git a/media/base/media_sample.h b/media/base/media_sample.h index d0d36606cd..270b6deaed 100644 --- a/media/base/media_sample.h +++ b/media/base/media_sample.h @@ -112,8 +112,7 @@ class MediaSample : public base::RefCountedThreadSafe { } void set_data(const uint8* data, const size_t data_size) { - data_size_ = data_size; - data_.assign(data, data + data_size_); + data_.assign(data, data + data_size); } void set_is_key_frame(bool value) { @@ -137,10 +136,7 @@ class MediaSample : public base::RefCountedThreadSafe { const uint8* side_data, size_t side_data_size, bool is_key_frame); - MediaSample() : dts_(0), pts_(0), - duration_(0), - is_key_frame_(false), - data_size_(0) {} + MediaSample(); virtual ~MediaSample(); // Decoding time stamp. @@ -156,7 +152,6 @@ class MediaSample : public base::RefCountedThreadSafe { // http://www.matroska.org/technical/specs/index.html BlockAdditional[A5]. // Not used by mp4 and other containers. std::vector side_data_; - size_t data_size_; DISALLOW_COPY_AND_ASSIGN(MediaSample); }; diff --git a/media/formats/wvm/wvm_media_parser.cc b/media/formats/wvm/wvm_media_parser.cc index 81f7ab1388..395c4f5535 100644 --- a/media/formats/wvm/wvm_media_parser.cc +++ b/media/formats/wvm/wvm_media_parser.cc @@ -30,7 +30,6 @@ namespace { const uint32 kEcmStreamId = 0xF0; const uint32 kV2MetadataStreamId = 0xF1; // EMM_stream const uint32 kScramblingBitsMask = 0x30; - const uint32 kEncryptedOddKey = 0x30; const uint32 kStartCode1 = 0x00; const uint32 kStartCode2 = 0x00; const uint32 kStartCode3 = 0x01; @@ -92,6 +91,8 @@ WvmMediaParser::WvmMediaParser() : is_initialized_(false), SHA256_Init(sha_context_); } +WvmMediaParser::~WvmMediaParser() {} + void WvmMediaParser::Init(const InitCB& init_cb, const NewSampleCB& new_sample_cb, KeySource* decryption_key_source) { @@ -891,5 +892,23 @@ void WvmMediaParser::EmitSample( } } +DemuxStreamIdMediaSample::DemuxStreamIdMediaSample() : + demux_stream_id(0), + parsed_audio_or_video_stream_id(0) {} + +DemuxStreamIdMediaSample::~DemuxStreamIdMediaSample() {} + +PrevSampleData::PrevSampleData() { + Reset(); +} + +PrevSampleData::~PrevSampleData() {} + +void PrevSampleData::Reset() { + audio_sample = video_sample = NULL; + audio_stream_id = video_stream_id = 0; + audio_sample_duration = video_sample_duration = 0; +} + } // namespace wvm } // namespace media diff --git a/media/formats/wvm/wvm_media_parser.h b/media/formats/wvm/wvm_media_parser.h index e8e7cc3f5f..04159b15a6 100644 --- a/media/formats/wvm/wvm_media_parser.h +++ b/media/formats/wvm/wvm_media_parser.h @@ -23,6 +23,9 @@ namespace media { namespace wvm { struct DemuxStreamIdMediaSample { + public: + DemuxStreamIdMediaSample(); + ~DemuxStreamIdMediaSample(); uint32 demux_stream_id; uint32 parsed_audio_or_video_stream_id; scoped_refptr media_sample; @@ -30,12 +33,9 @@ struct DemuxStreamIdMediaSample { struct PrevSampleData { public: - PrevSampleData() { Reset(); } - void Reset() { - audio_sample = video_sample = NULL; - audio_stream_id = video_stream_id = 0; - audio_sample_duration = video_sample_duration = 0; - } + PrevSampleData(); + ~PrevSampleData(); + void Reset(); scoped_refptr audio_sample; scoped_refptr video_sample; uint32 audio_stream_id; @@ -47,7 +47,7 @@ struct PrevSampleData { class WvmMediaParser : public MediaParser { public: WvmMediaParser(); - virtual ~WvmMediaParser() {} + virtual ~WvmMediaParser(); // MediaParser implementation overrides. virtual void Init(const InitCB& init_cb,