Home | History | Annotate | Download | only in include
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 /*
     19     This PVA_FF_TrackReferenceAtom Class provides a reference from the containing stream
     20     to another stream in the MPEG-4 presentation.
     21 */
     22 
     23 
     24 #ifndef __TrackReferenceAtom_H__
     25 #define __TrackReferenceAtom_H__
     26 
     27 #include "atom.h"
     28 #include "trackreferencetypeatom.h"
     29 
     30 
     31 class PVA_FF_TrackReferenceAtom : public PVA_FF_Atom
     32 {
     33 
     34     public:
     35         PVA_FF_TrackReferenceAtom(uint32 refType); // Constructor
     36         virtual ~PVA_FF_TrackReferenceAtom(); // Destructor
     37 
     38         // Member get method
     39         PVA_FF_TrackReferenceTypeAtom &getTrackReferenceTypeAtom()
     40         {
     41             return *_ptrackReferenceTypeAtom;
     42         }
     43         PVA_FF_TrackReferenceTypeAtom *getTrackReferenceTypeAtomPtr()
     44         {
     45             return _ptrackReferenceTypeAtom;
     46         }
     47 
     48         // Add track reference - return index of reference in table - 1-based
     49         int32 addTrackReference(uint32 ref)
     50         {
     51             return _ptrackReferenceTypeAtom->addTrackReference(ref);
     52         }
     53 
     54         // Assuming a hint track can reference only ONE track
     55         uint32 getTrackReference() const
     56         {
     57             return _ptrackReferenceTypeAtom->getTrackReferenceAt(0);
     58         }
     59 
     60         // Rendering the PVA_FF_Atom in proper format (bitlengths, etc.) to an ostream
     61         virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp);
     62 
     63     private:
     64         virtual void recomputeSize();
     65 
     66         PVA_FF_TrackReferenceTypeAtom *_ptrackReferenceTypeAtom;
     67 
     68 };
     69 
     70 
     71 
     72 #endif
     73 
     74