---------------------------------------------------------------------------
| 1715 | |
| 1716 | //--------------------------------------------------------------------------- |
| 1717 | void Mpeg7_Transform_Visual(Node* Parent, MediaInfo_Internal &MI, size_t StreamPos, size_t Extended, size_t Menu_Pos=(size_t)-1) |
| 1718 | { |
| 1719 | Node* Node_VisualCoding=Parent->Add_Child("mpeg7:VisualCoding"); |
| 1720 | |
| 1721 | //ID |
| 1722 | if (Extended) |
| 1723 | Mpeg7_Create_Id(Node_VisualCoding, "visual", StreamPos, Menu_Pos); |
| 1724 | |
| 1725 | //StreamID |
| 1726 | Mpeg7_Create_StreamID(Node_VisualCoding, Extended, MI, Stream_Video, StreamPos); |
| 1727 | |
| 1728 | //Format |
| 1729 | Node* Node_Format=Mpeg7_CS(Node_VisualCoding, "mpeg7:Format", "VisualCodingFormatCS", Mpeg7_VisualCodingFormatCS_termID, VideoCompressionCodeCS_Name, MI, StreamPos); |
| 1730 | if (Node_Format) |
| 1731 | { |
| 1732 | Ztring Value=Mpeg7_Visual_colorDomain(MI, StreamPos); //Algo puts empty string if not known |
| 1733 | if (!Value.empty()) |
| 1734 | Node_Format->Add_Attribute("colorDomain", Value); |
| 1735 | } |
| 1736 | |
| 1737 | //Pixel |
| 1738 | if (!MI.Get(Stream_Video, StreamPos, Video_PixelAspectRatio).empty() |
| 1739 | || !MI.Get(Stream_Video, StreamPos, Video_BitDepth).empty()) |
| 1740 | { |
| 1741 | Node* Node_Pixel=Node_VisualCoding->Add_Child("mpeg7:Pixel"); |
| 1742 | Node_Pixel->Add_Attribute_IfNotEmpty(MI, Stream_Video, StreamPos, Video_PixelAspectRatio, "aspectRatio"); |
| 1743 | Ztring bitsPer=Mpeg7_StripExtraValues(MI.Get(Stream_Video, StreamPos, Video_BitDepth)); |
| 1744 | if (!bitsPer.empty()) |
| 1745 | Node_Pixel->Add_Attribute("bitsPer", bitsPer); |
| 1746 | } |
| 1747 | |
| 1748 | //Frame |
| 1749 | if (!MI.Get(Stream_Video, StreamPos, Video_DisplayAspectRatio).empty() |
| 1750 | || !MI.Get(Stream_Video, StreamPos, Video_Height).empty() |
| 1751 | || !MI.Get(Stream_Video, StreamPos, Video_Width).empty() |
| 1752 | || !MI.Get(Stream_Video, StreamPos, Video_FrameRate).empty() |
| 1753 | || !MI.Get(Stream_Video, StreamPos, Video_FrameRate_Mode).empty() |
| 1754 | || !MI.Get(Stream_Video, StreamPos, Video_ScanType).empty()) |
| 1755 | { |
| 1756 | Node* Node_Frame=Node_VisualCoding->Add_Child("mpeg7:Frame"); |
| 1757 | Node_Frame->Add_Attribute_IfNotEmpty(MI, Stream_Video, StreamPos, Video_DisplayAspectRatio, "aspectRatio"); |
| 1758 | |
| 1759 | Ztring Height=Mpeg7_StripExtraValues(MI.Get(Stream_Video, StreamPos, Video_Height)); |
| 1760 | if (!Height.empty()) |
| 1761 | Node_Frame->Add_Attribute("height", Height); |
| 1762 | |
| 1763 | Ztring Width=Mpeg7_StripExtraValues(MI.Get(Stream_Video, StreamPos, Video_Width)); |
| 1764 | if (!Width.empty()) |
| 1765 | Node_Frame->Add_Attribute("width", Width); |
| 1766 | |
| 1767 | Node_Frame->Add_Attribute_IfNotEmpty(MI, Stream_Video, StreamPos, Video_FrameRate, "rate"); |
| 1768 | |
| 1769 | Ztring Value=MI.Get(Stream_Video, StreamPos, Video_ScanType).MakeLowerCase(); |
| 1770 | if (!Value.empty()) |
| 1771 | { |
| 1772 | if (Value==__T("mbaff") || Value==__T("interlaced")) |
| 1773 | Node_Frame->Add_Attribute("structure", "interlaced"); |
| 1774 | else if (Value==__T("progressive")) |
no test coverage detected