示例#1
0
 public Mpeg4AppleTag(Mpeg4AppleItemListBox box, Mpeg4File file) : base()
 {
     // Hold onto the ilst_box and file. If the box doesn'type exist, create
     // one.
     listBox   = (box == null) ? new Mpeg4AppleItemListBox() : box;
     this.file = file;
 }
		public Mpeg4BoxHeader(Mpeg4File file, long position)
		{
			this.file = file;
			this.position = position;
			//boxType = null;
			//extendedType = null;
			//largeSize = 0;
			//size = 0;         
			Read();
		}
示例#3
0
 public Mpeg4BoxHeader(Mpeg4File file, long position)
 {
     this.file     = file;
     this.position = position;
     //boxType = null;
     //extendedType = null;
     //largeSize = 0;
     //size = 0;
     Read();
 }
示例#4
0
 public Mpeg4AppleTag(Mpeg4File file) : this(null, file)
 {
 }
示例#5
0
 // FileBox cannot be read from a file and is a seed box for a file.
 public Mpeg4FileBox(Mpeg4File file) : base(null)
 {
     this.File = file;
 }
示例#6
0
		// FileBox cannot be read from a file and is a seed box for a file.
		public Mpeg4FileBox(Mpeg4File file) : base(null)
		{
			this.File = file;
		}
示例#7
0
        // Create a box by reading the file and add it to "parent".
        public static Mpeg4Box Create(Mpeg4File file, long position, Mpeg4Box parent)
        {
            // Read the box header.
            Mpeg4BoxHeader header = new Mpeg4BoxHeader(file, position);

            // If we're not even valid, quit.
            if (!header.IsValid)
            {
                return(null);
            }

            // IF we're in a SampleDescriptionBox and haven'type loaded all the
            // entries, try loading an appropriate entry.
            if (parent.BoxType == "stsd" && parent.Children.Count < ((Mpeg4IsoSampleDescriptionBox)parent).EntryCount)
            {
                Mpeg4IsoHandlerBox handler = parent.Handler;
                if (handler != null && handler.HandlerType == "soun")
                {
                    return(new Mpeg4IsoAudioSampleEntry(header, parent));
                }
                else
                {
                    return(new Mpeg4IsoSampleEntry(header, parent));
                }
            }

            //
            // A bunch of standard items.
            //

            if (header.BoxType == "moov")
            {
                return(new Mpeg4IsoMovieBox(header, parent));
            }

            if (header.BoxType == "mvhd")
            {
                return(new Mpeg4IsoMovieHeaderBox(header, parent));
            }

            if (header.BoxType == "mdia")
            {
                return(new Mpeg4IsoMediaBox(header, parent));
            }

            if (header.BoxType == "minf")
            {
                return(new Mpeg4IsoMediaInformationBox(header, parent));
            }

            if (header.BoxType == "stbl")
            {
                return(new Mpeg4IsoSampleTableBox(header, parent));
            }

            if (header.BoxType == "stsd")
            {
                return(new Mpeg4IsoSampleDescriptionBox(header, parent));
            }

            if (header.BoxType == "stco")
            {
                return(new Mpeg4IsoChunkOffsetBox(header, parent));
            }

            if (header.BoxType == "co64")
            {
                return(new Mpeg4IsoChunkLargeOffsetBox(header, parent));
            }

            if (header.BoxType == "trak")
            {
                return(new Mpeg4IsoTrackBox(header, parent));
            }

            if (header.BoxType == "hdlr")
            {
                return(new Mpeg4IsoHandlerBox(header, parent));
            }

            if (header.BoxType == "udta")
            {
                return(new Mpeg4IsoUserDataBox(header, parent));
            }

            if (header.BoxType == "meta")
            {
                return(new Mpeg4IsoMetaBox(header, parent));
            }

            if (header.BoxType == "ilst")
            {
                return(new Mpeg4AppleItemListBox(header, parent));
            }

            if (header.BoxType == "data")
            {
                return(new Mpeg4AppleDataBox(header, parent));
            }

            if (header.BoxType == "esds")
            {
                return(new Mpeg4AppleElementaryStreamDescriptor(header, parent));
            }

            if (header.BoxType == "free" || header.BoxType == "skip")
            {
                return(new Mpeg4IsoFreeSpaceBox(header, parent));
            }

            if (header.BoxType == "mean" || header.BoxType == "name")
            {
                return(new Mpeg4AppleAdditionalInfoBox(header, parent));
            }

            // If we still don'type have a tag, and we're inside an ItemLisBox, load
            // lthe box as an AnnotationBox (Apple tag item).
            if (parent.GetType() == typeof(Mpeg4AppleItemListBox))
            {
                return(new Mpeg4AppleAnnotationBox(header, parent));
            }

            // Nothing good. Go generic.
            return(new Mpeg4UnknownBox(header, parent));
        }
