Bug 1054704 - Generate an IDR NAL for fake H.264. r=jesup, a=sledru
authorEKR <ekr@rtfm.com>
Thu, 21 Aug 2014 10:09:38 -0700
changeset 209611 e276d1a68b63983a955d842a8eb5c8284b9e20d9
parent 209610 84bdca67fffedf5f9a313e2ff23b5921826c4fd3
child 209612 c9102769c7417bebfe40b71f145a352ddd9e0a86
push id6727
push userryanvm@gmail.com
push dateSat, 30 Aug 2014 15:31:43 +0000
treeherdermozilla-aurora@7b3b162ff01c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, sledru
bugs1054704
milestone33.0a2
Bug 1054704 - Generate an IDR NAL for fake H.264. r=jesup, a=sledru
dom/media/gmp-plugin/gmp-fake.cpp
--- a/dom/media/gmp-plugin/gmp-fake.cpp
+++ b/dom/media/gmp-plugin/gmp-fake.cpp
@@ -169,20 +169,22 @@ class FakeVideoEncoder : public GMPVideo
     GMPErr err = host_->CreateFrame (kGMPEncodedVideoFrame, &ftmp);
     if (err != GMPNoErr) {
       GMPLOG (GL_ERROR, "Error creating encoded frame");
       return;
     }
 
     GMPVideoEncodedFrame* f = static_cast<GMPVideoEncodedFrame*> (ftmp);
 
+    // Encode this in a frame that looks a little bit like H.264.
+    // Note that we don't do PPS or SPS.
     // Copy the data. This really should convert this to network byte order.
     EncodedFrame eframe;
     eframe.length_ = sizeof(eframe) - sizeof(uint32_t);
-    eframe.h264_compat_ = 'g';
+    eframe.h264_compat_ = 5; // Emulate a H.264 IDR NAL.
     eframe.magic_ = ENCODED_FRAME_MAGIC;
     eframe.width_ = inputImage->Width();
     eframe.height_ = inputImage->Height();
     eframe.y_ = AveragePlane(inputImage->Buffer(kGMPYPlane),
                              inputImage->AllocatedSize(kGMPYPlane));
     eframe.u_ = AveragePlane(inputImage->Buffer(kGMPUPlane),
                              inputImage->AllocatedSize(kGMPUPlane));
     eframe.v_ = AveragePlane(inputImage->Buffer(kGMPVPlane),