From 326dde3b28e5a36ebc4f970e178b9281cbe29527 Mon Sep 17 00:00:00 2001 From: Jeffrey Tinker Date: Thu, 23 Aug 2012 02:01:21 -0700 Subject: [PATCH] Send current bandwidth info event when buffering occurs There is a dependent change in frameworks/av Change-Id: Ic189654486936a501a1b45c5acb442753303d362 related-to-bug: 5883234 --- proprietary/wvm/WVMExtractorImpl.cpp | 14 ++++++++++++++ proprietary/wvm/include/WVMExtractorImpl.h | 1 + 2 files changed, 15 insertions(+) diff --git a/proprietary/wvm/WVMExtractorImpl.cpp b/proprietary/wvm/WVMExtractorImpl.cpp index 978d98ae..7e922bff 100644 --- a/proprietary/wvm/WVMExtractorImpl.cpp +++ b/proprietary/wvm/WVMExtractorImpl.cpp @@ -556,6 +556,20 @@ int64_t WVMExtractorImpl::getCachedDurationUs(status_t *finalStatus) { return durationUs; } +status_t WVMExtractorImpl::getEstimatedBandwidthKbps(int32_t *kbps) +{ + status_t err = UNKNOWN_ERROR; + unsigned long bandwidth; + WVStatus status = WV_Info_CurrentBandwidth(mSession, &bandwidth); + if (status == WV_Status_OK) { + *kbps = bandwidth / 1024; + err = OK; + } else { + ALOGV("WV_Info_CurrentBandwidth failed: %d", status); + } + return err; +} + void WVMExtractorImpl::setAdaptiveStreamingMode(bool adaptive) { //ALOGD("WVMExtractorImpl::setAdaptiveStreamingMode(%d)", adaptive); diff --git a/proprietary/wvm/include/WVMExtractorImpl.h b/proprietary/wvm/include/WVMExtractorImpl.h index 7a48e1e0..96841d9c 100644 --- a/proprietary/wvm/include/WVMExtractorImpl.h +++ b/proprietary/wvm/include/WVMExtractorImpl.h @@ -34,6 +34,7 @@ public: virtual sp getMetaData(); virtual int64_t getCachedDurationUs(status_t *finalStatus); + virtual status_t getEstimatedBandwidthKbps(int32_t *kbps); virtual void setAdaptiveStreamingMode(bool adaptive); bool getAdaptiveStreamingMode() const;