示例#8
0
		// Create a box by reading the file and add it to "parent".
		public static Mpeg4Box Create(Mpeg4File file, long position, Mpeg4Box parent)
		{
			// Read the box header.
			Mpeg4BoxHeader header = new Mpeg4BoxHeader(file, position);

			// If we're not even valid, quit.
			if (!header.IsValid)
				return null;

			// IF we're in a SampleDescriptionBox and haven'type loaded all the
			// entries, try loading an appropriate entry.
			if (parent.BoxType == "stsd" && parent.Children.Count < ((Mpeg4IsoSampleDescriptionBox)parent).EntryCount)
			{
				Mpeg4IsoHandlerBox handler = parent.Handler;
				if (handler != null && handler.HandlerType == "soun")
					return new Mpeg4IsoAudioSampleEntry(header, parent);
				else
					return new Mpeg4IsoSampleEntry(header, parent);
			}

			//
			// A bunch of standard items.
			//

			if (header.BoxType == "moov")
				return new Mpeg4IsoMovieBox(header, parent);

			if (header.BoxType == "mvhd")
				return new Mpeg4IsoMovieHeaderBox(header, parent);

			if (header.BoxType == "mdia")
				return new Mpeg4IsoMediaBox(header, parent);

			if (header.BoxType == "minf")
				return new Mpeg4IsoMediaInformationBox(header, parent);

			if (header.BoxType == "stbl")
				return new Mpeg4IsoSampleTableBox(header, parent);

			if (header.BoxType == "stsd")
				return new Mpeg4IsoSampleDescriptionBox(header, parent);

			if (header.BoxType == "stco")
				return new Mpeg4IsoChunkOffsetBox(header, parent);

			if (header.BoxType == "co64")
				return new Mpeg4IsoChunkLargeOffsetBox(header, parent);

			if (header.BoxType == "trak")
				return new Mpeg4IsoTrackBox(header, parent);

			if (header.BoxType == "hdlr")
				return new Mpeg4IsoHandlerBox(header, parent);

			if (header.BoxType == "udta")
				return new Mpeg4IsoUserDataBox(header, parent);

			if (header.BoxType == "meta")
				return new Mpeg4IsoMetaBox(header, parent);

			if (header.BoxType == "ilst")
				return new Mpeg4AppleItemListBox(header, parent);

			if (header.BoxType == "data")
				return new Mpeg4AppleDataBox(header, parent);

			if (header.BoxType == "esds")
				return new Mpeg4AppleElementaryStreamDescriptor(header, parent);

			if (header.BoxType == "free" || header.BoxType == "skip")
				return new Mpeg4IsoFreeSpaceBox(header, parent);

			if (header.BoxType == "mean" || header.BoxType == "name")
				return new Mpeg4AppleAdditionalInfoBox(header, parent);

			// If we still don'type have a tag, and we're inside an ItemLisBox, load
			// lthe box as an AnnotationBox (Apple tag item).
			if (parent.GetType() == typeof(Mpeg4AppleItemListBox))
				return new Mpeg4AppleAnnotationBox(header, parent);

			// Nothing good. Go generic.
			return new Mpeg4UnknownBox(header, parent);
		}