Valkka
1.6.1
OpenSource Video Management
|
Frame: An abstract queueable class. More...
#include <frame.h>
Public Member Functions | |
Frame () | |
Default ctor. | |
virtual | ~Frame () |
Default virtual dtor. | |
frame_essentials (FrameClass::none, Frame) | |
frame_clone (FrameClass::none, Frame) | |
virtual void | print (std::ostream &os) const |
Produces frame output. | |
virtual std::string | dumpPayload () |
Dumps internal payload data. | |
virtual void | dumpPayloadToFile (std::ofstream &fout) |
Dumps internal payload data into a file. | |
virtual void | updateAux () |
Update internal auxiliary state variables. | |
virtual void | update () |
Update helper points (call always) | |
virtual void | reset () |
Reset the internal data. | |
virtual bool | isSeekable () |
Can we seek to this frame? (e.g. is it a key-frame .. for H264 sps packets are used as seek markers) | |
void | copyMetaFrom (Frame *f) |
Copy metadata (slot, subsession index, timestamp) to this frame. | |
Public Attributes | |
SlotNumber | n_slot |
Slot number identifying the media source. | |
int | subsession_index |
Media subsession index. | |
long int | mstimestamp |
Presentation time stamp (PTS) in milliseconds. | |
Protected Attributes | |
FrameClass | frameclass |
Declares frametype for correct typecast. Used by Frame::getFrameClass() | |
Frame: An abstract queueable class.
Instances of this class can be placed into FrameFifos and passed through FrameFilters (see the FrameFifo and FrameFilter classes). They have characteristic internal data, defined in child classes.
The internal data can be paylod, information for decoder setup, signals to threads, etc.
FrameFifos and FrameFilters are responsible for checking the exact type of the Frame, performing correct typecast and using/discarding/modificating the Frame.
All Frame classes can be put through FrameFilters, but not all Frame classes are copyable/queueable. Copyable Frame instances can be placed in a FrameFifo (that creates a copy of the Frame before queuing it).
A FrameFifo can also decide to transform the frame to another type before placing it into the queue.
The internal data (and state of the object) consists typically of managed objects, created with external libraries (say, FFmpeg/libav) and "helper" objects/members. In the case of FFmpeg these are auxiliary members that make the use of the underlying FFmpeg objects more transparent. State of the managed objects and the helper objects must be kept consistent.
When the state of the managed object(s) is changed, call "updateFrom" with const parameters. This also makes it more transparent, which parameters trigger updates in helper (and managed) objects.