diff options
author | Zhu,Tianyang <tianyang.zhu@intel.com> | 2014-05-08 16:05:49 +0800 |
---|---|---|
committer | buildslave <sys_buildbot@intel.com> | 2014-05-19 00:48:50 +0000 |
commit | c3439ed85f37967b4e3f0433e9db259ca70f458b (patch) | |
tree | 8c873e0a12b57577eee405ed20190350ac293b11 /common/observers | |
parent | 9c9829d3ea5f72dbe1ceb1f09607b1c2ed13faa7 (diff) | |
download | android_hardware_intel_img_hwcomposer-c3439ed85f37967b4e3f0433e9db259ca70f458b.tar.gz android_hardware_intel_img_hwcomposer-c3439ed85f37967b4e3f0433e9db259ca70f458b.tar.bz2 android_hardware_intel_img_hwcomposer-c3439ed85f37967b4e3f0433e9db259ca70f458b.zip |
For Widi downscaling feature
BZ: 188797
Follow below steps to enable downscaling
a: Disconnect WIDI;
b: adb shell setprop "widi.video.dscaling.enable" "true";
c: re-connect WIDI
TBD: need WIDI team help
a: Default value: offX = 0; offY = 0; bufWidth = 1920; bufHeight = 1080;
b: Calling "setDownscaling" in "prepare" isn't resonable and has
a time sequence issue, the first video frame hasn't got right DS params
and doecder to a wrong buffer;
Change-Id: I817060bde30d5a60633223ec90c5597ab5e03be0
Signed-off-by: Zhu,Tianyang <tianyang.zhu@intel.com>
Diffstat (limited to 'common/observers')
-rw-r--r-- | common/observers/MultiDisplayObserver.cpp | 32 | ||||
-rw-r--r-- | common/observers/MultiDisplayObserver.h | 9 |
2 files changed, 41 insertions, 0 deletions
diff --git a/common/observers/MultiDisplayObserver.cpp b/common/observers/MultiDisplayObserver.cpp index 488f07f..bc76092 100644 --- a/common/observers/MultiDisplayObserver.cpp +++ b/common/observers/MultiDisplayObserver.cpp @@ -103,6 +103,7 @@ MultiDisplayObserver::MultiDisplayObserver() mMDSInfoProvider(NULL), mMDSConnObserver(NULL), mMDSCallback(NULL), + mMDSDecoderConfig(NULL), mLock(), mCondition(), mThreadLoopCount(0), @@ -172,6 +173,11 @@ bool MultiDisplayObserver::initMDSClient() ETRACE("failed to create mds video Client"); return false; } + mMDSDecoderConfig = mds->getDecoderConfig(); + if (mMDSDecoderConfig.get() == NULL) { + ETRACE("failed to create mds decoder Client"); + return false; + } status_t ret = mMDSCbRegistrar->registerCallback(mMDSCallback); if (ret != NO_ERROR) { @@ -197,6 +203,7 @@ void MultiDisplayObserver::deinitMDSClient() mMDSInfoProvider = NULL; mMDSCallback = NULL; mMDSConnObserver = NULL; + mMDSDecoderConfig = NULL; } bool MultiDisplayObserver::initMDSClientAsync() @@ -409,6 +416,31 @@ status_t MultiDisplayObserver::notifyWidiConnectionStatus( bool connected) return mMDSConnObserver->updateWidiConnectionStatus(connected); } +status_t MultiDisplayObserver::setDecoderOutputResolution( + int sessionID, + int32_t width, int32_t height, + int32_t offX, int32_t offY, + int32_t bufWidth, int32_t bufHeight) +{ + Mutex::Autolock _l(mLock); + if (mMDSDecoderConfig.get() == NULL) { + return NO_INIT; + } + if (width <= 0 || height <= 0 || + offX < 0 || offY < 0 || + bufWidth <= 0 || bufHeight <= 0) { + ETRACE(" Invalid parameter: %dx%d, %dx%d, %dx%d", width, height, offX, offY, bufWidth, bufHeight); + return UNKNOWN_ERROR; + } + + status_t ret = mMDSDecoderConfig->setDecoderOutputResolution(sessionID, width, height, offX, offY, bufWidth, bufHeight); + if (ret == NO_ERROR) { + ITRACE("Video Session[%d] output resolution %dx%d ", sessionID, width, height); + } + return ret; +} + + #endif //TARGET_HAS_MULTIPLE_DISPLAY } // namespace intel diff --git a/common/observers/MultiDisplayObserver.h b/common/observers/MultiDisplayObserver.h index 5c6f939..f434c4d 100644 --- a/common/observers/MultiDisplayObserver.h +++ b/common/observers/MultiDisplayObserver.h @@ -79,6 +79,10 @@ public: int getVideoSessionNumber(); bool isExternalDeviceTimingFixed() const; status_t notifyWidiConnectionStatus(bool connected); + status_t setDecoderOutputResolution(int sessionID, + int32_t width, int32_t height, + int32_t offX, int32_t offY, + int32_t bufWidth, int32_t bufHeight); private: bool isMDSRunning(); @@ -101,6 +105,7 @@ private: sp<IMultiDisplayCallbackRegistrar> mMDSCbRegistrar; sp<IMultiDisplayInfoProvider> mMDSInfoProvider; sp<IMultiDisplayConnectionObserver> mMDSConnObserver; + sp<IMultiDisplayDecoderConfig> mMDSDecoderConfig; sp<MultiDisplayCallback> mMDSCallback; mutable Mutex mLock; Condition mCondition; @@ -129,6 +134,10 @@ public: int getVideoSessionNumber() { return 0; } bool isExternalDeviceTimingFixed() const { return false; } status_t notifyWidiConnectionStatus(bool connected) { return NO_ERROR; } + status_t setDecoderOutputResolution( + int sessionID, + int32_t width, int32_t height, + int32_t, int32_t, int32_t, int32_t) { return NO_ERROR; } }; #endif //TARGET_HAS_MULTIPLE_DISPLAY |