SharedAdaptor Class Reference

Wrapper for an adaptor so that the shared Adaptor can be used amongst several DataChannels/DataSinks. adaptor shareable amongst several DataSinks/DataChannels. More...

#include <SharedAdaptor.hpp>

Inheritance diagram for SharedAdaptor:

Adaptor List of all members.

Public Member Functions

 SharedAdaptor (ReferenceCounter *&ref, Adaptor *&a)
ReferenceCountergetReferenceCounter ()
AdaptorgetAdaptor ()
list< Frame * > adapt (Frame *frm)
 Accepts as input a frame, and checks if it can adapt the frame, If the frame is modified, a new Frame object is created and inserted into the return list.
Adaptorclone ()
 Create a shallow copy of the Adaptor.
void initialize ()
 Initialize internal data structures.
void setESInfo (ESInfo *esi)
 the following is only for virtual method implementation
ESInfogetESInfo ()
u32 getTranscodingCosts () const
 returns adaptation costs (CPU only)

Protected Attributes

ReferenceCounterusageCnt
 how many objects are currently using this adaptor
Adaptoradaptor
 the adaptor protected by this wrapper class

Detailed Description

Wrapper for an adaptor so that the shared Adaptor can be used amongst several DataChannels/DataSinks. adaptor shareable amongst several DataSinks/DataChannels.

Create one adaptor, one ReferenceCounter and N SharedAdaptor wrappers. When deleting the SharedAdaptor, the last one that is deleted will destroy the Adaptor

Author:
Peter Schojer
Version:
Id
SharedAdaptor.hpp,v 1.4 2004/06/14 09:02:46 pschojer Exp

Definition at line 65 of file SharedAdaptor.hpp.


Member Function Documentation

list< Frame * > SharedAdaptor::adapt Frame frm  )  [inline, virtual]
 

Accepts as input a frame, and checks if it can adapt the frame, If the frame is modified, a new Frame object is created and inserted into the return list.

This new frame is returned only, if the size of the payload is larger than zero. If the frame was not modified, it is also inserted into the list. For more complex adaptors, it will happen, that the adaptor caches up one complete GOP and returns the full GOP in network order. A caching adaptor has to create deep-copies for each frames. Never directly modify the payload of the input frm, always create copies!!!

Parameters:
frm object to adapt. An Adaptor is never allowed to free the input frame. This has to be done in the caller.
Returns:
List of adapted Frame objects

Reimplemented from Adaptor.

Definition at line 82 of file SharedAdaptor.hpp.

References Adaptor::adapt(), and adaptor.

00082 { return adaptor->adapt(frm); };

Adaptor* SharedAdaptor::clone  )  [inline, virtual]
 

Create a shallow copy of the Adaptor.

Creates an Adaptor with the same setup (without copying the current status).

Returns:
An Adaptor object.

Implements Adaptor.

Definition at line 84 of file SharedAdaptor.hpp.

References adaptor, and usageCnt.

00084 { return new SharedAdaptor(usageCnt, adaptor); };

void SharedAdaptor::initialize  )  [inline, virtual]
 

Initialize internal data structures.

Implements Adaptor.

Definition at line 86 of file SharedAdaptor.hpp.

00086 {};


The documentation for this class was generated from the following files: