diff --git a/content/html/content/src/HTMLMediaElement.cpp b/content/html/content/src/HTMLMediaElement.cpp
index ffd45fd77177..f978268dbc90 100644
--- a/content/html/content/src/HTMLMediaElement.cpp
+++ b/content/html/content/src/HTMLMediaElement.cpp
@@ -1763,7 +1763,29 @@ HTMLMediaElement::CaptureStreamInternal(bool aFinishWhenEnded)
}
OutputMediaStream* out = mOutputStreams.AppendElement();
+#ifdef DEBUG
+ // Estimate hints based on the type of the media element
+ // under the preference media.capturestream_hints for the
+ // debug builds only. This allows WebRTC Peer Connection
+ // to behave appropriately when media streams generated
+ // via mozCaptureStream*() are added to the Peer Connection.
+ // This functionality is planned to be used as part of Audio
+ // Quality Performance testing for WebRTC.
+ // Bug932845: Revisit this once hints mechanism is dealt with
+ // holistically.
+ uint8_t hints = 0;
+ if (Preferences::GetBool("media.capturestream_hints.enabled")) {
+ nsCOMPtr video = do_QueryObject(this);
+ if (video && GetVideoFrameContainer()) {
+ hints = DOMMediaStream::HINT_CONTENTS_VIDEO | DOMMediaStream::HINT_CONTENTS_AUDIO;
+ } else {
+ hints = DOMMediaStream::HINT_CONTENTS_AUDIO;
+ }
+ }
+ out->mStream = DOMMediaStream::CreateTrackUnionStream(window, hints);
+#else
out->mStream = DOMMediaStream::CreateTrackUnionStream(window);
+#endif
nsRefPtr principal = GetCurrentPrincipal();
out->mStream->CombineWithPrincipal(principal);
out->mFinishWhenEnded = aFinishWhenEnded;
diff --git a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
index 5e9e93f8f087..400a77519e8c 100644
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -758,9 +758,11 @@ void MediaPipelineTransmit::PipelineListener::ProcessAudioChunk(
if (chunk.mBuffer) {
switch (chunk.mBufferFormat) {
case AUDIO_FORMAT_FLOAT32:
- MOZ_MTLOG(ML_ERROR, "Can't process audio except in 16-bit PCM yet");
- MOZ_ASSERT(PR_FALSE);
- return;
+ {
+ const float* buf = static_cast(chunk.mChannelData[0]);
+ ConvertAudioSamplesWithScale(buf, static_cast(samples),
+ chunk.mDuration, chunk.mVolume);
+ }
break;
case AUDIO_FORMAT_S16:
{