Esempio n. 1
0
        /// <summary>
        /// Given a byte[] (in the form of a BufferChunk) containing a MediaType received from WM Interop, and an
        /// allocated instance of MediaType, fill in the MediaType from the byte[].  This is just the
        /// payload-independant part.
        /// </summary>
        /// <param name="mt"></param>
        /// <param name="bc"></param>
        public static void ReconstituteBaseMediaType(MediaType mt, BufferChunk bc)
        {
            Guid g = NextGuid(bc);

            mt.MajorType    = MediaType.MajorTypeGuidToEnum(g);
            mt.mt.majortype = g;
            g                      = NextGuid(bc);
            mt.SubType             = MediaType.SubTypeGuidToEnum(g);
            mt.mt.subtype          = g;
            mt.FixedSizeSamples    = (NextInt32(bc) == 0)?false:true;
            mt.TemporalCompression = (NextInt32(bc) == 0)?false:true;
            mt.SampleSize          = NextInt32(bc);
            g                      = NextGuid(bc);
            mt.FormatType          = MediaType.FormatTypeGuidToEnum(g);
            mt.mt.formattype       = g;
            IntPtr punk     = (IntPtr)NextInt32(bc);
            int    cbformat = NextInt32(bc);
            IntPtr pbformat = (IntPtr)NextInt32(bc);             //This not a valid pointer in this context.
        }