2015-07-24 15:28:16 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_AUDIOCAPTURESTREAM_H_
|
|
|
|
#define MOZILLA_AUDIOCAPTURESTREAM_H_
|
|
|
|
|
|
|
|
#include "MediaStreamGraph.h"
|
|
|
|
#include "AudioMixer.h"
|
2016-01-26 05:49:01 +03:00
|
|
|
#include "StreamTracks.h"
|
2015-07-24 15:28:16 +03:00
|
|
|
#include <algorithm>
|
|
|
|
|
|
|
|
namespace mozilla
|
|
|
|
{
|
|
|
|
|
|
|
|
class DOMMediaStream;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See MediaStreamGraph::CreateAudioCaptureStream.
|
|
|
|
*/
|
|
|
|
class AudioCaptureStream : public ProcessedMediaStream,
|
|
|
|
public MixerCallbackReceiver
|
|
|
|
{
|
|
|
|
public:
|
2015-09-30 04:31:53 +03:00
|
|
|
explicit AudioCaptureStream(DOMMediaStream* aWrapper, TrackID aTrackId);
|
2015-07-24 15:28:16 +03:00
|
|
|
virtual ~AudioCaptureStream();
|
|
|
|
|
2016-03-03 19:26:31 +03:00
|
|
|
void Start();
|
|
|
|
|
2015-07-24 15:28:16 +03:00
|
|
|
void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void MixerCallback(AudioDataValue* aMixedBuffer, AudioSampleFormat aFormat,
|
|
|
|
uint32_t aChannels, uint32_t aFrames,
|
|
|
|
uint32_t aSampleRate) override;
|
|
|
|
AudioMixer mMixer;
|
2015-09-30 04:31:53 +03:00
|
|
|
TrackID mTrackId;
|
2016-03-03 19:26:31 +03:00
|
|
|
bool mStarted;
|
2015-07-24 15:28:16 +03:00
|
|
|
bool mTrackCreated;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* MOZILLA_AUDIOCAPTURESTREAM_H_ */
|