1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/zhouws-chn-ZPlay_VideoPlayer

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
В этом репозитории не указан файл с открытой лицензией (LICENSE). При использовании обратитесь к конкретному описанию проекта и его зависимостям в коде.
Клонировать/Скачать
zffaudio.h 1.6 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
tang_god Отправлено 27.08.2020 02:34 80f89a6
#ifndef ZFFAUDIO_H
#define ZFFAUDIO_H
#include <QMutex>
#include <QMutexLocker>
#include <QThread>
#include <QList>
#include <QAudioOutput>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/version.h>
#include <libavdevice/avdevice.h>
#include <libavutil/time.h>
#include <libavutil/mathematics.h>
#include <libswscale/swscale.h>
#include <libswresample/swresample.h>
}
class ZFFaudio : public QThread {
public:
static ZFFaudio* getInstance();
float GetCurTimeSec() {
return curTimestampSec;
}
void start(Priority = InheritPriority);
void terminate();
void stop();
void init(int sampleRate,
int channel,
int sampleSize);
private:
ZFFaudio();
static QAtomicPointer<ZFFaudio>_instance;
static QMutex _mutex;
/* Thread */
void run() override;
int ToPCM(char *,
AVFrame *);
/* QMEDIA */
bool StartPlay(); // 启动
void PlayAudio(bool isplay); // 暂停
bool Write(const char *data,
int datasize); // 将音频写入
void StopPlay(); // 停止
int GetFree(); // 获取剩余空间
int sampleRate = 44100; // 样本率
int sampleSize = 32; // 样本大小
int channel = 2; ///通道数
/* */
float curTimestampSec = 0.0;
/* Device */
QIODevice *io = NULL;
QAudioOutput *output = NULL;
bool _canBeRun = false;
};
#endif // ZFFAUDIO_H

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/zhouws-chn-ZPlay_VideoPlayer.git
git@api.gitlife.ru:oschina-mirror/zhouws-chn-ZPlay_VideoPlayer.git
oschina-mirror
zhouws-chn-ZPlay_VideoPlayer
zhouws-chn-ZPlay_VideoPlayer
master