Enable -Wconversion

This commit is contained in:
Nicolas Werner 2022-10-26 01:10:35 +02:00
parent 5be8298d0a
commit b28fa86e6a
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
23 changed files with 102 additions and 78 deletions

View file

@ -141,7 +141,8 @@ parseSDP(const std::string &sdp, GstWebRTCSDPType type)
{
GstSDPMessage *msg;
gst_sdp_message_new(&msg);
if (gst_sdp_message_parse_buffer((guint8 *)sdp.c_str(), sdp.size(), msg) == GST_SDP_OK) {
if (gst_sdp_message_parse_buffer((guint8 *)sdp.c_str(), static_cast<guint>(sdp.size()), msg) ==
GST_SDP_OK) {
return gst_webrtc_session_description_new(type, msg);
} else {
nhlog::ui()->error("WebRTC: failed to parse remote session description");
@ -371,9 +372,12 @@ getResolution(GstElement *pipe, const gchar *elementName, const gchar *padName)
std::pair<int, int>
getPiPDimensions(const std::pair<int, int> &resolution, int fullWidth, double scaleFactor)
{
int pipWidth = fullWidth * scaleFactor;
int pipHeight = static_cast<double>(resolution.second) / resolution.first * pipWidth;
return {pipWidth, pipHeight};
double pipWidth = fullWidth * scaleFactor;
double pipHeight = static_cast<double>(resolution.second) / resolution.first * pipWidth;
return {
static_cast<int>(std::ceil(pipWidth)),
static_cast<int>(std::ceil(pipHeight)),
};
}
void