コード例 #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);
        }