DV_DIF_EssenceSubParser Class Reference

Class that handles parsing of DV-DIf streams. More...

#include <esp_dvdif.h>

Inheritance diagram for DV_DIF_EssenceSubParser:

EssenceSubParser RefCount IRefCount List of all members.

Public Member Functions

 DV_DIF_EssenceSubParser ()
 ~DV_DIF_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 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 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.

Protected Member Functions

MDObjectPtr BuildCDCIEssenceDescriptor (FileHandle InFile, UInt64 Start=0)
 Read the header at the specified position in a DV file to build a video essence descriptor.
MDObjectPtr BuildSoundEssenceDescriptor (FileHandle InFile, UInt64 Start=0)
 Read the header at the specified position in a DV file to build an audio essence descriptor.
MDObjectPtr BuildCDCIEssenceDescriptorFromAVI (FileHandle InFile, UInt64 Start)
 Read the header at the specified position in a DV-AVI file to build an essence descriptor.
MDObjectPtr BuildSoundEssenceDescriptorFromAVI (FileHandle InFile, UInt64 Start)
 Read the header at the specified position in a DV-AVI file to build an audio 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.
DataChunkPtr AVIRead (FileHandle InFile, size_t Bytes)
 Read data from AVI wrapped essence.

Protected Attributes

Rational NativeEditRate
 The native edit rate of this essence.
Rational SelectedEditRate
 Selected edit rate of this essence.
unsigned int EditRatio
 Ratio of selected to native edit rate.
Position PictureNumber
 Current picture number.
Position CurrentPos
 Current position in the input file.
Position DIFStart
 Byte offset of first byte of first DIF.
Position DIFEnd
 Byte offset of last byte of last DIF + 1, or -1 if the file is an AVI file.
int SeqCount
 Number of DIF sequences in a frame.
bool isS314M
 True if this is a SMPTE 314M DV stream ("DV-Based").
UInt32 AVIFrameCount
 The number of frames, if the essence is AVI wrapped.
int StreamNumber
 AVI Stream number, if the essence is AVI wrapped.
UInt32 AVIStreamID
 The essence chunk FOURCC for this essence.
UInt32 AVIListRemaining
 The number of bytes remaining in the current LIST while essence parsing.
UInt32 AVIChunkRemaining
 The number of bytes remaining in the current #db chunk while essence parsing.
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.
UInt8Buffer
 Buffer for efficient file reading.
int BuffCount
 Count of bytes still unread in Buffer.
UInt8BuffPtr
 Pointer to next byte to read from Buffer.
MDObjectParent CurrentDescriptor
 Pointer to the last essence descriptor we built.

Friends

class DV_DIF_EssenceSubParser::ESP_EssenceSource

Classes

class  ESP_EssenceSource
 Class for EssenceSource objects for parsing/sourcing DV-DIF essence. More...

Detailed Description

Class that handles parsing of DV-DIf streams.


Constructor & Destructor Documentation

DV_DIF_EssenceSubParser (  )  [inline]

~DV_DIF_EssenceSubParser (  )  [inline]


Member Function Documentation

EssenceSubParserPtr NewParser ( void   )  const [virtual]

Build a new parser of this type and return a pointer to it.

Implements EssenceSubParser.

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.

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 from EssenceSubParser.

void Use ( UInt32  Stream,
WrappingOptionPtr UseWrapping 
) [virtual]

Set a wrapping option for future Read and Write calls.

Reimplemented from EssenceSubParser.

bool SetEditRate ( Rational  EditRate  )  [virtual]

Set a non-native edit rate.

Returns:
true if this rate is acceptable

Reimplemented from EssenceSubParser.

virtual Rational GetEditRate ( void   )  [inline, virtual]

Get the current edit rate.

Implements EssenceSubParser.

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

Get BytesPerEditUnit, if Constant.

Reimplemented from EssenceSubParser.

Position GetCurrentPosition ( void   )  [virtual]

Get the current position in SetEditRate() sized edit units.

Returns:
0 if position not known

Implements EssenceSubParser.

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

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

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

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

Implements EssenceSubParser.

bool SetOption ( std::string  Option,
Int64  Param = 0 
) [virtual]

Set a parser specific option.

Returns:
true if the option was successfully set

Reimplemented from 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.

MDObjectPtr BuildCDCIEssenceDescriptor ( FileHandle  InFile,
UInt64  Start = 0 
) [protected]

Read the header at the specified position in a DV file to build a video essence descriptor.

DRAGONS: Currently rather scrappy

MDObjectPtr BuildSoundEssenceDescriptor ( FileHandle  InFile,
UInt64  Start = 0 
) [protected]

Read the header at the specified position in a DV file to build an audio essence descriptor.

DRAGONS: Currently rather scrappy

MDObjectPtr BuildCDCIEssenceDescriptorFromAVI ( FileHandle  InFile,
UInt64  Start 
) [protected]

Read the header at the specified position in a DV-AVI file to build an essence descriptor.

MDObjectPtr BuildSoundEssenceDescriptorFromAVI ( FileHandle  InFile,
UInt64  Start 
) [protected]

Read the header at the specified position in a DV-AVI file to build an audio essence descriptor.

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.

Note:
The file position pointer is moved to the start of the chunk at the end of this function, but CurrentPos points to the start of the next edit unit

PictureNumber is incremented for each picture 'read'

TODO: Currently assumes 25Mbit - needs fixing

DataChunkPtr AVIRead ( FileHandle  InFile,
size_t  Bytes 
) [protected]

Read data from AVI wrapped essence.

Parses the list and chunk structure - can recurse


Friends And Related Function Documentation

friend class DV_DIF_EssenceSubParser::ESP_EssenceSource [friend]


Member Data Documentation

Rational NativeEditRate [protected]

The native edit rate of this essence.

Rational SelectedEditRate [protected]

Selected edit rate of this essence.

unsigned int EditRatio [protected]

Ratio of selected to native edit rate.

Position PictureNumber [protected]

Current picture number.

Position CurrentPos [protected]

Current position in the input file.

Position DIFStart [protected]

Byte offset of first byte of first DIF.

Position DIFEnd [protected]

Byte offset of last byte of last DIF + 1, or -1 if the file is an AVI file.

int SeqCount [protected]

Number of DIF sequences in a frame.

bool isS314M [protected]

True if this is a SMPTE 314M DV stream ("DV-Based").

UInt32 AVIFrameCount [protected]

The number of frames, if the essence is AVI wrapped.

int StreamNumber [protected]

AVI Stream number, if the essence is AVI wrapped.

UInt32 AVIStreamID [protected]

The essence chunk FOURCC for this essence.

UInt32 AVIListRemaining [protected]

The number of bytes remaining in the current LIST while essence parsing.

UInt32 AVIChunkRemaining [protected]

The number of bytes remaining in the current #db chunk while essence parsing.

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.

UInt8* Buffer [protected]

Buffer for efficient file reading.

int BuffCount [protected]

Count of bytes still unread in Buffer.

UInt8* BuffPtr [protected]

Pointer to next byte to read from Buffer.

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


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