/// <summary>
        /// Locates the handler reference and verifies that the given
        /// <paramref name="componentSubType"/> is correct for this
        /// sample description.
        /// </summary>
        /// <param name="componentSubType">the component sub-type</param>
        /// <returns>true if the component sub-type is valid, false otherwise</returns>
        protected bool CheckComponentSubType(ComponentSubType componentSubType)
        {
            QtAtom media = FindParent(AtomName.Media);

            if (media != null)
            {
                HandlerReference handlerReference = media.FindChild(AtomName.HandlerReference) as HandlerReference;
                if (handlerReference != null && handlerReference.ComponentSubType != componentSubType)
                {
                    return(false);
                }
            }
            return(true);
        }
Beispiel #2
0
            internal TrackData(QtAtom track, Chunk mdatChunk, long fileOffset)
            {
                _track             = track;
                _mdatChunk         = mdatChunk;
                _fileOffset        = fileOffset;
                _buffer            = new byte[8];
                _sampleTable       = GetRequiredAtom <QtAtom>(track, AtomName.SampleTable, true);
                _handlerReference  = GetRequiredAtom <HandlerReference>(track, AtomName.HandlerReference, true);
                _sampleDescription = GetRequiredAtom <SampleDescription>(_sampleTable, AtomName.SampleDescription);
                _chunkOffset       = GetRequiredAtom <ChunkOffset>(_sampleTable, AtomName.ChunkOffset);
                _sampleSize        = GetRequiredAtom <SampleSize>(_sampleTable, AtomName.SampleSize);
                _sampleToChunk     = GetRequiredAtom <SampleToChunk>(_sampleTable, AtomName.SampleToChunk);
                _chunks            = new List <Chunk>();

                _validators = new List <VideoSampleValidator> {
                    IsValidH264Sample, IsValidMpeg4Sample, IsValidH263Sample
                };
                _validatorsToRemove = new List <VideoSampleValidator>();

                FirstSampleOffset   = long.MaxValue;
                LastSampleEndOffset = long.MinValue;
            }