Backed out 6 changesets (bug 1127554) for Linux32 debug bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Sat, 21 Feb 2015 13:58:04 -0500
changeset 240824 ec501c1722c02202b6e03cec277d948974a65e73
parent 240823 8cb9be6123f88a86f9dc1fe1136ba452c869b7c0
child 240825 bbda80b65439a11b7f7c4d1ffb4540465894a7c1
push id7665
push userryanvm@gmail.com
push dateSat, 21 Feb 2015 18:58:07 +0000
treeherdermozilla-aurora@ec501c1722c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1127554
milestone37.0a2
backs outd8fdb34c556518f6e87662014f7c76f97808f350
ec548321aaf2c59a711d6049e4c291d326b3e181
abcc80b81681af8b3689875a2955c25078160081
386a1b2123872aae11324592140bdf845c540c9a
bdeb39455a420d06d8de0eb35dfbea24e5e30a93
f40214d5561a3f569687eb3d57efc8749170607e
Backed out 6 changesets (bug 1127554) for Linux32 debug bustage. Backed out changeset d8fdb34c5565 (bug 1127554) Backed out changeset ec548321aaf2 (bug 1127554) Backed out changeset abcc80b81681 (bug 1127554) Backed out changeset 386a1b212387 (bug 1127554) Backed out changeset bdeb39455a42 (bug 1127554) Backed out changeset f40214d5561a (bug 1127554)
dom/media/fmp4/AVCCDecoderModule.cpp
dom/media/fmp4/android/AndroidDecoderModule.cpp
dom/media/fmp4/apple/AppleATDecoder.cpp
dom/media/fmp4/ffmpeg/FFmpegAudioDecoder.cpp
dom/media/fmp4/ffmpeg/FFmpegH264Decoder.cpp
dom/media/fmp4/gonk/GonkVideoDecoderManager.cpp
dom/media/fmp4/wmf/WMFVideoMFTManager.cpp
media/libstagefright/binding/Adts.cpp
media/libstagefright/binding/AnnexB.cpp
media/libstagefright/binding/DecoderData.cpp
media/libstagefright/binding/Index.cpp
media/libstagefright/binding/include/mp4_demuxer/AnnexB.h
media/libstagefright/binding/include/mp4_demuxer/DecoderData.h
--- a/dom/media/fmp4/AVCCDecoderModule.cpp
+++ b/dom/media/fmp4/AVCCDecoderModule.cpp
@@ -82,19 +82,17 @@ AVCCMediaDataDecoder::Init()
     return mDecoder->Init();
   }
   return mLastError;
 }
 
 nsresult
 AVCCMediaDataDecoder::Input(mp4_demuxer::MP4Sample* aSample)
 {
-  if (!mp4_demuxer::AnnexB::ConvertSampleToAVCC(aSample)) {
-    return NS_ERROR_FAILURE;
-  }
+  mp4_demuxer::AnnexB::ConvertSampleToAVCC(aSample);
   if (!mDecoder) {
     // It is not possible to create an AVCC H264 decoder without SPS.
     // As such, creation will fail if the extra_data just extracted doesn't
     // contain a SPS.
     nsresult rv = CreateDecoderAndInit(aSample);
     if (rv == NS_ERROR_NOT_INITIALIZED) {
       // We are missing the required SPS to create the decoder.
       // Ignore for the time being, the MP4Sample will be dropped.
--- a/dom/media/fmp4/android/AndroidDecoderModule.cpp
+++ b/dom/media/fmp4/android/AndroidDecoderModule.cpp
@@ -61,20 +61,17 @@ public:
     return InitDecoder(mSurfaceTexture->JavaSurface());
   }
 
   void Cleanup() MOZ_OVERRIDE {
     mGLContext = nullptr;
   }
 
   virtual nsresult Input(mp4_demuxer::MP4Sample* aSample) MOZ_OVERRIDE {
-    if (!mp4_demuxer::AnnexB::ConvertSampleToAnnexB(aSample)) {
-      return NS_ERROR_OUT_OF_MEMORY;
-    }
-
+    mp4_demuxer::AnnexB::ConvertSampleToAnnexB(aSample);
     return MediaCodecDataDecoder::Input(aSample);
   }
 
   bool WantCopy() {
     // Allocating a texture is incredibly slow on PowerVR
     return mGLContext->Vendor() != GLVendor::Imagination;
   }
 
--- a/dom/media/fmp4/apple/AppleATDecoder.cpp
+++ b/dom/media/fmp4/apple/AppleATDecoder.cpp
@@ -461,25 +461,21 @@ static void
                 AudioStreamPacketDescription* aPackets)
 {
 }
 
 nsresult
 AppleATDecoder::GetImplicitAACMagicCookie(const mp4_demuxer::MP4Sample* aSample)
 {
   // Prepend ADTS header to AAC audio.
-  nsAutoPtr<mp4_demuxer::MP4Sample> adtssample(aSample->Clone());
-  if (!adtssample) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
+  mp4_demuxer::MP4Sample adtssample(*aSample);
   bool rv = mp4_demuxer::Adts::ConvertSample(mConfig.channel_count,
                                              mConfig.frequency_index,
                                              mConfig.aac_profile,
-                                             adtssample);
+                                             &adtssample);
   if (!rv) {
     NS_WARNING("Failed to apply ADTS header");
     return NS_ERROR_FAILURE;
   }
   if (!mStream) {
     OSStatus rv = AudioFileStreamOpen(this,
                                       _MetadataCallback,
                                       _SampleCallback,
@@ -487,18 +483,18 @@ AppleATDecoder::GetImplicitAACMagicCooki
                                       &mStream);
     if (rv) {
       NS_WARNING("Couldn't open AudioFileStream");
       return NS_ERROR_FAILURE;
     }
   }
 
   OSStatus status = AudioFileStreamParseBytes(mStream,
-                                              adtssample->size,
-                                              adtssample->data,
+                                              adtssample.size,
+                                              adtssample.data,
                                               0 /* discontinuity */);
   if (status) {
     NS_WARNING("Couldn't parse sample");
   }
 
   if (status || mFileStreamError || mMagicCookie.Length()) {
     // We have decoded a magic cookie or an error occurred as such
     // we won't need the stream any longer.
--- a/dom/media/fmp4/ffmpeg/FFmpegAudioDecoder.cpp
+++ b/dom/media/fmp4/ffmpeg/FFmpegAudioDecoder.cpp
@@ -83,22 +83,17 @@ CopyAndPackAudio(AVFrame* aFrame, uint32
 }
 
 void
 FFmpegAudioDecoder<LIBAV_VER>::DecodePacket(MP4Sample* aSample)
 {
   AVPacket packet;
   av_init_packet(&packet);
 
-  if (!aSample->Pad(FF_INPUT_BUFFER_PADDING_SIZE)) {
-    NS_WARNING("FFmpeg audio decoder failed to allocate sample.");
-    mCallback->Error();
-    return;
-  }
-
+  aSample->Pad(FF_INPUT_BUFFER_PADDING_SIZE);
   packet.data = aSample->data;
   packet.size = aSample->size;
 
   if (!PrepareFrame()) {
     NS_WARNING("FFmpeg audio decoder failed to allocate frame.");
     mCallback->Error();
     return;
   }
--- a/dom/media/fmp4/ffmpeg/FFmpegH264Decoder.cpp
+++ b/dom/media/fmp4/ffmpeg/FFmpegH264Decoder.cpp
@@ -48,28 +48,18 @@ FFmpegH264Decoder<LIBAV_VER>::Init()
 }
 
 FFmpegH264Decoder<LIBAV_VER>::DecodeResult
 FFmpegH264Decoder<LIBAV_VER>::DoDecodeFrame(mp4_demuxer::MP4Sample* aSample)
 {
   AVPacket packet;
   av_init_packet(&packet);
 
-  if (!mp4_demuxer::AnnexB::ConvertSampleToAnnexB(aSample)) {
-    NS_WARNING("FFmpeg h264 decoder failed to convert sample to Annex B.");
-    mCallback->Error();
-    return DecodeResult::DECODE_ERROR;
-  }
-
-  if (!aSample->Pad(FF_INPUT_BUFFER_PADDING_SIZE)) {
-    NS_WARNING("FFmpeg h264 decoder failed to allocate sample.");
-    mCallback->Error();
-    return DecodeResult::DECODE_ERROR;
-  }
-
+  mp4_demuxer::AnnexB::ConvertSampleToAnnexB(aSample);
+  aSample->Pad(FF_INPUT_BUFFER_PADDING_SIZE);
   packet.data = aSample->data;
   packet.size = aSample->size;
   packet.dts = aSample->decode_timestamp;
   packet.pts = aSample->composition_timestamp;
   packet.flags = aSample->is_sync_point ? AV_PKT_FLAG_KEY : 0;
   packet.pos = aSample->byte_offset;
 
   if (!PrepareFrame()) {
--- a/dom/media/fmp4/gonk/GonkVideoDecoderManager.cpp
+++ b/dom/media/fmp4/gonk/GonkVideoDecoderManager.cpp
@@ -440,20 +440,17 @@ GonkVideoDecoderManager::Input(mp4_demux
 {
   if (mDecoder == nullptr) {
     GVDM_LOG("Decoder is not inited");
     return NS_ERROR_UNEXPECTED;
   }
   status_t rv;
   if (aSample != nullptr) {
     // We must prepare samples in AVC Annex B.
-    if (!mp4_demuxer::AnnexB::ConvertSampleToAnnexB(aSample)) {
-      return NS_ERROR_FAILURE;
-    }
-
+    mp4_demuxer::AnnexB::ConvertSampleToAnnexB(aSample);
     // Forward sample data to the decoder.
 
     QueueFrameTimeIn(aSample->composition_timestamp, aSample->duration);
 
     const uint8_t* data = reinterpret_cast<const uint8_t*>(aSample->data);
     uint32_t length = aSample->size;
     rv = mDecoder->Input(data, length, aSample->composition_timestamp, 0);
   }
--- a/dom/media/fmp4/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/fmp4/wmf/WMFVideoMFTManager.cpp
@@ -231,19 +231,17 @@ WMFVideoMFTManager::Init()
   return decoder.forget();
 }
 
 HRESULT
 WMFVideoMFTManager::Input(mp4_demuxer::MP4Sample* aSample)
 {
   if (mStreamType != VP8 && mStreamType != VP9) {
     // We must prepare samples in AVC Annex B.
-    if (!mp4_demuxer::AnnexB::ConvertSampleToAnnexB(aSample)) {
-      return E_FAIL;
-    }
+    mp4_demuxer::AnnexB::ConvertSampleToAnnexB(aSample);
   }
   // Forward sample data to the decoder.
   const uint8_t* data = reinterpret_cast<const uint8_t*>(aSample->data);
   uint32_t length = aSample->size;
   return mDecoder->Input(data, length, aSample->composition_timestamp);
 }
 
 HRESULT
--- a/media/libstagefright/binding/Adts.cpp
+++ b/media/libstagefright/binding/Adts.cpp
@@ -51,20 +51,17 @@ Adts::ConvertSample(uint16_t aChannelCou
   header[1] = 0xf1;
   header[2] =
     ((aProfile - 1) << 6) + (aFrequencyIndex << 2) + (aChannelCount >> 2);
   header[3] = ((aChannelCount & 0x3) << 6) + (newSize >> 11);
   header[4] = (newSize & 0x7ff) >> 3;
   header[5] = ((newSize & 7) << 5) + 0x1f;
   header[6] = 0xfc;
 
-  if (!aSample->Prepend(&header[0], ArrayLength(header))) {
-    return false;
-  }
-
+  aSample->Prepend(&header[0], ArrayLength(header));
   if (aSample->crypto.valid) {
     if (aSample->crypto.plain_sizes.Length() == 0) {
       aSample->crypto.plain_sizes.AppendElement(kADTSHeaderSize);
       aSample->crypto.encrypted_sizes.AppendElement(aSample->size - kADTSHeaderSize);
     } else {
       aSample->crypto.plain_sizes[0] += kADTSHeaderSize;
     }
   }
--- a/media/libstagefright/binding/AnnexB.cpp
+++ b/media/libstagefright/binding/AnnexB.cpp
@@ -11,33 +11,31 @@
 
 using namespace mozilla;
 
 namespace mp4_demuxer
 {
 
 static const uint8_t kAnnexBDelimiter[] = { 0, 0, 0, 1 };
 
-bool
+void
 AnnexB::ConvertSampleToAnnexB(MP4Sample* aSample)
 {
   MOZ_ASSERT(aSample);
 
   if (!IsAVCC(aSample)) {
-    return true;
+    return;
   }
   MOZ_ASSERT(aSample->data);
 
-  if (!ConvertSampleTo4BytesAVCC(aSample)) {
-    return false;
-  }
+  ConvertSampleTo4BytesAVCC(aSample);
 
   if (aSample->size < 4) {
-    // Nothing to do, it's corrupted anyway.
-    return true;
+    // Nothing to do, it's corrupted anyway.
+    return;
   }
 
   ByteReader reader(aSample->data, aSample->size);
 
   mozilla::Vector<uint8_t> tmp;
   ByteWriter writer(tmp);
 
   while (reader.Remaining() >= 4) {
@@ -46,30 +44,24 @@ AnnexB::ConvertSampleToAnnexB(MP4Sample*
 
     writer.Write(kAnnexBDelimiter, ArrayLength(kAnnexBDelimiter));
     if (!p) {
       break;
     }
     writer.Write(p, nalLen);
   }
 
-  if (!aSample->Replace(tmp.begin(), tmp.length())) {
-    return false;
-  }
+  aSample->Replace(tmp.begin(), tmp.length());
 
   // Prepend the Annex B NAL with SPS and PPS tables to keyframes.
   if (aSample->is_sync_point) {
     nsRefPtr<ByteBuffer> annexB =
       ConvertExtraDataToAnnexB(aSample->extra_data);
-    if (!aSample->Prepend(annexB->Elements(), annexB->Length())) {
-      return false;
-    }
+    aSample->Prepend(annexB->Elements(), annexB->Length());
   }
-
-  return true;
 }
 
 already_AddRefed<ByteBuffer>
 AnnexB::ConvertExtraDataToAnnexB(const ByteBuffer* aExtraData)
 {
   // AVCC 6 byte header looks like:
   //     +------+------+------+------+------+------+------+------+
   // [0] |   0  |   0  |   0  |   0  |   0  |   0  |   0  |   1  |
@@ -206,35 +198,36 @@ ParseNALUnits(ByteWriter& aBw, ByteReade
   }
   size_t sizeNAL = aBr.Remaining();
   if (sizeNAL) {
     aBw.WriteU32(sizeNAL);
     aBw.Write(aBr.Read(sizeNAL), sizeNAL);
   }
 }
 
-bool
+void
 AnnexB::ConvertSampleToAVCC(MP4Sample* aSample)
 {
   if (IsAVCC(aSample)) {
-    return ConvertSampleTo4BytesAVCC(aSample);
+    ConvertSampleTo4BytesAVCC(aSample);
+    return;
   }
 
   uint32_t header = mozilla::BigEndian::readUint32(aSample->data);
   if (header != 0x00000001 && (header >> 8) != 0x000001) {
     // Not AnnexB, can't convert.
-    return true;
+    return;
   }
 
   mozilla::Vector<uint8_t> nalu;
   ByteWriter writer(nalu);
   ByteReader reader(aSample->data, aSample->size);
 
   ParseNALUnits(writer, reader);
-  return aSample->Replace(nalu.begin(), nalu.length());
+  aSample->Replace(nalu.begin(), nalu.length());
 }
 
 already_AddRefed<ByteBuffer>
 AnnexB::ExtractExtraData(const MP4Sample* aSample)
 {
   nsRefPtr<ByteBuffer> extradata = new ByteBuffer;
   if (!IsAVCC(aSample)) {
     return extradata.forget();
@@ -314,45 +307,45 @@ AnnexB::HasSPS(const ByteBuffer* aExtraD
     return false;
   }
   uint8_t numSps = reader.ReadU8() & 0x1f;
   reader.DiscardRemaining();
 
   return numSps > 0;
 }
 
-bool
+void
 AnnexB::ConvertSampleTo4BytesAVCC(MP4Sample* aSample)
 {
   MOZ_ASSERT(IsAVCC(aSample));
 
   int nalLenSize = ((*aSample->extra_data)[4] & 3) + 1;
 
   if (nalLenSize == 4) {
-    return true;
+    return;
   }
   mozilla::Vector<uint8_t> dest;
   ByteWriter writer(dest);
   ByteReader reader(aSample->data, aSample->size);
   while (reader.Remaining() > nalLenSize) {
     uint32_t nalLen;
     switch (nalLenSize) {
       case 1: nalLen = reader.ReadU8();  break;
       case 2: nalLen = reader.ReadU16(); break;
       case 3: nalLen = reader.ReadU24(); break;
       case 4: nalLen = reader.ReadU32(); break;
     }
     const uint8_t* p = reader.Read(nalLen);
     if (!p) {
-      return true;
+      return;
     }
     writer.WriteU32(nalLen);
     writer.Write(p, nalLen);
   }
-  return aSample->Replace(dest.begin(), dest.length());
+  aSample->Replace(dest.begin(), dest.length());
 }
 
 bool
 AnnexB::IsAVCC(const MP4Sample* aSample)
 {
   return aSample->size >= 3 && aSample->extra_data &&
     aSample->extra_data->Length() >= 7 && (*aSample->extra_data)[0] == 1;
 }
--- a/media/libstagefright/binding/DecoderData.cpp
+++ b/media/libstagefright/binding/DecoderData.cpp
@@ -7,17 +7,16 @@
 #include "mp4_demuxer/ByteReader.h"
 #include "mp4_demuxer/DecoderData.h"
 #include <media/stagefright/foundation/ABitReader.h>
 #include "media/stagefright/MetaData.h"
 #include "media/stagefright/MediaBuffer.h"
 #include "media/stagefright/MediaDefs.h"
 #include "media/stagefright/Utils.h"
 #include "mozilla/ArrayUtils.h"
-#include "mozilla/fallible.h"
 #include "include/ESDS.h"
 
 using namespace stagefright;
 
 namespace mp4_demuxer
 {
 
 static int32_t
@@ -206,34 +205,29 @@ MP4Sample::MP4Sample()
   , byte_offset(0)
   , is_sync_point(0)
   , data(nullptr)
   , size(0)
   , extra_data(nullptr)
 {
 }
 
-MP4Sample*
-MP4Sample::Clone() const
+MP4Sample::MP4Sample(const MP4Sample& copy)
+  : mMediaBuffer(nullptr)
+  , decode_timestamp(copy.decode_timestamp)
+  , composition_timestamp(copy.composition_timestamp)
+  , duration(copy.duration)
+  , byte_offset(copy.byte_offset)
+  , is_sync_point(copy.is_sync_point)
+  , size(copy.size)
+  , crypto(copy.crypto)
+  , extra_data(copy.extra_data)
 {
-  nsAutoPtr<MP4Sample> s(new MP4Sample());
-  s->decode_timestamp = decode_timestamp;
-  s->composition_timestamp = composition_timestamp;
-  s->duration = duration;
-  s->byte_offset = byte_offset;
-  s->is_sync_point = is_sync_point;
-  s->size = size;
-  s->crypto = crypto;
-  s->extra_data = extra_data;
-  s->extra_buffer = s->data = new ((fallible_t())) uint8_t[size];
-  if (!s->extra_buffer) {
-    return nullptr;
-  }
-  memcpy(s->data, data, size);
-  return s.forget();
+  extra_buffer = data = new uint8_t[size];
+  memcpy(data, copy.data, size);
 }
 
 MP4Sample::~MP4Sample()
 {
   if (mMediaBuffer) {
     mMediaBuffer->release();
   }
 }
@@ -250,91 +244,76 @@ MP4Sample::Update(int64_t& aMediaTime, i
   byte_offset = FindInt64(m, kKey64BitFileOffset);
   is_sync_point = FindInt32(m, kKeyIsSyncFrame);
   data = reinterpret_cast<uint8_t*>(mMediaBuffer->data());
   size = mMediaBuffer->range_length();
 
   crypto.Update(m);
 }
 
-bool
+void
 MP4Sample::Pad(size_t aPaddingBytes)
 {
   size_t newSize = size + aPaddingBytes;
 
   // If the existing MediaBuffer has enough space then we just recycle it. If
   // not then we copy to a new buffer.
   uint8_t* newData = mMediaBuffer && newSize <= mMediaBuffer->size()
                        ? data
-                       : new ((fallible_t())) uint8_t[newSize];
-  if (!newData) {
-    return false;
-  }
+                       : new uint8_t[newSize];
 
   memset(newData + size, 0, aPaddingBytes);
 
   if (newData != data) {
     memcpy(newData, data, size);
     extra_buffer = data = newData;
     if (mMediaBuffer) {
       mMediaBuffer->release();
       mMediaBuffer = nullptr;
     }
   }
-
-  return true;
 }
 
-bool
+void
 MP4Sample::Prepend(const uint8_t* aData, size_t aSize)
 {
   size_t newSize = size + aSize;
 
   // If the existing MediaBuffer has enough space then we just recycle it. If
   // not then we copy to a new buffer.
   uint8_t* newData = mMediaBuffer && newSize <= mMediaBuffer->size()
                        ? data
-                       : new ((fallible_t())) uint8_t[newSize];
-  if (!newData) {
-    return false;
-  }
+                       : new uint8_t[newSize];
 
   memmove(newData + aSize, data, size);
   memmove(newData, aData, aSize);
   size = newSize;
 
   if (newData != data) {
     extra_buffer = data = newData;
     if (mMediaBuffer) {
       mMediaBuffer->release();
       mMediaBuffer = nullptr;
     }
   }
-
-  return true;
 }
 
-bool
+void
 MP4Sample::Replace(const uint8_t* aData, size_t aSize)
 {
   // If the existing MediaBuffer has enough space then we just recycle it. If
   // not then we copy to a new buffer.
   uint8_t* newData = mMediaBuffer && aSize <= mMediaBuffer->size()
                        ? data
-                       : new ((fallible_t())) uint8_t[aSize];
-  if (!newData) {
-    return false;
-  }
+                       : new uint8_t[aSize];
 
   memcpy(newData, aData, aSize);
   size = aSize;
 
   if (newData != data) {
     extra_buffer = data = newData;
     if (mMediaBuffer) {
       mMediaBuffer->release();
       mMediaBuffer = nullptr;
     }
   }
-
-  return true;
 }
 }
--- a/media/libstagefright/binding/Index.cpp
+++ b/media/libstagefright/binding/Index.cpp
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mp4_demuxer/ByteReader.h"
 #include "mp4_demuxer/Index.h"
 #include "mp4_demuxer/Interval.h"
 #include "mp4_demuxer/MoofParser.h"
 #include "media/stagefright/MediaSource.h"
 #include "MediaResource.h"
-#include "mozilla/fallible.h"
 
 #include <algorithm>
 #include <limits>
 
 using namespace stagefright;
 using namespace mozilla;
 
 namespace mp4_demuxer
@@ -95,20 +94,17 @@ MP4Sample* SampleIterator::GetNext()
   sample->decode_timestamp = s->mDecodeTime;
   sample->composition_timestamp = s->mCompositionRange.start;
   sample->duration = s->mCompositionRange.Length();
   sample->byte_offset = s->mByteRange.mStart;
   sample->is_sync_point = s->mSync;
   sample->size = s->mByteRange.Length();
 
   // Do the blocking read
-  sample->data = sample->extra_buffer = new ((fallible_t())) uint8_t[sample->size];
-  if (!sample->data) {
-    return nullptr;
-  }
+  sample->data = sample->extra_buffer = new uint8_t[sample->size];
 
   size_t bytesRead;
   if (!mIndex->mSource->ReadAt(sample->byte_offset, sample->data, sample->size,
                                &bytesRead) || bytesRead != sample->size) {
     return nullptr;
   }
 
   if (!s->mCencRange.IsNull()) {
--- a/media/libstagefright/binding/include/mp4_demuxer/AnnexB.h
+++ b/media/libstagefright/binding/include/mp4_demuxer/AnnexB.h
@@ -14,21 +14,21 @@ namespace mp4_demuxer
 class ByteReader;
 class MP4Sample;
 
 class AnnexB
 {
 public:
   // All conversions assume size of NAL length field is 4 bytes.
   // Convert a sample from AVCC format to Annex B.
-  static bool ConvertSampleToAnnexB(MP4Sample* aSample);
+  static void ConvertSampleToAnnexB(MP4Sample* aSample);
   // Convert a sample from Annex B to AVCC.
   // an AVCC extradata must not be set.
-  static bool ConvertSampleToAVCC(MP4Sample* aSample);
-  static bool ConvertSampleTo4BytesAVCC(MP4Sample* aSample);
+  static void ConvertSampleToAVCC(MP4Sample* aSample);
+  static void ConvertSampleTo4BytesAVCC(MP4Sample* aSample);
 
   // Parse an AVCC extradata and construct the Annex B sample header.
   static already_AddRefed<ByteBuffer> ConvertExtraDataToAnnexB(
     const ByteBuffer* aExtraData);
   static already_AddRefed<ByteBuffer> ExtractExtraData(
     const MP4Sample* aSample);
   static bool HasSPS(const MP4Sample* aSample);
   static bool HasSPS(const ByteBuffer* aExtraData);
--- a/media/libstagefright/binding/include/mp4_demuxer/DecoderData.h
+++ b/media/libstagefright/binding/include/mp4_demuxer/DecoderData.h
@@ -150,37 +150,35 @@ public:
 };
 
 typedef int64_t Microseconds;
 
 class MP4Sample
 {
 public:
   MP4Sample();
+  MP4Sample(const MP4Sample& copy);
   virtual ~MP4Sample();
-  MP4Sample* Clone() const;
   void Update(int64_t& aMediaTime, int64_t& aTimestampOffset);
-  bool Pad(size_t aPaddingBytes);
+  void Pad(size_t aPaddingBytes);
 
   stagefright::MediaBuffer* mMediaBuffer;
 
   Microseconds decode_timestamp;
   Microseconds composition_timestamp;
   Microseconds duration;
   int64_t byte_offset;
   bool is_sync_point;
 
   uint8_t* data;
   size_t size;
 
   CryptoSample crypto;
   nsRefPtr<ByteBuffer> extra_data;
 
-  bool Prepend(const uint8_t* aData, size_t aSize);
-  bool Replace(const uint8_t* aData, size_t aSize);
+  void Prepend(const uint8_t* aData, size_t aSize);
+  void Replace(const uint8_t* aData, size_t aSize);
 
   nsAutoArrayPtr<uint8_t> extra_buffer;
-private:
-  MP4Sample(const MP4Sample&); // Not implemented
 };
 }
 
 #endif