Logo Search packages:      
Sourcecode: aften version File versions  Download package

Aften::FrameEncoder< TSample > Class Template Reference

Inheritance diagram for Aften::FrameEncoder< TSample >:

List of all members.


Detailed Description

template<TSample>
class Aften::FrameEncoder< TSample >

The Aften AC3 Encoder base class.

The Aften AC3 Encoder.

Template Parameters:
TSample The type of the sample.

Definition at line 37 of file aftenxx.h.


Public Member Functions

override void Abort ()
 Aborts the encoding. This instance needs to be disposed afterwards.
abstract void Abort ()
 Aborts the encoding. This instance needs to be disposed afterwards.
void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
override void Encode (Stream samples, Stream frames)
 Encodes the specified interleaved samples stream and flushes the encoder.
void Encode (TSample[] samples, int samplesPerChannelCount, Stream frames)
 Encodes a part of the specified interleaved samples.
void Encode (TSample[] samples, Stream frames)
 Encodes the specified interleaved samples.
MemoryStream Encode (TSample[] samples, int samplesPerChannelCount)
 Encodes a part of the specified interleaved samples.
MemoryStream Encode (TSample[] samples)
 Encodes the specified interleaved samples.
override void Encode (Array samples, int samplesPerChannelCount, Stream frames)
 Encodes a part of the specified interleaved samples.
abstract void Encode (Stream samples, Stream frames)
 Encodes the specified interleaved samples stream.
MemoryStream Encode (Stream samples)
 Encodes the specified interleaved samples.
abstract void Encode (Array samples, int samplesPerChannelCount, Stream frames)
 Encodes a part of the specified interleaved samples.
void Encode (Array samples, Stream frames)
 Encodes the specified interleaved samples.
MemoryStream Encode (Array samples, int samplesPerChannelCount)
 Encodes a part of the specified interleaved samples.
MemoryStream Encode (Array samples)
 Encodes the specified interleaved samples.
int Encode (unsigned char *frameBuffer, const void *samples, int count)
 Encodes PCM samples to an A/52 frame; returns encoded frame size.
void EncodeAndFlush (Stream samples, Stream frames)
 Encodes the specified interleaved samples stream and flushes the encoder. This instance needs to be disposed afterwards.
MemoryStream EncodeAndFlush (Stream samples)
 Encodes the specified interleaved samples and flushes the encoder. This instance needs to be disposed afterwards.
override void Flush (Stream frames)
 Flushes the encoder und returns the remaining frames. This instance needs to be disposed afterwards.
abstract void Flush (Stream frames)
 Flushes the encoder und returns the remaining frames. This instance needs to be disposed afterwards.
MemoryStream Flush ()
 Flushes the encoder und returns the remaining frames. This instance needs to be disposed afterwards.
 FrameEncoder (AftenContext &context)
 Constructor: Initializes the encoder with specified context.
delegate void RemappingDelegate (TSample[] samples, int channels, AudioCodingMode audioCodingMode)
 Delegate for a remapping function.
 ~FrameEncoder ()
 Destructor: Deinitalizes the encoder.

Static Public Member Functions

static EncodingContext GetDefaultsContext ()
 Gets a default context.
static AftenContext GetDefaultsContext ()
 Gets a context with default values.

Protected Member Functions

static void aften_encode_close (ref EncodingContext context)
static int aften_encode_init (ref EncodingContext context)
void CheckSamplesLength (Array samples)
 Checks the length of the samples array.
override void DoCloseEncoder ()
 Closes the encoder.
abstract void DoCloseEncoder ()
 Closes the encoder.
 FrameEncoder (int channels)
 Initializes a new instance of the FrameEncoder class.
virtual void OnFrameEncoded (object sender, FrameEventArgs e)
 Called when a frame has been encoded.

Protected Attributes

const string _EqualAmountOfSamples = "Each channel must have an equal amount of samples."
 Error message EqualAmountOfSamples.

Properties

bool EncodingDone [get, set]
 Gets or sets a value indicating whether encoding is done.

Events

EventHandler< FrameEventArgsFrameEncoded
 Raised when a frame has been encoded.

Private Member Functions

static void aften_set_defaults (ref EncodingContext context)
void CheckEncodingState ()
 Checks the state of the encoding.
void Dispose (bool disposing)
 Releases unmanaged and - optionally - managed resources.
int EncodeFrame (int samplesPerChannelCount)
 Encodes the frame.
internal delegate int EncodeFrameDelegate (ref EncodingContext context, byte[] frameBuffer, TSample[] samples, int count)
internal FrameEncoder (ref EncodingContext context, EncodeFrameDelegate encodeFrame, ToTSampleDelegate toTSample, A52SampleFormat sampleFormat)
 Initializes a new instance of the FrameEncoder class.
internal FrameEncoder (ref EncodingContext context, RemappingDelegate remap, EncodeFrameDelegate encodeFrame, ToTSampleDelegate toTSample, A52SampleFormat sampleFormat)
 Initializes a new instance of the FrameEncoder class.
internal delegate TSample ToTSampleDelegate (byte[] buffer, int startIndex)
 ~FrameEncoder ()
 Releases unmanaged resources and performs other cleanup operations before the FrameEncoder is reclaimed by garbage collection.

Private Attributes

int m_bAbort
bool m_bDisposed
bool m_bEncodingDone
bool m_bFedSamples
bool m_bGotFrames
EncodingContext m_Context
AftenContext m_context
readonly EncodeFrameDelegate m_EncodeFrame
readonly byte[] m_FrameBuffer = new byte[A52Sizes.MaximumCodedFrameSize]
readonly int m_nChannels
int m_nFrameNumber
int m_nRemainingSamplesCount
readonly int m_nTotalSamplesPerFrame
readonly int m_nTSampleSize = Marshal.SizeOf( typeof( TSample ) )
readonly RemappingDelegate m_Remap
readonly TSample[] m_Samples
readonly byte[] m_StreamBuffer
readonly TSample[] m_StreamSamples
readonly ToTSampleDelegate m_ToTSample

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index