Bug 1043695 - Log output frame metadata. r=cpearce
authorRalph Giles <giles@mozilla.com>
Thu, 24 Jul 2014 16:57:00 -0700
changeset 196826 a140fa9605f0cf1f3c2e92ea79d09545204489d5
parent 196825 18d6d559e00b576c2572004cd50c64dea69246de
child 196827 c62d33eb57d3b870cdc167c0cac1b442a36554d9
push id46977
push userrgiles@mozilla.com
push dateWed, 30 Jul 2014 16:59:13 +0000
treeherdermozilla-inbound@dc0fbe8b84d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1043695
milestone34.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 1043695 - Log output frame metadata. r=cpearce Also cleans up the input sample log so they're easier to compare.
content/media/fmp4/apple/AppleVTDecoder.cpp
--- a/content/media/fmp4/apple/AppleVTDecoder.cpp
+++ b/content/media/fmp4/apple/AppleVTDecoder.cpp
@@ -75,20 +75,20 @@ AppleVTDecoder::Shutdown()
     mFormat = nullptr;
   }
   return NS_OK;
 }
 
 nsresult
 AppleVTDecoder::Input(mp4_demuxer::MP4Sample* aSample)
 {
-  LOG("mp4 input sample %p %lld us %lld pts%s %d bytes dispatched",
+  LOG("mp4 input sample %p pts %lld duration %lld us%s %d bytes",
       aSample,
+      aSample->composition_timestamp,
       aSample->duration,
-      aSample->composition_timestamp,
       aSample->is_sync_point ? " keyframe" : "",
       aSample->size);
 
 #ifdef LOG_MEDIA_SHA1
   SHA1Sum hash;
   hash.update(aSample->data, aSample->size);
   uint8_t digest_buf[SHA1Sum::kHashSize];
   hash.finish(digest_buf);
@@ -156,33 +156,41 @@ PlatformCallback(void* decompressionOutp
                  OSStatus status,
                  VTDecodeInfoFlags flags,
                  CVImageBufferRef image,
                  CMTime presentationTimeStamp,
                  CMTime presentationDuration)
 {
   LOG("AppleVideoDecoder %s status %d flags %d", __func__, status, flags);
 
+  AppleVTDecoder* decoder =
+    static_cast<AppleVTDecoder*>(decompressionOutputRefCon);
+  nsAutoPtr<FrameRef> frameRef =
+    nsAutoPtr<FrameRef>(static_cast<FrameRef*>(sourceFrameRefCon));
+
+  LOG("mp4 output frame %lld pts %lld duration %lld us%s",
+    frameRef->byte_offset,
+    frameRef->timestamp,
+    frameRef->duration,
+    frameRef->is_sync_point ? " keyframe" : ""
+  );
+
   // Validate our arguments.
   if (status != noErr || !image) {
     NS_WARNING("VideoToolbox decoder returned no data");
     return;
   }
   if (flags & kVTDecodeInfo_FrameDropped) {
     NS_WARNING("  ...frame dropped...");
   }
   MOZ_ASSERT(CFGetTypeID(image) == CVPixelBufferGetTypeID(),
     "VideoToolbox returned an unexpected image type");
 
   // Forward the data back to an object method which can access
   // the correct MP4Reader callback.
-  AppleVTDecoder* decoder =
-    static_cast<AppleVTDecoder*>(decompressionOutputRefCon);
-  nsAutoPtr<FrameRef> frameRef =
-    nsAutoPtr<FrameRef>(static_cast<FrameRef*>(sourceFrameRefCon));
   decoder->OutputFrame(image, frameRef);
 }
 
 // Copy and return a decoded frame.
 nsresult
 AppleVTDecoder::OutputFrame(CVPixelBufferRef aImage,
                             nsAutoPtr<FrameRef> aFrameRef)
 {