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 {
|
|
|
|
|
2016-12-08 11:00:12 +03:00
|
|
|
class AbstractThread;
|
2015-07-24 15:28:16 +03:00
|
|
|
class DOMMediaStream;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See MediaStreamGraph::CreateAudioCaptureStream.
|
|
|
|
*/
|
|
|
|
class AudioCaptureStream : public ProcessedMediaStream,
|
|
|
|
public MixerCallbackReceiver {
|
|
|
|
public:
|
2017-06-29 23:11:23 +03:00
|
|
|
explicit AudioCaptureStream(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;
|
|
|
|
};
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* MOZILLA_AUDIOCAPTURESTREAM_H_ */
|