Fix the use of invalid function to set the video frame rate
[platform/core/api/mediastreamer.git] / src / media_streamer_gst.c
index f210034..c7cf997 100644 (file)
@@ -2554,8 +2554,12 @@ static media_format_h __ms_create_fmt_from_caps(GstCaps *caps)
        int fmt_ret = MEDIA_FORMAT_ERROR_NONE;
        const gchar *pad_type = NULL;
        const gchar *pad_format = NULL;
-       int channels = 0, bps = 0;
-       int width = 0, height = 0, avg_bps = 0, max_bps = 0;
+       int channels = 0;
+       int bps = 0;
+       int width = 0;
+       int height = 0;
+       int fps_n = 0;
+       int fps_d = 0;
 
        ms_debug_fenter();
 
@@ -2581,14 +2585,13 @@ static media_format_h __ms_create_fmt_from_caps(GstCaps *caps)
 
        if (MS_ELEMENT_IS_VIDEO(pad_type)) {
                gst_structure_get_int(pad_struct, "width", &width);
-               gst_structure_get_fraction(pad_struct, "framerate", &max_bps, &avg_bps);
                gst_structure_get_int(pad_struct, "height", &height);
+               gst_structure_get_fraction(pad_struct, "framerate", &fps_n, &fps_d);
 
                media_format_set_video_mime(fmt, ms_convert_video_string_format_to_media_format(pad_format));
                media_format_set_video_width(fmt, width);
                media_format_set_video_height(fmt, height);
-               media_format_set_video_avg_bps(fmt, avg_bps);
-               media_format_set_video_max_bps(fmt, max_bps);
+               media_format_set_video_frame_rate(fmt, fps_n / fps_d);
        } else if (MS_ELEMENT_IS_AUDIO(pad_type)) {
                media_format_set_audio_mime(fmt, ms_convert_audio_string_format_to_media_format(pad_format));
                gst_structure_get_int(pad_struct, "channels", &channels);