Exemplo n.º 1
0
        //public Mpeg4AppleDataBox[] DataBoxes(ByteVectorCollection list)
        public IList <Mpeg4AppleDataBox> DataBoxes(ByteVectorCollection list)
        {
            //ArrayList l = new ArrayList();
            List <Mpeg4AppleDataBox> boxes = new List <Mpeg4AppleDataBox>();

            // Check each box to see if the match any of the provided types.
            // If a match is found, loop through the children and add any data box.
            foreach (Mpeg4Box box in listBox.Children)
            {
                foreach (ByteVector vector in list)
                {
                    if (FixId(vector) == box.BoxType)
                    {
                        foreach (Mpeg4Box dataBox in box.Children)
                        {
                            //if (dataBox.GetType() == typeof(Mpeg4AppleDataBox))
                            Mpeg4AppleDataBox appleDataBox = dataBox as Mpeg4AppleDataBox;
                            if (appleDataBox != null)
                            {
                                boxes.Add(appleDataBox);
                            }
                        }
                    }
                }
            }

            // Return the results as an numbers.
            return(boxes);
            //(Mpeg4AppleDataBox[])l.ToArray(typeof(Mpeg4AppleDataBox));
        }
Exemplo n.º 2
0
        public void SetData(ByteVector type, ByteVectorCollection data, uint flags)
        {
            if (data != null)
            {
                if (data.Count > 0)
                {
                    Mpeg4AppleDataBox[] boxes = new Mpeg4AppleDataBox[data.Count];
                    for (int i = 0; i < data.Count; i++)
                    {
                        boxes[i] = new Mpeg4AppleDataBox(data[i], flags);
                    }

                    SetData(type, boxes);
                }
                else
                {
                    ClearData(type);
                }
            }
            else
            {
                ClearData(type);
            }
        }