상속: EbmlAscii
예제 #1
0
        public override EbmlGeneric New()
        {
            EbmlUtf8 b = new EbmlUtf8();
            b.Id = Id;
            b.InputOffset = InputOffset;
            b.Value = Value;
            b.Weight = Weight;

            return b;
        }
예제 #2
0
        public override EbmlGeneric New()
        {
            EbmlUtf8 b = new EbmlUtf8();

            b.Id          = Id;
            b.InputOffset = InputOffset;
            b.Value       = Value;
            b.Weight      = Weight;

            return(b);
        }
예제 #3
0
        internal static EbmlBinary NormalizeHeader(Container c)
        {
            //Remove DATEUTC
            EbmlMaster info = (EbmlMaster)c.FindFirst(Ids.MATROSKA_ID_INFO);
            EbmlBinary date = (EbmlBinary)info.FindFirst(Ids.MATROSKA_ID_DATEUTC);
            if (date != null)
                info.Value.Remove(date);
            //Changing Muxing and Writting App to a Constant.
            EbmlUtf8 muxapp = (EbmlUtf8)info.FindFirst(Ids.MATROSKA_ID_MUXINGAPP);
            if (muxapp == null)
            {
                muxapp = new EbmlUtf8 { Id = Ids.MATROSKA_ID_MUXINGAPP };
                info.Value.Add(muxapp);
            }
            EbmlUtf8 wrtapp = (EbmlUtf8)info.FindFirst(Ids.MATROSKA_ID_WRITINGAPP);
            if (wrtapp == null)
            {
                wrtapp = new EbmlUtf8 { Id = Ids.MATROSKA_ID_WRITINGAPP };
                info.Value.Add(wrtapp);
            }
            muxapp.Value = wrtapp.Value = "AOD";
            EbmlBinary seguid = (EbmlBinary)info.FindFirst(Ids.MATROSKA_ID_SEGMENTUID);
            if (seguid == null)
            {
                seguid = new EbmlBinary { Id = Ids.MATROSKA_ID_SEGMENTUID, Value = new byte[16] };
                info.Value.Add(seguid);
            }

            info.Value.Sort();
            return seguid;
        }
예제 #4
0
 internal static void MoveTagInfoToTracks(Container c)
 {
     //Moving Title and Language tags to tracks if they exists
     List<EbmlGeneric> tracks = c.FindAll(Ids.MATROSKA_ID_TRACKENTRY);
     List<EbmlGeneric> tags = c.FindAll(Ids.MATROSKA_ID_TAG);
     foreach (EbmlMaster t in tags)
     {
         EbmlMaster tt = (EbmlMaster)t.FindFirst(Ids.MATROSKA_ID_TAGTARGETS);
         if (tt != null)
         {
             EbmlMaster sp = (EbmlMaster)t.FindFirst(Ids.MATROSKA_ID_SIMPLETAG);
             EbmlUint jk = (EbmlUint)tt.FindFirst(Ids.MATROSKA_ID_TAGTARGETS_TRACKUID);
             if (jk != null)
             {
                 EbmlUtf8 name = (EbmlUtf8)sp.FindFirst(Ids.MATROSKA_ID_TAGNAME);
                 EbmlUtf8 value = (EbmlUtf8)sp.FindFirst(Ids.MATROSKA_ID_TAGSTRING);
                 if (name != null && value != null)
                 {
                     string nm = name.Value.ToUpper(CultureInfo.InvariantCulture);
                     string vl = value.Value;
                     if (nm == "LANGUAGE" || nm == "TITLE" || nm == "NAME")
                     {
                         foreach (EbmlMaster j in tracks)
                         {
                             EbmlUint u = (EbmlUint)j.FindFirst(Ids.MATROSKA_ID_TRACKUID);
                             if (u.Value == jk.Value)
                             {
                                 EbmlUtf8 change;
                                 if (nm == "TITLE" || nm == "NAME")
                                 {
                                     change = (EbmlUtf8)j.FindFirst(Ids.MATROSKA_ID_TRACKNAME);
                                     if (change == null)
                                     {
                                         change = new EbmlUtf8 { Id = Ids.MATROSKA_ID_TRACKNAME };
                                         j.Value.Add(change);
                                     }
                                 }
                                 else
                                 {
                                     change = (EbmlUtf8)j.FindFirst(Ids.MATROSKA_ID_TRACKLANGUAGE);
                                     if (change == null)
                                     {
                                         change = new EbmlUtf8 { Id = Ids.MATROSKA_ID_TRACKLANGUAGE };
                                         j.Value.Add(change);
                                     }
                                 }
                                 change.Value = vl;
                                 j.Value.Sort();
                                 break;
                             }
                         }
                     }
                 }
             }
         }
     }
 }