1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

style(audio, video): Style fixes

This commit is contained in:
Diadlo 2016-07-07 12:58:28 +03:00
parent 76f694fe73
commit 2258748d28
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
4 changed files with 15 additions and 18 deletions

View File

@ -582,15 +582,6 @@ void Audio::doCapture()
emit frameAvailable(buf, AUDIO_FRAME_SAMPLE_COUNT, AUDIO_CHANNELS, AUDIO_SAMPLE_RATE); emit frameAvailable(buf, AUDIO_FRAME_SAMPLE_COUNT, AUDIO_CHANNELS, AUDIO_SAMPLE_RATE);
} }
/**
Returns true if the input device is open and suscribed to
*/
bool Audio::isInputReady() const
{
QMutexLocker locker(&audioLock);
return alInDev && inSubscriptions;
}
/** /**
Returns true if the output device is open Returns true if the output device is open
*/ */

View File

@ -63,21 +63,24 @@ public:
qreal minInputGain() const; qreal minInputGain() const;
void setMinInputGain(qreal dB); void setMinInputGain(qreal dB);
qreal maxInputGain() const; qreal maxInputGain() const;
void setMaxInputGain(qreal dB); void setMaxInputGain(qreal dB);
qreal inputGain() const; qreal inputGain() const;
void setInputGain(qreal dB); void setInputGain(qreal dB);
void reinitInput(const QString& inDevDesc); void reinitInput(const QString& inDevDesc);
bool reinitOutput(const QString& outDevDesc); bool reinitOutput(const QString& outDevDesc);
bool isInputReady() const;
bool isOutputReady() const; bool isOutputReady() const;
static QStringList outDeviceNames(); static QStringList outDeviceNames();
static QStringList inDeviceNames(); static QStringList inDeviceNames();
void subscribeOutput(ALuint& sid); void subscribeOutput(ALuint& sid);
void unsubscribeOutput(ALuint& sid); void unsubscribeOutput(ALuint& sid);
void subscribeInput(); void subscribeInput();
void unsubscribeInput(); void unsubscribeInput();

View File

@ -195,12 +195,13 @@ CameraDevice* CameraDevice::open(QString devName, VideoMode mode)
else if (mode) else if (mode)
{ {
qWarning() << "Video mode-setting not implemented for input " << iformat->name; qWarning() << "Video mode-setting not implemented for input " << iformat->name;
(void)mode; Q_UNUSED(mode);
} }
CameraDevice* dev = open(devName, &options); CameraDevice* dev = open(devName, &options);
if (options) if (options)
av_dict_free(&options); av_dict_free(&options);
return dev; return dev;
} }
@ -367,6 +368,8 @@ QVector<VideoMode> CameraDevice::getScreenModes()
QVector<VideoMode> CameraDevice::getVideoModes(QString devName) QVector<VideoMode> CameraDevice::getVideoModes(QString devName)
{ {
Q_UNUSED(devName);
if (!iformat); if (!iformat);
else if (isScreen(devName)) else if (isScreen(devName))
return getScreenModes(); return getScreenModes();
@ -385,7 +388,6 @@ QVector<VideoMode> CameraDevice::getVideoModes(QString devName)
else else
qWarning() << "Video mode listing not implemented for input "<<iformat->name; qWarning() << "Video mode listing not implemented for input "<<iformat->name;
(void)devName;
return {}; return {};
} }

View File

@ -139,6 +139,7 @@ CameraSource::~CameraSource()
{ {
for (int i = 0; i < subscriptions; i++) for (int i = 0; i < subscriptions; i++)
device->close(); device->close();
device = nullptr; device = nullptr;
} }