[0.6.135] fix video info error 54/202954/3 accepted/tizen/5.0/unified/20190409.154846 submit/tizen_5.0/20190408.080132
authorEunhye Choi <eunhae1.choi@samsung.com>
Mon, 8 Apr 2019 05:54:40 +0000 (14:54 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Mon, 8 Apr 2019 06:43:22 +0000 (15:43 +0900)
- Sets the right video stream information considering the plane num.
- side issue of 5d1c02ba12f2242370e47e7da8f6a0b5e45f4ccd
- this is the same with tizen 5.5 commit
  I182c8d31a5b34f1b9d8b4cf127aa3066571330df

Change-Id: I4d74ccabb14ed627937bef5f32fbbde08e5acec2

packaging/libmm-player.spec
src/include/mm_player.h
src/mm_player_priv.c

index 21eedeed8247c21e9a430b1bacb054d4ca07a32c..bfb1b40b91bccd157e97892b1fc0a4fa80871e74 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-player
 Summary:    Multimedia Framework Player Library
-Version:    0.6.134
+Version:    0.6.135
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index b941138284f9cdd6701456c3b5b24d6e8f4eb2a6..949fd91d02d2d7b94c747bc78b21ea592dad5d9d 100644 (file)
@@ -267,6 +267,7 @@ typedef struct {
        int stride[BUFFER_MAX_PLANE_NUM];      /**< stride of plane */
        int elevation[BUFFER_MAX_PLANE_NUM];   /**< elevation of plane */
        int orientation;                       /**< orientation */
+       int plane_num;
 } MMPlayerVideoStreamDataType;
 
 /**
index fffea7787b203c5a124fbdb0a2786e0af0602881..ef4dbaf4e41259ea5c0056842d9b88a5d1e46c31 100644 (file)
@@ -3728,6 +3728,7 @@ __mmplayer_video_stream_decoded_render_cb(GstElement* object, GstBuffer *buffer,
        unsigned int fourcc = 0;
        unsigned int pitch = 0;
        int index = 0;
+       GstVideoInfo info;
 
        MMPLAYER_FENTER();
        MMPLAYER_RETURN_IF_FAIL(player && player->video_stream_cb);
@@ -3760,6 +3761,8 @@ __mmplayer_video_stream_decoded_render_cb(GstElement* object, GstBuffer *buffer,
        if (string_format)
                fourcc = _mmplayer_convert_fourcc_string_to_value(string_format);
        stream->format = util_get_pixtype(fourcc);
+       gst_video_info_from_caps(&info, caps);
+       stream->plane_num = GST_VIDEO_INFO_N_PLANES(&info);
        gst_caps_unref(caps);
        caps = NULL;
 
@@ -3785,9 +3788,18 @@ __mmplayer_video_stream_decoded_render_cb(GstElement* object, GstBuffer *buffer,
        if (player->set_mode.video_zc &&
                player->set_mode.media_packet_video_stream &&
                gst_is_tizen_memory(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;
                }