mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
coremediabuffer: set ->pixel_buf for CVPixelBuffer buffers
Fix a bug for which we never actually set ->pixel_buf to non-NULL for CVPixelBuffer buffers.
This commit is contained in:
parent
cf9c73367d
commit
ad00f4a0e2
1 changed files with 4 additions and 6 deletions
|
@ -238,13 +238,11 @@ gst_core_media_buffer_new (CMSampleBufferRef sample_buf,
|
||||||
gboolean use_video_meta)
|
gboolean use_video_meta)
|
||||||
{
|
{
|
||||||
CVImageBufferRef image_buf;
|
CVImageBufferRef image_buf;
|
||||||
CVPixelBufferRef pixel_buf;
|
|
||||||
CMBlockBufferRef block_buf;
|
CMBlockBufferRef block_buf;
|
||||||
GstCoreMediaMeta *meta;
|
GstCoreMediaMeta *meta;
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
|
|
||||||
image_buf = CMSampleBufferGetImageBuffer (sample_buf);
|
image_buf = CMSampleBufferGetImageBuffer (sample_buf);
|
||||||
pixel_buf = NULL;
|
|
||||||
block_buf = CMSampleBufferGetDataBuffer (sample_buf);
|
block_buf = CMSampleBufferGetDataBuffer (sample_buf);
|
||||||
|
|
||||||
buf = gst_buffer_new ();
|
buf = gst_buffer_new ();
|
||||||
|
@ -258,19 +256,19 @@ gst_core_media_buffer_new (CMSampleBufferRef sample_buf,
|
||||||
CFRetain (block_buf);
|
CFRetain (block_buf);
|
||||||
meta->sample_buf = sample_buf;
|
meta->sample_buf = sample_buf;
|
||||||
meta->image_buf = image_buf;
|
meta->image_buf = image_buf;
|
||||||
meta->pixel_buf = pixel_buf;
|
meta->pixel_buf = NULL;
|
||||||
meta->block_buf = block_buf;
|
meta->block_buf = block_buf;
|
||||||
|
|
||||||
if (image_buf != NULL && CFGetTypeID (image_buf) == CVPixelBufferGetTypeID ()) {
|
if (image_buf != NULL && CFGetTypeID (image_buf) == CVPixelBufferGetTypeID ()) {
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
gboolean has_padding = FALSE;
|
gboolean has_padding = FALSE;
|
||||||
|
|
||||||
pixel_buf = (CVPixelBufferRef) image_buf;
|
meta->pixel_buf = (CVPixelBufferRef) image_buf;
|
||||||
if (!gst_video_info_init_from_pixel_buffer (&info, pixel_buf)) {
|
if (!gst_video_info_init_from_pixel_buffer (&info, meta->pixel_buf)) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gst_core_media_buffer_wrap_pixel_buffer (buf, &info, pixel_buf,
|
if (!gst_core_media_buffer_wrap_pixel_buffer (buf, &info, meta->pixel_buf,
|
||||||
&has_padding)) {
|
&has_padding)) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue