[gst-devel] How to manipulate with Gst.Caps' in C#?

wl2776 wl2776 at gmail.com
Mon Oct 11 13:23:45 CEST 2010


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
-- 
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-manipulate-with-Gst-Caps-in-C-tp2989588p2989588.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list