From f62212466c15affebbea0b402c6df27af521f143 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Wed, 14 Oct 2020 17:10:32 +0900 Subject: [PATCH] Fix the use of invalid function to set the video frame rate - 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 --- packaging/capi-media-streamer.spec | 2 +- src/media_streamer_gst.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packaging/capi-media-streamer.spec b/packaging/capi-media-streamer.spec index 4dac37a..59c51dc 100644 --- a/packaging/capi-media-streamer.spec +++ b/packaging/capi-media-streamer.spec @@ -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 diff --git a/src/media_streamer_gst.c b/src/media_streamer_gst.c index f210034..c7cf997 100644 --- a/src/media_streamer_gst.c +++ b/src/media_streamer_gst.c @@ -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); -- 2.7.4