mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
ffmpegcolorspace: Transfer structures instead of copying them
Avoids many expensive structure copies
This commit is contained in:
parent
72e2d296f2
commit
19f5fda87d
2 changed files with 4 additions and 9 deletions
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit c804988a15bf68d5661a7af7799a51140d03c425
|
||||
Subproject commit 733fca913736edad29dea6a8dded921282ecee20
|
|
@ -128,7 +128,6 @@ gst_ffmpegcsp_transform_caps (GstBaseTransform * btrans,
|
|||
GstCaps *template;
|
||||
GstCaps *tmp, *tmp2;
|
||||
GstCaps *result;
|
||||
guint i, n;
|
||||
GstStructure *s;
|
||||
GstCaps *alpha, *non_alpha;
|
||||
|
||||
|
@ -143,18 +142,14 @@ gst_ffmpegcsp_transform_caps (GstBaseTransform * btrans,
|
|||
|
||||
/* Now move alpha formats to the beginning if caps is an alpha format
|
||||
* or at the end if caps is no alpha format */
|
||||
n = gst_caps_get_size (tmp);
|
||||
|
||||
alpha = gst_caps_new_empty ();
|
||||
non_alpha = gst_caps_new_empty ();
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
s = gst_caps_get_structure (tmp, i);
|
||||
|
||||
while ((s = gst_caps_steal_structure (tmp, 0))) {
|
||||
if (gst_ffmpegcsp_structure_is_alpha (s))
|
||||
gst_caps_append_structure (alpha, gst_structure_copy (s));
|
||||
gst_caps_append_structure (alpha, s);
|
||||
else
|
||||
gst_caps_append_structure (non_alpha, gst_structure_copy (s));
|
||||
gst_caps_append_structure (non_alpha, s);
|
||||
}
|
||||
|
||||
s = gst_caps_get_structure (caps, 0);
|
||||
|
|
Loading…
Reference in a new issue