diff options
-rw-r--r-- | include/camera/CameraParameters.h | 8 | ||||
-rw-r--r-- | media/libstagefright/MPEG4Extractor.cpp | 8 | ||||
-rw-r--r-- | media/libstagefright/OggExtractor.cpp | 8 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 23 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.h | 3 |
5 files changed, 41 insertions, 9 deletions
diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h index 6a5d254..99a3115 100644 --- a/include/camera/CameraParameters.h +++ b/include/camera/CameraParameters.h @@ -337,11 +337,14 @@ public: static const char PIXEL_FORMAT_JPEG[]; // Values for focus mode settings. - // Auto-focus mode. + // Auto-focus mode. Applications should call + // CameraHardwareInterface.autoFocus to start the focus in this mode. static const char FOCUS_MODE_AUTO[]; // Focus is set at infinity. Applications should not call // CameraHardwareInterface.autoFocus in this mode. static const char FOCUS_MODE_INFINITY[]; + // Macro (close-up) focus mode. Applications should call + // CameraHardwareInterface.autoFocus to start the focus in this mode. static const char FOCUS_MODE_MACRO[]; // Focus is fixed. The camera is always in this mode if the focus is not // adjustable. If the camera has auto-focus, this mode can fix the @@ -355,7 +358,8 @@ public: // Continuous auto focus mode. The camera continuously tries to focus. This // is ideal for shooting video or shooting photo of moving object. Auto // focus starts when the parameter is set. Applications should not call - // CameraHardwareInterface.autoFocus in this mode. + // CameraHardwareInterface.autoFocus in this mode. To stop continuous + // focus, applications should change the focus mode to other modes. static const char FOCUS_MODE_CONTINUOUS[]; // The camera determines the exposure by giving more weight to the diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index 6af3a7f..12a1e6e 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -1273,6 +1273,14 @@ status_t MPEG4Extractor::updateAudioTrackInfoFromESDS_MPEG4Audio( hexdump(csd, csd_size); #endif + if (csd_size == 0) { + // There's no further information, i.e. no codec specific data + // Let's assume that the information provided in the mpeg4 headers + // is accurate and hope for the best. + + return OK; + } + if (csd_size < 2) { return ERROR_MALFORMED; } diff --git a/media/libstagefright/OggExtractor.cpp b/media/libstagefright/OggExtractor.cpp index b699d8f..9630092 100644 --- a/media/libstagefright/OggExtractor.cpp +++ b/media/libstagefright/OggExtractor.cpp @@ -158,7 +158,7 @@ status_t OggSource::read( ReadOptions::SeekMode mode; if (options && options->getSeekTo(&seekTimeUs, &mode)) { off_t pos = seekTimeUs * mExtractor->mImpl->approxBitrate() / 8000000ll; - LOGI("seeking to offset %ld", pos); + LOGV("seeking to offset %ld", pos); if (mExtractor->mImpl->seekToOffset(pos) != OK) { return ERROR_END_OF_STREAM; @@ -267,7 +267,7 @@ ssize_t MyVorbisExtractor::readPage(off_t offset, Page *page) { uint8_t header[27]; if (mSource->readAt(offset, header, sizeof(header)) < (ssize_t)sizeof(header)) { - LOGE("failed to read %d bytes at offset 0x%08lx", sizeof(header), offset); + LOGV("failed to read %d bytes at offset 0x%08lx", sizeof(header), offset); return ERROR_IO; } @@ -384,7 +384,7 @@ status_t MyVorbisExtractor::readNextPacket(MediaBuffer **out) { packetSize); if (n < (ssize_t)packetSize) { - LOGE("failed to read %d bytes at 0x%08lx", packetSize, dataOffset); + LOGV("failed to read %d bytes at 0x%08lx", packetSize, dataOffset); return ERROR_IO; } @@ -418,7 +418,7 @@ status_t MyVorbisExtractor::readNextPacket(MediaBuffer **out) { buffer = NULL; } - LOGE("readPage returned %ld", n); + LOGV("readPage returned %ld", n); return n < 0 ? n : (status_t)ERROR_END_OF_STREAM; } diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index 6e7633e..ff31470 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -1601,7 +1601,7 @@ bool AudioFlinger::MixerThread::threadLoop() } if (mSuspended) { - sleepTime = idleSleepTime; + sleepTime = suspendSleepTimeUs(); } // sleepTime == 0 means we must write to audio hardware if (sleepTime == 0) { @@ -2021,6 +2021,11 @@ uint32_t AudioFlinger::MixerThread::idleSleepTimeUs() return (uint32_t)(((mFrameCount * 1000) / mSampleRate) * 1000) / 2; } +uint32_t AudioFlinger::MixerThread::suspendSleepTimeUs() +{ + return (uint32_t)(((mFrameCount * 1000) / mSampleRate) * 1000); +} + // ---------------------------------------------------------------------------- AudioFlinger::DirectOutputThread::DirectOutputThread(const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output, int id, uint32_t device) : PlaybackThread(audioFlinger, output, id, device) @@ -2365,7 +2370,7 @@ bool AudioFlinger::DirectOutputThread::threadLoop() } if (mSuspended) { - sleepTime = idleSleepTime; + sleepTime = suspendSleepTimeUs(); } // sleepTime == 0 means we must write to audio hardware if (sleepTime == 0) { @@ -2486,6 +2491,18 @@ uint32_t AudioFlinger::DirectOutputThread::idleSleepTimeUs() return time; } +uint32_t AudioFlinger::DirectOutputThread::suspendSleepTimeUs() +{ + uint32_t time; + if (AudioSystem::isLinearPCM(mFormat)) { + time = (uint32_t)(((mFrameCount * 1000) / mSampleRate) * 1000); + } else { + time = 10000; + } + return time; +} + + // ---------------------------------------------------------------------------- AudioFlinger::DuplicatingThread::DuplicatingThread(const sp<AudioFlinger>& audioFlinger, AudioFlinger::MixerThread* mainThread, int id) @@ -2612,7 +2629,7 @@ bool AudioFlinger::DuplicatingThread::threadLoop() } if (mSuspended) { - sleepTime = idleSleepTime; + sleepTime = suspendSleepTimeUs(); } // sleepTime == 0 means we must write to audio hardware if (sleepTime == 0) { diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index 5520551..51881f0 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -664,6 +664,7 @@ private: virtual void deleteTrackName_l(int name) = 0; virtual uint32_t activeSleepTimeUs() = 0; virtual uint32_t idleSleepTimeUs() = 0; + virtual uint32_t suspendSleepTimeUs() = 0; private: @@ -724,6 +725,7 @@ private: virtual void deleteTrackName_l(int name); virtual uint32_t activeSleepTimeUs(); virtual uint32_t idleSleepTimeUs(); + virtual uint32_t suspendSleepTimeUs(); AudioMixer* mAudioMixer; }; @@ -744,6 +746,7 @@ private: virtual void deleteTrackName_l(int name); virtual uint32_t activeSleepTimeUs(); virtual uint32_t idleSleepTimeUs(); + virtual uint32_t suspendSleepTimeUs(); private: void applyVolume(uint16_t leftVol, uint16_t rightVol, bool ramp); |