Bug 1425277 - p5: add Append() to MediaRawDataWriter. r=jya
authorJohn Lin <jolin@mozilla.com>
Mon, 26 Nov 2018 18:28:31 +0000
changeset 504511 3bf7f358af16db7285ad8025d7aae82869d805be
parent 504510 6dbd2767e7abfb93b88da4e9744bfc1f44aab74d
child 504512 b86195e2307af27bfe09b6b9b7447f0ac1f718f5
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1425277
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1425277 - p5: add Append() to MediaRawDataWriter. r=jya Differential Revision: https://phabricator.services.mozilla.com/D7561
dom/media/MediaData.cpp
dom/media/MediaData.h
--- a/dom/media/MediaData.cpp
+++ b/dom/media/MediaData.cpp
@@ -414,16 +414,20 @@ MediaRawDataWriter::MediaRawDataWriter(M
 bool MediaRawDataWriter::SetSize(size_t aSize) {
   return mTarget->mBuffer.SetLength(aSize);
 }
 
 bool MediaRawDataWriter::Prepend(const uint8_t* aData, size_t aSize) {
   return mTarget->mBuffer.Prepend(aData, aSize);
 }
 
+bool MediaRawDataWriter::Append(const uint8_t* aData, size_t aSize) {
+  return mTarget->mBuffer.Append(aData, aSize);
+}
+
 bool MediaRawDataWriter::Replace(const uint8_t* aData, size_t aSize) {
   return mTarget->mBuffer.Replace(aData, aSize);
 }
 
 void MediaRawDataWriter::Clear() { mTarget->mBuffer.Clear(); }
 
 uint8_t* MediaRawDataWriter::Data() { return mTarget->mBuffer.Data(); }
 
--- a/dom/media/MediaData.h
+++ b/dom/media/MediaData.h
@@ -541,16 +541,17 @@ class MediaRawDataWriter {
 
   // Data manipulation methods. mData and mSize may be updated accordingly.
 
   // Set size of buffer, allocating memory as required.
   // If size is increased, new buffer area is filled with 0.
   MOZ_MUST_USE bool SetSize(size_t aSize);
   // Add aData at the beginning of buffer.
   MOZ_MUST_USE bool Prepend(const uint8_t* aData, size_t aSize);
+  MOZ_MUST_USE bool Append(const uint8_t* aData, size_t aSize);
   // Replace current content with aData.
   MOZ_MUST_USE bool Replace(const uint8_t* aData, size_t aSize);
   // Clear the memory buffer. Will set target mData and mSize to 0.
   void Clear();
   // Remove aSize bytes from the front of the sample.
   void PopFront(size_t aSize);
 
  private: