Ejemplo n.º 1
0
        private void TestCodec()
        {
            int c1, c2;

            m_head.GetCodecInfoCount(out c1);
            m_head.AddCodecInfo("moo", "fooit", CodecInfoType.Unknown, 0, new byte[0]);
            m_head.GetCodecInfoCount(out c2);

            Debug.Assert(c2 == c1 + 1);
        }
Ejemplo n.º 2
0
        //------------------------------------------------------------------------------
        // Name: CWMVCopy:CopyCodecInfo()
        // Desc: Copies codec information from the reader header to the writer header.
        //------------------------------------------------------------------------------
        protected void CopyCodecInfo()
        {
            int           cCodecInfo;
            StringBuilder pwszName        = null;
            StringBuilder pwszDescription = null;

            byte[]         pbCodecInfo        = null;
            IWMHeaderInfo3 pReaderHeaderInfo3 = null;
            IWMHeaderInfo3 pWriterHeaderInfo3 = null;

            pReaderHeaderInfo3 = m_pReaderHeaderInfo as IWMHeaderInfo3;

            pWriterHeaderInfo3 = m_pWriterHeaderInfo as IWMHeaderInfo3;

            pReaderHeaderInfo3.GetCodecInfoCount(out cCodecInfo);

            for (int i = 0; i < cCodecInfo; i++)
            {
                CodecInfoType enumCodecType;
                short         cchName        = 0;
                short         cchDescription = 0;
                short         cbCodecInfo    = 0;

                //
                // Get codec info from the source
                //
                pReaderHeaderInfo3.GetCodecInfo(i, ref cchName, null,
                                                ref cchDescription, null, out enumCodecType,
                                                ref cbCodecInfo, null);

                pwszName        = new StringBuilder(cchName);
                pwszDescription = new StringBuilder(cchDescription);
                pbCodecInfo     = new byte[cbCodecInfo];

                pReaderHeaderInfo3.GetCodecInfo(i, ref cchName, pwszName,
                                                ref cchDescription, pwszDescription, out enumCodecType,
                                                ref cbCodecInfo, pbCodecInfo);

                //
                // Add the codec info to the writer
                //
                pWriterHeaderInfo3.AddCodecInfo(pwszName.ToString(),
                                                pwszDescription.ToString(),
                                                enumCodecType,
                                                cbCodecInfo, pbCodecInfo);
            }
        }