[Bug 736100] video-info: doesn't return the right I420 image size for certain resolutions

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Sep 8 13:42:49 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=736100
  GStreamer | gst-plugins-base | git

--- Comment #11 from Aleix Conchillo Flaqué <aconchillo at gmail.com> 2014-09-08 20:42:44 UTC ---
Thank you guys. I have investigated a little bit more. Internally, webrtc uses
libyuv.

And the VideoFrame class provides CopyToPlanes. So, the following code works
for me as well:

  size_t size = GST_VIDEO_INFO_SIZE (&video_info);
  guint8 *image = (guint8 *) g_malloc0 (size);

  guint8 *dst_y = image + GST_VIDEO_INFO_COMP_OFFSET (&video_info, 0);
  guint8 *dst_u = image + GST_VIDEO_INFO_COMP_OFFSET (&video_info, 1);
  guint8 *dst_v = image + GST_VIDEO_INFO_COMP_OFFSET (&video_info, 2);

  guint dst_y_stride = GST_VIDEO_INFO_COMP_STRIDE (&video_info, 0);
  guint dst_u_stride = GST_VIDEO_INFO_COMP_STRIDE (&video_info, 1);
  guint dst_v_stride = GST_VIDEO_INFO_COMP_STRIDE (&video_info, 2);

  frame -> CopyToPlanes(dst_y, dst_u, dst_v,
                        dst_y_stride, dst_u_stride, dst_v_stride);

  GstBuffer *buffer = gst_buffer_new_wrapped (image, size);

As Nicolas suggested, it would be better to allow a zero-copy of it.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list