Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [windows] Fix can not get irisRtcRenderingHandle in 32-bit #1311

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions windows/video_view_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,34 @@ void VideoViewController::HandleMethodCall(
return;
}

intptr_t irisRtcRenderingHandle;
if (!GetValueFromEncodableMap(arguments, "irisRtcRenderingHandle", irisRtcRenderingHandle))
int64_t irisRtcRenderingHandle;
{
result->Error("Invalid arguments", "No irisRtcRenderingHandle provided.");
return;
auto iter = arguments->find(flutter::EncodableValue(flutter::EncodableValue("irisRtcRenderingHandle")));
if (iter != arguments->end() && !iter->second.IsNull())
{
// The `irisRtcRenderingHandle` maybe in 32-bit on some devices, we need call `LongValue` explictly
irisRtcRenderingHandle = iter->second.LongValue();
}
else
{
result->Error("Invalid arguments", "No irisRtcRenderingHandle provided.");
return;
}
}

int64_t uid;

auto iter = arguments->find(flutter::EncodableValue(flutter::EncodableValue("uid")));
if (iter != arguments->end() && !iter->second.IsNull())
{
// The uid may between 32-bit and 64-bit value, we need call `LongValue` explictly
uid = iter->second.LongValue();
}
else
{
result->Error("Invalid arguments", "No uid provided.");
return;
auto iter = arguments->find(flutter::EncodableValue(flutter::EncodableValue("uid")));
if (iter != arguments->end() && !iter->second.IsNull())
{
// The uid may between 32-bit and 64-bit value, we need call `LongValue` explictly
uid = iter->second.LongValue();
}
else
{
result->Error("Invalid arguments", "No uid provided.");
return;
}
}

std::string channelId;
Expand Down
Loading