[v0.2.30] support RGB format 65/92565/1 accepted/tizen/common/20161018.175423 accepted/tizen/ivi/20161019.093224 accepted/tizen/mobile/20161019.093155 accepted/tizen/tv/20161019.093203 accepted/tizen/wearable/20161019.093211 submit/tizen/20161018.110515
authorNAMJEONGYOON <just.nam@samsung.com>
Mon, 17 Oct 2016 10:55:19 +0000 (19:55 +0900)
committerNAMJEONGYOON <just.nam@samsung.com>
Mon, 17 Oct 2016 10:55:19 +0000 (19:55 +0900)
Change-Id: Ice945d68dc1db602db2450e08d3ab4b6d78c1430

legacy/src/legacy_player.c
packaging/mmsvc-player.spec

index 574bbaf..7c63cc8 100644 (file)
@@ -855,7 +855,8 @@ static void _video_media_packet_dump(MMPlayerVideoStreamDataType *video_stream,
        int ret = 0;
 
        if ((video_stream->format != MM_PIXEL_FORMAT_NV12) &&
-               (video_stream->format != MM_PIXEL_FORMAT_I420)) {
+               (video_stream->format != MM_PIXEL_FORMAT_I420) &&
+               (video_stream->format != MM_PIXEL_FORMAT_RGBA)) {
                LOGE("not support dump for [%d] video format.", video_stream->format);
                return;
        }
@@ -866,27 +867,38 @@ static void _video_media_packet_dump(MMPlayerVideoStreamDataType *video_stream,
        media_packet_get_number_of_video_planes(pkt, (uint32_t*)&num);
        LOGD("num of planes %d", num);
 
-       if (video_stream->format == MM_PIXEL_FORMAT_I420)
-               uv_width = video_stream->width/2;
-       else
-               uv_width = video_stream->width;
-
-       for (cnt = 0 ; cnt < num ; cnt++) {
-               if (cnt == 0) {
-                       media_packet_get_video_plane_data_ptr(pkt, 0, &temp);
-                       media_packet_get_video_stride_width(pkt, 0, &stride_width);
-                       media_packet_get_video_stride_height(pkt, 0, &stride_height);
-                       for (i = 0; i < video_stream->height; i++) {
-                               ret = fwrite(temp, video_stream->width, 1, fp);
-                               temp += stride_width;
-                       }
-                       LOGD("[%d] strid %d %d\n", cnt, stride_width, stride_height);
-               } else {
-                       media_packet_get_video_plane_data_ptr(pkt, cnt, &temp);
-                       media_packet_get_video_stride_width(pkt, cnt, &stride_width);
-                       for (i = 0; i < video_stream->height/2; i++) {
-                               ret = fwrite(temp, uv_width, 1, fp);
-                               temp += stride_width;
+       if (video_stream->format == MM_PIXEL_FORMAT_RGBA) {
+               media_packet_get_video_plane_data_ptr(pkt, 0, &temp);
+               media_packet_get_video_stride_width(pkt, 0, &stride_width);
+               media_packet_get_video_stride_height(pkt, 0, &stride_height);
+               LOGD("stride %d %d\n", stride_width, stride_height);
+               for(i = 0; i < video_stream->height; i++) {
+                       ret = fwrite(temp, video_stream->width * 4, 1, fp);
+                       temp += video_stream->width * 4;
+               }
+       } else {
+               if (video_stream->format == MM_PIXEL_FORMAT_I420)
+                       uv_width = video_stream->width/2;
+               else
+                       uv_width = video_stream->width;
+
+               for (cnt = 0 ; cnt < num ; cnt++) {
+                       if (cnt == 0) {
+                               media_packet_get_video_plane_data_ptr(pkt, 0, &temp);
+                               media_packet_get_video_stride_width(pkt, 0, &stride_width);
+                               media_packet_get_video_stride_height(pkt, 0, &stride_height);
+                               for (i = 0; i < video_stream->height; i++) {
+                                       ret = fwrite(temp, video_stream->width, 1, fp);
+                                       temp += stride_width;
+                               }
+                               LOGD("[%d] stride %d %d\n", cnt, stride_width, stride_height);
+                       } else {
+                               media_packet_get_video_plane_data_ptr(pkt, cnt, &temp);
+                               media_packet_get_video_stride_width(pkt, cnt, &stride_width);
+                               for (i = 0; i < video_stream->height/2; i++) {
+                                       ret = fwrite(temp, uv_width, 1, fp);
+                                       temp += stride_width;
+                               }
                        }
                }
        }
@@ -940,6 +952,8 @@ static bool __video_stream_callback(void *stream, void *user_data)
                                else
                                        info.planes[i].offset = info.planes[i - 1].offset + info.planes[i - 1].size;
                                info.size += info.planes[i].size;
+                               if (video_stream->format == MM_PIXEL_FORMAT_RGBA)
+                                       info.size = video_stream->stride[0] * video_stream->height;
                        }
                        tsurf = tbm_surface_internal_create_with_bos(&info, (tbm_bo *)video_stream->bo, bo_num);
                        /*LOGD("tbm surface %p", tsurf); */
@@ -965,6 +979,8 @@ static bool __video_stream_callback(void *stream, void *user_data)
                                if (video_stream->format == MM_PIXEL_FORMAT_NV12T) {
                                        memcpy(tsuri.planes[0].ptr, ptr, tsuri.planes[0].size);
                                        memcpy(tsuri.planes[1].ptr, ptr2, tsuri.planes[1].size);
+                               } else if (video_stream->format == MM_PIXEL_FORMAT_RGBA) {
+                                       memcpy(tsuri.planes[0].ptr, ptr, tsuri.planes[0].size);
                                } else {
                                        for (plane_idx = 0; plane_idx < tsuri.num_planes; plane_idx++) {
                                                memcpy(tsuri.planes[plane_idx].ptr, ptr, tsuri.planes[plane_idx].size);
index 2be6d54..a1a5a6c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-player
 Summary:    A Media Player module for muse server
-Version:    0.2.29
+Version:    0.2.30
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0