Bug 1051566 - Support H.264 Mode 0 in GMP OpenH264. r=ehugg, a=sledru
authorRandell Jesup <rjesup@jesup.org>
Mon, 11 Aug 2014 17:13:59 -0400
changeset 209369 240a0232bc04869dbb9d40775dd67b49645f173b
parent 209368 d92bf0799e5c9b1a6e80dfe769c029ce2727afca
child 209370 68689e07ffec8d542ef2c9335609afe0db6958e5
push id6643
push userryanvm@gmail.com
push dateThu, 14 Aug 2014 17:16:40 +0000
treeherdermozilla-aurora@eb36729316d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehugg, sledru
bugs1051566
milestone33.0a2
Bug 1051566 - Support H.264 Mode 0 in GMP OpenH264. r=ehugg, a=sledru
media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
--- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
@@ -193,22 +193,24 @@ WebrtcGmpVideoEncoder::InitEncode_g(cons
 
   codec.mGMPApiVersion = 33;
   codec.mWidth = aCodecSettings->width;
   codec.mHeight = aCodecSettings->height;
   codec.mStartBitrate = aCodecSettings->startBitrate;
   codec.mMinBitrate = aCodecSettings->minBitrate;
   codec.mMaxBitrate = aCodecSettings->maxBitrate;
   codec.mMaxFramerate = aCodecSettings->maxFramerate;
+  if (aCodecSettings->codecSpecific.H264.packetizationMode == 1) {
+    aMaxPayloadSize = 4*1024*1024; // insanely large
+  }
 
   // Pass dummy codecSpecific data for now...
   nsTArray<uint8_t> codecSpecific;
 
-  // H.264 mode 1 only supported so far
-  GMPErr err = mGMP->InitEncode(codec, codecSpecific, this, 1, 1024*1024 /*aMaxPayloadSize*/);
+  GMPErr err = mGMP->InitEncode(codec, codecSpecific, this, 1, aMaxPayloadSize);
   if (err != GMPNoErr) {
     return WEBRTC_VIDEO_CODEC_ERROR;
   }
 
   return WEBRTC_VIDEO_CODEC_OK;
 }
 
 
--- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
+++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
@@ -2856,18 +2856,21 @@ int vcmGetVideoCodecList(int request_typ
 /**
  * Get supported H.264 video packetization modes
  * @return mask of supported video packetization modes for H.264. Value returned
  * must be 1 to 3 (bit 0 is mode 0, bit 1 is mode 1.
  * Bit 2 (Mode 2) is not supported yet.
  */
 int vcmGetH264SupportedPacketizationModes()
 {
-  // We support mode 1 packetization only in webrtc currently
+#ifdef MOZ_WEBRTC_OMX
   return VCM_H264_MODE_1;
+#else
+  return VCM_H264_MODE_0|VCM_H264_MODE_1;
+#endif
 }
 
 /**
  * Get supported H.264 profile-level-id
  * @return supported profile-level-id value
  */
 uint32_t vcmGetVideoH264ProfileLevelID()
 {