mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
video: keep the buffer reffed in the videoframe
This would also ensure that the buffer is not writable while mapped.
This commit is contained in:
parent
bee3d7b683
commit
c6f55538e3
1 changed files with 4 additions and 3 deletions
|
@ -1030,9 +1030,6 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
|
|||
else
|
||||
meta = gst_buffer_get_video_meta_id (buffer, id);
|
||||
|
||||
frame->buffer = buffer;
|
||||
frame->meta = meta;
|
||||
|
||||
if (meta) {
|
||||
frame->info.flags = meta->flags;
|
||||
frame->info.finfo = &formats[meta->format].info;
|
||||
|
@ -1064,6 +1061,9 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
|
|||
frame->data[i] = frame->map[0].data + info->offset[i];
|
||||
}
|
||||
}
|
||||
frame->buffer = gst_buffer_ref (buffer);
|
||||
frame->meta = meta;
|
||||
|
||||
return TRUE;
|
||||
|
||||
/* ERRORS */
|
||||
|
@ -1127,6 +1127,7 @@ gst_video_frame_unmap (GstVideoFrame * frame)
|
|||
} else {
|
||||
gst_buffer_unmap (buffer, &frame->map[0]);
|
||||
}
|
||||
gst_buffer_unref (buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue