public void WriteFrame(ref Frame frame) { // Right now we just ignore timecodes and write the sample data out directly // Prehaps later we could add some padding code if some samples are dropped // If samples are overlapping that's just too bad. m_Writer.WriteSampleData(ref frame.Data, 0, frame.Data.Length); }
public Frame GetNextFrame(ITrackInfo Track) { MatroskaFileFrame mFrame = m_File.getNextFrame(Track.Number); // Check for EOS if (mFrame == null) return null; Frame frame = new Frame(); frame.Track = Track; frame.Timecode = (mFrame.Timecode / 1000.0); frame.Duration = (mFrame.Duration / 1000.0); int referenceCount = 1; if (mFrame.References != null) referenceCount += mFrame.References.Length; frame.References = new double[referenceCount]; frame.References[0] = (mFrame.Reference / 1000.0); for (int i = 1; i < referenceCount; i++) frame.References[i] = (mFrame.References[i] / 1000.0); frame.Data = ArrayCopy.SByteToByte(mFrame.Data); return frame; }