#include <esp_wavepcm.h>
Inheritance diagram for WAVE_PCM_EssenceSubParser:
Public Member Functions | |
WAVE_PCM_EssenceSubParser () | |
virtual EssenceSubParserPtr | NewParser (void) const |
Build a new parser of this type and return a pointer to it. | |
virtual StringList | HandledExtensions (void) |
Report the extensions of files this sub-parser is likely to handle. | |
virtual EssenceStreamDescriptorList | IdentifyEssence (FileHandle InFile) |
Examine the open file and return a list of essence descriptors. | |
virtual WrappingOptionList | IdentifyWrappingOptions (FileHandle InFile, EssenceStreamDescriptor &Descriptor) |
Examine the open file and return the wrapping options known by this parser. | |
virtual void | Use (UInt32 Stream, WrappingOptionPtr UseWrapping) |
Set a wrapping option for future Read and Write calls. | |
virtual bool | SetEditRate (Rational EditRate) |
Set a non-native edit rate. | |
virtual Rational | GetEditRate (void) |
Get the current edit rate. | |
virtual Rational | GetPreferredEditRate (void) |
Get the preferred edit rate (if one is known). | |
virtual UInt32 | GetBytesPerEditUnit (UInt32 KAGSize=1) |
Get BytesPerEditUnit, if Constant. | |
virtual Position | GetCurrentPosition (void) |
Get the current position in SetEditRate() sized edit units. | |
virtual DataChunkPtr | Read (FileHandle InFile, UInt32 Stream, UInt64 Count=1) |
Read a number of wrapping items from the specified stream and return them in a data chunk. | |
virtual EssenceSourcePtr | GetEssenceSource (FileHandle InFile, UInt32 Stream, UInt64 Count=1) |
Build an EssenceSource to read a number of wrapping items from the specified stream. | |
virtual Length | Write (FileHandle InFile, UInt32 Stream, MXFFilePtr OutFile, UInt64 Count=1) |
Write a number of wrapping items from the specified stream to an MXF file. | |
virtual std::string | GetParserName (void) const |
Get a unique name for this sub-parser. | |
Protected Member Functions | |
bool | CalcWrappingSequence (Rational EditRate) |
Work out wrapping sequence. | |
Position | CalcCurrentPosition (void) |
Calculate the current position in SetEditRate() sized edit units from "BytePosition" in bytes. | |
MDObjectPtr | BuildWaveAudioDescriptor (FileHandle InFile, UInt64 Start=0) |
Read the sequence header at the specified position in an MPEG2 file to build an essence descriptor. | |
size_t | ReadInternal (FileHandle InFile, UInt32 Stream, UInt64 Count) |
Scan the essence to calculate how many bytes to transfer for the given edit unit count. | |
Protected Attributes | |
UInt32 | SampleRate |
The sample rate of this essence. | |
Rational | UseEditRate |
The edit rate to use for wrapping this essence. | |
Position | DataStart |
Start of "data" chunk (value part). | |
Length | DataSize |
Size of "data" chunk (value part). | |
Position | CurrentPosition |
Current position in the input file in edit units. | |
Position | BytePosition |
Current position in the input file in bytes. | |
size_t | CachedDataSize |
The size of the next data to be read, or (size_t)-1 if not known. | |
UInt64 | CachedCount |
The number of wrapping units that CachedDataSize relates to. | |
int | SampleSize |
Size of each sample in bytes (includes all channels). | |
UInt32 | ConstSamples |
Number of samples per edit unit (if constant, else zero). | |
int | SampleSequenceSize |
Size of SampleSequence if used. | |
UInt32 * | SampleSequence |
Array of counts of samples per edit unit for non integer relationships between edit rate and sample rate. | |
int | SequencePos |
Current position in the sequence (i.e. next entry to use). | |
MDObjectParent | CurrentDescriptor |
Pointer to the last essence descriptor we built. | |
Friends | |
class | WAVE_PCM_EssenceSubParser::ESP_EssenceSource |
Classes | |
class | ESP_EssenceSource |
Class for EssenceSource objects for parsing/sourcing MPEG-VES essence. More... |
WAVE_PCM_EssenceSubParser | ( | ) | [inline] |
virtual EssenceSubParserPtr NewParser | ( | void | ) | const [inline, virtual] |
virtual StringList HandledExtensions | ( | void | ) | [inline, virtual] |
Report the extensions of files this sub-parser is likely to handle.
Reimplemented from EssenceSubParser.
EssenceStreamDescriptorList IdentifyEssence | ( | FileHandle | InFile | ) | [virtual] |
Examine the open file and return a list of essence descriptors.
Reimplemented from EssenceSubParser.
WrappingOptionList IdentifyWrappingOptions | ( | FileHandle | InFile, | |
EssenceStreamDescriptor & | Descriptor | |||
) | [virtual] |
Examine the open file and return the wrapping options known by this parser.
InFile | The open file to examine (if the descriptor does not contain enough info) | |
Descriptor | An essence stream descriptor (as produced by function IdentifyEssence) of the essence stream requiring wrapping |
Reimplemented from EssenceSubParser.
virtual void Use | ( | UInt32 | Stream, | |
WrappingOptionPtr | UseWrapping | |||
) | [inline, virtual] |
Set a wrapping option for future Read and Write calls.
virtual bool SetEditRate | ( | Rational | EditRate | ) | [inline, virtual] |
Set a non-native edit rate.
Must be called after Use()
Reimplemented from EssenceSubParser.
virtual Rational GetEditRate | ( | void | ) | [inline, virtual] |
Rational GetPreferredEditRate | ( | void | ) | [virtual] |
Get the preferred edit rate (if one is known).
Reimplemented from EssenceSubParser.
virtual Position GetCurrentPosition | ( | void | ) | [inline, virtual] |
DataChunkPtr Read | ( | FileHandle | InFile, | |
UInt32 | Stream, | |||
UInt64 | Count = 1 | |||
) | [virtual] |
Read a number of wrapping items from the specified stream and return them in a data chunk.
If frame or line mapping is used the parameter Count is used to determine how many items are read. In frame wrapping it is in units of EditRate, as specified in the call to Use(), which may not be the frame rate of this essence
Implements EssenceSubParser.
virtual EssenceSourcePtr GetEssenceSource | ( | FileHandle | InFile, | |
UInt32 | Stream, | |||
UInt64 | Count = 1 | |||
) | [inline, virtual] |
Build an EssenceSource to read a number of wrapping items from the specified stream.
Implements EssenceSubParser.
Length Write | ( | FileHandle | InFile, | |
UInt32 | Stream, | |||
MXFFilePtr | OutFile, | |||
UInt64 | Count = 1 | |||
) | [virtual] |
Write a number of wrapping items from the specified stream to an MXF file.
If frame or line mapping is used the parameter Count is used to determine how many items are read. In frame wrapping it is in units of EditRate, as specified in the call to Use(), which may not be the frame rate of this essence stream
Implements EssenceSubParser.
virtual std::string GetParserName | ( | void | ) | const [inline, virtual] |
Get a unique name for this sub-parser.
The name must be all lower case, and must be unique. The recommended name is the part of the filename of the parser header after "esp_" and before the ".h". If the parser has no name return "" (however this will prevent named wrapping option selection for this sub-parser)
Reimplemented from EssenceSubParser.
bool CalcWrappingSequence | ( | Rational | EditRate | ) | [protected] |
Work out wrapping sequence.
Position CalcCurrentPosition | ( | void | ) | [protected] |
Calculate the current position in SetEditRate() sized edit units from "BytePosition" in bytes.
MDObjectPtr BuildWaveAudioDescriptor | ( | FileHandle | InFile, | |
UInt64 | Start = 0 | |||
) | [protected] |
Read the sequence header at the specified position in an MPEG2 file to build an essence descriptor.
"RIFF"
"fmt "
"data"
size_t ReadInternal | ( | FileHandle | InFile, | |
UInt32 | Stream, | |||
UInt64 | Count | |||
) | [protected] |
Scan the essence to calculate how many bytes to transfer for the given edit unit count.
friend class WAVE_PCM_EssenceSubParser::ESP_EssenceSource [friend] |
UInt32 SampleRate [protected] |
The sample rate of this essence.
Rational UseEditRate [protected] |
The edit rate to use for wrapping this essence.
Position CurrentPosition [protected] |
Current position in the input file in edit units.
Position BytePosition [protected] |
Current position in the input file in bytes.
A value of 0 means the start of the data chunk, any other value is that position within the whole file. This means that a full rewind can be achieved by setting BytePosition = 0
size_t CachedDataSize [protected] |
The size of the next data to be read, or (size_t)-1 if not known.
UInt64 CachedCount [protected] |
The number of wrapping units that CachedDataSize relates to.
int SampleSize [protected] |
Size of each sample in bytes (includes all channels).
UInt32 ConstSamples [protected] |
Number of samples per edit unit (if constant, else zero).
int SampleSequenceSize [protected] |
Size of SampleSequence if used.
UInt32* SampleSequence [protected] |
Array of counts of samples per edit unit for non integer relationships between edit rate and sample rate.
int SequencePos [protected] |
Current position in the sequence (i.e. next entry to use).
MDObjectParent CurrentDescriptor [protected] |
Pointer to the last essence descriptor we built.
This is used as a quick-and-dirty check that we know how to process this source