/// <summary> /// Handle chunk elements found in the AVI file. Ignores unknown chunks and /// </summary> /// <param name="rp"></param> /// <param name="FourCC"></param> /// <param name="unpaddedLength"></param> /// <param name="paddedLength"></param> private void ProcessAVIChunk(RiffParser rp, int FourCC, int unpaddedLength, int paddedLength) { if (AviRiffData.ckidMainAVIHeader == FourCC) { // Main AVI header DecodeAVIHeader(rp, paddedLength); } else if (AviRiffData.ckidAVIStreamHeader == FourCC) { // Stream header DecodeAVIStream(rp, paddedLength); } else if (AviRiffData.ckidAVIISFT == FourCC) { Byte[] ba = new byte[paddedLength]; rp.ReadData(ba, 0, paddedLength); StringBuilder sb = new StringBuilder(unpaddedLength); for (int i = 0; i < unpaddedLength; ++i) { if (0 != ba[i]) { sb.Append((char)ba[i]); } } m_isft = sb.ToString(); } else { // Unknon chunk - skip rp.SkipData(paddedLength); } }
private void ProcessWaveChunk(RiffParser rp, int FourCC, int unpaddedLength, int length) { // Is this a 'fmt' chunk? if (AviRiffData.ckidWaveFMT == FourCC) { DecodeWave(rp, length); } else { rp.SkipData(length); } }
/// <summary> /// Handle List elements found in the AVI file. Ignores unknown lists and recursively looks /// at the content of known lists. /// </summary> /// <param name="rp"></param> /// <param name="FourCC"></param> /// <param name="length"></param> private void ProcessAVIList(RiffParser rp, int FourCC, int length) { RiffParser.ProcessChunkElement pac = ProcessAVIChunk; RiffParser.ProcessListElement pal = ProcessAVIList; // Is this the header? if ((AviRiffData.ckidAVIHeaderList == FourCC) || (AviRiffData.ckidAVIStreamList == FourCC) || (AviRiffData.ckidINFOList == FourCC)) { while (length > 0) { if (false == rp.ReadElement(ref length, pac, pal)) { break; } } } else { // Unknown lists - ignore rp.SkipData(length); } }
private void ProcessWaveChunk(RiffParser rp, int FourCC, int unpaddedLength, int length) { // Is this a 'fmt' chunk? if (AviRiffData.ckidWaveFMT == FourCC) { DecodeWave(rp, length); } else { rp.SkipData(length); } }
/// <summary> /// Default list element handler - skip the entire list /// </summary> /// <param name="rp"></param> /// <param name="FourCC"></param> /// <param name="length"></param> private void ProcessList(RiffParser rp, int FourCC, int length) { rp.SkipData(length); }
/// <summary> /// Handle List elements found in the AVI file. Ignores unknown lists and recursively looks /// at the content of known lists. /// </summary> /// <param name="rp"></param> /// <param name="FourCC"></param> /// <param name="length"></param> private void ProcessAVIList(RiffParser rp, int FourCC, int length) { RiffParser.ProcessChunkElement pac = new RiffParser.ProcessChunkElement(ProcessAVIChunk); RiffParser.ProcessListElement pal = new RiffParser.ProcessListElement(ProcessAVIList); // Is this the header? if ((AviRiffData.ckidAVIHeaderList == FourCC) || (AviRiffData.ckidAVIStreamList == FourCC) || (AviRiffData.ckidINFOList == FourCC)) { while (length > 0) { if (false == rp.ReadElement(ref length, pac, pal)) break; } } else { // Unknown lists - ignore rp.SkipData(length); } }
/// <summary> /// Handle chunk elements found in the AVI file. Ignores unknown chunks and /// </summary> /// <param name="rp"></param> /// <param name="FourCC"></param> /// <param name="unpaddedLength"></param> /// <param name="paddedLength"></param> private void ProcessAVIChunk(RiffParser rp, int FourCC, int unpaddedLength, int paddedLength) { if (AviRiffData.ckidMainAVIHeader == FourCC) { // Main AVI header DecodeAVIHeader(rp, unpaddedLength, paddedLength); } else if (AviRiffData.ckidAVIStreamHeader == FourCC) { // Stream header DecodeAVIStream(rp, unpaddedLength, paddedLength); } else if (AviRiffData.ckidAVIISFT == FourCC) { Byte[] ba = new byte[paddedLength]; rp.ReadData(ba, 0, paddedLength); StringBuilder sb = new StringBuilder(unpaddedLength); for (int i = 0; i < unpaddedLength; ++i) { if (0 != ba[i]) sb.Append((char)ba[i]); } m_isft = sb.ToString(); } else { // Unknon chunk - skip rp.SkipData(paddedLength); } }
/// <summary> /// Default list element handler - skip the entire list /// </summary> /// <param name="rp"></param> /// <param name="FourCC"></param> /// <param name="length"></param> private void ProcessList(RiffParser rp, int FourCC, int length) { rp.SkipData(length); }
/// <summary> /// Defaulkt chunk handler - skip chunk data /// </summary> /// <param name="rp"></param> /// <param name="FourCC"></param> /// <param name="unpaddedLength"></param> /// <param name="paddedLength"></param> private static void ProcessChunk(RiffParser rp, int FourCC, int unpaddedLength, int paddedLength) { rp.SkipData(paddedLength); }
/// <summary> /// Defaulkt chunk handler - skip chunk data /// </summary> /// <param name="rp"></param> /// <param name="FourCC"></param> /// <param name="unpaddedLength"></param> /// <param name="paddedLength"></param> private static void ProcessChunk(RiffParser rp, int FourCC, int unpaddedLength, int paddedLength) { rp.SkipData(paddedLength); }