EssenceSubParser Class Reference

Abstract base class for all essence parsers. More...

#include <essence.h>

Inheritance diagram for EssenceSubParser:

RefCount IRefCount DV_DIF_EssenceSubParser JP2K_EssenceSubParser MPEG2_VES_EssenceSubParser TEMPLATE_EssenceSubParser WAVE_PCM_EssenceSubParser List of all members.

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 IndexManagerPtrGetIndexManager (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...

Detailed Description

Abstract base class for all essence parsers.

Note:
It is important that no derived class has its own derivation of RefCount<>


Constructor & Destructor Documentation

virtual ~EssenceSubParser (  )  [inline, virtual]

Base destructor (to allow polymorphism).


Member Function Documentation

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

Returns:
A list of EssenceStreamDescriptors where each essence stream identified in the input file has an identifier (to allow it to be referenced later) and an MXF File Descriptor

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.

Parameters:
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
Note:
The options should be returned in an order of preference as the caller is likely to use the first that it can support

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

Returns:
true if all OK

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.

Returns:
true if this rate is acceptable

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).

Returns:
The prefered edit rate or 0/0 if note known

Reimplemented in JP2K_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.

virtual UInt32 GetBytesPerEditUnit ( UInt32  KAGSize = 1  )  [inline, virtual]

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.

virtual void SetStreamOffset ( Position  EditUnit,
UInt64  Offset 
) [inline, virtual]

Set the stream offset for a specified edit unit into the current index manager.

virtual bool OfferStreamOffset ( Position  EditUnit,
UInt64  Offset 
) [inline, virtual]

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.

Returns:
The edit unit of the entry accepted - or IndexLowest if none available

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

Note:
This is going to take a lot of memory in clip wrapping!

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

Note:
This is the only safe option for clip wrapping
Returns:
Count of bytes transferred

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.

Returns:
true if the option was successfully set

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.

Note:
You must redifine this function in a sub-parser even if it is not going to be its own factory (EssenceSubParserFactory used). In this case it is best to call the factory's NewParser() method.

Implemented in DV_DIF_EssenceSubParser, JP2K_EssenceSubParser, MPEG2_VES_EssenceSubParser, TEMPLATE_EssenceSubParser, and WAVE_PCM_EssenceSubParser.


Friends And Related Function Documentation

friend class ESP_EssenceSource [friend]


Member Data Documentation

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.


The documentation for this class was generated from the following file:
Generated on Mon Apr 2 15:20:58 2007 for MXFLib by  doxygen 1.5.1-p1