Ejemplo n.º 1
0
        public override ByteVector Render()
        {
            ByteVector output     = new ByteVector();
            uint       childCount = 0;

            foreach (AsfObject child in children)
            {
                if (child.Guid != AsfGuid.AsfPaddingObject)
                {
                    output += child.Render();
                    childCount++;
                }
            }

            int sizeDifference = (int)(output.Count + 30 - OriginalSize);

            if (sizeDifference != 0)
            {
                AsfPaddingObject obj = new AsfPaddingObject((uint)(sizeDifference > 0 ? 4096 : -sizeDifference));
                output += obj.Render();
                childCount++;
            }

            return(Render(RenderDWord(childCount) + reserved + output));
        }
Ejemplo n.º 2
0
        public AsfObject[] ReadObjects(uint count, long position)
        {
            ArrayList l = new ArrayList();

            for (int i = 0; i < (int)count; i++)
            {
                Seek(position);
                AsfGuid id = ReadGuid();

                AsfObject obj;

                if (id.Equals(AsfGuid.AsfFilePropertiesObject))
                {
                    obj = new AsfFilePropertiesObject(this, position);
                }
                else if (id.Equals(AsfGuid.AsfStreamPropertiesObject))
                {
                    obj = new AsfStreamPropertiesObject(this, position);
                }
                else if (id.Equals(AsfGuid.AsfContentDescriptionObject))
                {
                    obj = new AsfContentDescriptionObject(this, position);
                }
                else if (id.Equals(AsfGuid.AsfExtendedContentDescriptionObject))
                {
                    obj = new AsfExtendedContentDescriptionObject(this, position);
                }
                else if (id.Equals(AsfGuid.AsfPaddingObject))
                {
                    obj = new AsfPaddingObject(this, position);
                }
                else
                {
                    obj = new AsfUnknownObject(this, position);
                }

                l.Add(obj);
                position += obj.OriginalSize;
            }

            return((AsfObject[])l.ToArray(typeof(AsfObject)));
        }
Ejemplo n.º 3
0
		public override ByteVector Render()
		{
			ByteVector output = new ByteVector();
			uint childCount = 0;
			foreach (AsfObject child in children)
				if (child.Guid != AsfGuid.AsfPaddingObject)
				{
					output += child.Render();
					childCount++;
				}

			int sizeDifference = (int)(output.Count + 30 - OriginalSize);

			if (sizeDifference != 0)
			{
				AsfPaddingObject obj = new AsfPaddingObject((uint)(sizeDifference > 0 ? 4096 : -sizeDifference));
				output += obj.Render();
				childCount++;
			}

			return Render(RenderDWord(childCount) + reserved + output);
		}
Ejemplo n.º 4
0
		public AsfObject[] ReadObjects(uint count, long position)
		{
			ArrayList l = new ArrayList();
			for (int i = 0; i < (int)count; i++)
			{
				Seek(position);
				AsfGuid id = ReadGuid();

				AsfObject obj;

				if (id.Equals(AsfGuid.AsfFilePropertiesObject))
					obj = new AsfFilePropertiesObject(this, position);
				else if (id.Equals(AsfGuid.AsfStreamPropertiesObject))
					obj = new AsfStreamPropertiesObject(this, position);
				else if (id.Equals(AsfGuid.AsfContentDescriptionObject))
					obj = new AsfContentDescriptionObject(this, position);
				else if (id.Equals(AsfGuid.AsfExtendedContentDescriptionObject))
					obj = new AsfExtendedContentDescriptionObject(this, position);
				else if (id.Equals(AsfGuid.AsfPaddingObject))
					obj = new AsfPaddingObject(this, position);
				else
					obj = new AsfUnknownObject(this, position);

				l.Add(obj);
				position += obj.OriginalSize;
			}

			return (AsfObject[])l.ToArray(typeof(AsfObject));
		}