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 /*     -------------------------------------------------------------------       */
     20 /*                        MPEG-4 TextSampleEntry Class                           */
     21 /*     -------------------------------------------------------------------       */
     22 /*********************************************************************************/
     23 /*
     24     This TextSampleEntry Class is used for text streams.
     25 */
     26 
     27 
     28 #ifndef TEXTSAMPLEENTRY_H_INCLUDED
     29 #define TEXTSAMPLEENTRY_H_INCLUDED
     30 
     31 #ifndef OSCL_FILE_IO_H_INCLUDED
     32 #include "oscl_file_io.h"
     33 #endif
     34 
     35 #ifndef SAMPLEENTRY_H_INCLUDED
     36 #include "sampleentry.h"
     37 #endif
     38 
     39 #define MAX_TEXT_SAMPLE_SIZE  2048
     40 
     41 class BoxRecord;
     42 class FontRecord;
     43 class StyleRecord;
     44 class FontTableAtom;
     45 
     46 class TextSampleEntry : public SampleEntry
     47 {
     48 
     49     public:
     50         OSCL_IMPORT_REF TextSampleEntry(MP4_FF_FILE *fp, uint32 size, uint32 type);
     51         OSCL_IMPORT_REF virtual ~TextSampleEntry();  // Destructor
     52 
     53         uint32 getDisplayFlags()
     54         {
     55             return _displayFlags;
     56         }
     57 
     58         int8 getHorzJustification()
     59         {
     60             return _horzJustification;
     61         }
     62 
     63         int8 getVertJustification()
     64         {
     65             return _vertJustification;
     66         }
     67 
     68         uint8 *getBackgroundColourRGBA()
     69         {
     70             return _pBackgroundRGBA;
     71         }
     72 
     73         virtual uint32 getMaxBufferSizeDB() const
     74         {
     75             return MAX_TEXT_SAMPLE_SIZE;
     76         }
     77 
     78         OSCL_IMPORT_REF int16 getBoxTop();
     79         OSCL_IMPORT_REF int16 getBoxLeft();
     80         OSCL_IMPORT_REF int16 getBoxBottom();
     81         OSCL_IMPORT_REF int16 getBoxRight();
     82 
     83         OSCL_IMPORT_REF uint16 getStartChar() ;
     84         OSCL_IMPORT_REF uint16 getEndChar() ;
     85         OSCL_IMPORT_REF uint16 getFontID();
     86         OSCL_IMPORT_REF uint8 getFontStyleFlags() ;
     87         OSCL_IMPORT_REF uint8 getfontSize();
     88         OSCL_IMPORT_REF uint8 *getTextColourRGBA();
     89         OSCL_IMPORT_REF uint16  getFontListSize();
     90         OSCL_IMPORT_REF FontRecord   *getFontRecordAt(uint16 index) ;
     91 
     92         virtual uint8 getObjectTypeIndication() const;
     93 
     94     private:
     95         uint32          _displayFlags;
     96         int8            _horzJustification;
     97         int8            _vertJustification;
     98         uint8           *_pBackgroundRGBA;
     99         BoxRecord       *_pBoxRecord;
    100         StyleRecord     *_pStyleRecord;
    101         FontTableAtom   *_pFontTableAtom;
    102 };
    103 
    104 
    105 #endif  // TEXTSAMPLEENTRY_H_INCLUDED
    106 
    107 
    108