#include <essence.h>
Inheritance diagram for EssenceSubParser:
Public Member Functions | |
virtual | ~EssenceSubParser () |
Base destructor (to allow polymorphism). | |
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 | CanReValidate (void) |
Does this essence parser support ReValidate(). | |
virtual bool | ReValidate (FileHandle Infile, UInt32 Stream, MDObjectPtr &Descriptor, WrappingOptionPtr &UseWrapping) |
Quickly validate that the given (open) file can be wrapped as specified. | |
WrappingOption::WrapType | GetWrapType (void) |
Get the wrapping type that has been selected by Use(). | |
virtual bool | SetEditRate (Rational EditRate) |
Set a non-native edit rate. | |
virtual Rational | GetEditRate (void)=0 |
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)=0 |
Get the current position in SetEditRate() sized edit units. | |
virtual void | SetIndexManager (IndexManagerPtr &TheManager, int StreamID=0) |
Set the IndexManager for this essence stream (and the stream ID if we are not the main stream). | |
virtual IndexManagerPtr & | GetIndexManager (void) |
Get the IndexManager for this essence stream. | |
virtual int | GetIndexStreamID (void) |
Get the IndexManager StreamID for this essence stream. | |
virtual void | SetStreamOffset (Position EditUnit, UInt64 Offset) |
Set the stream offset for a specified edit unit into the current index manager. | |
virtual bool | OfferStreamOffset (Position EditUnit, UInt64 Offset) |
Offer the stream offset for a specified edit unit to the current index manager. | |
virtual void | IndexNext (void) |
Instruct index manager to accept the next edit unit. | |
virtual int | IndexLogNext (void) |
Instruct index manager to accept and log the next edit unit. | |
virtual int | LogNext (void) |
Instruct index manager to log the next edit unit. | |
virtual Position | ReadLog (int LogID) |
Read an edit unit from the index manager's log. | |
virtual Position | AcceptProvisional (void) |
Instruct index manager to accept provisional entry. | |
Position | GetLastNewEditUnit (void) |
Read the edit unit of the last entry added via the index manager (or IndexLowest if none added). | |
virtual UInt8 | GetGCEssenceType (void) |
Get the GCEssenceType to use when wrapping this essence in a Generic Container. | |
virtual UInt8 | GetGCElementType (void) |
Get the GCEssenceType to use when wrapping this essence in a Generic Container. | |
virtual DataChunkPtr | Read (FileHandle InFile, UInt32 Stream, UInt64 Count=1)=0 |
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)=0 |
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)=0 |
Write a number of wrapping items from the specified stream to an MXF file. | |
virtual bool | SetOption (std::string Option, Int64 Param=0) |
Set a parser specific option. | |
virtual std::string | GetParserName (void) const |
Get a unique name for this sub-parser. | |
virtual EssenceSubParserPtr | NewParser (void) const =0 |
Build a new sub-parser of the appropriate type. | |
Protected Attributes | |
WrappingOptionPtr | SelectedWrapping |
The wrapping options selected. | |
IndexManagerPtr | Manager |
The index manager in use. | |
int | ManagedStreamID |
This essence stream's stream ID in the index manager. | |
Friends | |
class | ESP_EssenceSource |
Classes | |
class | ESP_EssenceSource |
Base class for essence parser EssenceSource objects. More... |
virtual ~EssenceSubParser | ( | ) | [inline, virtual] |
Base destructor (to allow polymorphism).
virtual StringList HandledExtensions | ( | void | ) | [inline, virtual] |
Report the extensions of files this sub-parser is likely to handle.
Reimplemented in DV_DIF_EssenceSubParser, JP2K_EssenceSubParser, MPEG2_VES_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
virtual EssenceStreamDescriptorList IdentifyEssence | ( | FileHandle | InFile | ) | [inline, virtual] |
Examine the open file and return a list of essence descriptors.
This function should fail as fast as possible if the essence if not identifyable by this object
Reimplemented in DV_DIF_EssenceSubParser, JP2K_EssenceSubParser, MPEG2_VES_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
virtual WrappingOptionList IdentifyWrappingOptions | ( | FileHandle | InFile, | |
EssenceStreamDescriptor & | Descriptor | |||
) | [inline, 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 in DV_DIF_EssenceSubParser, JP2K_EssenceSubParser, MPEG2_VES_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
virtual void Use | ( | UInt32 | Stream, | |
WrappingOptionPtr & | UseWrapping | |||
) | [inline, virtual] |
Set a wrapping option for future Read and Write calls.
Reimplemented in DV_DIF_EssenceSubParser, and MPEG2_VES_EssenceSubParser.
virtual bool CanReValidate | ( | void | ) | [inline, virtual] |
Does this essence parser support ReValidate().
virtual bool ReValidate | ( | FileHandle | Infile, | |
UInt32 | Stream, | |||
MDObjectPtr & | Descriptor, | |||
WrappingOptionPtr & | UseWrapping | |||
) | [inline, virtual] |
Quickly validate that the given (open) file can be wrapped as specified.
Providing that the given essence descriptor and wrapping option can be used this will leave the parser in the state it would have been in after calls to IdentifyEssence(), IdentifyWrappingOptions() and Use(). This is used when parsing a list of files to check that the second and later files are the same format as the first
WrappingOption::WrapType GetWrapType | ( | void | ) | [inline] |
Get the wrapping type that has been selected by Use().
virtual bool SetEditRate | ( | Rational | EditRate | ) | [inline, virtual] |
Set a non-native edit rate.
Reimplemented in DV_DIF_EssenceSubParser, JP2K_EssenceSubParser, MPEG2_VES_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
virtual Rational GetEditRate | ( | void | ) | [pure virtual] |
Get the current edit rate.
Implemented in DV_DIF_EssenceSubParser, JP2K_EssenceSubParser, MPEG2_VES_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
virtual Rational GetPreferredEditRate | ( | void | ) | [inline, virtual] |
Get the preferred edit rate (if one is known).
Reimplemented in JP2K_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
Get BytesPerEditUnit, if Constant.
Note that we use KAGSize to prevent compiler warnings (we cannot omit it as it has a default value)
Reimplemented in DV_DIF_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
virtual Position GetCurrentPosition | ( | void | ) | [pure virtual] |
Get the current position in SetEditRate() sized edit units.
This is relative to the start of the stream, so the first edit unit is always 0. This is the same as the number of edit units read so far, so when the essence is exhausted the value returned shall be the size of the essence
Implemented in DV_DIF_EssenceSubParser, JP2K_EssenceSubParser, MPEG2_VES_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
virtual void SetIndexManager | ( | IndexManagerPtr & | TheManager, | |
int | StreamID = 0 | |||
) | [inline, virtual] |
Set the IndexManager for this essence stream (and the stream ID if we are not the main stream).
Reimplemented in MPEG2_VES_EssenceSubParser.
virtual IndexManagerPtr& GetIndexManager | ( | void | ) | [inline, virtual] |
Get the IndexManager for this essence stream.
virtual int GetIndexStreamID | ( | void | ) | [inline, virtual] |
Get the IndexManager StreamID for this essence stream.
Set the stream offset for a specified edit unit into the current index manager.
Offer the stream offset for a specified edit unit to the current index manager.
virtual void IndexNext | ( | void | ) | [inline, virtual] |
Instruct index manager to accept the next edit unit.
virtual int IndexLogNext | ( | void | ) | [inline, virtual] |
Instruct index manager to accept and log the next edit unit.
virtual int LogNext | ( | void | ) | [inline, virtual] |
Instruct index manager to log the next edit unit.
virtual Position ReadLog | ( | int | LogID | ) | [inline, virtual] |
Read an edit unit from the index manager's log.
virtual Position AcceptProvisional | ( | void | ) | [inline, virtual] |
Instruct index manager to accept provisional entry.
Position GetLastNewEditUnit | ( | void | ) | [inline] |
Read the edit unit of the last entry added via the index manager (or IndexLowest if none added).
virtual UInt8 GetGCEssenceType | ( | void | ) | [inline, virtual] |
Get the GCEssenceType to use when wrapping this essence in a Generic Container.
virtual UInt8 GetGCElementType | ( | void | ) | [inline, virtual] |
Get the GCEssenceType to use when wrapping this essence in a Generic Container.
virtual DataChunkPtr Read | ( | FileHandle | InFile, | |
UInt32 | Stream, | |||
UInt64 | Count = 1 | |||
) | [pure 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
Implemented in DV_DIF_EssenceSubParser, JP2K_EssenceSubParser, MPEG2_VES_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
virtual EssenceSourcePtr GetEssenceSource | ( | FileHandle | InFile, | |
UInt32 | Stream, | |||
UInt64 | Count = 1 | |||
) | [pure virtual] |
Build an EssenceSource to read a number of wrapping items from the specified stream.
Implemented in DV_DIF_EssenceSubParser, JP2K_EssenceSubParser, MPEG2_VES_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
virtual Length Write | ( | FileHandle | InFile, | |
UInt32 | Stream, | |||
MXFFilePtr | OutFile, | |||
UInt64 | Count = 1 | |||
) | [pure 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
Implemented in DV_DIF_EssenceSubParser, JP2K_EssenceSubParser, MPEG2_VES_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
virtual bool SetOption | ( | std::string | Option, | |
Int64 | Param = 0 | |||
) | [inline, virtual] |
Set a parser specific option.
Reimplemented in DV_DIF_EssenceSubParser, and MPEG2_VES_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 in DV_DIF_EssenceSubParser, JP2K_EssenceSubParser, MPEG2_VES_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
virtual EssenceSubParserPtr NewParser | ( | void | ) | const [pure virtual] |
Build a new sub-parser of the appropriate type.
Implemented in DV_DIF_EssenceSubParser, JP2K_EssenceSubParser, MPEG2_VES_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.
friend class ESP_EssenceSource [friend] |
WrappingOptionPtr SelectedWrapping [protected] |
The wrapping options selected.
IndexManagerPtr Manager [protected] |
The index manager in use.
int ManagedStreamID [protected] |
This essence stream's stream ID in the index manager.