#include <essence.h>
Inheritance diagram for GCReader:
Public Member Functions | |
GCReader (MXFFilePtr File, GCReadHandlerPtr DefaultHandler=NULL, GCReadHandlerPtr FillerHandler=NULL) | |
Create a new GCReader, optionally with a given default item handler and filler handler. | |
void | SetDefaultHandler (GCReadHandlerPtr DefaultHandler=NULL) |
Set the default read handler. | |
void | SetFillerHandler (GCReadHandlerPtr FillerHandler=NULL) |
Set the filler handler. | |
void | SetEncryptionHandler (GCReadHandlerPtr EncryptionHandler=NULL) |
Set encryption handler. | |
void | SetDataHandler (UInt32 TrackNumber, GCReadHandlerPtr DataHandler=NULL) |
Set data handler for a given track number. | |
bool | ReadFromFile (Position FilePos, Position StreamPos, bool SingleKLV=false) |
Read from file - and specify a start location. | |
bool | ReadFromFile (bool SingleKLV=false) |
Read from file - continuing from a previous read. | |
void | SetStreamOffset (Position NewOffset) |
Set the offset of the start of the next KLV within this GC stream. | |
Position | GetFileOffset (void) |
Get the file offset of the next read (or the current KLV if inside ReadFromFile). | |
bool | HandleData (KLVObjectPtr Object) |
Force a KLVObject to be handled. | |
void | StopReading (bool PushBackKLV=false) |
Stop reading even though there appears to be valid data remaining. | |
Position | GetStreamOffset (void) |
Get the offset of the start of the current KLV within this GC stream. | |
Protected Attributes | |
MXFFilePtr | File |
File from which to read. | |
Position | FileOffset |
The offset of the start of the current (or next) KLV within the file. Current KLV during HandleData() and next at other times. | |
Position | StreamOffset |
The offset of the start of the current KLV within the data stream. | |
bool | StopNow |
True if no more KLVs should be read - set by StopReading() and ReadFromFile() with SingleKLV=true. | |
bool | StopCalled |
True if StopReading() called while processing the current KLV. | |
bool | PushBackRequested |
True if StopReading() called with PushBackKLV = true. | |
GCReadHandlerPtr | DefaultHandler |
The default handler to receive all KLVs without a specific handler. | |
GCReadHandlerPtr | FillerHandler |
The hanlder to receive all filler KLVs. | |
GCReadHandlerPtr | EncryptionHandler |
The hanlder to receive all encrypted KLVs. | |
std::map< UInt32, GCReadHandlerPtr > | Handlers |
Map of read handlers indexed by track number. |
GCReader | ( | MXFFilePtr | File, | |
GCReadHandlerPtr | DefaultHandler = NULL , |
|||
GCReadHandlerPtr | FillerHandler = NULL | |||
) |
Create a new GCReader, optionally with a given default item handler and filler handler.
void SetDefaultHandler | ( | GCReadHandlerPtr | DefaultHandler = NULL |
) | [inline] |
Set the default read handler.
This handler receives all KLVs without a specific data handler assigned including KLVs that do not appear to be standard GC KLVs. If not default handler is set KLVs with no specific handler will be discarded.
void SetFillerHandler | ( | GCReadHandlerPtr | FillerHandler = NULL |
) | [inline] |
Set the filler handler.
If no filler handler is set all filler KLVs are discarded
void SetEncryptionHandler | ( | GCReadHandlerPtr | EncryptionHandler = NULL |
) | [inline] |
Set encryption handler.
This handler will receive all encrypted KLVs and after decrypting them will resubmit the decrypted version for handling using function HandleData()
void SetDataHandler | ( | UInt32 | TrackNumber, | |
GCReadHandlerPtr | DataHandler = NULL | |||
) | [inline] |
Set data handler for a given track number.
Read from file - and specify a start location.
All KLVs are dispatched to handlers Stops reading at the next partition pack unless SingleKLV is true when only one KLV is dispatched
FilePos | Location within the file to start this read | |
StreamPos | Stream offset of the first KLV to be read | |
SingleKLV | True if only a single KLV is to be read |
bool ReadFromFile | ( | bool | SingleKLV = false |
) |
Read from file - continuing from a previous read.
All KLVs are dispatched to handlers Stops reading at the next partition pack unless SingleKLV is true when only one KLV is dispatched
void SetStreamOffset | ( | Position | NewOffset | ) | [inline] |
Set the offset of the start of the next KLV within this GC stream.
Generally this will only be called as a result of parsing a partition pack
Position GetFileOffset | ( | void | ) | [inline] |
Get the file offset of the next read (or the current KLV if inside ReadFromFile).
bool HandleData | ( | KLVObjectPtr | Object | ) |
void StopReading | ( | bool | PushBackKLV = false |
) |
Stop reading even though there appears to be valid data remaining.
This function can be called from a handler if it detects that the current KLV is either the last KLV in partition, or does not belong in this partition at all. If the KLV belongs to another partition, or handling should be deferred for some reason, PushBackKLV can be set to true
Position GetStreamOffset | ( | void | ) | [inline] |
Get the offset of the start of the current KLV within this GC stream.
MXFFilePtr File [protected] |
File from which to read.
Position FileOffset [protected] |
The offset of the start of the current (or next) KLV within the file. Current KLV during HandleData() and next at other times.
Position StreamOffset [protected] |
The offset of the start of the current KLV within the data stream.
bool StopNow [protected] |
True if no more KLVs should be read - set by StopReading() and ReadFromFile() with SingleKLV=true.
bool StopCalled [protected] |
True if StopReading() called while processing the current KLV.
bool PushBackRequested [protected] |
True if StopReading() called with PushBackKLV = true.
GCReadHandlerPtr DefaultHandler [protected] |
The default handler to receive all KLVs without a specific handler.
GCReadHandlerPtr FillerHandler [protected] |
The hanlder to receive all filler KLVs.
GCReadHandlerPtr EncryptionHandler [protected] |
The hanlder to receive all encrypted KLVs.
std::map<UInt32, GCReadHandlerPtr> Handlers [protected] |
Map of read handlers indexed by track number.