From d293e93ad62ecfb2e8163e197b5fdd3b200a3349 Mon Sep 17 00:00:00 2001 From: Chandan Padhi Date: Wed, 25 Feb 2015 15:15:56 +0530 Subject: [PATCH] [MM][Tizen 3.0] Fix video corruption when video resolution is changed. When the resolution of video is changed from server, video was corrupted. This patch makes MediaSourcePlayerGstreamer handle the video resolution changes. Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=11432 Change-Id: I0185c67e3a25785fe4b6866e9c708881b41578d7 Signed-off-by: msu.koo --- .../media/base/tizen/media_source_player_gstreamer.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tizen_src/impl/media/base/tizen/media_source_player_gstreamer.cc b/tizen_src/impl/media/base/tizen/media_source_player_gstreamer.cc index 604de51..0ee7f50 100644 --- a/tizen_src/impl/media/base/tizen/media_source_player_gstreamer.cc +++ b/tizen_src/impl/media/base/tizen/media_source_player_gstreamer.cc @@ -1296,6 +1296,24 @@ void MediaSourcePlayerGstreamer::OnNewFrameAvailable(GstSample* sample) { if (!gst_width_ || !gst_height_) GetFrameDetails(); + GstCaps* caps = gst_sample_get_caps(sample); + if (caps) { + GstVideoInfo vi; + gst_video_info_from_caps(&vi, caps); + int width = GST_VIDEO_INFO_WIDTH(&vi); + int height = GST_VIDEO_INFO_HEIGHT(&vi); + + if (width != gst_width_|| height != gst_height_) { + LOG (INFO) << __FUNCTION__ + << " ###### from " << gst_width_ << "X" << gst_height_ + << " to " << width << "X" << height; + gst_width_ = width; + gst_height_ = height; + manager()->OnMediaDataChange( + GetPlayerId(), video_format_, gst_height_, gst_width_, media_type); + } + } + base::TimeDelta timestamp = base::TimeDelta::FromMicroseconds( GST_BUFFER_TIMESTAMP(buffer) / -- 2.7.4