public override int OnElt(CommonElt elt) { if (OnEvent != null) { // Because the event is delivered asynchronously we must copy the elt HERE before the native memory (C++) is destroyed. Elt element = Elt.New(elt); EventHandlerTrigger.TriggerEvent <EltEventArgs>(OnEvent, this, new EltEventArgs(element)); } return(0); }
protected Elt(CommonElt elt) { m_Elements = new MyObservableCollection <Elt>(true); m_Type = (EltType_t)elt.getType(); m_BitsStart = elt.getBitsStart().Trim(); m_BitsVal = elt.getBitsVal().Trim(); m_BitsCount = elt.getBitsCount(); Explode(elt); }
internal static Elt New(CommonElt elt) { System.Diagnostics.Debug.Assert(elt != null); switch (elt.getType()) { case CommonElementType_t.CommonEltType_Syntax: { return(new EltSyntax(SwigHelper.CastTo <CommonSyntax>(elt))); } case CommonElementType_t.CommonEltType_Control: { return(new EltControl(SwigHelper.CastTo <CommonControl>(elt))); } case CommonElementType_t.CommonEltType_Header: { return(new EltHeader(SwigHelper.CastTo <CommonHeader>(elt))); } case CommonElementType_t.CommonEltType_Function: { return(new EltFunction(SwigHelper.CastTo <CommonFunction>(elt))); } case CommonElementType_t.CommonEltType_Error: { return(new EltError(SwigHelper.CastTo <CommonError>(elt))); } case CommonElementType_t.CommonEltType_Mb: { CommonMb mb = SwigHelper.CastTo <CommonMb>(elt); return(mb.getMbType() == CommonEltMbType_t.CommonEltMbType_H264 ? new H264Mb(SwigHelper.CastTo <CommonMbH264>(elt)) : new EltMb(mb)); } /* === H.264 === */ case CommonElementType_t.CommonEltType_Nalu: { return(new EltH264Nalu(SwigHelper.CastTo <CommonH264Nalu>(elt))); } case CommonElementType_t.CommonEltType_Section: { return(new EltH264Section(SwigHelper.CastTo <CommonH264Section>(elt))); } default: { throw new NotImplementedException("No constructor for element with type = " + elt.getType()); } } }
void Explode(CommonElt elt) { CommonEltVectorPtr elts = elt.getElements(); Elt _elt; foreach (CommonElt e in elts) { if ((_elt = Elt.New(e)) != null) { m_Elements.Add(_elt); } } }