summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-10-27 09:25:20 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-10-27 23:06:26 +0530
commitbb0a83b0185ab789e06dec16869e587d839414fa (patch)
tree2b00d6509bce8bdffaa55f065db79c31bebc6908
parentf7908637554ff5f8ce60938e9c56962644ea71d3 (diff)
downloadgstreamer-plugins-bad-bb0a83b0185ab789e06dec16869e587d839414fa.tar.gz
plugins: Use explicit type conversion from enums
MSVC warns about this because it's a C++ compiler, and this actually results in useful things such as the incorrect 'gboolean' return value for functions that return GstFlowReturn, so let's do explicit conversions to reduce the noise and increase its efficacy.
-rw-r--r--ext/gl/gstglstereosplit.c3
-rw-r--r--ext/openh264/gstopenh264enc.cpp6
-rw-r--r--gst/videoparsers/gsth264parse.c3
3 files changed, 7 insertions, 5 deletions
diff --git a/ext/gl/gstglstereosplit.c b/ext/gl/gstglstereosplit.c
index 1eaa440b2..744a7f221 100644
--- a/ext/gl/gstglstereosplit.c
+++ b/ext/gl/gstglstereosplit.c
@@ -247,7 +247,8 @@ strip_mview_fields (GstCaps * incaps, GstVideoMultiviewFlags keep_flags)
GstVideoMultiviewFlags flags, mask;
gst_structure_remove_field (st, "multiview-mode");
- if (gst_structure_get_flagset (st, "multiview-flags", &flags, &mask)) {
+ if (gst_structure_get_flagset (st, "multiview-flags", (guint*) &flags,
+ (guint*) &mask)) {
flags &= keep_flags;
mask = keep_flags;
gst_structure_set (st, "multiview-flags",
diff --git a/ext/openh264/gstopenh264enc.cpp b/ext/openh264/gstopenh264enc.cpp
index a5e488f6a..ad1812046 100644
--- a/ext/openh264/gstopenh264enc.cpp
+++ b/ext/openh264/gstopenh264enc.cpp
@@ -794,9 +794,9 @@ gst_openh264enc_handle_frame (GstVideoEncoder * encoder,
openh264enc->time_per_frame = (GST_SECOND / openh264enc->framerate);
openh264enc->previous_timestamp = frame->pts;
} else {
- openh264enc->time_per_frame =
- openh264enc->time_per_frame * 0.8 + (frame->pts -
- openh264enc->previous_timestamp) * 0.2;
+ openh264enc->time_per_frame = (guint64)
+ (openh264enc->time_per_frame * 0.8 + (frame->pts -
+ openh264enc->previous_timestamp) * 0.2);
openh264enc->previous_timestamp = frame->pts;
if (openh264enc->frame_count % 10 == 0) {
fps = GST_SECOND / (gdouble) openh264enc->time_per_frame;
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index 095a6453e..be2f46288 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -1829,7 +1829,8 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
/* Pass through or set output stereo/multiview config */
if (s && gst_structure_has_field (s, "multiview-mode")) {
caps_mview_mode = gst_structure_get_string (s, "multiview-mode");
- gst_structure_get_flagset (s, "multiview-flags", &mview_flags, NULL);
+ gst_structure_get_flagset (s, "multiview-flags", (guint*) &mview_flags,
+ NULL);
} else if (mview_mode != GST_VIDEO_MULTIVIEW_MODE_NONE) {
if (gst_video_multiview_guess_half_aspect (mview_mode,
width, height, par_n, par_d)) {