From: Sejun Park Date: Mon, 8 Apr 2019 05:40:09 +0000 (+0900) Subject: [0.6.181] fix video info error X-Git-Tag: submit/tizen/20190415.103247~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b07f64551207cfed5072e9217de48c6d1920177a;p=platform%2Fcore%2Fmultimedia%2Flibmm-player.git [0.6.181] fix video info error - Sets the right video information considering the plane num. - side issue of 5d1c02ba12f2242370e47e7da8f6a0b5e45f4ccd Change-Id: I182c8d31a5b34f1b9d8b4cf127aa3066571330df --- diff --git a/packaging/libmm-player.spec b/packaging/libmm-player.spec index 349dc81..fc928cf 100644 --- a/packaging/libmm-player.spec +++ b/packaging/libmm-player.spec @@ -1,6 +1,6 @@ Name: libmm-player Summary: Multimedia Framework Player Library -Version: 0.6.180 +Version: 0.6.181 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/include/mm_player.h b/src/include/mm_player.h index 494c07c..50bef0e 100644 --- a/src/include/mm_player.h +++ b/src/include/mm_player.h @@ -285,6 +285,7 @@ typedef struct { int elevation[BUFFER_MAX_PLANE_NUM]; /**< elevation of plane */ int orientation; /**< orientation */ int bo_size; /**< TBM buffer object size */ + int plane_num; /**< number of Plane */ } mmplayer_video_decoded_data_info_t; /** diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index fe5ef87..644c8e1 100644 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -9123,6 +9123,7 @@ __mmplayer_create_stream_from_pad(GstPad *pad) mmplayer_video_decoded_data_info_t *stream = NULL; gint width, height; MMPixelFormatType format; + GstVideoInfo info; caps = gst_pad_get_current_caps(pad); if (!caps) { @@ -9135,9 +9136,11 @@ __mmplayer_create_stream_from_pad(GstPad *pad) gst_structure_get_int(structure, "width", &width); gst_structure_get_int(structure, "height", &height); string_format = gst_structure_get_string(structure, "format"); + if (string_format) fourcc = _mmplayer_convert_fourcc_string_to_value(string_format); format = util_get_pixtype(fourcc); + gst_video_info_from_caps(&info, caps); gst_caps_unref(caps); /* moved here */ @@ -9155,6 +9158,7 @@ __mmplayer_create_stream_from_pad(GstPad *pad) stream->width = width; stream->height = height; stream->format = format; + stream->plane_num = GST_VIDEO_INFO_N_PLANES(&info); return stream; } @@ -9165,10 +9169,18 @@ __mmplayer_zerocopy_set_stride_elevation_bo(mmplayer_video_decoded_data_info_t * unsigned int pitch = 0; int index = 0; tbm_surface_h surface = gst_tizen_memory_get_surface(mem); + tbm_bo bo = NULL; for (index = 0; index < gst_tizen_memory_get_num_bos(mem); index++) { + bo = gst_tizen_memory_get_bos(mem, index); + if (bo) + stream->bo[index] = tbm_bo_ref(bo); + else + LOGE("failed to get bo for index %d", index); + } + + for (index = 0; index < stream->plane_num; index++) { tbm_surface_internal_get_plane_data(surface, index, NULL, NULL, &pitch); - stream->bo[index] = tbm_bo_ref(gst_tizen_memory_get_bos(mem, index)); stream->stride[index] = pitch; stream->elevation[index] = stream->height; }