Beispiel #1
0
        /// <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);
            }
        }
Beispiel #2
0
 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);
     }
 }
Beispiel #3
0
        /// <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);
            }
        }
Beispiel #4
0
 /// <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);
 }