From: Chandan Padhi Date: Wed, 25 Feb 2015 09:45:56 +0000 (+0530) Subject: [MM][Tizen 3.0] Fix video corruption when video resolution is changed. X-Git-Tag: submit/tizen/20201118.160233~1173 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d293e93ad62ecfb2e8163e197b5fdd3b200a3349;p=platform%2Fframework%2Fweb%2Fchromium-efl.git [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 --- 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) /