Exemplo n.º 1
0
        public int GetTrackID()
        {
            int    result = 0;
            Mp4Box box    = FindChildBox("tfhd");

            if (box != null)
            {
                Mp4BoxTFHD tfhdbox = box as Mp4BoxTFHD;
                if (tfhdbox != null)
                {
                    return(tfhdbox.GetTrackID());
                }
            }
            return(result);
        }
Exemplo n.º 2
0
        static public Mp4BoxTFHD CreateTFHDBox(int TrackID, int SampleFlags)
        {
            int        Flag    = 32;
            byte       version = 0x00;
            Mp4BoxTFHD box     = new Mp4BoxTFHD();

            if (box != null)
            {
                box.Length = 8 + 4 + 4 + 4;
                box.Type   = "tfhd";
                byte[] Buffer = new byte[box.Length - 8];
                if (Buffer != null)
                {
                    WriteMp4BoxByte(Buffer, 0, version);
                    WriteMp4BoxInt24(Buffer, 1, Flag);
                    WriteMp4BoxInt32(Buffer, 4, TrackID);
                    WriteMp4BoxInt32(Buffer, 8, SampleFlags);
                    box.Data = Buffer;
                    return(box);
                }
            }
            return(null);
        }