WMA_ASF.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:5k
源码类别:

DVD

开发平台:

Others

  1. /****************************************************************************************
  2.  *  Copyright (c) 2000 ZORAN Corporation, All Rights Reserved
  3.  *  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
  4.  *
  5.  *  File: $Workfile: WMA_ASF.h $             
  6.  *
  7.  * Description:
  8.  * ============
  9.  * Microsoft(r) Advanced-Systems Format for Windows(r) Media Audio
  10.  *
  11.  * Log:
  12.  * ====
  13.  ****************************************************************************************
  14.  * Updates:
  15.  ****************************************************************************************
  16.  * $Log: /I76/I76_Common/I76_Reference/Playcore/Nav_Clips/WMA_ASF.h $
  17.  * 
  18.  * 2     11/10/03 11:33a Leonh
  19.  * Get Sampling rate for WMA
  20.  * 
  21.  * 1     10/30/02 18:06 Rond
  22.  * 
  23.  * 1     11/09/02 15:49 Atai
  24.  * 
  25.  * 2     22/08/02 16:05 Nirm
  26.  * - First revision.
  27.  * 
  28.  * 1     21/08/02 16:48 Nirm
  29.  ****************************************************************************************/
  30. #include "Config.h" // Global Configuration - do not remove!
  31. #ifndef __WMA_ASF_H_
  32. #define __WMA_ASF_H_
  33. #include "IncludeSysDefs.h"
  34. // NOTE: All of the structures MUST be packed, since they represent
  35. //  data-structures resident on the Medium!
  36. #pragma pack(1)
  37. /////////////////////////////////////////////////////////////////////////////
  38. // Constants and Enumerations
  39. #define GUID_SIZE 16
  40. #define OBJECT_HEADER_SIZE 24 // THE GUID AND OBJECT SIZE
  41. #define TYPE_SPECIFIC_DATA_ADD 78//offset in audio stream properties object
  42. #define HEADER_OBJECT_GUID
  43. { 0x75b22630L, 0x668e, 0x11cf, { 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c } }
  44. #define PROPERTIES_OBJECT_GUID
  45. { 0x8cabdca1L, 0xa947, 0x11cf, { 0x8e, 0xe4, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 } }
  46. #define STREAM_PROPERTIES_OBJECT_GUID 
  47. { 0xb7dc0791L, 0xa9b7, 0x11cf, { 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 } }
  48. #define AUDIO_STREAM_PROPERTIES_GUID 
  49. { 0xf8699e40L, 0x5b4d, 0x11cf, { 0xa8, 0xfd, 0x00, 0x80, 0x5f, 0x5c, 0x44, 0x2b } }
  50. #define CONTENT_DESCRIPTION_OBJECT_GUID 
  51. { 0x75b22633L, 0x668e, 0x11cf, { 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c } }
  52. #define FORMAT_TAG_WMA 0x0161
  53. #define FORMAT_TAG_GSM1 0x7A21
  54. #define FOMRAT_TAG_GSM2 0x7A22
  55. /////////////////////////////////////////////////////////////////////////////
  56. // Macros
  57. #ifdef MOTOROLA
  58. #define LE_QWORD_LOW(qwLittleEndian) (DWORD)(qwLittleEndian[1])
  59. #define LE_QWORD_HIGH(qwLittleEndian) (DWORD)(qwLittleEndian[0])
  60. #else
  61. #define LE_QWORD_LOW(qwLittleEndian) (DWORD)(qwLittleEndian[0])
  62. #define LE_QWORD_HIGH(qwLittleEndian) (DWORD)(qwLittleEndian[1])
  63. #endif //MOTOROLA
  64. /////////////////////////////////////////////////////////////////////////////
  65. // Common Structures and Types
  66. typedef DWORD QWORD[2];
  67. typedef UINT16 WCHAR;
  68. typedef struct GUID_TAG {
  69. UINT32 iInt;
  70. UINT16 uShort1;
  71. UINT16 uShort2;
  72. BYTE   aBytes[8];
  73. } GUID;
  74. // Base for all Objects
  75. struct ObjectBase {
  76. GUID  guid;
  77. QWORD cbSize;
  78. };
  79. // Header-Object (ASF-Spec 2.2.1.1)
  80. typedef struct HeaderObject_TAG {
  81. GUID  guid;
  82. QWORD cbSize;
  83. DWORD dwHeadersCnt;
  84. WORD  wReserved;
  85. } HeaderObject;
  86. // Properties-Object (ASF-Spec 2.2.2.1)
  87. typedef struct PropertiesObject_TAG {
  88. // GUID  guid;
  89. // QWORD cbSize;
  90. GUID  MultimediaSID;
  91. QWORD cbTotalSize;
  92. QWORD ulCreated;
  93. QWORD ulInterleavePacketsCnt;
  94. QWORD ulPlayDuration;
  95. QWORD qwSendDuration;
  96. QWORD ulPreroll;
  97. DWORD dwFlags;
  98. DWORD cbMinInterleavePacketSize;
  99. DWORD cbMaxInterleavePacketSize; // shall always be equal to min_interleave_packet_size
  100. DWORD ulMaximumBitrate;
  101. } PropertiesObject;
  102. #define PROPERTIES_OBJECT_MAX_PKT_SIZE_OFFSET (sizeof(PropertiesObject) - (2*sizeof(DWORD)) + sizeof(GUID) + sizeof(QWORD))
  103. // Stream Properties Object (ASF-Spec 2.2.3.1)
  104. typedef struct StreamPropertiesObject_TAG {
  105. // GUID  guid;
  106. // QWORD cbSize;
  107. GUID  idStreamType;
  108. GUID  idErrorCorrectionType;
  109. QWORD ulOffset;
  110. DWORD ulTypeSpecificLength;
  111. DWORD reserved1;
  112. WORD wflag;// wStreamNumber;
  113. DWORD reserved2;
  114. // BYTE  aTypeSpecificData[];
  115. } StreamPropertiesObject;
  116. // Audio Type-Specific Data (ASF-Spec 2.2.3.3.2)
  117. typedef struct WAVEFORMATEX_TAG {
  118. WORD  wFormatTag;
  119. WORD  nChannels;
  120. DWORD nSamplesPerSec;
  121. DWORD nAvgBytesPerSec;
  122. WORD  nBlockAlign;
  123. WORD  wBitsPerSample;
  124. WORD  cbSize;
  125. } WAVEFORMATEX;
  126. // Content-Description Object (ASF-Spec 2.2.4.1)
  127. typedef struct ContentDescriptionObject_TAG {
  128. GUID  guid;
  129. QWORD cbSize;
  130. WORD  uTitleLength;
  131. WORD  uAuthorLength;
  132. WORD  uCopyrightLength;
  133. WORD  uDescriptionLength;
  134. WORD  uRatingLength;
  135. char  szTitle[];
  136. char  szAuthor[];
  137. char  szCopyright[];
  138. char  szDescription[];
  139. char  szRating[];
  140. } ContentDescriptionObject;
  141. // Data Section Introduction Object (ASF-Spec 2.3.1)
  142. typedef struct DataSectionIntroductionObject_TAG {
  143. BYTE aReserved[50];
  144. } DataSectionIntroductionObject;
  145. #pragma pack()
  146. #endif //__WMA_ASF_H_