ret = mm_streamrecorder_push_stream_buffer(handle->mm_handle, MM_STREAM_TYPE_VIDEO, pts, video_buf, video_buf->size[0]);
} else if (mimetype == MEDIA_FORMAT_I420) {
void *buf_data = NULL;
- uint64_t buf_size = 0;
- ret = media_packet_get_buffer_size(packet, &buf_size);
- if (ret != MEDIA_PACKET_ERROR_NONE) {
- LOGW("buffer size get fail");
- return STREAMRECORDER_ERROR_INVALID_PARAMETER;
- }
- ret = media_packet_get_buffer_data_ptr(packet, (void **)&buf_data);
+
+ ret = media_packet_get_video_plane_data_ptr(packet, 0, (void **)&buf_data);
if (ret != MEDIA_PACKET_ERROR_NONE) {
LOGW("buffer size get fail");
return STREAMRECORDER_ERROR_INVALID_PARAMETER;
return STREAMRECORDER_ERROR_OUT_OF_MEMORY;
}
}
- ret = mm_streamrecorder_push_stream_buffer(handle->mm_handle, MM_STREAM_TYPE_VIDEO, pts, buf_data, buf_size);
+ ret = mm_streamrecorder_push_video_packet(handle->mm_handle, packet, pts, buf_data);
}
} else {
media_packet_is_audio(packet, &flag);