diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-02 02:38:50 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-02 02:38:50 (GMT) |
commit | 2aa973db1d74044cad42f792ea0b682366391cd5 (patch) | |
tree | a8bfc060be78670818546528c5f4d8a52b542976 | |
parent | a433a46e4aa726185272d66069e6d9b7c8ab9cf8 (diff) | |
parent | b580c13afb26592b755956d809b02fd8fd5e99cd (diff) | |
download | Qt-2aa973db1d74044cad42f792ea0b682366391cd5.zip Qt-2aa973db1d74044cad42f792ea0b682366391cd5.tar.gz Qt-2aa973db1d74044cad42f792ea0b682366391cd5.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging:
Fix namespace issues.
Fix Audio input on OSX 10.6.
Fix warnings in AudioInput example.
-rw-r--r-- | examples/multimedia/audioinput/audioinput.cpp | 2 | ||||
-rw-r--r-- | examples/multimedia/audioinput/audioinput.h | 2 | ||||
-rw-r--r-- | src/multimedia/audio/qaudioinput_mac_p.cpp | 12 | ||||
-rw-r--r-- | src/multimedia/audio/qaudioinput_mac_p.h | 4 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiooutput_mac_p.cpp | 10 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiooutput_mac_p.h | 4 |
6 files changed, 19 insertions, 15 deletions
diff --git a/examples/multimedia/audioinput/audioinput.cpp b/examples/multimedia/audioinput/audioinput.cpp index b01a396..7c2cc30 100644 --- a/examples/multimedia/audioinput/audioinput.cpp +++ b/examples/multimedia/audioinput/audioinput.cpp @@ -76,6 +76,7 @@ AudioInfo::AudioInfo(const QAudioFormat &format, QObject *parent) case QAudioFormat::SignedInt: m_maxAmplitude = 127; break; + default: ; } break; case 16: @@ -86,6 +87,7 @@ AudioInfo::AudioInfo(const QAudioFormat &format, QObject *parent) case QAudioFormat::SignedInt: m_maxAmplitude = 32767; break; + default: ; } break; } diff --git a/examples/multimedia/audioinput/audioinput.h b/examples/multimedia/audioinput/audioinput.h index f87c682..be721de 100644 --- a/examples/multimedia/audioinput/audioinput.h +++ b/examples/multimedia/audioinput/audioinput.h @@ -119,8 +119,8 @@ private: QPushButton *m_suspendResumeButton; QComboBox *m_deviceBox; - AudioInfo *m_audioInfo; QAudioDeviceInfo m_device; + AudioInfo *m_audioInfo; QAudioFormat m_format; QAudioInput *m_audioInput; QIODevice *m_input; diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp index 7251513..bd2de52 100644 --- a/src/multimedia/audio/qaudioinput_mac_p.cpp +++ b/src/multimedia/audio/qaudioinput_mac_p.cpp @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE -namespace +namespace QtMultimediaInternal { static const int default_buffer_size = 4 * 1024; @@ -169,8 +169,10 @@ public: void reset() { - for (UInt32 i = 0; i < bfs->mNumberBuffers; ++i) + for (UInt32 i = 0; i < bfs->mNumberBuffers; ++i) { bfs->mBuffers[i].mDataByteSize = dataSize; + bfs->mBuffers[i].mData = 0; + } } private: @@ -523,7 +525,7 @@ QAudioInputPrivate::QAudioInputPrivate(const QByteArray& device, QAudioFormat co startTime = 0; totalFrames = 0; audioBuffer = 0; - internalBufferSize = default_buffer_size; + internalBufferSize = QtMultimediaInternal::default_buffer_size; clockFrequency = AudioGetHostClockFrequency() / 1000; errorCode = QAudio::NoError; stateCode = QAudio::StoppedState; @@ -668,13 +670,13 @@ bool QAudioInputPrivate::open() else internalBufferSize -= internalBufferSize % streamFormat.mBytesPerFrame; - audioBuffer = new QAudioInputBuffer(internalBufferSize, + audioBuffer = new QtMultimediaInternal::QAudioInputBuffer(internalBufferSize, periodSizeBytes, deviceFormat, streamFormat, this); - audioIO = new MacInputDevice(audioBuffer, this); + audioIO = new QtMultimediaInternal::MacInputDevice(audioBuffer, this); // Init if (AudioUnitInitialize(audioUnit) != noErr) { diff --git a/src/multimedia/audio/qaudioinput_mac_p.h b/src/multimedia/audio/qaudioinput_mac_p.h index e1b8e4a..42f90e2 100644 --- a/src/multimedia/audio/qaudioinput_mac_p.h +++ b/src/multimedia/audio/qaudioinput_mac_p.h @@ -75,7 +75,7 @@ QT_BEGIN_NAMESPACE class QTimer; class QIODevice; -namespace +namespace QtMultimediaInternal { class QAudioInputBuffer; } @@ -97,7 +97,7 @@ public: UInt64 startTime; QAudio::Error errorCode; QAudio::State stateCode; - QAudioInputBuffer* audioBuffer; + QtMultimediaInternal::QAudioInputBuffer* audioBuffer; QMutex mutex; QWaitCondition threadFinished; QAtomicInt audioThreadState; diff --git a/src/multimedia/audio/qaudiooutput_mac_p.cpp b/src/multimedia/audio/qaudiooutput_mac_p.cpp index 518f78f..6f32257 100644 --- a/src/multimedia/audio/qaudiooutput_mac_p.cpp +++ b/src/multimedia/audio/qaudiooutput_mac_p.cpp @@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE -namespace +namespace QtMultimediaInternal { static const int default_buffer_size = 8 * 1024; @@ -237,7 +237,7 @@ class MacOutputDevice : public QIODevice Q_OBJECT public: - MacOutputDevice(QAudioOutputBuffer* audioBuffer, QObject* parent): + MacOutputDevice(QtMultimediaInternal::QAudioOutputBuffer* audioBuffer, QObject* parent): QIODevice(parent), m_audioBuffer(audioBuffer) { @@ -263,7 +263,7 @@ public: } private: - QAudioOutputBuffer* m_audioBuffer; + QtMultimediaInternal::QAudioOutputBuffer* m_audioBuffer; }; @@ -285,7 +285,7 @@ QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray& device, const QAudioF startTime = 0; totalFrames = 0; audioBuffer = 0; - internalBufferSize = default_buffer_size; + internalBufferSize = QtMultimediaInternal::default_buffer_size; clockFrequency = AudioGetHostClockFrequency() / 1000; errorCode = QAudio::NoError; stateCode = QAudio::StoppedState; @@ -399,7 +399,7 @@ bool QAudioOutputPrivate::open() else internalBufferSize -= internalBufferSize % streamFormat.mBytesPerFrame; - audioBuffer = new QAudioOutputBuffer(internalBufferSize, periodSizeBytes, audioFormat); + audioBuffer = new QtMultimediaInternal::QAudioOutputBuffer(internalBufferSize, periodSizeBytes, audioFormat); connect(audioBuffer, SIGNAL(readyRead()), SLOT(inputReady())); // Pull audioIO = new MacOutputDevice(audioBuffer, this); diff --git a/src/multimedia/audio/qaudiooutput_mac_p.h b/src/multimedia/audio/qaudiooutput_mac_p.h index 1aacc67..752905c 100644 --- a/src/multimedia/audio/qaudiooutput_mac_p.h +++ b/src/multimedia/audio/qaudiooutput_mac_p.h @@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE class QIODevice; -namespace +namespace QtMultimediaInternal { class QAudioOutputBuffer; } @@ -96,7 +96,7 @@ public: UInt64 startTime; AudioStreamBasicDescription deviceFormat; AudioStreamBasicDescription streamFormat; - QAudioOutputBuffer* audioBuffer; + QtMultimediaInternal::QAudioOutputBuffer* audioBuffer; QAtomicInt audioThreadState; QWaitCondition threadFinished; QMutex mutex; |