Bug 1018554 - Fix WebMWriter warnings and mark content/media/gtest as FAIL_ON_WARNINGS. r=rillian
authorChris Peterson <cpeterson@mozilla.com>
Fri, 30 May 2014 18:00:46 -0700
changeset 205460 2bf38fef6ff2a7c15d947d74ddc0970a2a173c14
parent 205459 a456dc7f19c4bdb85151f997a0cc533aa710651d
child 205461 c1acd3bf21ed742b11c26e3b5a026871f251ce2c
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs1018554
milestone32.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 1018554 - Fix WebMWriter warnings and mark content/media/gtest as FAIL_ON_WARNINGS. r=rillian
content/media/gtest/TestWebMWriter.cpp
content/media/gtest/moz.build
content/media/webm/WebMWriter.cpp
content/media/webm/WebMWriter.h
--- a/content/media/gtest/TestWebMWriter.cpp
+++ b/content/media/gtest/TestWebMWriter.cpp
@@ -147,17 +147,16 @@ TEST(WebMWriter, Cluster)
   writer.SetVP8Metadata(width, height, displayWidth,
                         displayHeight, aTrackRate);
 
   nsTArray<nsTArray<uint8_t> > encodedBuf;
   writer.GetContainerData(&encodedBuf, ContainerWriter::GET_HEADER);
   EXPECT_TRUE(encodedBuf.Length() > 0);
   encodedBuf.Clear();
 
-  uint64_t timestamp = 0;
   // write the first I-Frame.
   writer.AppendDummyFrame(EncodedFrame::VP8_I_FRAME, FIXED_DURATION);
   // No data because the cluster is not closed.
   EXPECT_FALSE(writer.HaveValidCluster());
 
   // The second I-Frame.
   writer.AppendDummyFrame(EncodedFrame::VP8_I_FRAME, FIXED_DURATION);
   // Should have data because the first cluster is closed.
@@ -186,17 +185,16 @@ TEST(WebMWriter, FLUSH_NEEDED)
   int32_t width = 176;
   int32_t height = 352;
   int32_t displayWidth = 176;
   int32_t displayHeight = 352;
   TrackRate aTrackRate = 100000;
   writer.SetVP8Metadata(width, height, displayWidth,
                         displayHeight, aTrackRate);
 
-  uint64_t timestamp = 0;
   // write the first I-Frame.
   writer.AppendDummyFrame(EncodedFrame::VP8_I_FRAME, FIXED_DURATION);
 
   // P-Frame
   writer.AppendDummyFrame(EncodedFrame::VP8_P_FRAME, FIXED_DURATION);
   // Have data because the metadata is finished.
   EXPECT_TRUE(writer.HaveValidCluster());
   // No data because the cluster is not closed and the metatdata had been
--- a/content/media/gtest/moz.build
+++ b/content/media/gtest/moz.build
@@ -21,8 +21,10 @@ EXPORT_LIBRARY = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 LOCAL_INCLUDES += [
     '/content/media/encoder',
 ]
 
 FINAL_LIBRARY = 'xul-gtest'
+
+FAIL_ON_WARNINGS = True
--- a/content/media/webm/WebMWriter.cpp
+++ b/content/media/webm/WebMWriter.cpp
@@ -9,16 +9,21 @@
 namespace mozilla {
 
 WebMWriter::WebMWriter(uint32_t aTrackTypes) : ContainerWriter()
 {
   mMetadataRequiredFlag = aTrackTypes;
   mEbmlComposer = new EbmlComposer();
 }
 
+WebMWriter::~WebMWriter()
+{
+  // Out-of-line dtor so mEbmlComposer nsAutoPtr can delete a complete type.
+}
+
 nsresult
 WebMWriter::WriteEncodedTrack(const EncodedFrameContainer& aData,
                               uint32_t aFlags)
 {
   for (uint32_t i = 0 ; i < aData.GetEncodedFrames().Length(); i++) {
     mEbmlComposer->WriteSimpleBlock(aData.GetEncodedFrames().ElementAt(i).get());
   }
   return NS_OK;
--- a/content/media/webm/WebMWriter.h
+++ b/content/media/webm/WebMWriter.h
@@ -42,16 +42,18 @@ public:
  * The ctor/dtor run in the MediaRecorder thread, others run in MediaEncoder thread.
  */
 class WebMWriter : public ContainerWriter
 {
 public:
   // aTrackTypes indicate this muxer should multiplex into Video only or A/V foramt.
   // Run in MediaRecorder thread
   WebMWriter(uint32_t aTrackTypes);
+  virtual ~WebMWriter();
+
   // WriteEncodedTrack inserts raw packets into WebM stream.
   nsresult WriteEncodedTrack(const EncodedFrameContainer &aData,
                              uint32_t aFlags = 0) MOZ_OVERRIDE;
 
   // GetContainerData outputs multiplexing data.
   // aFlags indicates the muxer should enter into finished stage and flush out
   // queue data.
   nsresult GetContainerData(nsTArray<nsTArray<uint8_t> >* aOutputBufs,