Bug 896353 - Media Recording - Can't record the mediaStream created by AudioContext. r=roc

This commit is contained in:
Randy Lin 2013-07-24 18:01:52 +08:00
parent d193fbdd07
commit ed5b4692e0
2 changed files with 4 additions and 2 deletions

View File

@ -116,6 +116,7 @@ private:
MediaRecorder::~MediaRecorder()
{
if (mTrackUnionStream) {
mStreamPort->Destroy();
mTrackUnionStream->Destroy();
}
}
@ -192,8 +193,7 @@ MediaRecorder::Start(const Optional<int32_t>& aTimeSlice, ErrorResult& aResult)
MOZ_ASSERT(mEncoder, "CreateEncoder failed");
mTrackUnionStream->SetAutofinish(true);
nsRefPtr<MediaInputPort> port =
mTrackUnionStream->AllocateInputPort(mStream->GetStream(), MediaInputPort::FLAG_BLOCK_OUTPUT);
mStreamPort = mTrackUnionStream->AllocateInputPort(mStream->GetStream(), MediaInputPort::FLAG_BLOCK_OUTPUT);
if (mEncoder) {
mTrackUnionStream->AddListener(mEncoder);

View File

@ -110,6 +110,8 @@ protected:
nsRefPtr<DOMMediaStream> mStream;
// This media stream is used for notifying raw data to encoder and can be blocked.
nsRefPtr<ProcessedMediaStream> mTrackUnionStream;
// This is used for destroing the inputport when destroy the mediaRecorder
nsRefPtr<MediaInputPort> mStreamPort;
// This object creates on start() and destroys in ~MediaRecorder.
nsAutoPtr<EncodedBufferCache> mEncodedBufferCache;
// It specifies the container format as well as the audio and video capture formats.