You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Doc_BoxAlgorithm_EBMLStreamSpy.dox-part 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /**
  2. * \page BoxAlgorithm_EBMLStreamSpy EBML stream spy
  3. __________________________________________________________________
  4. Detailed description
  5. __________________________________________________________________
  6. * |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Description|
  7. * The purpose of this box is to spy an EBML stream and decode
  8. * its structure to the log manager. In order to do so, the box
  9. * has to know a list of expected EBML node identifiers and EBML
  10. * node types. If you don't know what EBML is, you should check
  11. * the \ref Doc_WhatIsEBML page. The list of expected node
  12. * identifiers and types is collected from a configuration file.
  13. * Also, the author is able to chose which log level to use
  14. * in order to output the information.
  15. *
  16. * Such box is mostly usefull for debug purpose. It allows
  17. * a developper to check what arrives to a box in a human
  18. * readable way.
  19. * |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Description|
  20. __________________________________________________________________
  21. Inputs description
  22. __________________________________________________________________
  23. * |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Inputs|
  24. * This box can receive as many input as necessary. All the inputs
  25. * will be of type \ref Doc_Streams_EBMLStream in order to
  26. * be parsed by this the reader.
  27. * |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Inputs|
  28. * |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Input1|
  29. * This is the default input of this box.
  30. * |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Input1|
  31. __________________________________________________________________
  32. Settings description
  33. __________________________________________________________________
  34. * |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Settings|
  35. * |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Settings|
  36. * |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Setting1|
  37. * This first setting indicates where to find the configuration file.
  38. * The box comes with a default configuration file containing all the
  39. * default node identifiers of BRAND_NAME. You should extend this
  40. * configuration in order to add your own EBML nodes in case you
  41. * have created new EBML stream types.
  42. * |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Setting1|
  43. * |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Setting2|
  44. * This second settings indicates what log level will be used to
  45. * print the EBML stream structure.
  46. * |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Setting2|
  47. __________________________________________________________________
  48. Examples description
  49. __________________________________________________________________
  50. * |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Examples|
  51. * As an example, we could connect an EBML stream spy to a sinus
  52. * oscillator. Leave the default sinus oscillator settings to their
  53. * default, except the sample count per buffer can be set to 8 for the
  54. * example. Chose an appropriate log level for the EBML stream spy and
  55. * press 'start'. You will probably notice that a lot of text is sent
  56. * to the log manager, making the use of this box difficult in real time.
  57. * Once again, consider it as a debugging box.
  58. *
  59. * The output should look like this :
  60. \verbatim
  61. [ INF ] <Box algorithm::EBML stream spy>
  62. [ INF ] <Box algorithm::EBML stream spy> For input Spied EBML stream 1 of type EBML stream :
  63. [ INF ] <Box algorithm::EBML stream spy> For chunk [id:0 (0x0)] at [time:(0x00000000, 0x00000000),(0x00000000, 0x00000000)]
  64. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x002b395f, 0x108adfae)]-[name:OVTK_NodeId_Header]
  65. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00cdd0f7, 0x46b0278d)]-[name:OVTK_NodeId_Header_StreamType]-[type:uinteger]-[value:0 (0x0)]
  66. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x006f5a08, 0x7796ebc5)]-[name:OVTK_NodeId_Header_StreamVersion]-[type:uinteger]-[value:0 (0x0)]
  67. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x007855de, 0x3748d375)]-[name:OVTK_NodeId_Header_Signal]
  68. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00141c43, 0x0c37006b)]-[name:OVTK_NodeId_Header_Signal_Sampling]-[type:uinteger]-[value:512 (0x200)]
  69. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x0072f560, 0x7ed2cbed)]-[name:OVTK_NodeId_Header_StreamedMatrix]
  70. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x003febd4, 0x2725d428)]-[name:OVTK_NodeId_Header_StreamedMatrix_DimensionCount]-[type:uinteger]-[value:2 (0x2)]
  71. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x0000e3c0, 0x3a7d5141)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension]
  72. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x001302f7, 0x36d8438a)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Size]-[type:uinteger]-[value:4 (0x4)]
  73. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:Channel 0]
  74. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:Channel 1]
  75. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:Channel 2]
  76. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:Channel 3]
  77. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x0000e3c0, 0x3a7d5141)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension]
  78. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x001302f7, 0x36d8438a)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Size]-[type:uinteger]-[value:8 (0x8)]
  79. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
  80. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
  81. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
  82. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
  83. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
  84. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
  85. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
  86. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00153e40, 0x190227e0)]-[name:OVTK_NodeId_Header_StreamedMatrix_Dimension_Label]-[type:string]-[value:]
  87. [ INF ] <Box algorithm::EBML stream spy>
  88. [ INF ] <Box algorithm::EBML stream spy>
  89. [ INF ] <Box algorithm::EBML stream spy> For input Spied EBML stream 1 of type EBML stream :
  90. [ INF ] <Box algorithm::EBML stream spy> For chunk [id:0 (0x0)] at [time:(0x00000000, 0x00000000),(0x00000000, 0x04000000)]
  91. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00cf2101, 0x02375310)]-[name:OVTK_NodeId_Buffer]
  92. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00120663, 0x08fbc165)]-[name:OVTK_NodeId_Buffer_StreamedMatrix]
  93. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00b18c10, 0x427d098c)]-[name:OVTK_NodeId_Buffer_StreamedMatrix_RawBuffer]-[type:binary]-[bytes:256 (0x100)]
  94. [ INF ] <Box algorithm::EBML stream spy>
  95. [ INF ] <Box algorithm::EBML stream spy>
  96. [ INF ] <Box algorithm::EBML stream spy> For input Spied EBML stream 1 of type EBML stream :
  97. [ INF ] <Box algorithm::EBML stream spy> For chunk [id:0 (0x0)] at [time:(0x00000000, 0x04000000),(0x00000000, 0x08000000)]
  98. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00cf2101, 0x02375310)]-[name:OVTK_NodeId_Buffer]
  99. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00120663, 0x08fbc165)]-[name:OVTK_NodeId_Buffer_StreamedMatrix]
  100. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00b18c10, 0x427d098c)]-[name:OVTK_NodeId_Buffer_StreamedMatrix_RawBuffer]-[type:binary]-[bytes:256 (0x100)]
  101. [ INF ] <Box algorithm::EBML stream spy>
  102. [ INF ] <Box algorithm::EBML stream spy>
  103. [ INF ] <Box algorithm::EBML stream spy> For input Spied EBML stream 1 of type EBML stream :
  104. [ INF ] <Box algorithm::EBML stream spy> For chunk [id:0 (0x0)] at [time:(0x00000000, 0x08000000),(0x00000000, 0x0c000000)]
  105. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00cf2101, 0x02375310)]-[name:OVTK_NodeId_Buffer]
  106. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00120663, 0x08fbc165)]-[name:OVTK_NodeId_Buffer_StreamedMatrix]
  107. [ INF ] <Box algorithm::EBML stream spy> Opened EBML node [id:(0x00b18c10, 0x427d098c)]-[name:OVTK_NodeId_Buffer_StreamedMatrix_RawBuffer]-[type:binary]-[bytes:256 (0x100)]
  108. [ INF ] <Box algorithm::EBML stream spy>
  109. ...
  110. \endverbatim
  111. *
  112. * Now let's try to understand what is produced. First we notice a clear
  113. * separation between the different chunk the box receives. In each chunk, we
  114. * have an EBML hierarchy with the different nodes. Here we analyse a signal
  115. * stream so we have a header followed by multiple buffers.
  116. *
  117. * Concerning the header, we can focuse on the signal header part and
  118. * the streamed matrix header part. In the first one, we can see that the sampling
  119. * rate node appears as an integer with value 512 (the default sinus oscillator
  120. * sampling frequency). The second one contains the description of the streamed
  121. * matrix. The matrix has two dimensions (electrodes and sample count per buffer).
  122. * The first dimension has a size of 4 (the default sinus oscillator channel count)
  123. * and each of this channel has a label (channel 0-3). Finally, the second dimension
  124. * has a size of 8 (the sample count per buffer you manually put in the sinus
  125. * oscillator configuration) and the samples themselves do not have a name.
  126. *
  127. * Now looking at the buffer, we only have the streamed matrix part (signal
  128. * stream do not produce signal specific buffer). The buffer content can not
  129. * be displayed in the console (it could be a huge amount of binary non human
  130. * readable data, so it is not relevant to print it). But you have an information
  131. * of the size of this buffer. 256 is exactly the number of channels (4) multiplied
  132. * by the number of samples per buffer (8) multiplied by the size of a single sample
  133. * (8 because a sample is coded on a 64 bits float).
  134. *
  135. * When familiar with EBML and OpenViBE streams, this box is a strong tool
  136. * to analyze what is sent from a box to another.
  137. * |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Examples|
  138. __________________________________________________________________
  139. Miscellaneous description
  140. __________________________________________________________________
  141. * |OVP_DocBegin_BoxAlgorithm_EBMLStreamSpy_Miscellaneous|
  142. * The syntax of the configuration file is simple. Each line of the file
  143. * should contain 3 fields. The first field is the name of the EBML node
  144. * that should be printed in the log manager (this is human readable).
  145. * The second field is the EBML node identifier. The last field is the node
  146. * type. Several types are supported :
  147. * - \e master : this means that this node does not have data attached but has
  148. * several children. Any non master node is a leaf, so can contain data.
  149. * - \e integer : this means that this node contains a signed integer value
  150. * - \e uinteger : this means that this node contains an unsigned integer value
  151. * - \e string : this means that this node contains an ASCII string value
  152. * - \e float : this means that this node contains a floating point value
  153. * - \e binary : this means that this node contains a raw buffer of elements.
  154. * In such case, only the size of the buffer is printed. The content of the
  155. * buffer is not printed.
  156. *
  157. * Any node identifier found in the stream and not present in the configuration
  158. * file will be considered of type \e unknown and treated as if it was a \e binary
  159. * node.
  160. *
  161. * Following is a part of the sample configuration file to illustrate the syntax :
  162. \verbatim
  163. ...
  164. OVTK_NodeId_Header_StreamedMatrix EBML::CIdentifier(0x0072F560, 0x7ED2CBED) master
  165. OVTK_NodeId_Header_StreamedMatrix_DimensionCount EBML::CIdentifier(0x003FEBD4, 0x2725D428) uinteger
  166. OVTK_NodeId_Header_StreamedMatrix_Dimension EBML::CIdentifier(0x0000E3C0, 0x3A7D5141) master
  167. OVTK_NodeId_Header_StreamedMatrix_Dimension_Size EBML::CIdentifier(0x001302F7, 0x36D8438A) uinteger
  168. OVTK_NodeId_Header_StreamedMatrix_Dimension_Label EBML::CIdentifier(0x00153E40, 0x190227E0) string
  169. OVTK_NodeId_Buffer_StreamedMatrix EBML::CIdentifier(0x00120663, 0x08FBC165) master
  170. OVTK_NodeId_Buffer_StreamedMatrix_RawBuffer EBML::CIdentifier(0x00B18C10, 0x427D098C) binary
  171. OVTK_NodeId_Header_Signal EBML::CIdentifier(0x007855DE, 0x3748D375) master
  172. OVTK_NodeId_Header_Signal_Sampling EBML::CIdentifier(0x00141C43, 0x0C37006B) uinteger
  173. ...
  174. \endverbatim
  175. * |OVP_DocEnd_BoxAlgorithm_EBMLStreamSpy_Miscellaneous|
  176. */