C# Class Unosquare.FFmpegMediaElement.FFmpegMedia

Represents a multimedia source with its corresponding control methods.
Inheritance: IAudioDataProvider, INotifyPropertyChanged, IDisposable
Afficher le fichier Open project: bbougot/Popcorn Class Usage Examples

Private Properties

Свойство Type Description
CreateMediaFrameFromDecodedPictureHolder FFmpegMediaFrame
CreateMediaFrameFromDecodedWaveHolder FFmpegMediaFrame
ExtractMediaFramesContinuously void
FillDecodedPictureHolderFrame bool
FillDecodedWaveHolderFrame bool
InitializeAudio void
InitializeMedia void
InitializeVideo void
InternalFillFramesCache void
InternalLoadFrames void
InternalSeekInput void
PullMediaFrame FFmpegMediaFrame
RenderVideoImage void
StartAudioRenderer void

Méthodes publiques

Méthode Description
Dispose ( ) : void

Releases all managed and unmanaged resources

FFmpegMedia ( string filePath, MediaErrorOccurredCallback errorCallback ) : FFmpeg.AutoGen

Initializes a new instance of the FFmpegMedia class.

FFmpegMedia ( string filePath, MediaErrorOccurredCallback errorCallback, string referer, string userAgent ) : FFmpeg.AutoGen

Initializes a new instance of the FFmpegMedia class.

RenderAudioBuffer ( byte bufferToFill, int &bytesWritten ) : bool

Renders the audio buffer. This is the implementation of IAudioDataProvider.RenderAudioBufferMethod It basically gets the decoded PCM bytes from the audio buffer provider. This method is called by the audio device itself.

Private Methods

Méthode Description
CreateMediaFrameFromDecodedPictureHolder ( ) : FFmpegMediaFrame
CreateMediaFrameFromDecodedWaveHolder ( ) : FFmpegMediaFrame
ExtractMediaFramesContinuously ( ) : void

Extracts the media frames continuously.

FillDecodedPictureHolderFrame ( AVPacket readingPacket, bool emptyPacket ) : bool
FillDecodedWaveHolderFrame ( AVPacket readingPacket, bool emptyPacket ) : bool
InitializeAudio ( ) : void

Initializes the audio.

InitializeMedia ( string filePath, string inputFormatName, string referer, string userAgent ) : void

Initializes the internal transcoder -- This create the input, processing, and output blocks that make up the video and audio decoding stream.

InitializeVideo ( ) : void
InternalFillFramesCache ( System.TimeSpan timeout ) : void
InternalLoadFrames ( decimal renderTime ) : void
InternalSeekInput ( decimal renderTime ) : void

Internals the seek input.

PullMediaFrame ( ) : FFmpegMediaFrame

Pulls the next-available frame. This does not queue the frame in either the video or audio queue. Please keep in mind that you will need to manually call the Release() method the returned object are done with it. If working with Media Caches, the cache will automatically release the frame

RenderVideoImage ( object sender, EventArgs e ) : void

Renders the video image. This method is called on a Dispatcher timer. It is responsible for rendering the decoded video image continuously. It also avoids rendering the same image again.

StartAudioRenderer ( ) : void

Method Details

Dispose() public méthode

Releases all managed and unmanaged resources
public Dispose ( ) : void
Résultat void

FFmpegMedia() public méthode

Initializes a new instance of the FFmpegMedia class.
public FFmpegMedia ( string filePath, MediaErrorOccurredCallback errorCallback ) : FFmpeg.AutoGen
filePath string The file path.
errorCallback MediaErrorOccurredCallback The error callback.
Résultat FFmpeg.AutoGen

FFmpegMedia() public méthode

Initializes a new instance of the FFmpegMedia class.
errorCallback cannot be null /// or /// filePath cannot be null or empty errorCallback cannot be null /// or /// filePath cannot be null or empty
public FFmpegMedia ( string filePath, MediaErrorOccurredCallback errorCallback, string referer, string userAgent ) : FFmpeg.AutoGen
filePath string The file path.
errorCallback MediaErrorOccurredCallback The error callback.
referer string The referer. Leave null or emtpy to skip setting it.
userAgent string The user agent. Leave null or empty in order to skip setting a User Agent
Résultat FFmpeg.AutoGen

RenderAudioBuffer() public méthode

Renders the audio buffer. This is the implementation of IAudioDataProvider.RenderAudioBufferMethod It basically gets the decoded PCM bytes from the audio buffer provider. This method is called by the audio device itself.
public RenderAudioBuffer ( byte bufferToFill, int &bytesWritten ) : bool
bufferToFill byte The buffer to fill.
bytesWritten int The bytes written.
Résultat bool