AudioDestinationGStreamer.h [plain text]
#ifndef AudioDestinationGStreamer_h
#define AudioDestinationGStreamer_h
#include "AudioBus.h"
#include "AudioDestination.h"
#include <wtf/RefPtr.h>
typedef struct _GstElement GstElement;
typedef struct _GstPad GstPad;
typedef struct _GstMessage GstMessage;
namespace WebCore {
class AudioDestinationGStreamer : public AudioDestination {
public:
AudioDestinationGStreamer(AudioIOCallback&, float sampleRate);
virtual ~AudioDestinationGStreamer();
void start() override;
void stop() override;
bool isPlaying() override { return m_isPlaying; }
float sampleRate() const override { return m_sampleRate; }
unsigned framesPerBuffer() const final;
AudioIOCallback& callback() const { return m_callback; }
gboolean handleMessage(GstMessage*);
private:
AudioIOCallback& m_callback;
RefPtr<AudioBus> m_renderBus;
float m_sampleRate;
bool m_isPlaying;
bool m_audioSinkAvailable;
GstElement* m_pipeline;
};
}
#endif // AudioDestinationGStreamer_h