int ISampleGrabberCB.SampleCB(double SampleTime, IMediaSample pSample)
        {
            // Make sure we only get called once
            if (!m_GotOne)
            {
                // copy the media sample to a member var
                m_GotOne = true;
                m_ims    = pSample as IMediaSample2;

                // Call all the tests
                TestProperties();
                m_ims = null;

                // Set the completion event so DoTests can return
                m_TestComplete.Set();
            }

            Marshal.ReleaseComObject(pSample);

            return(0);
        }
        /// <summary>
        /// Test all IMediaSampleTest methods
        /// </summary>
        public void DoTests()
        {
            m_graphBuilder = BuildGraph(g_TestFile);

            // All the tests are called in ISampleGrabberCB.SampleCB, since
            // that's where we are when we get the IMediaSample2
            GetSample();

            // All done.  Release everything
            if (m_graphBuilder != null)
            {
                Marshal.ReleaseComObject(m_graphBuilder);
                m_graphBuilder = null;
            }

            if (m_MediaType != null)
            {
                DsUtils.FreeAMMediaType(m_MediaType);
                m_MediaType = null;
            }

            m_ims = null;
        }