WMA_ASF.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:5k
- /****************************************************************************************
- * Copyright (c) 2000 ZORAN Corporation, All Rights Reserved
- * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
- *
- * File: $Workfile: WMA_ASF.h $
- *
- * Description:
- * ============
- * Microsoft(r) Advanced-Systems Format for Windows(r) Media Audio
- *
- * Log:
- * ====
- ****************************************************************************************
- * Updates:
- ****************************************************************************************
- * $Log: /I76/I76_Common/I76_Reference/Playcore/Nav_Clips/WMA_ASF.h $
- *
- * 2 11/10/03 11:33a Leonh
- * Get Sampling rate for WMA
- *
- * 1 10/30/02 18:06 Rond
- *
- * 1 11/09/02 15:49 Atai
- *
- * 2 22/08/02 16:05 Nirm
- * - First revision.
- *
- * 1 21/08/02 16:48 Nirm
- ****************************************************************************************/
- #include "Config.h" // Global Configuration - do not remove!
- #ifndef __WMA_ASF_H_
- #define __WMA_ASF_H_
- #include "IncludeSysDefs.h"
- // NOTE: All of the structures MUST be packed, since they represent
- // data-structures resident on the Medium!
- #pragma pack(1)
- /////////////////////////////////////////////////////////////////////////////
- // Constants and Enumerations
- #define GUID_SIZE 16
- #define OBJECT_HEADER_SIZE 24 // THE GUID AND OBJECT SIZE
- #define TYPE_SPECIFIC_DATA_ADD 78//offset in audio stream properties object
- #define HEADER_OBJECT_GUID
- { 0x75b22630L, 0x668e, 0x11cf, { 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c } }
- #define PROPERTIES_OBJECT_GUID
- { 0x8cabdca1L, 0xa947, 0x11cf, { 0x8e, 0xe4, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 } }
- #define STREAM_PROPERTIES_OBJECT_GUID
- { 0xb7dc0791L, 0xa9b7, 0x11cf, { 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 } }
- #define AUDIO_STREAM_PROPERTIES_GUID
- { 0xf8699e40L, 0x5b4d, 0x11cf, { 0xa8, 0xfd, 0x00, 0x80, 0x5f, 0x5c, 0x44, 0x2b } }
- #define CONTENT_DESCRIPTION_OBJECT_GUID
- { 0x75b22633L, 0x668e, 0x11cf, { 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c } }
- #define FORMAT_TAG_WMA 0x0161
- #define FORMAT_TAG_GSM1 0x7A21
- #define FOMRAT_TAG_GSM2 0x7A22
- /////////////////////////////////////////////////////////////////////////////
- // Macros
- #ifdef MOTOROLA
- #define LE_QWORD_LOW(qwLittleEndian) (DWORD)(qwLittleEndian[1])
- #define LE_QWORD_HIGH(qwLittleEndian) (DWORD)(qwLittleEndian[0])
- #else
- #define LE_QWORD_LOW(qwLittleEndian) (DWORD)(qwLittleEndian[0])
- #define LE_QWORD_HIGH(qwLittleEndian) (DWORD)(qwLittleEndian[1])
- #endif //MOTOROLA
- /////////////////////////////////////////////////////////////////////////////
- // Common Structures and Types
- typedef DWORD QWORD[2];
- typedef UINT16 WCHAR;
- typedef struct GUID_TAG {
- UINT32 iInt;
- UINT16 uShort1;
- UINT16 uShort2;
- BYTE aBytes[8];
- } GUID;
- // Base for all Objects
- struct ObjectBase {
- GUID guid;
- QWORD cbSize;
- };
- // Header-Object (ASF-Spec 2.2.1.1)
- typedef struct HeaderObject_TAG {
- GUID guid;
- QWORD cbSize;
- DWORD dwHeadersCnt;
- WORD wReserved;
- } HeaderObject;
- // Properties-Object (ASF-Spec 2.2.2.1)
- typedef struct PropertiesObject_TAG {
- // GUID guid;
- // QWORD cbSize;
- GUID MultimediaSID;
- QWORD cbTotalSize;
- QWORD ulCreated;
- QWORD ulInterleavePacketsCnt;
- QWORD ulPlayDuration;
- QWORD qwSendDuration;
- QWORD ulPreroll;
- DWORD dwFlags;
- DWORD cbMinInterleavePacketSize;
- DWORD cbMaxInterleavePacketSize; // shall always be equal to min_interleave_packet_size
- DWORD ulMaximumBitrate;
- } PropertiesObject;
- #define PROPERTIES_OBJECT_MAX_PKT_SIZE_OFFSET (sizeof(PropertiesObject) - (2*sizeof(DWORD)) + sizeof(GUID) + sizeof(QWORD))
- // Stream Properties Object (ASF-Spec 2.2.3.1)
- typedef struct StreamPropertiesObject_TAG {
- // GUID guid;
- // QWORD cbSize;
- GUID idStreamType;
- GUID idErrorCorrectionType;
- QWORD ulOffset;
- DWORD ulTypeSpecificLength;
- DWORD reserved1;
- WORD wflag;// wStreamNumber;
- DWORD reserved2;
- // BYTE aTypeSpecificData[];
- } StreamPropertiesObject;
- // Audio Type-Specific Data (ASF-Spec 2.2.3.3.2)
- typedef struct WAVEFORMATEX_TAG {
- WORD wFormatTag;
- WORD nChannels;
- DWORD nSamplesPerSec;
- DWORD nAvgBytesPerSec;
- WORD nBlockAlign;
- WORD wBitsPerSample;
- WORD cbSize;
- } WAVEFORMATEX;
- // Content-Description Object (ASF-Spec 2.2.4.1)
- typedef struct ContentDescriptionObject_TAG {
- GUID guid;
- QWORD cbSize;
- WORD uTitleLength;
- WORD uAuthorLength;
- WORD uCopyrightLength;
- WORD uDescriptionLength;
- WORD uRatingLength;
- char szTitle[];
- char szAuthor[];
- char szCopyright[];
- char szDescription[];
- char szRating[];
- } ContentDescriptionObject;
- // Data Section Introduction Object (ASF-Spec 2.3.1)
- typedef struct DataSectionIntroductionObject_TAG {
- BYTE aReserved[50];
- } DataSectionIntroductionObject;
- #pragma pack()
- #endif //__WMA_ASF_H_