C# 클래스 MP4_Mangler.FileRoot

Utility object for building useful MP4f files and file parts. This is not thread-safe!
파일 보기 프로젝트 열기: i-e-b/HLS---Smooth-Encoder 1 사용 예제들

공개 메소드들

메소드 설명
EndFile ( ) : void

Close a started MP4f file, writing footer data. After calling this, WriteStream() will cache data.

FileRoot ( ) : System

Create a new file root with the given streams. Frame data will be cached until StartFile() is called.

Once a file is started, the tracks and streams can't be changed. If you know the tracks in advance, it uses less memory to start the file as early as possible. If you don't know the tracks in advance, don't StartFile() until all tracks are known. It is possible to Write all frames in all tracks then StartFile() and EndFile() in direct succession.

GenerateFileSpec ( ) : byte[]

Output a 'ftyp' atom and it's children as raw data for the current set of streams. Does not write to file.

GenerateFooters ( ) : byte[]

Output a 'mfra' atom and it's children as raw data.

GenerateFragment ( MediaStream Stream ) : MediaFragmentHandler

Generate a pair of 'moof' and 'mdat' atoms for the given stream. The stream should contains a populated list of frame data, otherwise output will be empty. Keeps track of fragment index. Does not write to file. Does not remove frames. Does not adjust offset time.

GenerateHeaders ( ) : byte[]

Output a 'moov' atom and it's children as raw data for the current set of streams. Does not write to file.

StartFile ( string FilePath ) : void

Start an MP4f file. After a sucessful call, all cached data will be sent to this file, and frame data will no longer be cached on subsequent WriteStream() calls.

WriteStream ( MediaStream SourceStream ) : void

Write the frames of a stream to a file if one is open or to memory if not.

비공개 메소드들

메소드 설명
CacheStreamFrames ( MediaStream SourceStream ) : MediaStream

Store the frames of a stream in the KnownStreams cache, adding a new entry if needed. If there is a file open, then new streams will be refused with an argument exception

GenerateMoov ( ) : byte[]

Output a 'moov' atom and it's children as raw data.

메소드 상세

EndFile() 공개 메소드

Close a started MP4f file, writing footer data. After calling this, WriteStream() will cache data.
public EndFile ( ) : void
리턴 void

FileRoot() 공개 메소드

Create a new file root with the given streams. Frame data will be cached until StartFile() is called.
Once a file is started, the tracks and streams can't be changed. If you know the tracks in advance, it uses less memory to start the file as early as possible. If you don't know the tracks in advance, don't StartFile() until all tracks are known. It is possible to Write all frames in all tracks then StartFile() and EndFile() in direct succession.
public FileRoot ( ) : System
리턴 System

GenerateFileSpec() 공개 메소드

Output a 'ftyp' atom and it's children as raw data for the current set of streams. Does not write to file.
public GenerateFileSpec ( ) : byte[]
리턴 byte[]

GenerateFooters() 공개 메소드

Output a 'mfra' atom and it's children as raw data.
public GenerateFooters ( ) : byte[]
리턴 byte[]

GenerateFragment() 공개 메소드

Generate a pair of 'moof' and 'mdat' atoms for the given stream. The stream should contains a populated list of frame data, otherwise output will be empty. Keeps track of fragment index. Does not write to file. Does not remove frames. Does not adjust offset time.
public GenerateFragment ( MediaStream Stream ) : MediaFragmentHandler
Stream MediaStream
리턴 MP4_Mangler.FragmentBoxes.MediaFragmentHandler

GenerateHeaders() 공개 메소드

Output a 'moov' atom and it's children as raw data for the current set of streams. Does not write to file.
public GenerateHeaders ( ) : byte[]
리턴 byte[]

StartFile() 공개 메소드

Start an MP4f file. After a sucessful call, all cached data will be sent to this file, and frame data will no longer be cached on subsequent WriteStream() calls.
public StartFile ( string FilePath ) : void
FilePath string
리턴 void

WriteStream() 공개 메소드

Write the frames of a stream to a file if one is open or to memory if not.
public WriteStream ( MediaStream SourceStream ) : void
SourceStream MediaStream
리턴 void