C# 클래스 HCS_Encoder.ImageToYUV_Buffer

Converts System.Drawing images to scaled YUV420p buffers at 8bpp/planar
파일 보기 프로젝트 열기: i-e-b/HLS---Smooth-Encoder

공개 메소드들

메소드 설명
HandleCapturedFrame ( object sender, VideoDataEventArgs e ) : void

Respond to capture event. This should return as fast as possible.

ImageToYUV_Buffer ( int Width, int Height ) : System

Prepare a set of buffers to accept the images. Incoming frames will be scaled to match the given width and height. For best results, capture and buffer sizes should match. Rescaling does not preserve aspect ratio.

LoadToFrame ( MediaFrame &Frame ) : void

Load the buffer into a MediaFrame for the encoder. IMPORTANT: You must call UnloadFrame after this method is called. For efficiency, unload as soon as possible.

SelectiveDequeue ( double OffsetSeconds ) : void

Remove un-needed frames when encoding by a reference clock.

SelectiveLoadFrame ( MediaFrame &Frame, double OffsetSeconds ) : void

Load the closest matching frame by offset time. Fills the encoder-ready frame, with given time-code. WARNING: use this *OR* 'LoadToFrame', but not both!

UnloadFrame ( MediaFrame &Frame ) : void

Release memory previously locked by LoadToFrame()

비공개 메소드들

메소드 설명
FirstFrameMatchingTime ( double OffsetSeconds ) : int

Used by SelectiveLoadFrame() to pick a frame from the waiting frames buffer.

ResampleBuffer ( Bitmap img, byte &Luma, byte &Cr, byte &Cb, int width, int height ) : void

Resample an image into a set of YUV420 buffers.

This is done seperately from frame encoding the improve multi-processor performance

WipeBuffer ( ) : void

Emergeny clear-out. Drop all queued frames

WipeBufferUntil ( double AbandonTime ) : void

Remove all frames captured before the given capture time. They will not be encoded.

메소드 상세

HandleCapturedFrame() 공개 메소드

Respond to capture event. This should return as fast as possible.
public HandleCapturedFrame ( object sender, VideoDataEventArgs e ) : void
sender object
e VideoDataEventArgs
리턴 void

ImageToYUV_Buffer() 공개 메소드

Prepare a set of buffers to accept the images. Incoming frames will be scaled to match the given width and height. For best results, capture and buffer sizes should match. Rescaling does not preserve aspect ratio.
public ImageToYUV_Buffer ( int Width, int Height ) : System
Width int
Height int
리턴 System

LoadToFrame() 공개 메소드

Load the buffer into a MediaFrame for the encoder. IMPORTANT: You must call UnloadFrame after this method is called. For efficiency, unload as soon as possible.
public LoadToFrame ( MediaFrame &Frame ) : void
Frame MediaFrame
리턴 void

SelectiveDequeue() 공개 메소드

Remove un-needed frames when encoding by a reference clock.
public SelectiveDequeue ( double OffsetSeconds ) : void
OffsetSeconds double
리턴 void

SelectiveLoadFrame() 공개 메소드

Load the closest matching frame by offset time. Fills the encoder-ready frame, with given time-code. WARNING: use this *OR* 'LoadToFrame', but not both!
public SelectiveLoadFrame ( MediaFrame &Frame, double OffsetSeconds ) : void
Frame MediaFrame
OffsetSeconds double
리턴 void

UnloadFrame() 공개 메소드

Release memory previously locked by LoadToFrame()
public UnloadFrame ( MediaFrame &Frame ) : void
Frame MediaFrame
리턴 void