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 #ifndef FONTTABLEATOM_H_INCLUDED
     19 #define FONTTABLEATOM_H_INCLUDED
     20 
     21 
     22 #include "atom.h"
     23 #include "atomutils.h"
     24 #include "oscl_file_io.h"
     25 
     26 #ifndef OSCL_VECTOR_H_INCLUDED
     27 #include "oscl_vector.h"
     28 #endif
     29 #ifndef FONTRECORD_H_INCLUDED
     30 #include "fontrecord.h"
     31 #endif
     32 
     33 //This class is specific for Timed text fileformat
     34 //It stores and sets the no. of type of fontrecords are present
     35 
     36 typedef Oscl_Vector<PVA_FF_FontRecord*, OsclMemAllocator> fontRecordVecType;
     37 
     38 class PVA_FF_FontTableAtom : public PVA_FF_Atom
     39 {
     40 
     41     public:
     42         PVA_FF_FontTableAtom();  // Default constructor
     43         virtual ~PVA_FF_FontTableAtom();  // Destructor
     44 
     45         void setFontListSize(uint16 FontListSize);
     46         virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp);
     47         virtual void recomputeSize();
     48         virtual uint32 getSize();
     49         void setFontRecord(uint16 FontListID, uint16 FontId, int8 FontLength, uint8* FontName);
     50 
     51         PVA_FF_FontRecord * getFontRecordAt(uint16 index)
     52         {
     53             if ((index) > _pFontRecordArray->size())
     54             {
     55                 return NULL;
     56             }
     57 
     58             if (index < _entryCount)
     59             {
     60                 return (PVA_FF_FontRecord *)(*_pFontRecordArray)[(int32)index];
     61             }
     62             else
     63             {
     64                 return NULL;
     65             }
     66         }
     67 
     68     private:
     69         uint8* _sample;
     70         uint16 _entryCount;
     71         uint16 _fontlistsize;
     72         Oscl_Vector<PVA_FF_FontRecord *, OsclMemAllocator> *_pFontRecordArray;
     73 
     74 };
     75 
     76 
     77 #endif // FONTTABLEATOM_H_INCLUDED
     78