C# Класс Unosquare.FFmpegMediaElement.FFmpegMedia

Represents a multimedia source with its corresponding control methods.
Наследование: IAudioDataProvider, INotifyPropertyChanged, IDisposable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
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

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

Dispose() публичный Метод

Releases all managed and unmanaged resources
public Dispose ( ) : void
Результат void

FFmpegMedia() публичный Метод

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.
Результат FFmpeg.AutoGen

FFmpegMedia() публичный Метод

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
Результат FFmpeg.AutoGen

RenderAudioBuffer() публичный Метод

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.
Результат bool