[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] mp4/filewriter/pub chxhintgen.h, NONE,
From:       vkeinonen () helixcommunity ! org
Date:       2009-03-27 9:27:03
Message-ID: 200903271029.n2RATKOm025523 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/datatype/mp4/filewriter/pub
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv5511/pub

Added Files:
	chxhintgen.h chxrtpsample.h 
Log Message:
3GPP features for the MPEG 4 filewriter

 - New properties: 3GPPMode and GenerateHintTracks

 - Time-based interleaving for progressive downloads

 - Writing of hint tracks

 - Various bugfixes (add ctts if necessary, skip damr and d263 boxes left
   by the fileformat plugin)



--- NEW FILE: chxhintgen.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Version: RCSL 1.0/RPSL 1.0
 *
 * Portions Copyright (c) 1995-2009 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file, are
 * subject to the current version of the RealNetworks Public Source License
 * Version 1.0 (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the RealNetworks Community Source License Version 1.0
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl,
 * in which case the RCSL will apply. You may also obtain the license terms
 * directly from RealNetworks.  You may not use this file except in
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks
 * applicable to this file, the RCSL.  Please see the applicable RPSL or
 * RCSL for the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the portions
 * it created.
 *
 * This file, and the files included with this file, is distributed and made
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef CHXHINTGEN_H
#define CHXHINTGEN_H

#include <hxtypes.h>
#include <ihxpckts.h>
#include <hxslist.h>

#include "chxrtpsample.h"

class CBaseHinter;
class CommonSample;

class CHXHintContext {
public:
    CHXHintContext();
    ~CHXHintContext();
    UINT8 NewPayloadType();
private:
    UINT8	next_pt;
};

#define HINTTRACK_SDP_FRAG_MAX_SIZE	1024

class CHXHintGenerator {
public:
    CHXHintGenerator(CHXHintContext & = default_context);
    ~CHXHintGenerator();
    HX_RESULT SetStreamHeader(IHXValues *);
    HX_RESULT HandleSample(CommonSample *, UINT32 &);
    HX_RESULT GetRTPSample(CHXRTPSample *&);
    void SetNextSampleNumber(UINT32);
    HX_RESULT EndStream();
    UINT32 GetTimescale() const;
    UINT32 GetSampleTimescale() const;
    UINT32 ConvertMSTime(UINT32) const;
    UINT32 ConvertSampleTime(UINT32) const;
    UINT8 GetPayloadType() const;
    UINT16 GetMaxPacketSize() const;
    void GetSDP(const char *&, UINT32 &) const;

    void SetTimescale(UINT32);
    void DoneRTPSample(CHXRTPSample *);
    void AddSDPLine(const char *);
private:
    CHXHintContext	&context;
    CHXSimpleList	samplelist;
    CBaseHinter		*hinter;
    UINT32		nextsnum;
    UINT32		timescale;
    UINT32		sts;
    UINT16		maxpacketsize;
    bool		done;
    UINT8		payloadtype;

    char		sdpbuf[HINTTRACK_SDP_FRAG_MAX_SIZE];
    UINT32		sdpsize;

    static CHXHintContext default_context;
};

class CBaseHinter {
protected:
    CHXHintGenerator	*hgen;
public:
    CBaseHinter(CHXHintGenerator *);
    virtual ~CBaseHinter();

    virtual HX_RESULT Init(IHXValues *) = 0;
    virtual HX_RESULT HandleSample(CommonSample *, UINT32) = 0;
    virtual HX_RESULT EndStream() = 0;
};

inline UINT32
CHXHintGenerator::GetTimescale() const
{
    return timescale;
}

inline UINT32
CHXHintGenerator::GetSampleTimescale() const
{
    return sts;
}

inline UINT8
CHXHintGenerator::GetPayloadType() const
{
    return payloadtype;
}

inline UINT16
CHXHintGenerator::GetMaxPacketSize() const
{
    return maxpacketsize;
}

class CommonSample {
public:
    CommonSample();
    virtual ~CommonSample();

    virtual UINT32 GetSize() const = 0;
    virtual const void *GetData() const = 0;
    virtual UINT32 GetCTime() const = 0;
    virtual UINT32 GetDTime() const = 0;
    virtual HXBOOL IsKeyframe() const = 0;
};

#endif	/* CHXHINTGEN_H */

--- NEW FILE: chxrtpsample.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Version: RCSL 1.0/RPSL 1.0
 *
 * Portions Copyright (c) 1995-2009 RealNetworks, Inc. All Rights Reserved.
 *
 * The contents of this file, and the files included with this file, are
 * subject to the current version of the RealNetworks Public Source License
 * Version 1.0 (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the RealNetworks Community Source License Version 1.0
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl,
 * in which case the RCSL will apply. You may also obtain the license terms
 * directly from RealNetworks.  You may not use this file except in
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks
 * applicable to this file, the RCSL.  Please see the applicable RPSL or
 * RCSL for the rights, obligations and limitations governing use of the
 * contents of the file.
 *
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the portions
 * it created.
 *
 * This file, and the files included with this file, is distributed and made
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 *
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef CHXRTPSAMPLE_H
#define CHXRTPSAMPLE_H

#include <hxtypes.h>
#include <hxresult.h>

class CHXRTPSample {
public:
    CHXRTPSample();
    virtual ~CHXRTPSample();

    const UINT8 *
    GetData() const
    {
	return data;
    }

    UINT32
    GetSize() const
    {
	return cur_size;
    }

    UINT32
    GetTime() const
    {
	return timestamp;
    }

    HXBOOL
    IsSyncSample() const
    {
	return ss_flag;
    }

protected:
    UINT32	timestamp;
    HXBOOL	ss_flag;

    UINT32	cur_size;
    UINT8	*data;
};

#endif	/* !CHXRTPSAMPLE_H */


_______________________________________________
Datatype-cvs mailing list
Datatype-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic