Tuner JNI: Correct memcpy of C2DataIdInfo

Bug: 162778666
Test: mannual test by MTK
Change-Id: Ic97717e5fc32d97837e218fe769087b5abece2cb
Merged-In: Ic97717e5fc32d97837e218fe769087b5abece2cb
This commit is contained in:
shubang
2020-08-03 15:25:09 -07:00
committed by Henry Fang
parent eec09803da
commit 5b0bfdb03d
2 changed files with 6 additions and 4 deletions

View File

@@ -291,8 +291,9 @@ MQ& Dvr::getDvrMQ() {
C2DataIdInfo::C2DataIdInfo(uint32_t index, uint64_t value) : C2Param(kParamSize, index) {
CHECK(isGlobal());
CHECK_EQ(C2Param::INFO, kind());
DummyInfo info{value};
memcpy(this + 1, static_cast<C2Param *>(&info) + 1, kParamSize - sizeof(C2Param));
mInfo = StubInfo(value);
memcpy(static_cast<C2Param *>(this) + 1, static_cast<C2Param *>(&mInfo) + 1,
kParamSize - sizeof(C2Param));
}
/////////////// MediaEvent ///////////////////////

View File

@@ -250,8 +250,9 @@ class C2DataIdInfo : public C2Param {
public:
C2DataIdInfo(uint32_t index, uint64_t value);
private:
typedef C2GlobalParam<C2Info, C2Int64Value, 0> DummyInfo;
static const size_t kParamSize = sizeof(DummyInfo);
typedef C2GlobalParam<C2Info, C2Int64Value, 0> StubInfo;
StubInfo mInfo;
static const size_t kParamSize = sizeof(StubInfo);
};
} // namespace android