예제 #1
0
        public void Open(string filePath, TimeSpan startTime, TimeSpan duration)
        {
            if (Utility.IsEmptyString(filePath))
            {
                throw new ArgumentNullException("inputFilePath", "Invalid string parameter.");
            }

            _reader.Open(filePath);

            Logger.WriteLogMessage("Opened file [" + filePath + "] for reading.");

            WMHeaderInfo readerHeaderInfo = new WMHeaderInfo((IWMHeaderInfo)_reader);

            WM_ATTR  attr           = readerHeaderInfo.GetAttribute(Constants.g_wszWMDuration);
            TimeSpan readerDuration = new TimeSpan((long)(ulong)attr.Value);

            Logger.WriteLogMessage("Found input duration [" + readerDuration + "].");

            if (startTime != TimeSpan.Zero)
            {
                //
                // startTime, duration are in 100-nsec ticks
                //
                _reader.SetRange((ulong)startTime.Ticks, duration.Ticks); // seek

                Logger.WriteLogMessage("Set range on reader, startTime [" + startTime + "], duration [" + duration + "].");
            }

            _reader.GetOutputCount(out _readerOutputCount);

            Logger.WriteLogMessage("Found " + _readerOutputCount + " reader outputs.");

            IWMProfile readerProfile = (IWMProfile)_reader;

            readerProfile.GetStreamCount(out _readerStreamCount);
        }
예제 #2
0
파일: WmvReader.cs 프로젝트: tdhieu/openvss
        public void Open(string filePath, TimeSpan startTime, TimeSpan duration)
        {
            if (Utility.IsEmptyString(filePath))
                throw new ArgumentNullException("inputFilePath", "Invalid string parameter.");

            _reader.Open(filePath);

            Logger.WriteLogMessage("Opened file [" + filePath + "] for reading.");

            WMHeaderInfo readerHeaderInfo = new WMHeaderInfo((IWMHeaderInfo)_reader);

            WM_ATTR attr = readerHeaderInfo.GetAttribute(Constants.g_wszWMDuration);
            TimeSpan readerDuration = new TimeSpan((long)(ulong)attr.Value);

            Logger.WriteLogMessage("Found input duration [" + readerDuration + "].");

            if (startTime != TimeSpan.Zero)
            {
                //
                // startTime, duration are in 100-nsec ticks
                //
                _reader.SetRange((ulong)startTime.Ticks, duration.Ticks); // seek

                Logger.WriteLogMessage("Set range on reader, startTime [" + startTime + "], duration [" + duration + "].");
            }

            _reader.GetOutputCount(out _readerOutputCount);

            Logger.WriteLogMessage("Found " + _readerOutputCount + " reader outputs.");

            IWMProfile readerProfile = (IWMProfile)_reader;

            readerProfile.GetStreamCount(out _readerStreamCount);
        }