mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
avfvideosrc: check for failure to create buffer
gst_core_media_buffer_new and gst_core_video_texture_cache_get_gl_buffer can fail for various platform reasons. https://bugzilla.gnome.org/show_bug.cgi?id=748122
This commit is contained in:
parent
4a88951c52
commit
472d1959a2
1 changed files with 9 additions and 1 deletions
|
@ -909,6 +909,11 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
|||
}
|
||||
|
||||
*buf = gst_core_media_buffer_new (sbuf, useVideoMeta, textureCache == NULL);
|
||||
if (*buf == NULL) {
|
||||
CFRelease (sbuf);
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
if (format == GST_VIDEO_FORMAT_RGBA) {
|
||||
/* So now buf contains BGRA data (!) . Since downstream is actually going to
|
||||
* use the GL upload meta to get RGBA textures (??), we need to override the
|
||||
|
@ -920,8 +925,11 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
|||
}
|
||||
CFRelease (sbuf);
|
||||
|
||||
if (textureCache != NULL)
|
||||
if (textureCache != NULL) {
|
||||
*buf = gst_core_video_texture_cache_get_gl_buffer (textureCache, *buf);
|
||||
if (*buf == NULL)
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
GST_BUFFER_OFFSET (*buf) = offset++;
|
||||
GST_BUFFER_OFFSET_END (*buf) = GST_BUFFER_OFFSET (*buf) + 1;
|
||||
|
|
Loading…
Reference in a new issue