I need to get a copy of Gst.Caps and then remove several fields from it.
I do this in the following way.
taget_caps = caps1.Copy();
for (uint i = 0; i < caps1.Size; i++) {
Gst.Structure st = target_caps[i];
if (st.Name.ToString().Contains("video")) {
st.RemoveField("parsed");
st.RemoveField("codec_data");
st.RemoveField("profile");
st.RemoveField("level");
st["bitrate"] = video_bitrate;
} else if (st.Name.ToString().Contains("audio")){
st1.RemoveField("parsed");
st1["bitrate"] = audio_bitrate;
}
}
However, when my application finishes, I get the exception, saying:
"Additional information: Collection was modified; enumeration operation may not execute."
Call stack shows Gst.Caps.Finalize(), line 242 and Gst.Caps.RemoveStructureReferences(), line 59
Is there anything like DeepCopy for GstStructures? Google shows only variants, subclassing from ICloneable