コード例 #1
0
 public SourceReaderExtra(string fileName, object state, SourceReader sourceReader)
 {
     FileName = fileName;
     State = state;
     SourceReader = sourceReader;
 }
コード例 #2
0
ファイル: TranscodeSample.cs プロジェクト: vipoo/SuperMFLib
        SourceStream SetVideoMediaType(SourceReader sourceReader)
        {
            var sourceStream = sourceReader.Streams.First(s => s.IsSelected && s.NativeMediaType.IsVideo);

            sourceStream.CurrentMediaType = GetMediaTypeRGB();

            return sourceStream;
        }
コード例 #3
0
        SourceStream SetVideoMediaType(SourceReader sourceReader)
        {
            try
            {
                var sourceStream = sourceReader.Streams.FirstOrDefault(s => s.IsSelected && s.NativeMediaType.IsVideo);

                if (sourceStream.IsNull)
                    throw new Exception("Unable to find video track within file.");

                sourceStream.CurrentMediaType = new MediaType() { MajorType = MFMediaType.Video, SubType = MFMediaType.RGB32 };

                return sourceStream;
            }
            catch (Exception e)
            {
                throw new Exception(string.Format("Unable to decode video stream. {0}", e.Message), e);
            }
        }
コード例 #4
0
ファイル: TranscodeSample.cs プロジェクト: vipoo/SuperMFLib
        SourceStream SetAudioMediaType(SourceReader sourceReader)
        {
            var sourceStream = sourceReader.Streams.First(s => s.IsSelected && s.NativeMediaType.IsAudio);

            sourceStream.CurrentMediaType = new MediaType() { MajorType = MFMediaType.Audio, SubType = MFMediaType.PCM };

            return sourceStream;
        }
コード例 #5
0
ファイル: TranscodeSample.cs プロジェクト: vipoo/SuperMFLib
        private ProcessSample ConnectVideoStreams(SourceReader sourceReader, SinkWriter sinkWriter)
        {
            var sourceVideoStream = SetVideoMediaType(sourceReader);
            var sinkVideoStream = AddStream(sinkWriter, sourceVideoStream.CurrentMediaType, CreateTargetVideoMediaType(sourceVideoStream.NativeMediaType));

            return AVOperations.MediaTypeChange(sinkVideoStream, AVOperations.SaveTo(sinkVideoStream));
        }
コード例 #6
0
ファイル: TranscodeSample.cs プロジェクト: vipoo/SuperMFLib
        private ProcessSample ConnectStreams(SourceReader shortSourceReader, SourceReader shortSourceReader2,  SourceReader sourceReader, SinkWriter sinkWriter)
        {
            SetAudioMediaType(shortSourceReader);
            SetVideoMediaType(shortSourceReader);

            SetAudioMediaType(shortSourceReader2);
            SetVideoMediaType(shortSourceReader2);

            return AVOperations.SeperateAudioVideo(
                ConnectAudioStreams(sourceReader, sinkWriter),
                ConnectVideoStreams(sourceReader, sinkWriter));
        }
コード例 #7
0
        SourceStream SetAudioMediaType(SourceReader sourceReader)
        {
            try
            {
                var sourceStream = sourceReader.Streams.First(s => s.IsSelected && s.NativeMediaType.IsAudio);

                sourceStream.CurrentMediaType = new MediaType() { MajorType = MFMediaType.Audio, SubType = MFMediaType.PCM };

                return sourceStream;
            }
            catch(Exception e)
            {
                throw new Exception(string.Format("Unable to decode audio stream. {0}", e.Message), e);
            }
        }
コード例 #8
0
ファイル: TranscodeSample.cs プロジェクト: GoshaDE/SuperMFLib
 private ProcessSample ConnectStreams(SourceReader sourceReader, SinkWriter sinkWriter)
 {
     return AVOperations.SeperateAudioVideo(
         ConnectAudioStreams(sourceReader, sinkWriter),
         ConnectVideoStreams(sourceReader, sinkWriter));
 }