/* * File name: MILEncodeWrapper.cpp * Location: See Matrox Example Launcher in the MIL Control Center * */ // // Copyright (C) Matrox Electronic Systems Ltd., 1992-2020. // All Rights Reserved #include "MILEncodeWrapper.h" MilCompressionWrapper::MilCompressionWrapper(void): m_pMilSequenceEncode(NULL), m_pBaseInterface(NULL) {} MilCompressionWrapper::~MilCompressionWrapper(void) {} ///////////////////////////////////////////////////////////////// // // Class : MilCompressionWrapper // // Name : AllocateFilter // // Synopsis : Create an instance of the Mil Sequence Compression filter // // Returns : HRESULT if success returns S_OK // // Comments : The class queries for both the IMilSequenceEncode and // IBaseFilter interfaces and stores them internally. // ///////////////////////////////////////////////////////////////// HRESULT MilCompressionWrapper::AllocateFilter() { HRESULT hr = E_FAIL; /* Allocate the Mil Sequence Compression Filter.*/ hr = CoCreateInstance(CLSID_MilSequenceEncode, NULL, CLSCTX_INPROC_SERVER, IID_IMilSequenceEncode, (void**)&m_pMilSequenceEncode); if (SUCCEEDED(hr) && m_pMilSequenceEncode) { /* Gets the IBaseFilter Interface. */ hr = m_pMilSequenceEncode->QueryInterface(IID_IBaseFilter, (void**)&m_pBaseInterface); } return hr; } ///////////////////////////////////////////////////////////////// // // Class : MilCompressionWrapper // // Name : ReleaseFilter // // Synopsis : Releases the internally kept Interfaces // ///////////////////////////////////////////////////////////////// void MilCompressionWrapper::ReleaseFilter() { m_pBaseInterface = NULL; m_pMilSequenceEncode = NULL; } ///////////////////////////////////////////////////////////////// // // Class : MilCompressionWrapper // // Name : GetFilterInterface // // Synopsis : Returns the IBaseFilter pointer. // // Returns : IBaseFilter* // // Comments : Reference count is not modified by this function call. // ///////////////////////////////////////////////////////////////// IBaseFilter* MilCompressionWrapper::GetFilterInterface() { return m_pBaseInterface; }