Advertisement
Guest User

MKV StereoMode patch proposal 1 for MediaInfo

a guest
Jun 22nd, 2011
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.70 KB | None | 0 0
  1. Index: Source/MediaInfo/File__Analyse_Automatic.h
  2. ===================================================================
  3. --- Source/MediaInfo/File__Analyse_Automatic.h (revision 4091)
  4. +++ Source/MediaInfo/File__Analyse_Automatic.h (working copy)
  5. @@ -426,6 +426,7 @@
  6. Video_Format_Compression,
  7. Video_MultiView_BaseProfile,
  8. Video_MultiView_Count,
  9. + Video_MultiView_MuxingMode,
  10. Video_Format_Settings,
  11. Video_Format_Settings_BVOP,
  12. Video_Format_Settings_BVOP_String,
  13. Index: Source/MediaInfo/MediaInfo_Config_Automatic.cpp
  14. ===================================================================
  15. --- Source/MediaInfo/MediaInfo_Config_Automatic.cpp (revision 4091)
  16. +++ Source/MediaInfo/MediaInfo_Config_Automatic.cpp (working copy)
  17. @@ -3993,6 +3993,7 @@
  18. "Format_Compression;;;N YT;;;Compression mode of the Format\n"
  19. "MultiView_BaseProfile;;;Y NT;;;Multiview, profile of the base stream\n"
  20. "MultiView_Count;;;Y NT;;;Multiview, count of views\n"
  21. + "MultiView_MuxingMode;;;Y NT;;;Multiview, how views are muxed in the container in case this is not muxing in the stream\n"
  22. "Format_Settings;;;N NT;;;Settings needed for decoder used, summary\n"
  23. "Format_Settings_BVOP;;Yes;N YT;;;Settings needed for decoder used, detailled\n"
  24. "Format_Settings_BVOP/String;;;Y NT;;;Settings needed for decoder used, detailled\n"
  25. Index: Source/MediaInfo/Multiple/File_Mk.cpp
  26. ===================================================================
  27. --- Source/MediaInfo/Multiple/File_Mk.cpp (revision 4091)
  28. +++ Source/MediaInfo/Multiple/File_Mk.cpp (working copy)
  29. @@ -103,6 +103,30 @@
  30. }
  31. }
  32.  
  33. +//---------------------------------------------------------------------------
  34. +const char* Mk_StereoMode(int64u StereoMode)
  35. +{
  36. + switch (StereoMode)
  37. + {
  38. + case 0x00 : return "Mono";
  39. + case 0x01 : return "Side by side";
  40. + default : return "Unknown";
  41. + }
  42. +}
  43. +
  44. +//---------------------------------------------------------------------------
  45. +const char* Mk_StereoMode_v2(int64u StereoMode)
  46. +{
  47. + switch (StereoMode)
  48. + {
  49. + case 0x00 : return "Mono";
  50. + case 0x01 : return "Right";
  51. + case 0x02 : return "Left";
  52. + case 0x03 : return "Both";
  53. + default : return "Unknown";
  54. + }
  55. +}
  56. +
  57. //***************************************************************************
  58. // Infos
  59. //***************************************************************************
  60. @@ -132,6 +156,7 @@
  61. DataMustAlwaysBeComplete=false;
  62.  
  63. //Temp
  64. + Format_Version=0;
  65. TimecodeScale=1000000; //Default value
  66. Duration=0;
  67. Cluster_AlreadyParsed=false;
  68. @@ -495,6 +520,8 @@
  69. const int64u Segment_Tracks_TrackEntry_Video_PixelCropTop=0x14BB;
  70. const int64u Segment_Tracks_TrackEntry_Video_PixelHeight=0x3A;
  71. const int64u Segment_Tracks_TrackEntry_Video_PixelWidth=0x30;
  72. + const int64u Segment_Tracks_TrackEntry_Video_StereoMode=0x13B8;
  73. + const int64u Segment_Tracks_TrackEntry_Video_StereoModeBuggy=0x13B9;
  74. const int64u Segment_Tracks_TrackEntry_TrackOverlay=0x2FAB;
  75. const int64u Segment_Tracks_TrackEntry_TrackTranslate=0x2624;
  76. const int64u Segment_Tracks_TrackEntry_TrackTranslate_Codec=0x26BF;
  77. @@ -787,6 +814,7 @@
  78. ATOM(Segment_Tracks_TrackEntry_Video_PixelCropTop)
  79. ATOM(Segment_Tracks_TrackEntry_Video_PixelHeight)
  80. ATOM(Segment_Tracks_TrackEntry_Video_PixelWidth)
  81. + ATOM(Segment_Tracks_TrackEntry_Video_StereoMode)
  82. ATOM_END_MK
  83. ATOM(Segment_Tracks_TrackEntry_TrackOverlay)
  84. LIST(Segment_Tracks_TrackEntry_TrackTranslate)
  85. @@ -908,7 +936,12 @@
  86. Element_Name("DocTypeVersion");
  87.  
  88. //Parsing
  89. - UInteger_Info();
  90. + Format_Version=UInteger_Get();
  91. +
  92. + //Filling
  93. + FILLING_BEGIN();
  94. + Fill(Stream_General, 0, General_Format_Version, _T("Version ")+Ztring::ToZtring(Format_Version));
  95. + FILLING_END();
  96. }
  97.  
  98. //---------------------------------------------------------------------------
  99. @@ -917,7 +950,13 @@
  100. Element_Name("DocTypeReadVersion");
  101.  
  102. //Parsing
  103. - UInteger_Info();
  104. + int64u UInteger=UInteger_Get();
  105. +
  106. + //Filling
  107. + FILLING_BEGIN();
  108. + if (UInteger!=Format_Version)
  109. + Fill(Stream_General, 0, General_Format_Version, _T("Version ")+Ztring::ToZtring(UInteger)); //Adding compatible version for info about legacy decoders
  110. + FILLING_END();
  111. }
  112.  
  113. //---------------------------------------------------------------------------
  114. @@ -1964,6 +2003,7 @@
  115. if (Segment_Tag_SimpleTag_TagNames[0]==_T("MAJOR_BRAND")) return; //QuickTime techinical info, useless
  116. if (Segment_Tag_SimpleTag_TagNames[0]==_T("MINOR_VERSION")) return; //QuickTime techinical info, useless
  117. if (Segment_Tag_SimpleTag_TagNames[0]==_T("ORIGINAL_MEDIA_TYPE")) Segment_Tag_SimpleTag_TagNames[0]=_T("OriginalSourceForm");
  118. + if (Segment_Tag_SimpleTag_TagNames[0]==_T("STEREO_MODE")) return; //Useless
  119. if (Segment_Tag_SimpleTag_TagNames[0]==_T("TERMS_OF_USE")) Segment_Tag_SimpleTag_TagNames[0]=_T("TermsOfUse");
  120. for (size_t Pos=1; Pos<Segment_Tag_SimpleTag_TagNames.size(); Pos++)
  121. {
  122. @@ -2784,6 +2824,21 @@
  123. }
  124.  
  125. //---------------------------------------------------------------------------
  126. +void File_Mk::Segment_Tracks_TrackEntry_Video_StereoMode()
  127. +{
  128. + Element_Name("StereoMode");
  129. +
  130. + //Parsing
  131. + int64u UInteger=UInteger_Get(); Element_Info(Format_Version==2?Mk_StereoMode_v2(UInteger):Mk_StereoMode(UInteger));
  132. +
  133. + //Filling
  134. + FILLING_BEGIN();
  135. + Fill(Stream_Video, StreamPos_Last, Video_MultiView_Count, 2); //Matroska seems to be limited to 2 views
  136. + Fill(Stream_Video, StreamPos_Last, Video_MultiView_MuxingMode, Format_Version==2?Mk_StereoMode_v2(UInteger):Mk_StereoMode(UInteger));
  137. + FILLING_END();
  138. +}
  139. +
  140. +//---------------------------------------------------------------------------
  141. void File_Mk::Segment_Tracks_TrackEntry_TrackOverlay()
  142. {
  143. Element_Name("TrackOverlay");
  144. Index: Source/MediaInfo/Multiple/File_Mk.h
  145. ===================================================================
  146. --- Source/MediaInfo/Multiple/File_Mk.h (revision 4091)
  147. +++ Source/MediaInfo/Multiple/File_Mk.h (working copy)
  148. @@ -222,6 +222,8 @@
  149. void Segment_Tracks_TrackEntry_Video_PixelCropTop();
  150. void Segment_Tracks_TrackEntry_Video_PixelHeight();
  151. void Segment_Tracks_TrackEntry_Video_PixelWidth();
  152. + void Segment_Tracks_TrackEntry_Video_StereoMode();
  153. + void Segment_Tracks_TrackEntry_Video_StereoModeBuggy() {Segment_Tracks_TrackEntry_Video_StereoMode();}
  154. void Segment_Tracks_TrackEntry_TrackOverlay();
  155. void Segment_Tracks_TrackEntry_TrackTranslate();
  156. void Segment_Tracks_TrackEntry_TrackTranslate_Codec();
  157. @@ -297,6 +299,7 @@
  158.  
  159. //Temp
  160. std::vector<Ztring> AttachedFiles;
  161. + int64u Format_Version;
  162. int64u TimecodeScale;
  163. float64 Duration;
  164. int64u TrackNumber;
  165. Index: Source/Ressource/Text/Stream/Video.csv
  166. ===================================================================
  167. --- Source/Ressource/Text/Stream/Video.csv (revision 4086)
  168. +++ Source/Ressource/Text/Stream/Video.csv (working copy)
  169. @@ -22,6 +22,7 @@
  170. Format_Compression;;;N YT;;;Compression mode of the Format
  171. MultiView_BaseProfile;;;Y NT;;;Multiview, profile of the base stream
  172. MultiView_Count;;;Y NT;;;Multiview, count of views
  173. +MultiView_MuxingMode;;;Y NT;;;Multiview, how views are muxed in the container in case this is not muxing in the stream
  174. Format_Settings;;;N NT;;;Settings needed for decoder used, summary
  175. Format_Settings_BVOP;;Yes;N YT;;;Settings needed for decoder used, detailled
  176. Format_Settings_BVOP/String;;;Y NT;;;Settings needed for decoder used, detailled
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement