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;
}
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;
+ }
}
}
}
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); */
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);