diff options
author | Andreas Huber <andih@google.com> | 2012-10-01 16:38:26 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-01 16:41:01 -0700 |
commit | ee178668818eb4f43ff40735405f8fc42372620f (patch) | |
tree | 44a2a7470c37b2abd8ed5ffa67d56a53397b0151 | |
parent | 1c730d33da2fa861000b3990b5e6c9ff69291387 (diff) | |
download | frameworks_av-ee178668818eb4f43ff40735405f8fc42372620f.zip frameworks_av-ee178668818eb4f43ff40735405f8fc42372620f.tar.gz frameworks_av-ee178668818eb4f43ff40735405f8fc42372620f.tar.bz2 |
Use incremental updates sent by surface flinger
instead of running at a fixed framerate.
Change-Id: Ia3f36aa449e2e952bf3263ffbb709a9b79b09c26
related-to-bug: 7266398
3 files changed, 5 insertions, 7 deletions
diff --git a/media/libstagefright/wifi-display/source/Converter.cpp b/media/libstagefright/wifi-display/source/Converter.cpp index 99db060..60cca69 100644 --- a/media/libstagefright/wifi-display/source/Converter.cpp +++ b/media/libstagefright/wifi-display/source/Converter.cpp @@ -132,7 +132,7 @@ status_t Converter::initEncoder() { mOutputFormat->setInt32("bitrate", audioBitrate); } else { mOutputFormat->setInt32("bitrate", videoBitrate); - mOutputFormat->setInt32("frame-rate", 24); + mOutputFormat->setInt32("frame-rate", 60); mOutputFormat->setInt32("i-frame-interval", 1); // Iframes every 1 secs // mOutputFormat->setInt32("prepend-sps-pps-to-idr-frames", 1); } diff --git a/media/libstagefright/wifi-display/source/PlaybackSession.cpp b/media/libstagefright/wifi-display/source/PlaybackSession.cpp index 7fce133..7de607c 100644 --- a/media/libstagefright/wifi-display/source/PlaybackSession.cpp +++ b/media/libstagefright/wifi-display/source/PlaybackSession.cpp @@ -267,7 +267,7 @@ WifiDisplaySource::PlaybackSession::PlaybackSession( mSendSRPending(false), mHistoryLength(0) #if TRACK_BANDWIDTH - ,mFirstPacketTimeUs(-1ll), + ,mFirstPacketTimeUs(-1ll) ,mTotalBytesSent(0ll) #endif #if LOG_TRANSPORT_STREAM @@ -885,10 +885,8 @@ status_t WifiDisplaySource::PlaybackSession::addVideoSource() { source->setUseAbsoluteTimestamps(); - sp<MediaSource> videoSource = new RepeaterSource(source, 24.0f); - size_t numInputBuffers; - status_t err = addSource(true /* isVideo */, videoSource, &numInputBuffers); + status_t err = addSource(true /* isVideo */, source, &numInputBuffers); if (err != OK) { return err; @@ -1122,7 +1120,7 @@ ssize_t WifiDisplaySource::PlaybackSession::appendTSData( int64_t delayUs = ALooper::GetNowUs() - mFirstPacketTimeUs; if (delayUs > 0ll) { - ALOGV("approx. net bandwidth used: %.2f Mbit/sec", + ALOGI("approx. net bandwidth used: %.2f Mbit/sec", mTotalBytesSent * 8.0 / delayUs); } #endif diff --git a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp index 4c2b457..1083a80 100644 --- a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp +++ b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp @@ -539,7 +539,7 @@ status_t WifiDisplaySource::sendM4(int32_t sessionID) { // use "78 00 02 02 00008000 00000000 00000000 00 0000 0000 00 none none\r\n" AString body = StringPrintf( "wfd_video_formats: " - "78 00 02 02 00008000 00000000 00000000 00 0000 0000 00 none none\r\n" + "30 00 02 02 00000040 00000000 00000000 00 0000 0000 00 none none\r\n" "wfd_audio_codecs: AAC 00000001 00\r\n" // 2 ch AAC 48kHz "wfd_presentation_URL: rtsp://%s/wfd1.0/streamid=0 none\r\n" "wfd_client_rtp_ports: RTP/AVP/%s;unicast 19000 0 mode=play\r\n", |