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 TEXTSAMPLEENTRY_H_INCLUDED
     19 #define TEXTSAMPLEENTRY_H_INCLUDED
     20 
     21 
     22 #include "atom.h"
     23 #include "oscl_file_io.h"
     24 #include "decoderspecificinfo.h"
     25 #include "sampleentry.h"
     26 
     27 
     28 class PVA_FF_BoxRecord;
     29 class PVA_FF_FontRecord;
     30 class PVA_FF_StyleRecord;
     31 class PVA_FF_FontTableAtom;
     32 
     33 
     34 //This class is specific for the Timed text fileformat.
     35 //it handles and stores the configuraion information in the related atoms.
     36 
     37 class PVA_FF_TextSampleEntry : public PVA_FF_SampleEntry
     38 {
     39 
     40     public:
     41         OSCL_IMPORT_REF  PVA_FF_TextSampleEntry();
     42         OSCL_IMPORT_REF  virtual ~PVA_FF_TextSampleEntry();  // Destructor
     43 
     44         OSCL_IMPORT_REF void setBoxTop(int16 top);
     45         OSCL_IMPORT_REF void setBoxLeft(int16 left);
     46         OSCL_IMPORT_REF void setBoxBottom(int16 bottom);
     47         OSCL_IMPORT_REF void setBoxRight(int16 right);
     48 
     49         OSCL_IMPORT_REF void setStartChar(uint16 startchar) ;
     50         OSCL_IMPORT_REF void setEndChar(uint16 endchar) ;
     51         OSCL_IMPORT_REF void setFontID(uint16 fontID);
     52         OSCL_IMPORT_REF void setFontStyleFlags(uint8 flag) ;
     53         OSCL_IMPORT_REF void setfontSize(uint8 fontsize);
     54         OSCL_IMPORT_REF void setTextColourRGBA(uint8* RGBA);
     55         OSCL_IMPORT_REF void setFontListSize(uint16 fontlistsize);
     56         OSCL_IMPORT_REF void   *setFontRecord(uint16 fontlistID, uint16 fontID, int8 fontLength, uint8* fontName);
     57 
     58         void setSample(void* sample, uint32 size);
     59         void addTextDecoderSpecificInfo(PVA_FF_TextSampleDescInfo *pinfo);
     60         virtual void recomputeSize();
     61         virtual bool renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp);
     62     private:
     63         void init();
     64 
     65         // Reserved constants
     66         uint8  _reserved[6];
     67         uint16 _dataReferenceIndex;
     68         int16  _preDefined1;
     69         int16  _reserved1;
     70         int32  _predefined2[3];
     71         int32  _reserved2;
     72         int16  _preDefined2;
     73         int16  _predefined3;
     74 
     75         uint32          _start_sample_num;
     76         uint32          _end_sample_num;
     77         int32           _sdIndex;
     78         uint32          _displayFlags;
     79         int8            _horzJustification;
     80         int8            _vertJustification;
     81         uint8           *_pBackgroundRGBA;
     82         PVA_FF_BoxRecord        *_pBoxRecord;
     83         PVA_FF_StyleRecord      *_pStyleRecord;
     84         PVA_FF_FontTableAtom    *_pFontTableAtom;
     85 };
     86 
     87 
     88 #endif  // TEXTSAMPLEENTRY_H_INCLUDED
     89