summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-10-03 09:50:51 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-03 09:50:51 -0700
commit3a555c19dbd6ae7bf0d63cb9879befb22773770d (patch)
tree01533bec5a7a927c37a17a7d738539884661d17f /media/libstagefright
parentee40d832e55847182412b0f56da652af054d7c06 (diff)
parent8d16bbc5a354d302abfd912b8d88d9c7feb3948f (diff)
downloadframeworks_av-3a555c19dbd6ae7bf0d63cb9879befb22773770d.zip
frameworks_av-3a555c19dbd6ae7bf0d63cb9879befb22773770d.tar.gz
frameworks_av-3a555c19dbd6ae7bf0d63cb9879befb22773770d.tar.bz2
Merge "Increase polling frequency again temporarily to fix A/V issues" into jb-mr1-dev
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/wifi-display/source/Converter.cpp29
-rw-r--r--media/libstagefright/wifi-display/source/PlaybackSession.cpp9
2 files changed, 24 insertions, 14 deletions
diff --git a/media/libstagefright/wifi-display/source/Converter.cpp b/media/libstagefright/wifi-display/source/Converter.cpp
index 6f336c7..f044666 100644
--- a/media/libstagefright/wifi-display/source/Converter.cpp
+++ b/media/libstagefright/wifi-display/source/Converter.cpp
@@ -242,16 +242,18 @@ void Converter::onMessageReceived(const sp<AMessage> &msg) {
#if ENABLE_SILENCE_DETECTION
if (!mIsVideo) {
if (IsSilence(accessUnit)) {
- if (!mInSilentMode) {
- int64_t nowUs = ALooper::GetNowUs();
-
- if (mFirstSilentFrameUs < 0ll) {
- mFirstSilentFrameUs = nowUs;
- } else if (nowUs >= mFirstSilentFrameUs + 1000000ll) {
- mInSilentMode = true;
- ALOGI("audio in silent mode now.");
- break;
- }
+ if (mInSilentMode) {
+ break;
+ }
+
+ int64_t nowUs = ALooper::GetNowUs();
+
+ if (mFirstSilentFrameUs < 0ll) {
+ mFirstSilentFrameUs = nowUs;
+ } else if (nowUs >= mFirstSilentFrameUs + 10000000ll) {
+ mInSilentMode = true;
+ ALOGI("audio in silent mode now.");
+ break;
}
} else {
if (mInSilentMode) {
@@ -326,7 +328,7 @@ void Converter::scheduleDoMoreWork() {
}
mDoMoreWorkPending = true;
- (new AMessage(kWhatDoMoreWork, id()))->post(mIsVideo ? 10000ll : 5000ll);
+ (new AMessage(kWhatDoMoreWork, id()))->post(1000ll);
}
status_t Converter::feedEncoderInputBuffers() {
@@ -404,9 +406,8 @@ status_t Converter::doMoreWork() {
sp<ABuffer> buffer = new ABuffer(size);
buffer->meta()->setInt64("timeUs", timeUs);
- if (!mIsVideo) {
- ALOGV("audio time %lld us (%.2f secs)", timeUs, timeUs / 1E6);
- }
+ ALOGV("[%s] time %lld us (%.2f secs)",
+ mIsVideo ? "video" : "audio", timeUs, timeUs / 1E6);
memcpy(buffer->data(),
mEncoderOutputBuffers.itemAt(bufferIndex)->base() + offset,
diff --git a/media/libstagefright/wifi-display/source/PlaybackSession.cpp b/media/libstagefright/wifi-display/source/PlaybackSession.cpp
index c91b4c8..ffdafed 100644
--- a/media/libstagefright/wifi-display/source/PlaybackSession.cpp
+++ b/media/libstagefright/wifi-display/source/PlaybackSession.cpp
@@ -919,13 +919,22 @@ status_t WifiDisplaySource::PlaybackSession::addVideoSource() {
source->setUseAbsoluteTimestamps();
+#if 1
sp<RepeaterSource> videoSource =
new RepeaterSource(source, 30.0 /* rateHz */);
+#endif
+#if 1
size_t numInputBuffers;
status_t err = addSource(
true /* isVideo */, videoSource, true /* isRepeaterSource */,
&numInputBuffers);
+#else
+ size_t numInputBuffers;
+ status_t err = addSource(
+ true /* isVideo */, source, false /* isRepeaterSource */,
+ &numInputBuffers);
+#endif
if (err != OK) {
return err;