Fix the use of invalid function to set the video frame rate 90/245690/5 submit/tizen/20201015.052301
authorHyunil <hyunil46.park@samsung.com>
Wed, 14 Oct 2020 08:10:32 +0000 (17:10 +0900)
committerHyunil <hyunil46.park@samsung.com>
Thu, 15 Oct 2020 01:35:20 +0000 (10:35 +0900)
- To set the video frame rate, use media_format_set_video_frame_rate()

[Issue Type] Bug fix
[Version] 0.1.124

Change-Id: I2c4b19aa825104d3e152a03107e2207661514583
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
packaging/capi-media-streamer.spec
src/media_streamer_gst.c

index 4dac37a..59c51dc 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-streamer
 Summary:    A Media Streamer API
-Version:    0.1.123
+Version:    0.1.124
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
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);