How to manipulate with Gst.Caps' in C#?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to manipulate with Gst.Caps' in C#?

wl2776
Administrator
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
Reply | Threaded
Open this post in threaded view
|

Re: How to manipulate with Gst.Caps' in C#?

wl2776
Administrator
Looks like there's a bug somewhere in the C# binding.
Currently have passed it using strings and .FromString and .ToString methods.

Will try to update fresh git revision and file a bug if one will exist, when time permits.
Reply | Threaded
Open this post in threaded view
|

Re: How to manipulate with Gst.Caps' in C#?

Maarten Bosmans
2010/10/11 wl2776 <[hidden email]>:
> Looks like there's a bug somewhere in the C# binding.
> Currently have passed it using strings and .FromString and .ToString
> methods.

This is probably already solved in git.
http://cgit.freedesktop.org/gstreamer/gstreamer-sharp/commit/?id=9713ead713201f10c0fe4185bc8bb0df4c276cc3

> Will try to update fresh git revision and file a bug if one will exist, when
> time permits.

Maarten

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel