Bug 1054704. Generate an IDR NAL for fake H.264 r=jesup
authorEKR <ekr@rtfm.com>
Thu, 21 Aug 2014 10:09:38 -0700
changeset 201611 bead3ac993fad7adec9d9bdf3ad6595f06388c52
parent 201610 324833b277403ab63ca5a9a386edc371fba57a77
child 201612 01d9658ee977e2988248c2c3aae5cee15126c93f
push id27375
push userryanvm@gmail.com
push dateTue, 26 Aug 2014 19:56:59 +0000
treeherdermozilla-central@f9bfe115fee5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1054704
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 1054704. Generate an IDR NAL for fake H.264 r=jesup
dom/media/gmp-plugin/gmp-fake.cpp
--- a/dom/media/gmp-plugin/gmp-fake.cpp
+++ b/dom/media/gmp-plugin/gmp-fake.cpp
@@ -165,20 +165,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),