C# 클래스 HCS_Encoder.Utilities.EncoderController

This class provides a simplified way to start and stop an encode process, using a configuration file for the details.
상속: IDisposable
파일 보기 프로젝트 열기: i-e-b/HLS---Smooth-Encoder 1 사용 예제들

공개 메소드들

메소드 설명
ClearBuffers ( ) : void

Clear all captured frames from all attached buffers. Buffers will refill if capture devices are running.

ContinueCapture ( ) : void

Resumes capture devices after a call to 'PauseCapture()'

ContinueOutput ( int MinimumChunkIndex ) : void

Resumes output sending (if 'EnableOutput' is false). Any chunks with an index below 'MiniumumChunkIndex' will be dropped.

Dispose ( ) : void
EncoderController ( Configuration Config ) : System

Create and initialise a new encoder job with the given config

ForceInsertFrame ( System VideoFrame, double SimulatedCaptureTime ) : void

Force a timed frame into the encoder's buffers. May cause unexpected operation. Use with caution!

ForceInsertFrame ( TimedSample AudioFrame ) : void

Force a timed frame into the encoder's buffers. May cause unexpected operation. Use with caution!

PauseCapture ( ) : void

Pauses all capture devices, but allows the encoder loop to continue (will sleep while buffers are empty)

RegisterPlugin ( IAudioProcessor PlugIn ) : void

Add a plug-in to the audio buffer's plug-in list

RegisterPlugin ( IVideoProcessor PlugIn ) : void

Add a plug-in to the video buffer's plug-in list

Start ( ) : void

Start the encoding process. This will start to over-write any existing encodes made with the configuration being used.

Stop ( ) : void

Stop the encoding process

비공개 메소드들

메소드 설명
AdjustFrameSleep ( ) : void

Work out a resonable sleep duration (over which we'd expect a new frame in at least one buffer)

BuffersEmpty ( ) : bool

Returns true if any of the active capture buffers are below their encoding theshold.

CalculateScales ( int Width, int Height, List ScaleFactors ) : List

Given a set of linear scale factors, create a set of scaled (w*h) sizes.

Scaling the height and width directly will result in pixel count being reduced by the square of the scale factor, so instead we apply a rough factor to get a linear scaled pixel count.

CaptureSetup ( ) : void

Initialise capture devices and connect the appropriate buffers

ConnectPackageToBuffers ( EncoderPackage Package, PackageSpec Spec ) : void

Create encoder buffers for each package, and add to capture buffer lists.

EncoderCoreLoop ( object Package ) : void

This loop does the actual work of reading caches into the encoder and firing actions. This loop controls Multiple-bit-rate encoding

EncoderSetup ( ) : void

Initialise an encoder job based on previously setup capture devices. Need to have one job per 'ReductionFactor' in the config.

Halt ( ) : void

Stop the encode process, from within the core loop

InitAudioCapture ( ) : void
InitVideoCapture ( ) : void
InnerStartup ( ) : void

Start encoder threads & capture devices for each job.

ListRequiredPackages ( ) : List

Creates a list of encoder packages requires to fulfill the configured job.

NewEncoderThread ( EncoderPackage pkg ) : Thread

Create, start and return a new core encoder thread.

WaitAndCompensateCaptureTimes ( ) : void

Wait for first frames in buffer, and use those to compensate timecodes.

WaitForSyncFlag ( ) : void

Wait for the sync flag to be set by WaitAndCompensateCaptureTimes()

메소드 상세

ClearBuffers() 공개 메소드

Clear all captured frames from all attached buffers. Buffers will refill if capture devices are running.
public ClearBuffers ( ) : void
리턴 void

ContinueCapture() 공개 메소드

Resumes capture devices after a call to 'PauseCapture()'
public ContinueCapture ( ) : void
리턴 void

ContinueOutput() 공개 메소드

Resumes output sending (if 'EnableOutput' is false). Any chunks with an index below 'MiniumumChunkIndex' will be dropped.
public ContinueOutput ( int MinimumChunkIndex ) : void
MinimumChunkIndex int
리턴 void

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

EncoderController() 공개 메소드

Create and initialise a new encoder job with the given config
public EncoderController ( Configuration Config ) : System
Config EncoderConfiguration.Configuration
리턴 System

ForceInsertFrame() 공개 메소드

Force a timed frame into the encoder's buffers. May cause unexpected operation. Use with caution!
public ForceInsertFrame ( System VideoFrame, double SimulatedCaptureTime ) : void
VideoFrame System
SimulatedCaptureTime double
리턴 void

ForceInsertFrame() 공개 메소드

Force a timed frame into the encoder's buffers. May cause unexpected operation. Use with caution!
public ForceInsertFrame ( TimedSample AudioFrame ) : void
AudioFrame HCS_Encoder.Inputs.Buffers.TimedSample
리턴 void

PauseCapture() 공개 메소드

Pauses all capture devices, but allows the encoder loop to continue (will sleep while buffers are empty)
public PauseCapture ( ) : void
리턴 void

RegisterPlugin() 공개 메소드

Add a plug-in to the audio buffer's plug-in list
public RegisterPlugin ( IAudioProcessor PlugIn ) : void
PlugIn IAudioProcessor
리턴 void

RegisterPlugin() 공개 메소드

Add a plug-in to the video buffer's plug-in list
public RegisterPlugin ( IVideoProcessor PlugIn ) : void
PlugIn IVideoProcessor
리턴 void

Start() 공개 메소드

Start the encoding process. This will start to over-write any existing encodes made with the configuration being used.
public Start ( ) : void
리턴 void

Stop() 공개 메소드

Stop the encoding process
public Stop ( ) : void
리턴 void