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

This commit is contained in:
Randy Lin 2013-07-26 20:29:41 +08:00
parent b64e29c81b
commit dfc33dc92b
2 changed files with 6 additions and 2 deletions

View File

@ -115,6 +115,9 @@ private:
MediaRecorder::~MediaRecorder()
{
if (mStreamPort) {
mStreamPort->Destroy();
}
if (mTrackUnionStream) {
mTrackUnionStream->Destroy();
}
@ -192,8 +195,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.