plugins: Use explicit type conversion from enums
authorNirbheek Chauhan <nirbheek@centricular.com>
Thu, 27 Oct 2016 03:55:20 +0000 (09:25 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Thu, 27 Oct 2016 17:36:26 +0000 (23:06 +0530)
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.

ext/gl/gstglstereosplit.c
ext/openh264/gstopenh264enc.cpp
gst/videoparsers/gsth264parse.c

index 1eaa440..744a7f2 100644 (file)
@@ -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",
index a5e488f..ad18120 100644 (file)
@@ -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;
index 095a645..be2f462 100644 (file)
@@ -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)) {