michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #if !defined(RawStructs_h_) michael@0: #define RawStructs_h_ michael@0: michael@0: static const uint32_t RAW_ID = 0x595556; michael@0: michael@0: struct nsRawVideo_PRUint24 { michael@0: operator uint32_t() const { return value[2] << 16 | value[1] << 8 | value[0]; } michael@0: nsRawVideo_PRUint24& operator= (const uint32_t& rhs) michael@0: { value[2] = (rhs & 0x00FF0000) >> 16; michael@0: value[1] = (rhs & 0x0000FF00) >> 8; michael@0: value[0] = (rhs & 0x000000FF); michael@0: return *this; } michael@0: private: michael@0: uint8_t value[3]; michael@0: }; michael@0: michael@0: struct RawPacketHeader { michael@0: typedef nsRawVideo_PRUint24 PRUint24; michael@0: uint8_t packetID; michael@0: PRUint24 codecID; michael@0: }; michael@0: michael@0: // This is Arc's draft from wiki.xiph.org/OggYUV michael@0: struct RawVideoHeader { michael@0: typedef nsRawVideo_PRUint24 PRUint24; michael@0: uint8_t headerPacketID; // Header Packet ID (always 0) michael@0: PRUint24 codecID; // Codec identifier (always "YUV") michael@0: uint8_t majorVersion; // Version Major (breaks backwards compat) michael@0: uint8_t minorVersion; // Version Minor (preserves backwards compat) michael@0: uint16_t options; // Bit 1: Color (false = B/W) michael@0: // Bits 2-4: Chroma Pixel Shape michael@0: // Bit 5: 50% horizontal offset for Cr samples michael@0: // Bit 6: 50% vertical ... michael@0: // Bits 7-8: Chroma Blending michael@0: // Bit 9: Packed (false = Planar) michael@0: // Bit 10: Cr Staggered Horizontally michael@0: // Bit 11: Cr Staggered Vertically michael@0: // Bit 12: Unused (format is always little endian) michael@0: // Bit 13: Interlaced (false = Progressive) michael@0: // Bits 14-16: Interlace options (undefined) michael@0: michael@0: uint8_t alphaChannelBpp; michael@0: uint8_t lumaChannelBpp; michael@0: uint8_t chromaChannelBpp; michael@0: uint8_t colorspace; michael@0: michael@0: PRUint24 frameWidth; michael@0: PRUint24 frameHeight; michael@0: PRUint24 aspectNumerator; michael@0: PRUint24 aspectDenominator; michael@0: michael@0: uint32_t framerateNumerator; michael@0: uint32_t framerateDenominator; michael@0: }; michael@0: michael@0: #endif // RawStructs_h_