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

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] mp4/payload/pub pcmpyld.h,NONE,1.1.2.1
From:       gbajaj () helixcommunity ! org
Date:       2008-06-25 11:14:50
Message-ID: 200806251115.m5PBFsJL001729 () mailer ! progressive-comp ! com
[Download RAW message or body]

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

Added Files:
      Tag: hxclient_2_0_4_cayenne
	pcmpyld.h 
Log Message:
Changes to support playback of pcm.mov files


--- NEW FILE: pcmpyld.h ---
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: pcmpyld.h,v 1.1.2.1 2008/06/25 11:14:48 gbajaj Exp $
 * 
 * Portions Copyright (c) 1995-2004 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 (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (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.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * 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 PCMPYLD_H
#define PCMPYLD_H

#include "hxcom.h"
#include "hxformt.h"
#include "hxccf.h"
#include "ihxpckts.h"
#include "hxslist.h"

#define WAV_OPAQUE_DATA_SIZE 44
#define WAV_FOURCC(b1, b2, b3, b4)	((b1 << 24) |	\
					 (b2 << 16) |	\
					 (b3 << 8)  |	\
					 b4)

class WAVOPAQUEHEADER
{
public:
    UINT8*	pack(UINT8* buf, UINT32 &len);
    UINT8*	unpack(UINT8* buf, UINT32 len);
    const UINT32 static static_size() {return WAV_OPAQUE_DATA_SIZE;}

    UINT8 usVersion;
    UINT8 usFlags[3];
    UINT32 usEntriesCount;
	
    UINT32 usSize;
    UINT32 usDataFormat;
    UINT16 usReserved[3];
    UINT16 usRefIndex;

    UINT16 usEncVersion;
    UINT16 usEncRevision;
    UINT32 usEncVendor;	

    UINT16 usChannels;
    UINT16 usBitsPerSample; 	
    UINT16 usCompressionId;
    UINT16 usPacketSize;
    UINT32 ulSamplesPerSec;	

};

inline UINT8*
WAVOPAQUEHEADER::pack(UINT8* buf, UINT32 &len)
{
    UINT8* off = buf;
//  NOT IMPLEMENTED
    return NULL;
}

inline UINT8*
WAVOPAQUEHEADER::unpack(UINT8* buf, UINT32 len)
{
    if (len <= 0)
	return 0;
    UINT8* off = buf;

    {    usVersion = *off++;}
    {    usFlags[0] = *off++; usFlags[1] = *off++; usFlags[2] = *off++; }
    {
        UnpackUINT32BE(off, 4, &usEntriesCount);
        off+=4;
    }
    {
        UnpackUINT32BE(off, 4, &usSize);
        off+=4;
    }
    {
        UnpackUINT32BE(off, 4, &usDataFormat);
        off+=4;
    }
    {
        UnpackUINT16BE(off, 2, &usReserved[0]);
        off+=2;
        UnpackUINT16BE(off, 2, &usReserved[1]);
        off+=2;
        UnpackUINT16BE(off, 2, &usReserved[2]);
        off+=2;
    }
    {    UnpackUINT16BE(off, 2, &usRefIndex); off+=2;}
    {    UnpackUINT16BE(off, 2, &usEncVersion); off+=2;}
    {    UnpackUINT16BE(off, 2, &usEncRevision); off+=2;}
    {    
        UnpackUINT32BE(off, 4, &usEncVendor);	
        off+=4;
    }
    {    UnpackUINT16BE(off, 2, &usChannels);off+=2;}
    {    UnpackUINT16BE(off, 2, &usBitsPerSample);off+=2;}
    {    UnpackUINT16BE(off, 2, &usCompressionId);off+=2;}
    {    UnpackUINT16BE(off, 2, &usPacketSize);off+=2;}
    {    
        ulSamplesPerSec = 0;
        UnpackUINT16BE(off, 2, (UINT16*)&ulSamplesPerSec); 
        off+=4;//skip last 2 bytes;
    }	

    return off;
}

class HXConcatenatePCMPayloadFormat : public HXConcatenatePayloadFormat
{
public:
    static HX_RESULT CreateInstance(REF(IHXPayloadFormatObject*) pPyld);

    /*
     *  IUnknown methods
     */
    STDMETHOD(Close)            (THIS);

    STDMETHOD(SetStreamHeader)  (THIS_
                                IHXValues* pHeader);
    STDMETHOD(GetStreamHeader)  (THIS_
                                REF(IHXValues*) pHeader);
private:
    HXConcatenatePCMPayloadFormat();
    ~HXConcatenatePCMPayloadFormat();

    WAVOPAQUEHEADER m_OpaqueDataWavHeader;
};
#endif /* PCMPYLD_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