// constructor
PVA_FF_TrackFragmentAtom::PVA_FF_TrackFragmentAtom(uint32 mediaType,
        uint32 codecType,
        uint32 trackId,
        uint32 interleaveDuration,
        uint32 timescale)
        : PVA_FF_Atom(TRACK_FRAGMENT_ATOM)
{
    _mediaType = mediaType;
    _codecType = codecType;

    // no interleaving flag, as movie fragments are there in interleaving mode
    _timescale = timescale;
    _firstEntry = true;
    _prevTS = 0;
    _interleaveDuration = interleaveDuration;
    _fragmentDuration = 0;
    _ofirstTrun = true;

    // intialise track fragment header atom
    PV_MP4_FF_NEW(fp->auditCB, PVA_FF_TrackFragmentHeaderAtom, (trackId), _pTfhdAtom);

    // initialise track run vector
    PV_MP4_FF_NEW(fp->auditCB, PVA_FF_TrackFragmentRunAtomVecType, (), _pTrunList);

    recomputeSize();

}
void
PVA_FF_SLConfigDescriptor::init()
{
    _predefined = 0x02; // According to MPEG4 File Format specification
    // - section 13.1.3.2 "Handling of elementary streams"
    // (last paragraph)
    _reserved2 = 0x7f;
    _OCRStreamFlag = false;
    _OCRESID = 0;

    if (_predefined == 0x01)
    {
        _useAccessUnitStartFlag = false;
        _useAccessUnitEndFlag = false;
        _useRandomAccessPointFlag = false;
        _usePaddingFlag = false;
        _useTimeStampsFlag = false;
        _useIdleFlag = false;
        _AULength = 0;
        _degradationPriorityLength = 0;
        _AUSeqNumLength = 0;
        _packetSeqNumLength = 0;
        _reserved1 = 0x3; // 0b11
    }


    recomputeSize();
}
Пример #3
0
PVA_FF_FontRecord::PVA_FF_FontRecord(uint16 FontListID, uint16 FontID, int8 FontLength, uint8* FontName)
        : PVA_FF_Atom(FourCharConstToUint32('t', 't', 's', 'f'))
{
    OSCL_UNUSED_ARG(FontListID);
    _fontID = 0;
    _fontLength = 0;
    _pFontName = NULL;

    if (_fontID == 0)
    {
        _fontID = FontID;
    }
    if (_fontLength == 0)
    {
        _fontLength = FontLength;
    }

    if (_fontLength >  0)
    {
        _pFontName = (uint8 *)(OSCL_MALLOC(_fontLength * sizeof(char)));

        for (uint32 i = 0; i < (uint32)_fontLength; i++)
        {
            _pFontName[i] = FontName[i];
        }
    }

    recomputeSize();

}
bool PVA_FF_AssetInfoKeyWordsAtom::renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp)

{
    recomputeSize();
    int32 rendered = 0; // Keep track of number of bytes rendered

    // Render PVA_FF_Atom type and size
    if (!renderAtomBaseMembers(fp))
    {
        return false;
    }
    rendered += getDefaultSize();

    if (!PVA_FF_AtomUtils::render16(fp, _langCode))
    {
        return false;
    }
    rendered += 2;


    if (!PVA_FF_AtomUtils::render8(fp, _keyWordCnt))
    {
        return false;
    }
    rendered += 1;

    // calculate size of each object in the structure
    for (int i = 0; i < _keyWordCnt; i++)
    {
        (*_pKeyWordVect)[i]->renderToFileStream(fp);
        rendered += (*_pKeyWordVect)[i]->getSizeofStruct();

    }
    return true;
}
// Constructor
PVA_FF_MediaAtom::PVA_FF_MediaAtom(int32 mediaType,
                                   int32 codecType,
                                   uint32 fileAuthoringFlags,
                                   bool o3GPPCompliant,
                                   uint32 protocol,
                                   uint8 profile,
                                   uint8 profileComp,
                                   uint8 level)

        : PVA_FF_Atom(MEDIA_ATOM)
{
    PV_MP4_FF_NEW(fp->auditCB, PVA_FF_MediaHeaderAtom, (), _pmediaHeader);

    PV_MP4_FF_NEW(fp->auditCB, PVA_FF_HandlerAtom, (mediaType, (uint8)0, (uint8)0), _phandler);

    PV_MP4_FF_NEW(fp->auditCB, PVA_FF_MediaInformationAtom, (mediaType,
                  codecType,
                  fileAuthoringFlags,
                  o3GPPCompliant,
                  protocol, profile,
                  profileComp, level), _pmediaInformation);

    recomputeSize();
    _pmediaHeader->setParent(this);
    _phandler->setParent(this);
    _pmediaInformation->setParent(this);
}
Пример #6
0
PVA_FF_H263DecBitrateAtom::PVA_FF_H263DecBitrateAtom()
        : PVA_FF_Atom(FourCharConstToUint32('b', 'i', 't', 'r'))
{
    _avg_bitrate = 8000;
    _max_bitrate = 8000;
    recomputeSize();
}
Пример #7
0
// Adding to and getting first chunk offset values
void
PVA_FF_ChunkOffsetAtom::addChunkOffset(uint32 offset)
{
    _pchunkOffsets->push_back(offset);
    _entryCount += 1;

    recomputeSize();
}
int32
PVA_FF_TrackReferenceTypeAtom::addTrackReference(uint32 ref)
{
    _trackIDs->push_back(ref);
    recomputeSize();

    return _trackIDs->size();
}
Пример #9
0
// add new trex atom to the list
void
PVA_FF_MovieExtendsAtom::addTrexAtom(PVA_FF_TrackExtendsAtom *pTrexAtom)
{
    _pTrexAtomVec->push_back(pTrexAtom);
    pTrexAtom->setParent(this);

    recomputeSize();
}
// constructor
PVA_FF_MovieFragmentHeaderAtom::PVA_FF_MovieFragmentHeaderAtom(uint32 sequenceNumber)
        : PVA_FF_FullAtom(MOVIE_FRAGMENT_HEADER_ATOM, (uint8)0, (uint32)0)
{
    _sequenceNumber = sequenceNumber;

    recomputeSize();

}
// constructor
PVA_FF_MfroAtom::PVA_FF_MfroAtom()
    : PVA_FF_FullAtom(MOVIE_FRAGMENT_RANDOM_ACCESS_OFFSET_ATOM, (uint8)0, (uint32)0)
{
    _atomSize = 0;

    recomputeSize();

}
void PVA_FF_EditListAtom::addEditEntry(uint32 duration, int32 time, uint16 rate)
{
    _psegmentDurations->push_back(duration);
    _pmediaTimes->push_back(time);
    _pmediaRates->push_back(rate);
    _entryCount++;
    recomputeSize();
}
Пример #13
0
// Constructor
PVA_FF_DataInformationAtom::PVA_FF_DataInformationAtom()
        : PVA_FF_Atom(DATA_INFORMATION_ATOM)
{
    PV_MP4_FF_NEW(fp->auditCB, PVA_FF_DataReferenceAtom, (), _pdataReferenceAtom);

    _pdataReferenceAtom->setParent(this);
    recomputeSize();
}
PVA_FF_AssetInfoPerformerAtom::PVA_FF_AssetInfoPerformerAtom()
        : PVA_FF_FullAtom(ASSET_INFO_PERF_ATOM, 0, 0)
{
    _performer = (_STRLIT(""));
    _langCode = LANGUAGE_CODE_UNKNOWN;
    _byteOrderMask = BYTE_ORDER_MASK;
    recomputeSize();
}
PVA_FF_AssetInfoAuthorAtom::PVA_FF_AssetInfoAuthorAtom()
        : PVA_FF_FullAtom(ASSET_INFO_AUTHOR_ATOM, 0, 0)
{
    _author = (_STRLIT(""));
    _langCode = LANGUAGE_CODE_UNKNOWN;
    _byteOrderMask = BYTE_ORDER_MASK;
    recomputeSize();
}
PVA_FF_AssetInfoDescAtom::PVA_FF_AssetInfoDescAtom()
        : PVA_FF_FullAtom(ASSET_INFO_DESCP_ATOM, 0, 0)
{
    _description = (_STRLIT(""));
    _langCode = LANGUAGE_CODE_UNKNOWN;
    _byteOrderMask = BYTE_ORDER_MASK;
    recomputeSize();
}
// Default Constructor
PVA_FF_ObjectDescriptor::PVA_FF_ObjectDescriptor(uint16 nextAvailableODID, uint8 tag)
        : PVA_FF_BaseDescriptor(tag)
{
    init(nextAvailableODID);
    PV_MP4_FF_NEW(fp->auditCB, PVA_FF_ES_ID_RefVecType, (), _pES_ID_Ref_Vec);

    recomputeSize();
}
// Constructor
PVA_FF_DecoderConfigDescriptor::PVA_FF_DecoderConfigDescriptor(int32 streamType, int32 codecType)
        : PVA_FF_BaseDescriptor(0x04)
{
    _codecType = codecType;

    init(streamType);
    recomputeSize();
}
PVA_FF_AssetInfoGenreAtom::PVA_FF_AssetInfoGenreAtom()
        : PVA_FF_FullAtom(ASSET_INFO_GENRE_ATOM, 0, 0)
{
    _genre = (_STRLIT(""));
    _langCode = LANGUAGE_CODE_UNKNOWN;
    _byteOrderMask = BYTE_ORDER_MASK;
    recomputeSize();
}
PVA_FF_AssetInfoCopyRightAtom::PVA_FF_AssetInfoCopyRightAtom()
        : PVA_FF_FullAtom(ASSET_INFO_CPRT_ATOM, 0, 0)
{
    _cprt = (_STRLIT(""));
    _langCode = LANGUAGE_CODE_UNKNOWN;
    _byteOrderMask = BYTE_ORDER_MASK;
    recomputeSize();
}
// Constructor
PVA_FF_TextSampleEntry::PVA_FF_TextSampleEntry()
        : PVA_FF_SampleEntry(TEXT_SAMPLE_ENTRY)
{

    init();
    recomputeSize();


}
Пример #22
0
void
PVA_FF_TrackHeaderAtom::init(int32 type)
{
    PVA_FF_AtomUtils::setTime(_creationTime);
    PVA_FF_AtomUtils::setTime(_modificationTime);
    setTimeScale(0);

    _duration = 0;

    // Initialize the reserved words based on type
    _reserved1 = 0;
    _reserved2[0] = 0;
    _reserved2[1] = 0;
    _reserved2[2] = 0;
    _reserved3 = 0;
    _reserved4 = 0;
    _reserved5[0] = 0x00010000;
    _reserved5[1] = 0;
    _reserved5[2] = 0;
    _reserved5[3] = 0;
    _reserved5[4] = 0x00010000;
    _reserved5[5] = 0;
    _reserved5[6] = 0;
    _reserved5[7] = 0;
    _reserved5[8] = 0x40000000;
    _reserved6 = 0;
    _reserved7 = 0;

    if ((uint32) type == MEDIA_TYPE_AUDIO)  // Set flags for audio track
    {
        _reserved3 = 0x0100;
    }
    else if ((uint32) type == MEDIA_TYPE_VISUAL)  // Set flags for visual track
    {
        _reserved6 = (_width << 16); ;
        _reserved7 = (_height << 16);;
    }
    else if ((uint32) type == MEDIA_TYPE_TEXT)//added for timed text track height and width
    {
        _reserved6 = (TIMED_TEXT_WIDTH << 16);
        _reserved7 = (TIMED_TEXT_HEIGHT << 16);

    }
    else
    {
        // No other special flags
    }

    /*
     * Variables added to ensure that the total track duration includes the duration of the
     * last sample as well, which in our case fp same as the last but one.
     */
    _prevTS = 0;
    _deltaTS = 0;

    recomputeSize();
}
// constructor
PVA_FF_MovieExtendsHeaderAtom::PVA_FF_MovieExtendsHeaderAtom()
        : PVA_FF_FullAtom(MOVIE_EXTENDS_HEADER_ATOM, (uint8)0, (uint32)0)
{
    _fragmentDuration = 0;
    _fileOffset = 0;
    _oRendered = false;
    recomputeSize();

}
void
PVA_FF_FileTypeAtom::addCompatibleBrand(uint32 brand)
{
    if (_pCompatibleBrandVec != NULL)
    {
        _pCompatibleBrandVec->push_back(brand);
        recomputeSize();
    }
}
// Constructor
PVA_FF_DecoderSpecificInfo::PVA_FF_DecoderSpecificInfo(PVA_FF_TextSampleDescInfo *pdata, uint32 size)
        : PVA_FF_BaseDescriptor(0x05)
{
    _infoSize = size;
    _pinfo = (uint8 *)OSCL_MALLOC(_infoSize);

    oscl_memcpy(_pinfo, pdata, _infoSize);
    recomputeSize();
}
Пример #26
0
// Constructor
PVA_FF_SyncSampleAtom::PVA_FF_SyncSampleAtom()
        : PVA_FF_FullAtom(SYNC_SAMPLE_ATOM, (uint8)0, (uint32)0)
{
    _entryCount = 0;
    PV_MP4_FF_NEW(fp->auditCB, uint32VecType, (), _psampleNumbers);
    _nextSampleNumber = 0;

    recomputeSize();
}
Пример #27
0
// Default constructor
PVA_FF_EVRCSpecificAtom::PVA_FF_EVRCSpecificAtom()
        : PVA_FF_Atom(FourCharConstToUint32('d', 'e', 'v', 'c'))
{
    _VendorCode = PACKETVIDEO_FOURCC;

    _frames_per_sample = 1;

    recomputeSize();
}
PVA_FF_AssetInfoAlbumAtom::PVA_FF_AssetInfoAlbumAtom()
        : PVA_FF_FullAtom(ASSET_INFO_ALBUM_TITLE_ATOM, 0, 0)
{
    _albumTitle = (_STRLIT(""));
    _langCode = LANGUAGE_CODE_UNKNOWN;
    _trackNumber = 1;
    _byteOrderMask = BYTE_ORDER_MASK;
    recomputeSize();
}
PVA_FF_AssetInfoClassificationAtom::PVA_FF_AssetInfoClassificationAtom()
        : PVA_FF_FullAtom(ASSET_INFO_CLSF_ATOM, 0, 0)
{
    _classificationInfo		=	(_STRLIT(""));
    _classificationEntity    =   0;
    _classificationTable		=   0;
    _langCode = LANGUAGE_CODE_UNKNOWN;
    _byteOrderMask = BYTE_ORDER_MASK;
    recomputeSize();
}
PVA_FF_AssetInfoRatingAtom::PVA_FF_AssetInfoRatingAtom()
        : PVA_FF_FullAtom(ASSET_INFO_RATING_ATOM, 0, 0)
{
    _ratingInfo		=	(_STRLIT(""));
    _ratingEntity    =   RATING_ENTITY_UNKNOWN;
    _ratingCriteria  =   RATING_CRITERIA_UNKNOWN;
    _langCode = LANGUAGE_CODE_UNKNOWN;
    _byteOrderMask = BYTE_ORDER_MASK;
    recomputeSize();
}