VLSI Solution Oy / MegaLib Documentation

CodecServices Struct Reference

#include <codec.h>


Data Fields

u_int16 version
u_int16(* Read )(struct CodecServices *cs, u_int16 *ptr, u_int16 firstOdd, u_int16 bytes)
u_int32(* Skip )(struct CodecServices *cs, u_int32 bytes)
s_int16(* Seek )(struct CodecServices *cs, s_int32 offset, s_int16 whence)
s_int32(* Tell )(struct CodecServices *cs)
s_int16(* Output )(struct CodecServices *cs, s_int16 *data, s_int16 n)
void(* Comment )(struct CodecServices *cs, u_int16 c)
void(* Spectrum )(struct CodecServices *cs, s_int16 __y *data, s_int16 n, s_int16 ch)
u_int32 fileSize
u_int32 fileLeft
u_int16 goTo
s_int16 cancel
s_int32 playTimeSeconds
s_int32 playTimeSamples
u_int32 playTimeTotal
u_int32 sampleRate
u_int16 channels
enum ChannelMatrix matrix [MAX_SOURCE_CHANNELS]
u_int32 avgBitRate
u_int32 currBitRate
u_int32 peakBitRate
s_int16 gain
u_int16 fastForward


Detailed Description

Codec Services structure. The caller must provide values for elements Read, Seek, Tell and fileSize. The caller may also set move and cancel for control operations. Note that the prototypes for Read, Seek and Tell are on purpose the same as they are for stdio.h functions fread(), fseek() and ftell().

Definition at line 53 of file codec.h.


Field Documentation

u_int32 CodecServices::avgBitRate
 

Average bitrate. Updated by the codec. May change during playback.

Definition at line 123 of file codec.h.

s_int16 CodecServices::cancel
 

Request codec to cancel playing current file. To request cancellation, set this to a positive value. When the codec has finished cancelling, it will clear this value and return ceCancelled.

Definition at line 105 of file codec.h.

u_int16 CodecServices::channels
 

Number of channels. Updated by the codec.

Definition at line 119 of file codec.h.

void(* CodecServices::Comment)(struct CodecServices *cs, u_int16 c)
 

Offers comments fields one character at the time. Special code 0x4000U is reserved for end-of-line. 0xC000U means end of comments.

u_int32 CodecServices::currBitRate
 

Current bitrate. Updated by the codec. May change during playback.

Definition at line 125 of file codec.h.

u_int16 CodecServices::fastForward
 

Request codec to fast forward current file. If set, playback is requested at fastForward times normal playback speed. To stop fast forwarding, set value to 1 or 0.

Definition at line 134 of file codec.h.

u_int32 CodecServices::fileLeft
 

Bytes left in a file. If set to 0xFFFFFFFFU, then the file is a stream and never ends.

Definition at line 87 of file codec.h.

u_int32 CodecServices::fileSize
 

File size in bytes. If set to 0xFFFFFFFFU, then the file is a stream and the file size is not known.

Definition at line 84 of file codec.h.

s_int16 CodecServices::gain
 

Volume gain recommended by codec in 1/2 dB steps. Updated by the codec.

Definition at line 130 of file codec.h.

u_int16 CodecServices::goTo
 

Point to move to in an audio file in seconds. When set to anything other than 0xFFFFU, the codec has the responsibility to jump to that point. The codec has the freedom of deciding for itself the actual landing point in the file. When the codec has reached its destination it will clear this variable, and the actual position in the file can be read from playTimeSeconds. If the codec cannot jump to a given point (e.g. the file is a stream and the jump point would require jumping backwards), goTo is silently cleared to 0xFFFFU.

Definition at line 99 of file codec.h.

enum ChannelMatrix CodecServices::matrix[MAX_SOURCE_CHANNELS]
 

Channel matrix. Updated by the codec.

Definition at line 121 of file codec.h.

s_int16(* CodecServices::Output)(struct CodecServices *cs, s_int16 *data, s_int16 n)
 

Output to audio file. data is a pointer to the data. There are n chan channel samples (Example: n = 32, cs->chan = 2, there are a total of 64 samples in data).

u_int32 CodecServices::peakBitRate
 

Peak bitrate of the file. Updated by the codec. May change during playback.

Definition at line 128 of file codec.h.

s_int32 CodecServices::playTimeSamples
 

Samples played since last full second. Updated by the codec. If set to -1, the codec doesn't know where it is in the file.

Definition at line 111 of file codec.h.

s_int32 CodecServices::playTimeSeconds
 

Playback time from beginning of file in seconds. Updated by the codec. If set to -1, the codec doesn't know where it is in the file.

Definition at line 108 of file codec.h.

u_int32 CodecServices::playTimeTotal
 

Total playback time in seconds. Updated by the codec. May be a changing estimate if an exact figure isn't available. 0xFFFFFFFFU if there is no information available.

Definition at line 115 of file codec.h.

u_int16(* CodecServices::Read)(struct CodecServices *cs, u_int16 *ptr, u_int16 firstOdd, u_int16 bytes)
 

Read data from a file. If firstOdd is set, only the LSB of the first word is filled. If the last word is not completely filled (either firstOdd set or bytes is odd, but not both), only the MSB is changed.

u_int32 CodecServices::sampleRate
 

Sample rate. Updated by the codec. 0 if unknown.

Definition at line 117 of file codec.h.

s_int16(* CodecServices::Seek)(struct CodecServices *cs, s_int32 offset, s_int16 whence)
 

Seek in a file. offset and whence are equivalent with their fseek() counterparts. If Seek is NULL, the input is a stream and cannot be seeked.

u_int32(* CodecServices::Skip)(struct CodecServices *cs, u_int32 bytes)
 

Skip data in a file. This should also be supported for streams.

void(* CodecServices::Spectrum)(struct CodecServices *cs, s_int16 __y *data, s_int16 n, s_int16 ch)
 

Spectrum analyzer hook.

s_int32(* CodecServices::Tell)(struct CodecServices *cs)
 

Tell location in a file (in bytes).

u_int16 CodecServices::version
 

Version number. 8 MSBs contain version number, 8 LSBs size of the structure in words.

Definition at line 56 of file codec.h.


The documentation for this struct was generated from the following file:
All software copyright 2005-2006 VLSI Solution OY. Redistribution of this software is strictly forbidden.