Skip to content
Browse files

- Removed dvblib.dll from DS filters project

- Final rename to B2C2
  • Loading branch information...
1 parent c1460ab commit 8b563bc2b48b753059053e99b06d6579e497de5e @MisterD81 MisterD81 committed Feb 25, 2012
Showing with 7 additions and 3,597 deletions.
  1. +0 −8 DirectShowFilters/Filters.sln
  2. +0 −1,028 DirectShowFilters/dvblib/Source/B2C2MPEG2AdapterWin.cpp
  3. +0 −63 DirectShowFilters/dvblib/Source/Include/B2C2_Guids.h
  4. +0 −49 DirectShowFilters/dvblib/Source/Include/IB2C2MPEG2DataPin.h
  5. +0 −194 DirectShowFilters/dvblib/Source/Include/b2c2_defs.h
  6. +0 −189 DirectShowFilters/dvblib/Source/Include/b2c2mpeg2adapter.h
  7. +0 −155 DirectShowFilters/dvblib/Source/Include/ib2c2mpeg2avctrl.h
  8. +0 −230 DirectShowFilters/dvblib/Source/Include/ib2c2mpeg2datactrl.h
  9. +0 −245 DirectShowFilters/dvblib/Source/Include/ib2c2mpeg2tunerctrl.h
  10. +0 −16 DirectShowFilters/dvblib/Source/Resource.h
  11. BIN DirectShowFilters/dvblib/Source/dvblib.aps
  12. +0 −936 DirectShowFilters/dvblib/Source/dvblib.cpp
  13. +0 −21 DirectShowFilters/dvblib/Source/dvblib.def
  14. +0 −94 DirectShowFilters/dvblib/Source/dvblib.h
  15. +0 −115 DirectShowFilters/dvblib/Source/dvblib.rc
  16. +0 −13 DirectShowFilters/dvblib/Source/res/dvblib.rc2
  17. +0 −24 DirectShowFilters/dvblib/Source/stdafx.cpp
  18. +0 −37 DirectShowFilters/dvblib/Source/stdafx.h
  19. BIN DirectShowFilters/dvblib/bin/Debug/dvblib.dll
  20. BIN DirectShowFilters/dvblib/bin/Debug/dvblib.pdb
  21. BIN DirectShowFilters/dvblib/bin/Debug/vc100.pdb
  22. BIN DirectShowFilters/dvblib/bin/Release/dvblib.dll
  23. +0 −173 DirectShowFilters/dvblib/dvblib.vcxproj
  24. 0 TvEngine3/TVLibrary/TVLibrary/Implementations/DVB/Graphs/{SS2 → B2C2}/DeivceInfo.cs
  25. 0 TvEngine3/TVLibrary/TVLibrary/Implementations/DVB/Graphs/{SS2 → B2C2}/EnumsB2C2.cs
  26. 0 TvEngine3/TVLibrary/TVLibrary/Implementations/DVB/Graphs/{SS2 → B2C2}/IB2C2MPEG2AVCtrl3.cs
  27. 0 TvEngine3/TVLibrary/TVLibrary/Implementations/DVB/Graphs/{SS2 → B2C2}/IB2C2MPEG2DataCtrl6.cs
  28. 0 TvEngine3/TVLibrary/TVLibrary/Implementations/DVB/Graphs/{SS2 → B2C2}/IB2C2MPEG2TunerCtrl4.cs
  29. 0 TvEngine3/TVLibrary/TVLibrary/Implementations/DVB/Graphs/{SS2 → B2C2}/StructB2C2.cs
  30. 0 TvEngine3/TVLibrary/TVLibrary/Implementations/DVB/Graphs/{SS2 → B2C2}/TvCardDvbB2C2.cs
  31. +7 −7 TvEngine3/TVLibrary/TVLibrary/TVLibrary.csproj
View
8 DirectShowFilters/Filters.sln
@@ -20,8 +20,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MPAudioSwitcher", "MPAudios
{E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA} = {E8A3F6FA-AE1C-4C8E-A0B6-9C8480324EAA}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dvblib", "dvblib\dvblib.vcxproj", "{0DD8968F-A6F6-4365-9CC1-9CF87A76178B}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TsMuxer", "TsMuxer\TsMuxer.vcxproj", "{8AC0B595-EB93-4CBE-BEC7-E4A3D65DF3A6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dxerr9", "DXErr9\dxerr9.vcxproj", "{1FC036DE-1148-45E1-ADD3-FE1B20B652A7}"
@@ -92,12 +90,6 @@ Global
{D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Release|Win32.Build.0 = Release|Win32
{D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Release|x64.ActiveCfg = Release|x64
{D8DB3E7E-D50E-4EC3-A9B9-DAD18F5FE466}.Release|x64.Build.0 = Release|x64
- {0DD8968F-A6F6-4365-9CC1-9CF87A76178B}.Debug|Win32.ActiveCfg = Debug|Win32
- {0DD8968F-A6F6-4365-9CC1-9CF87A76178B}.Debug|Win32.Build.0 = Debug|Win32
- {0DD8968F-A6F6-4365-9CC1-9CF87A76178B}.Debug|x64.ActiveCfg = Debug|Win32
- {0DD8968F-A6F6-4365-9CC1-9CF87A76178B}.Release|Win32.ActiveCfg = Release|Win32
- {0DD8968F-A6F6-4365-9CC1-9CF87A76178B}.Release|Win32.Build.0 = Release|Win32
- {0DD8968F-A6F6-4365-9CC1-9CF87A76178B}.Release|x64.ActiveCfg = Release|Win32
{8AC0B595-EB93-4CBE-BEC7-E4A3D65DF3A6}.Debug|Win32.ActiveCfg = Debug|Win32
{8AC0B595-EB93-4CBE-BEC7-E4A3D65DF3A6}.Debug|Win32.Build.0 = Debug|Win32
{8AC0B595-EB93-4CBE-BEC7-E4A3D65DF3A6}.Debug|x64.ActiveCfg = Debug|Win32
View
1,028 DirectShowFilters/dvblib/Source/B2C2MPEG2AdapterWin.cpp
@@ -1,1028 +0,0 @@
-/*
- * Copyright (C) 2005-2008 Team MediaPortal
- * Author: Agree
- * http://www.team-mediaportal.com
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Make; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-#include "stdafx.h"
-#include <stdio.h>
-
-#include "Include\b2c2_defs.h"
-
-#include <tchar.h>
-#include <Dshow.h>
-#include <initguid.h>
-#include "Include\B2C2_Guids.h"
-
-#if defined _B2C2_USE_DEVICE_NOTIFICATION
-
- #if WINVER < 0x0500
- #error WINVER >= 0x0500 must be defined at project settings in combination with _B2C2_USE_DEVICE_NOTIFICATION
- #endif // WINVER < 0x0500
-
- #include <Winuser.h>
- #include <ndisguid.h>
-
- #ifdef UNICODE
- #define REGISTERDEVICENOTIFY TEXT ("RegisterDeviceNotificationW")
- #else
- #define REGISTERDEVICENOTIFY "RegisterDeviceNotificationA"
- #endif
-
- #define UNREGISTERDEVICENOTIFY "UnregisterDeviceNotification"
-
- #define TRACE_NOTIFICATION printf
-
-#endif //defined _B2C2_USE_DEVICE_NOTIFICATION
-
-#include "Include\b2c2mpeg2adapter.h"
-
-#include "Include\ib2c2mpeg2tunerctrl.h"
-#include "Include\ib2c2mpeg2datactrl.h"
-#include "Include\ib2c2mpeg2avctrl.h"
-
-B2C2MPEG2Adapter::B2C2MPEG2Adapter (const TCHAR *pszAdapterName )
-{
- memset (&m_szLastErrorText, 0, sizeof (m_szLastErrorText));
- m_dwLastErrorCode = 0;
-
- // Initialize COM.
- CoInitialize(NULL);
-
- m_pFilterGraph = NULL;
- m_pFilter = NULL;
-
- m_pPinOutAudio = NULL;
- m_pPinOutVideo = NULL;
-
- m_pMediaControl = NULL;
- m_pMediaEvent= NULL;
-
- m_pIB2C2MPEG2TunerCtrl = NULL;
- m_pIB2C2MPEG2DataCtrl = NULL;
- m_pIB2C2MPEG2AvCtrl = NULL;
-
- for (int iCnt = 0; iCnt < B2C2_FILTER_MAX_TS_PINS; iCnt++)
- {
- m_pTsPinFilter[iCnt] = NULL;
- m_pTsPinInterfaceFilter[iCnt] = NULL;
- m_pTsOutPin[iCnt] = NULL;
- m_pTsFilterInPin[iCnt] = NULL;
- }
-
-#if defined _B2C2_USE_DEVICE_NOTIFICATION
- m_hDevNotify = NULL; // Because RegisterDeviceNotification returns NULL as error
- m_hUser32Dll = NULL; // Because LoadLibrary returns NULL as error
-#endif //defined _B2C2_USE_DEVICE_NOTIFICATION
-}
-
-B2C2MPEG2Adapter::~B2C2MPEG2Adapter ()
-{
- Release ();
-
- // Tear down COM.
-
- CoUninitialize ();
-}
-
-HRESULT B2C2MPEG2Adapter::Initialize ()
-{
- HRESULT hr;
-
- // **********************************************************************
- // *** Set up the Filter Graph
- // **********************************************************************
-
- hr = CoCreateInstance (CLSID_FilterGraph,
- NULL,
- CLSCTX_INPROC,
- IID_IGraphBuilder,
- (void**) &m_pFilterGraph);
-
- if (FAILED (hr))
- {
- SetLastError (TEXT ("Create Filter Graph"), hr);
- return hr;
- }
-
- // Create B2C2 Filter, which is the upstream source filter.
-
- hr = CoCreateInstance (CLSID_B2C2MPEG2Filter,
- NULL,
- CLSCTX_INPROC,
- IID_IBaseFilter,
- (void **)&m_pFilter);
-
- if (FAILED (hr))
- {
- SetLastError (TEXT ("Create B2C2 MPEG2 Filter"), hr);
- return hr;
- }
-
- // Add B2C2 Filter to Filter Graph:
-
- hr = m_pFilterGraph->AddFilter (m_pFilter, L"B2C2-Filter");
-
- if (FAILED (hr))
- {
- SetLastError (TEXT ("Add B2C2 Filter to Filter Graph"), hr);
- return hr;
- }
-
- // Get Filter Data Control interface.
-
- hr = m_pFilter->QueryInterface (IID_IB2C2MPEG2DataCtrl3, (VOID **)&m_pIB2C2MPEG2DataCtrl);
-
- if (FAILED (hr))
- {
- SetLastError (TEXT ("Query Interface IID_IB2C2MPEG2DataCtrl3"), hr);
- return hr;
- }
-
- // **********************************************************************
- // *** Configure tuner
- // **********************************************************************
-
- // Get B2C2 Filter Tuner Control interface in preparation for tuning.
-
- hr = m_pFilter->QueryInterface (IID_IB2C2MPEG2TunerCtrl2, (VOID **)&m_pIB2C2MPEG2TunerCtrl);
-
- if (FAILED (hr))
- {
- SetLastError (TEXT ("Query Interface IID_IB2C2MPEG2TunerCtrl2"), hr);
- return hr;
- }
-
- // Initialize the tuner
-
- hr = m_pIB2C2MPEG2TunerCtrl->Initialize ();
-
- if (FAILED (hr))
- {
- SetLastError (TEXT ("Initialize Tuner Control"), hr);
- return hr;
- }
-
- // Get Filter Audio/Video Control interface.
-
- hr = m_pFilter->QueryInterface (IID_IB2C2MPEG2AVCtrl, (VOID **)&m_pIB2C2MPEG2AvCtrl);
-
- if (FAILED (hr))
- {
- SetLastError (TEXT ("Query Interface IID_IB2C2MPEG2AVCtrl"), hr);
- return hr;
- }
-
- // **********************************************************************
- // *** Validate member creation
- // **********************************************************************
-
- if ( m_pIB2C2MPEG2TunerCtrl == NULL
- || m_pIB2C2MPEG2DataCtrl == NULL
- || m_pIB2C2MPEG2AvCtrl == NULL)
- {
- SetLastError (TEXT ("Internal Error, initialize"), B2C2_SDK_E_CREATE_INTERFACE);
- return B2C2_SDK_E_CREATE_INTERFACE;
- }
-
- // This must be here; to read tuner settings.
-
- m_pIB2C2MPEG2TunerCtrl->CheckLock ();
-
- /*
- BOOL bLock = !FAILED (m_pIB2C2MPEG2TunerCtrl->CheckLock());
- TRACE (TEXT ("Broadband4PC is %s lock!\n"), bLock ? TEXT ("in") : TEXT ("out of"));
- */
-
- return S_OK;
-}
-
-// This function will enumerate all pins at once,
-// therefore need only to be called once per filter lifetime
-// Pins will be released at Release ().
-
-HRESULT B2C2MPEG2Adapter::EnumerateFilterPins(BOOL bAudoPin /*= TRUE*/,
- BOOL bVideoPin /*= TRUE*/,
- BOOL bTsPins /*= TRUE*/)
-{
- HRESULT hr;
-
- IEnumPins *pEnum;
- PIN_INFO pin_Info;
- IPin * pPinOut = NULL;
-
- char szPinName[128]; // from SDK, strmif.h; PIN_INFO::achName[ 128 ]
- char szTsPinName[10];
-
- // Check if already initialized; got filter
-
- if (m_pFilter == NULL)
- {
- SetLastError (TEXT ("Not Initialize, enumerate pins"), B2C2_SDK_E_NOT_INITIALIZED);
- return B2C2_SDK_E_NOT_INITIALIZED; // *** FUNCTION EXIT POINT
- }
-
- // Locate B2C2 Filter Audio and Video pins:
-
- // 1) Get list of filter's pins.
-
- hr = m_pFilter->EnumPins(&pEnum);
-
- if(FAILED (hr))
- {
- SetLastError (TEXT ("Enumerate B2C2 Filter pins"), hr);
- return hr; // *** FUNCTION EXIT POINT
- }
-
- // 2) Locate Audio and Video pins.
-
- while(pEnum->Next(1, &pPinOut, NULL) == S_OK)
- {
- hr = pPinOut->QueryPinInfo(&pin_Info);
-
- if (pin_Info.pFilter != NULL)
- {
- pin_Info.pFilter->Release();
- }
-
- if(FAILED (hr))
- {
- continue;
- }
-
- if(pin_Info.dir != PINDIR_OUTPUT)
- {
- continue;
- }
-
- wcstombs (szPinName, pin_Info.achName, sizeof (szPinName));
-
- BOOL bPinUsed = FALSE;
-
- // Check for TS pins first
-
- if (bTsPins)
- {
- for (int iCnt = 0; iCnt < B2C2_FILTER_MAX_TS_PINS; iCnt++)
- {
- sprintf (szTsPinName,"Data %d",iCnt);
-
- if ( m_pTsOutPin[iCnt] == NULL
- && bTsPins
- && strstr (szPinName, szTsPinName) != NULL)
- {
- m_pTsOutPin[iCnt] = pPinOut;
- bPinUsed = TRUE;
- break; // Don't need to go to next pin
- }
- }
- }
-
- if (bPinUsed)
- {
- }
- else
- // Check if Audio PIN; if still 'missing'
- if ( m_pPinOutAudio == NULL
- && bAudoPin
- && strstr (szPinName, "Audio") != NULL)
- {
- m_pPinOutAudio = pPinOut;
- }
- else
- // Check if Video PIN; if still 'missing'
- if ( m_pPinOutVideo == NULL
- && bVideoPin
- && strstr (szPinName, "Video") != NULL)
- {
- m_pPinOutVideo = pPinOut;
- }
- else
- {
- // No PIN of interest, or don't need this reference,
- // so decrease the counter
- pPinOut->Release();
- }
-
- // See if we got all we need; for AV pins only
- if ( !bTsPins
- && bVideoPin && m_pPinOutVideo
- && bAudoPin && m_pPinOutAudio)
- {
- break; // Got both pins.
- }
- }
-
- pEnum->Release();
-
- return S_OK;
-}
-
-HRESULT B2C2MPEG2Adapter::GetAudioVideoOutPins(IPin **ppPinOutAudio, IPin **ppPinOutVideo)
-{
- HRESULT hr;
-
- // Check if already initialized; got filter
-
- if (m_pFilter == NULL)
- {
- SetLastError (TEXT ("Not Initialize, enumerate B2C2 Filter AV pins"), B2C2_SDK_E_NOT_INITIALIZED);
- return B2C2_SDK_E_NOT_INITIALIZED; // *** FUNCTION EXIT POINT
- }
-
- // Do we already have all pins requested?
-
- if ( (ppPinOutVideo && m_pPinOutVideo == NULL)
- || (ppPinOutAudio && m_pPinOutAudio == NULL))
- {
- // Locate B2C2 Filter Audio and Video pins:
-
- hr = EnumerateFilterPins (ppPinOutAudio != NULL, ppPinOutVideo != NULL, FALSE);
-
- if (FAILED (hr))
- {
- // Last error has already been set at EnumerateFilterPins ()
- return hr; // *** FUNCTION EXIT POINT
- }
- }
-
- // Return the pins.
-
- if (ppPinOutVideo)
- {
- *ppPinOutVideo = m_pPinOutVideo;
- }
-
- if (ppPinOutAudio)
- {
- *ppPinOutAudio = m_pPinOutAudio;
- }
-
- return S_OK;
-}
-
-HRESULT B2C2MPEG2Adapter::GetMediaControl(IMediaControl **ppMediaControl)
-{
- HRESULT hr;
-
- // Check if already initialized; got FilterGraph
-
- if (m_pFilterGraph == NULL)
- {
- SetLastError (TEXT ("Not Initialize, query Media Control"), B2C2_SDK_E_NOT_INITIALIZED);
- return B2C2_SDK_E_NOT_INITIALIZED; // *** FUNCTION EXIT POINT
- }
-
- // Check if Media Control was already queried
-
- if (!m_pMediaControl)
- {
- hr = m_pFilterGraph->QueryInterface (IID_IMediaControl, (void **)&m_pMediaControl);
-
- if (FAILED (hr))
- {
- SetLastError (TEXT ("Query Interface IID_IMediaControl"), hr);
- return hr; // *** FUNCTION EXIT POINT
- }
- }
-
- // Return the Media Control
-
- if (ppMediaControl)
- {
- *ppMediaControl = m_pMediaControl;
- }
-
- return S_OK;
-}
-
-HRESULT B2C2MPEG2Adapter::GetMediaEvent(IMediaEvent **ppMediaEvent)
-{
- HRESULT hr;
-
- // Check if already initialized; got FilterGraph
-
- if (m_pFilterGraph == NULL)
- {
- SetLastError (TEXT ("Not Initialize; query Media Event"), B2C2_SDK_E_NOT_INITIALIZED);
- return B2C2_SDK_E_NOT_INITIALIZED; // *** FUNCTION EXIT POINT
- }
-
- // Check if Media Event was already queried
-
- if (!m_pMediaEvent)
- {
- hr = m_pFilterGraph->QueryInterface(IID_IMediaEvent, (void **)&m_pMediaEvent);
-
- if (FAILED (hr))
- {
- SetLastError (TEXT ("Query Interface IID_IMediaEvent"), hr);
- return hr; // *** FUNCTION EXIT POINT
- }
- }
-
- // Return the Media Event
-
- if (ppMediaEvent)
- {
- *ppMediaEvent = m_pMediaEvent;
- }
-
- return S_OK;
-}
-
-HRESULT B2C2MPEG2Adapter::CreateTsFilter (int nPin,
- REFCLSID refCLSID,
- IBaseFilter **ppCustomFilter /* = NULL*/)
-{
- HRESULT hr;
-
- // Check if already initialized; got FilterGraph
-
- if (m_pFilterGraph == NULL)
- {
- SetLastError (TEXT ("Not Initialize, create custom TS PIN filter"), B2C2_SDK_E_NOT_INITIALIZED);
- return B2C2_SDK_E_NOT_INITIALIZED; // *** FUNCTION EXIT POINT
- }
-
- // Check if valid PIN number
-
- if (nPin < 0 || nPin >= B2C2_FILTER_MAX_TS_PINS)
- {
- SetLastError (TEXT ("Invalid PIN number, create custom TS PIN filter"), B2C2_SDK_E_INVALID_PIN);
- return B2C2_SDK_E_INVALID_PIN; // *** FUNCTION EXIT POINT
- }
-
- // Check if filter already created
-
- if (!m_pTsPinFilter[nPin])
- {
- // 1) Create Custom Filter
-
- hr = CoCreateInstance ((REFCLSID)refCLSID,
- NULL,
- CLSCTX_INPROC,
- (REFIID)IID_IBaseFilter,
- (void **)&m_pTsPinFilter[nPin]);
-
- if (FAILED (hr))
- {
- SetLastError (TEXT ("Create custom TS PIN filter"), hr);
- return hr; // *** FUNCTION EXIT POINT
- }
-
- // 2) Add to Filter Graph.
-
- hr = m_pFilterGraph->AddFilter (m_pTsPinFilter[nPin], NULL);
-
- if(FAILED (hr))
- {
- SetLastError (TEXT ("Add custom TS PIN filter to Filter Graph"), hr);
- return hr; // *** FUNCTION EXIT POINT
- }
- }
-
- // Return the filter
-
- if (ppCustomFilter)
- {
- *ppCustomFilter = m_pTsPinFilter[nPin];
- }
-
- return S_OK;
-}
-
-HRESULT B2C2MPEG2Adapter::GetTsInterfaceFilter (int nPin, const IID& iid, IUnknown ** ppInterfaceFilter)
-{
- HRESULT hr;
-
- // Check if already initialized; got FilterGraph
-
- if (m_pFilterGraph == NULL)
- {
- SetLastError (TEXT ("Not Initialize"), B2C2_SDK_E_NOT_INITIALIZED);
- return B2C2_SDK_E_NOT_INITIALIZED; // *** FUNCTION EXIT POINT
- }
-
- // Check if valid PIN number
-
- if (nPin < 0 || nPin >= B2C2_FILTER_MAX_TS_PINS)
- {
- SetLastError (TEXT ("Invalid PIN number, query Interface Filter"), B2C2_SDK_E_INVALID_PIN);
- return B2C2_SDK_E_INVALID_PIN; // *** FUNCTION EXIT POINT
- }
-
- // Check if custom filter is already created; call CreateTsFilter ()
-
- if (!m_pTsPinFilter[nPin])
- {
- SetLastError (TEXT ("TS filter not initialize, query Interface Filter"), B2C2_SDK_E_NO_TS_FILTER);
- return B2C2_SDK_E_NO_TS_FILTER; // *** FUNCTION EXIT POINT
- }
-
- // Check if interface already queried
-
- if (!m_pTsPinInterfaceFilter[nPin])
- {
- hr = m_pTsPinFilter[nPin]->QueryInterface (iid,
- (VOID **)&m_pTsPinInterfaceFilter[nPin]);
-
- if(FAILED (hr))
- {
- SetLastError (TEXT ("Query Interface Filter on TS Pin Filter"), hr);
- return hr; // *** FUNCTION EXIT POINT
- }
- }
-
- // Return the interface
-
- if (ppInterfaceFilter)
- {
- *ppInterfaceFilter = m_pTsPinInterfaceFilter[nPin];
- }
-
- return S_OK;
-}
-
-HRESULT B2C2MPEG2Adapter::GetTsOutPin (int nPin, IPin **ppTsOutPin)
-{
- HRESULT hr;
-
- // Check if already initialized; got Filter
-
- if (m_pFilter == NULL)
- {
- SetLastError (TEXT ("Not Initialize, enumerate B2C2 Filter Data pins"), B2C2_SDK_E_NOT_INITIALIZED);
- return B2C2_SDK_E_NOT_INITIALIZED; // *** FUNCTION EXIT POINT
- }
-
- // Check if valid PIN number
-
- if (nPin < 0 || nPin >= B2C2_FILTER_MAX_TS_PINS)
- {
- SetLastError (TEXT ("Invalid PIN number, query Interface Filter"), B2C2_SDK_E_INVALID_PIN);
- return B2C2_SDK_E_INVALID_PIN; // *** FUNCTION EXIT POINT
- }
-
- // Do we already have this pin?
-
- if (m_pTsOutPin[nPin] == NULL)
- {
- // Locate B2C2 Filter 'Data n' pins:
-
- hr = EnumerateFilterPins (FALSE, FALSE, TRUE);
-
- if(FAILED (hr))
- {
- // Last error has already been set at EnumerateFilterPins ()
- return hr; // *** FUNCTION EXIT POINT
- }
- }
-
- // Return the PIN
-
- if (ppTsOutPin)
- {
- *ppTsOutPin = m_pTsOutPin[nPin];
- }
-
- return S_OK;
-}
-
-HRESULT B2C2MPEG2Adapter::ConnectTsFilterInToTsOutPin (int nPin, const TCHAR * szInPinName /*= NULL*/)
-{
- HRESULT hr;
- IEnumPins *pEnum;
- PIN_INFO pin_Info;
- IPin * pPinIn = NULL;
- BOOL bUsePin;
-
- // Check if already initialized; got FilterGraph
-
- if ( m_pFilterGraph == NULL
- || m_pFilter == NULL)
- {
- SetLastError (TEXT ("Not Initialize, enumerate B2C2 Filter Data pins"), B2C2_SDK_E_NOT_INITIALIZED);
- return B2C2_SDK_E_NOT_INITIALIZED; // *** FUNCTION EXIT POINT
- }
-
- // Check if valid PIN number
-
- if (nPin < 0 || nPin >= B2C2_FILTER_MAX_TS_PINS)
- {
- SetLastError (TEXT ("Invalid PIN number, query Interface Filter"), B2C2_SDK_E_INVALID_PIN);
- return B2C2_SDK_E_INVALID_PIN; // *** FUNCTION EXIT POINT
- }
-
- // Check if we got a filter for this PIN
-
- if (m_pTsPinFilter[nPin] == NULL)
- {
- SetLastError (TEXT ("TS filter not initialize, connect B2C2 Filter Data pins"), B2C2_SDK_E_NO_TS_FILTER);
- return B2C2_SDK_E_NO_TS_FILTER; // *** FUNCTION EXIT POINT
- }
-
- // Do we already have this Output pin?
-
- if (m_pTsOutPin[nPin] == NULL)
- {
- // Locate B2C2 Filter 'Data n' pins:
-
- hr = EnumerateFilterPins (FALSE, FALSE, TRUE);
-
- if (FAILED (hr))
- {
- // Last error has already been set at EnumerateFilterPins ()
- return hr; // *** FUNCTION EXIT POINT
- }
- }
-
- // Double check
-
- if (m_pTsOutPin[nPin] == NULL)
- {
- SetLastError (TEXT ("Internal Error, connect B2C2 Filter Data pins"), E_FAIL);
- return E_FAIL;
- }
-
- // Do we already have this Output pin?
-
- if (m_pTsFilterInPin[nPin] != NULL)
- {
- //There is already a pin connected!
- SetLastError (TEXT ("PIN already connected, connect B2C2 Filter Data pins"), B2C2_SDK_E_PIN_ALREADY_CONNECTED);
- return B2C2_SDK_E_PIN_ALREADY_CONNECTED; // *** FUNCTION EXIT POINT
- }
-
- // Locate Dump Filter Generic Input pin:
-
- // 1) Get list of filter's pins.
-
- hr = m_pTsPinFilter[nPin]->EnumPins(&pEnum);
-
- if (FAILED (hr))
- {
- SetLastError (TEXT ("Enumerat TS filter pins"), hr);
- return hr; // *** FUNCTION EXIT POINT
- }
-
- // 2) Locate the correct pin.
-
- while (pEnum->Next(1, &pPinIn, NULL) == S_OK)
- {
- bUsePin = TRUE;
-
- hr = pPinIn->QueryPinInfo(&pin_Info);
-
- if (pin_Info.pFilter != NULL)
- {
- pin_Info.pFilter->Release();
- }
-
- if (FAILED (hr))
- {
- continue;
- }
-
- if (pin_Info.dir != PINDIR_INPUT)
- {
- // Wrong direction
- bUsePin = FALSE;
- }
-
- // check name if defined
- if (bUsePin && szInPinName)
- {
- char szPinName[128]; // from SDK, strmif.h; PIN_INFO::achName[ 128 ]
- wcstombs (szPinName, pin_Info.achName, sizeof (szPinName));
-
- if (strstr (szPinName, szInPinName) == NULL)
- {
- // Not this PIN
- bUsePin = FALSE;
- }
- }
-
- if (bUsePin)
- {
- // This is our PIN
- m_pTsFilterInPin[nPin] = pPinIn;
-
- // Don't need to look for more
- break;
- }
- else
- {
- // We don't need this pin
- pPinIn->Release ();
- pPinIn = NULL;
- }
- }
-
- pEnum->Release ();
-
- // Check if pin is found
-
- if (m_pTsFilterInPin[nPin] == NULL)
- {
- SetLastError (TEXT ("No Input PIN found, connect B2C2 Filter Data pins"), B2C2_SDK_E_NO_INPUT_PIN);
- return B2C2_SDK_E_NO_INPUT_PIN;
- }
-
- // Directly connect B2C2 Filter data output pin n to rendered/custom filter input pin.
-
- hr = m_pFilterGraph->ConnectDirect (m_pTsOutPin[nPin], m_pTsFilterInPin[nPin], NULL);
-
- if (FAILED (hr))
- {
- SetLastError (TEXT ("Filter Graph ConnectDirect method"), hr);
- return hr; // *** FUNCTION EXIT POINT
- }
-
- return S_OK;
-}
-
-void B2C2MPEG2Adapter::Release()
-{
- // **********************************************************************
- // *** Tear down all filters used, Filter Graph and COM
- // **********************************************************************
-
- for (int iCnt = 0; iCnt < B2C2_FILTER_MAX_TS_PINS; iCnt++)
- {
- if (m_pTsPinFilter[iCnt])
- {
- m_pTsPinFilter[iCnt]->Release();
- m_pTsPinFilter[iCnt] = NULL;
- }
- if (m_pTsPinInterfaceFilter[iCnt])
- {
- m_pTsPinInterfaceFilter[iCnt]->Release();
- m_pTsPinInterfaceFilter[iCnt] = NULL;
- }
- if (m_pTsOutPin[iCnt])
- {
- m_pTsOutPin[iCnt]->Release();
- m_pTsOutPin[iCnt] = NULL;
- }
- if (m_pTsFilterInPin[iCnt])
- {
- m_pTsFilterInPin[iCnt]->Release();
- m_pTsFilterInPin[iCnt] = NULL;
- }
- }
-
- if (m_pMediaControl)
- {
- m_pMediaControl->Release();
- m_pMediaControl = NULL;
- }
-
- if (m_pMediaEvent)
- {
- m_pMediaEvent->Release();
- m_pMediaEvent = NULL;
- }
-
- if (m_pPinOutAudio)
- {
- m_pPinOutAudio->Release();
- m_pPinOutAudio = NULL;
- }
-
- if (m_pPinOutVideo)
- {
- m_pPinOutVideo->Release();
- m_pPinOutVideo = NULL;
- }
-
- if (m_pIB2C2MPEG2AvCtrl)
- {
- m_pIB2C2MPEG2AvCtrl->Release();
- m_pIB2C2MPEG2AvCtrl = NULL;
- }
-
- if (m_pIB2C2MPEG2TunerCtrl)
- {
- m_pIB2C2MPEG2TunerCtrl->Release();
- m_pIB2C2MPEG2TunerCtrl = NULL;
- }
-
- if (m_pIB2C2MPEG2DataCtrl)
- {
- m_pIB2C2MPEG2DataCtrl->Release();
- m_pIB2C2MPEG2DataCtrl = NULL;
- }
-
- if (m_pFilter)
- {
- m_pFilter->Release();
- m_pFilter = NULL;
- }
-
- if (m_pFilterGraph)
- {
- m_pFilterGraph->Release();
- m_pFilterGraph = NULL;
- }
-}
-
-#if defined _B2C2_USE_DEVICE_NOTIFICATION
-
-// This function is only included if _B2C2_USE_DEVICE_NOTIFICATION is defined
-
-BOOL B2C2MPEG2Adapter::RegisterDeviceNotification(HANDLE hRecipient)
-{
- HDEVNOTIFY (WINAPI *lpRegisterDeviceNotification) (
- IN HANDLE hRecipient,
- IN LPVOID NotificationFilter,
- IN DWORD Flags);
-
- if (m_hDevNotify != NULL)
- {
- // Notification receiver already registered
- return FALSE;
- }
-
- // Try to load User32.dll; not availabe on 98 or Me
- if(m_hUser32Dll == NULL)
- {
- // Load the library.
- m_hUser32Dll = LoadLibrary(TEXT ("User32.dll"));
- }
-
- if(m_hUser32Dll == NULL)
- {
- return FALSE;
- }
-
- lpRegisterDeviceNotification = (HDEVNOTIFY (WINAPI *)(HANDLE, LPVOID, DWORD))GetProcAddress((HMODULE)m_hUser32Dll, REGISTERDEVICENOTIFY);
-
- if (lpRegisterDeviceNotification)
- {
- DEV_BROADCAST_DEVICEINTERFACE filterData;
-
- ZeroMemory(&filterData, sizeof(DEV_BROADCAST_DEVICEINTERFACE));
-
- filterData.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
- filterData.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
- filterData.dbcc_classguid = GUID_NDIS_LAN_CLASS;
-
- m_hDevNotify = (*lpRegisterDeviceNotification)(hRecipient,
- &filterData,
- DEVICE_NOTIFY_WINDOW_HANDLE);
-
- }
-
- return (m_hDevNotify != NULL);
-}
-
-// This function is only included if _B2C2_USE_DEVICE_NOTIFICATION is defined
-
-BOOL B2C2MPEG2Adapter::UnregisterDeviceNotification()
-{
- BOOL (WINAPI *lpUnregisterDeviceNotification) (IN HDEVNOTIFY Handle);
-
- BOOL blRet = FALSE;
-
- if (m_hDevNotify == NULL)
- {
- // No device notification registers
- SetLastError (TEXT ("No Notification registered"), (DWORD) (-1));
- return blRet;
- }
-
- // Library already loaded by register
- if (m_hUser32Dll == NULL)
- {
- SetLastError (TEXT ("Library not loaded"), (DWORD) (-1));
- return blRet;
- }
-
- lpUnregisterDeviceNotification = (BOOL (WINAPI *)(HANDLE))GetProcAddress((HMODULE)m_hUser32Dll, UNREGISTERDEVICENOTIFY);
-
- if(lpUnregisterDeviceNotification)
- {
- blRet = (*lpUnregisterDeviceNotification)(m_hDevNotify);
-
- if (!blRet)
- {
- SetLastError (TEXT ("Unregister Device Notification"), ::GetLastError());
- }
- }
-
- FreeLibrary((HMODULE)m_hUser32Dll);
- m_hUser32Dll = NULL;
-
- m_hDevNotify = NULL;
-
- return blRet;
-}
-
-// This function is only included if _B2C2_USE_DEVICE_NOTIFICATION is defined
-
-B2C2MPEG2Adapter::E_B2C2_DEVICE B2C2MPEG2Adapter::GetB2C2DeviceType (PDEV_BROADCAST_HDR pDevBcHdr)
-{
- E_B2C2_DEVICE eDevice = EDEV_NON_B2C2;
- TCHAR *pDeviceName = NULL;
-
- // For Windows 2000 and later
- if (pDevBcHdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
- {
- PDEV_BROADCAST_DEVICEINTERFACE pBcDevIf = (PDEV_BROADCAST_DEVICEINTERFACE) pDevBcHdr;
- pDeviceName = pBcDevIf->dbcc_name;
- }
- // For Windows 98 and later
- else if(pDevBcHdr->dbch_devicetype == DBT_DEVTYP_DEVNODE)
- {
- PDEV_BROADCAST_DEVNODE pBcDevNode = (PDEV_BROADCAST_DEVNODE) pDevBcHdr;
- CM_Get_Device_ID(pBcDevNode->dbcd_devnode, m_szDeviceId, MAX_DEVICE_ID_LEN, 0);
- pDeviceName = m_szDeviceId;
- }
-
- if (pDeviceName)
- {
- // No Network Device, so check if B2C2 Device
- size_t nLen = _tcslen (pDeviceName);
-
- DWORD i;
-
- nLen = min(nLen, B2C2_MAX_DEVICE_NAME_LEN - sizeof(TCHAR));
- for(i = 0; i < nLen; i++)
- {
- m_szTmpStr[i] = tolower(pDeviceName[i]);
- }
- m_szTmpStr[nLen] = 0;//terminate the string
-
- // Check for USB device
- if (_tcsstr(m_szTmpStr, B2C2_USB_DEVICE_ID)) // "vid_0af7"
- {
- eDevice = EDEV_B2C2_USB;
- } else
- // Might be PCI device
- if (_tcsstr(m_szTmpStr, B2C2_USB_DEVICE_ID)) // "13d0"
- {
- eDevice = EDEV_B2C2_PCI;
- }
- }
- return eDevice;
-}
-
-// This function is only included if _B2C2_USE_DEVICE_NOTIFICATION is defined
-
-B2C2MPEG2Adapter::E_B2C2_DEVICE B2C2MPEG2Adapter::IsDeviceBroadcastEvent(UINT uiEvent, WPARAM wChangeEvent, LPARAM lData)
-{
- E_B2C2_DEVICE eDevice = EDEV_NON_B2C2;
-
- if (wChangeEvent == uiEvent)
- {
- eDevice = GetB2C2DeviceType ((PDEV_BROADCAST_HDR) lData);
- }
-
- return eDevice;
-}
-
-// This function is only included if _B2C2_USE_DEVICE_NOTIFICATION is defined
-
-int B2C2MPEG2Adapter::IsDeviceArrival(WPARAM wChangeEvent, LPARAM lData)
-{
- E_B2C2_DEVICE eDevice = IsDeviceBroadcastEvent (DBT_DEVICEARRIVAL, wChangeEvent, lData);
-
- if (eDevice > EDEV_NON_B2C2)
- {
- TRACE_NOTIFICATION (_T("Got WM_DEVICECHANGE (DBT_DEVICEARRIVAL, %ld)\n"), lData);
- }
-
- return (int) eDevice;
-}
-
-// This function is only included if _B2C2_USE_DEVICE_NOTIFICATION is defined
-
-int B2C2MPEG2Adapter::IsDeviceRemoveComplete(WPARAM wChangeEvent, LPARAM lData)
-{
- E_B2C2_DEVICE eDevice = IsDeviceBroadcastEvent (DBT_DEVICEREMOVECOMPLETE, wChangeEvent, lData);
-
- if (eDevice > EDEV_NON_B2C2)
- {
- TRACE_NOTIFICATION (_T("Got WM_DEVICECHANGE (DBT_DEVICEREMOVECOMPLETE, %ld)\n"), lData);
- }
-
- return (int) eDevice;
-}
-
-#endif //defined _B2C2_USE_DEVICE_NOTIFICATION
View
63 DirectShowFilters/dvblib/Source/Include/B2C2_Guids.h
@@ -1,63 +0,0 @@
-//
-// Copyright (c) 1998-2001 B2C2, Inc. All Rights Reserved.
-//
-
-// B2C2_Guids.h
-
-
-#ifndef _B2C2_GUIDS_H_
-#define _B2C2_GUIDS_H_
-
-// B2C2 MPEG2 Filter GUID
-
-// {E82536A0-94DA-11d2-A463-00A0C95D308D}
-DEFINE_GUID(CLSID_B2C2MPEG2Filter,
-0xe82536a0, 0x94da, 0x11d2, 0xa4, 0x63, 0x0, 0xa0, 0xc9, 0x5d, 0x30, 0x8d);
-
-// B2C2 MPEG2 Filter Tuner Ctrl. Interface GUID
-
-// {D875D4A9-0749-4fe8-ADB9-CC13F9B3DD45}
-DEFINE_GUID(IID_IB2C2MPEG2TunerCtrl,
-0xd875d4a9, 0x749, 0x4fe8, 0xad, 0xb9, 0xcc, 0x13, 0xf9, 0xb3, 0xdd, 0x45);
-
-// B2C2 MPEG2 Filter Tuner Ctrl. Interface 2 GUID
-
-// {CD900832-50DF-4f8f-882D-1C358F90B3F2}
-DEFINE_GUID(IID_IB2C2MPEG2TunerCtrl2,
-0xcd900832, 0x50df, 0x4f8f, 0x88, 0x2d, 0x1c, 0x35, 0x8f, 0x90, 0xb3, 0xf2);
-
-// B2C2 MPEG2 Filter Tuner Data Ctrl. Interface GUID
-
-// {7F35C560-08B9-11d5-A469-00D0D7B2C2D7}
-DEFINE_GUID(IID_IB2C2MPEG2DataCtrl,
-0x7f35c560, 0x8b9, 0x11d5, 0xa4, 0x69, 0x0, 0xd0, 0xd7, 0xb2, 0xc2, 0xd7);
-
-// B2C2 MPEG2 Filter Tuner Data Ctrl. Interface 2 GUID
-
-// {B0666B7C-8C7D-4c20-BB9B-4A7FE0F313A8}
-DEFINE_GUID(IID_IB2C2MPEG2DataCtrl2,
-0xb0666b7c, 0x8c7d, 0x4c20, 0xbb, 0x9b, 0x4a, 0x7f, 0xe0, 0xf3, 0x13, 0xa8);
-
-// {E2857B5B-84E7-48b7-B842-4EF5E175F315}
-DEFINE_GUID(IID_IB2C2MPEG2DataCtrl3,
-0xe2857b5b, 0x84e7, 0x48b7, 0xb8, 0x42, 0x4e, 0xf5, 0xe1, 0x75, 0xf3, 0x15);
-
-
-// B2C2 MPEG2 Filter Audio/Video Ctrl. Interface GUID
-
-// {295950B0-696D-4a04-9EE3-C031A0BFBEDE}
-DEFINE_GUID(IID_IB2C2MPEG2AVCtrl,
-0x295950b0, 0x696d, 0x4a04, 0x9e, 0xe3, 0xc0, 0x31, 0xa0, 0xbf, 0xbe, 0xde);
-
-// B2C2 MPEG2 Filter Audio/Video Ctrl. Interface 2 GUID
-
-// {9C0563CE-2EF7-4568-A297-88C7BB824075}
-DEFINE_GUID(IID_IB2C2MPEG2AVCtrl2,
-0x9c0563ce, 0x2ef7, 0x4568, 0xa2, 0x97, 0x88, 0xc7, 0xbb, 0x82, 0x40, 0x75);
-
-// {76604DC1-9052-4483-B57B-E3B353E45720}
-DEFINE_GUID(IID_IB2C2MPEG2DataPin,
-0x76604dc1, 0x9052, 0x4483, 0xb5, 0x7b, 0xe3, 0xb3, 0x53, 0xe4, 0x57, 0x20);
-
-
-#endif // _B2C2_GUIDS_H_
View
49 DirectShowFilters/dvblib/Source/Include/IB2C2MPEG2DataPin.h
@@ -1,49 +0,0 @@
-/*
-Copyright (c) 1998-2002 B2C2, Incorporated. All Rights Reserved.
-
-THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF B2C2, INCORPORATED.
-The copyright notice above does not evidence any
-actual or intended publication of such source code.
-
-This file is proprietary source code of B2C2, Incorporated. and is released pursuant to and
-subject to the restrictions of the non-disclosure agreement and license contract entered
-into by the parties.
-
- IB2C2MPEGDataPin.h
- define the interface for the data output pins
-*/
-
-#ifndef _IB2C2MPEG2DataPin_H__
-#define _IB2C2MPEG2DataPin_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-DECLARE_INTERFACE_(IB2C2MPEG2DataPin, IUnknown) {
-
- //return the pin index
- STDMETHOD(GetDataPinIndex) (THIS_
- long *
- ) PURE;
-
- //add PIDs to this pin
- //Parameter: a PID array, a pointer to long as number of PIDs in the array
- //Return: FAILED() -- non added, plNumPID contains the number of PIDs added
- STDMETHOD(AddDataPIDs) (THIS_
- long *plNumPID, long *plPIDs
- ) PURE;
-
- //delete PIDs to this pin
- //Parameter: a PID array, number of PIDs in the array
- //Return: FAILED() -- non deleted
- STDMETHOD(DeleteDataPIDs) (THIS_
- long, long *
- ) PURE;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif//_IB2C2MPEG2DataPin_H__
View
194 DirectShowFilters/dvblib/Source/Include/b2c2_defs.h
@@ -1,194 +0,0 @@
-/*********************************************************************
-*
-* Filename: b2c2_defs.h
-*
-* Description:
-*
-* History:
-*
-*
-* Copyright (c) 2002 B2C2, Incorporated
-*
-*
-*********************************************************************/
-/*
-// Copyright (c) 1998-2002 B2C2, Incorporated. All Rights Reserved.
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF B2C2, INCORPORATED.
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-//
-// This file is proprietary source code of B2C2, Incorporated. and is released pursuant to and
-// subject to the restrictions of the non-disclosure agreement and license contract entered
-// into by the parties.
-*/
-
-//
-// File: b2c2_defs.h
-//
-
-#ifndef _B2C2_DEFS_H_
-#define _B2C2_DEFS_H_
-
-/*
- * FEC enumeration used by SetFEC()/GetFEC()
- */
-typedef enum eFECTAG
-{
- FEC_1_2 = 1,
- FEC_2_3,
- FEC_3_4,
- FEC_5_6,
- FEC_7_8,
- FEC_AUTO,
- FEC_COUNT = 6,
-} eFEC;
-
-/*
- * Guard interval enumeration used by SetGuardInterval()/GetGuardInterval()
- */
-typedef enum eGuardIntervalTAG
-{
- GUARD_INTERVAL_1_32 = 0,
- GUARD_INTERVAL_1_16,
- GUARD_INTERVAL_1_8,
- GUARD_INTERVAL_1_4,
- GUARD_INTERVAL_AUTO,
- GUARD_INTERVAL_COUNT,
-} eGuardInterval;
-
-/*
- * Polarity enumeration used by SetPolarity()/GetPolarity ()
- */
-typedef enum ePolarityTAG
-{
- POLARITY_HORIZONTAL = 0,
- POLARITY_VERTICAL,
- POLARITY_COUNT,
- //if no LNB power is needed
- POLARITY_LNB_NO_POWER = 10,
-} ePolarity;
-
-/*
- * LNB enumeration used by SetLnbKHz()/GetLnbKHz()
- */
-typedef enum eLNBSelectionTAG
-{
- LNB_SELECTION_0 = 0,
- LNB_SELECTION_22,
- LNB_SELECTION_33,
- LNB_SELECTION_44,
- LNB_SELECTION_COUNT,
-} eLNBSelection;
-
-/*
- * Diseqc enumeration used by SetDiseqc()/GetDiseqc()
- */
-typedef enum eDiseqcTAG
-{
- DISEQC_NONE = 0,
- DISEQC_SIMPLE_A,
- DISEQC_SIMPLE_B,
- DISEQC_LEVEL_1_A_A,
- DISEQC_LEVEL_1_B_A,
- DISEQC_LEVEL_1_A_B,
- DISEQC_LEVEL_1_B_B,
- DISEQC_COUNT
-} eDiseqc;
-
-/*
- * Modulation enumeration used by SetModulation()/GetModulation()
- */
-typedef enum eModulationTAG
-{
- QAM_4 = 2,
- QAM_16,
- QAM_32,
- QAM_64,
- QAM_128,
- QAM_256,
- MODE_UNKNOWN = -1
-} eModulation;
-
-/*
- * Tuner Modulation enumeration used in TunerCapabilities structure to
- * return the modulation used by the tuner.
- */
-typedef enum tTunerModulationTAG
-{
- TUNER_SATELLITE = 0,
- TUNER_CABLE = 1,
- TUNER_TERRESTRIAL = 2,
- TUNER_ATSC = 3,
- TUNER_UNKNOWN = -1,
-} tTunerModulation;
-
-
-/*
- * Structure completedy by GetTunerCapabilities() to return tuner capabilities
- */
-typedef struct tTunerCapabilities
-{
- tTunerModulation eModulation;
- unsigned long dwConstellationSupported; // Show if SetModulation() is supported
- unsigned long dwFECSupported; // Show if SetFec() is suppoted
- unsigned long dwMinTransponderFreqInKHz;
- unsigned long dwMaxTransponderFreqInKHz;
- unsigned long dwMinTunerFreqInKHz;
- unsigned long dwMaxTunerFreqInKHz;
- unsigned long dwMinSymbolRateInBaud;
- unsigned long dwMaxSymbolRateInBaud;
- unsigned long bAutoSymbolRate;
- unsigned long dwPerformanceMonitoring; // See bitmask definitions below
-} tTunerCapabilities, *pTunerCapabilities;
-
-/*
- * Bitmasks for comparison with dwPerformanceMonitoring member of tTunerCapabilities
- * to determine which of these various options are supported by the current tuner.
- */
- // If set in dwPerformanceMonitoring, tuner supports:
-#define BER_SUPPORTED 1L // BER reporting via GetPreErrorCorrectionBER ()
-#define BLOCK_COUNT_SUPPORTED (1L << 1) // Block count report via GetTotalBlocks ()
-#define CORRECTED_BLOCK_COUNT_SUPPORTED (1L << 2) // Corrected block count via GetCorrectedBlocks
-#define UNCORRECTED_BLOCK_COUNT_SUPPORTED (1L << 3) // Uncorrected block count via GetUncorrectedBlocks
-#define SNR_SUPPORTED (1L << 4) // SNR via GetSNR ()
-#define SIGNAL_STRENGTH_SUPPORTED (1L << 5) // Signal strength via GetSignalStrength()
-#define SIGNAL_QUALITY_SUPPORTED (1L << 6) // Signal quality via GetSignalQuality()
-
-/*
- * Structure for Mac address list used by *UnicastMacAddress* functions
- */
-#define B2C2_SDK_MAC_ADDR_SIZE 6
-#define B2C2_SDK_MAC_ADDR_LIST_MAX 32
-
-typedef struct tMacAddressList
-{
- long lCount; // Input : Number of MAC addresses at array
- // Output: Number of MAC addresses set
- unsigned char aabtMacAddr[B2C2_SDK_MAC_ADDR_LIST_MAX][B2C2_SDK_MAC_ADDR_SIZE];
-} tMacAddressList, *ptMacAddressList;
-
-/*
- * Error codes, returned by B2C2 SDK functions in addition to
- * COM error codes.
- */
-
-#define B2C2_SDK_E_ALREADY_EXIST 0x10011000 // The PID to add by AddPIDsToPin or AddPIDs already exists.
-//#define B2C2_SDK_E_PID_ERROR 0x90011001
-#define B2C2_SDK_E_ALREADY_FULL 0x90011002 // Failed to add PID by AddPIDsToPin or AddPIDs because maximum number reached.
-
-// B2C2MPEG2Adapter error codes
-
-#define B2C2_SDK_E_CREATE_INTERFACE 0x90020001 // Not all interfaces could be created correctly.
-#define B2C2_SDK_E_UNSUPPORTED_DEVICE 0x90020002 // (Linux) The given network device is no B2C2 Boradband device.
-
-#define B2C2_SDK_E_NOT_INITIALIZED 0x90020003 // Device has not been initialized before calling this functions.
- // Call Initialize () first.
-
-#define B2C2_SDK_E_INVALID_PIN 0x90020004 // (Windows) The pin number given at the first argument is invalid { 0 ... 3 }.
-#define B2C2_SDK_E_NO_TS_FILTER 0x90020005 // (Windows) No custom renderer filter created. Call CreateTsFilter () first.
-#define B2C2_SDK_E_PIN_ALREADY_CONNECTED 0x90020007 // (Windows) The output pin is already connected to a renderer filter input pin.
-#define B2C2_SDK_E_NO_INPUT_PIN 0x90020008 // (Windows) No input pin on the custom renderer filter found, check pin name if given.
-
-
-#endif // _B2C2_DEFS_H_
View
189 DirectShowFilters/dvblib/Source/Include/b2c2mpeg2adapter.h
@@ -1,189 +0,0 @@
-/*
-// Copyright (c) 1998-2002 B2C2, Incorporated. All Rights Reserved.
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF B2C2, INCORPORATED.
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-//
-// This file is proprietary source code of B2C2, Incorporated. and is released pursuant to and
-// subject to the restrictions of the non-disclosure agreement and license contract entered
-// into by the parties.
-*/
-//
-// File: b2c2mpeg2adapter.h
-//
-//
-// Note: (Windows) In order to use the device notification handling support functions
-// of the adapter class,
-//
-// _B2C2_USE_DEVICE_NOTIFICATION and WINVER=0x0500
-//
-// must be defined at the Project Settings
-//
-
-#ifndef _b2c2mpeg2adapter_h_
-#define _b2c2mpeg2adapter_h_
-
-#if defined _B2C2_USE_DEVICE_NOTIFICATION
- #include <dbt.h>
- #include <cfgmgr32.h> // for MAX_DEVICE_ID_LEN and CM_Get_Device_ID ()
- // part of NTDDK
-#endif //defined _B2C2_USE_DEVICE_NOTIFICATION
-
-#if defined __linux__
- class IB2C2MPEG2TunerCtrl2;
- class IB2C2MPEG2DataCtrl3;
- class IB2C2MPEG2AVCtrl2;
-
- // Forward declaration, since we are using a pointer only.
- class CAVSrcFilter;
-#endif //defined __linux__
-
-#if defined WIN32
- typedef interface IGraphBuilder IGraphBuilder;
- typedef interface IBaseFilter IBaseFilter;
- typedef interface IPin IPin;
- typedef interface IMediaControl IMediaControl;
- typedef interface IMediaEvent IMediaEvent;
- typedef interface IB2C2MPEG2DataCtrl3 IB2C2MPEG2DataCtrl3;
- typedef interface IB2C2MPEG2TunerCtrl2 IB2C2MPEG2TunerCtrl2;
- typedef interface IB2C2MPEG2AVCtrl2 IB2C2MPEG2AVCtrl2;
-
- #define B2C2_USB_DEVICE_ID TEXT("vid_0af7")
- #define B2C2_PCI_DEVICE_ID TEXT("13d0")
-
- #define B2C2_FILTER_MAX_TS_PINS 4
-#endif //defined WIN32
-
-//
-// B2C2MPEG2Adapter
-//
-class B2C2MPEG2Adapter
-{
-public: // Construction
- B2C2MPEG2Adapter (const TCHAR *pszAdapterName);
- ~B2C2MPEG2Adapter ();
-
-public: // Interface
-
-#if defined WIN32
- inline IGraphBuilder* GetFilterGraph() { return m_pFilterGraph; }
-#endif //defined WIN32
-
- inline IB2C2MPEG2TunerCtrl2* GetTunerControl() { return m_pIB2C2MPEG2TunerCtrl; }
- inline IB2C2MPEG2DataCtrl3* GetDataControl() { return m_pIB2C2MPEG2DataCtrl; }
- inline IB2C2MPEG2AVCtrl2* GetAvControl() { return m_pIB2C2MPEG2AvCtrl; }
-
- inline BOOL IsInitialized() { return (m_pFilter != NULL); };
-
-public: // Methods
- HRESULT Initialize();
- void Release();
-
- // Error information handling methods
-
- inline DWORD GetLastError()
- {
- DWORD dwRet = m_dwLastErrorCode;
- m_dwLastErrorCode = 0;
- return dwRet;
- }
- inline const TCHAR* GetLastErrorText() { return (const TCHAR*) m_szLastErrorText; }
-
- inline void SetLastError(const TCHAR *szErrText, DWORD dwErrCode)
- {
- m_dwLastErrorCode = dwErrCode;
- sprintf( m_szLastErrorText, TEXT("%.*s"), B2C2_MAX_ERROR_TEXT-1, szErrText);
- }
-
-#if defined WIN32
- HRESULT EnumerateFilterPins (BOOL bAudoPin = TRUE, BOOL bVideoPin = TRUE, BOOL bTsPins = TRUE);
- HRESULT GetAudioVideoOutPins (IPin **ppPinOutAudio, IPin **ppPinOutVideo);
-
- HRESULT GetMediaControl (IMediaControl **ppMediaControl);
- HRESULT GetMediaEvent (IMediaEvent **ppMediaEvent);
-
- HRESULT CreateTsFilter (int nPin, REFCLSID refCLSID, IBaseFilter **ppCustomFilter = NULL);
- HRESULT GetTsInterfaceFilter (int nPin, const IID& iid, IUnknown ** ppInterfaceFilter);
- HRESULT GetTsOutPin (int nPin, IPin **ppTsOutPin);
- HRESULT ConnectTsFilterInToTsOutPin (int nPin, const TCHAR * szInPinName = NULL);
-#endif //defined WIN32
-
-protected: // Instantiated member classes (Linux) or Interface pointer (Windows)
-
- IB2C2MPEG2TunerCtrl2 *m_pIB2C2MPEG2TunerCtrl;
- IB2C2MPEG2DataCtrl3 *m_pIB2C2MPEG2DataCtrl;
- IB2C2MPEG2AVCtrl2 *m_pIB2C2MPEG2AvCtrl;
-
-#if defined __linux__
- CAVSrcFilter *m_pFilter;
-#endif //defined __linux__
-
-#if defined WIN32
- IGraphBuilder *m_pFilterGraph;
- IBaseFilter *m_pFilter;
- IPin *m_pPinOutAudio;
- IPin *m_pPinOutVideo;
- IMediaControl *m_pMediaControl;
- IMediaEvent *m_pMediaEvent;
- IBaseFilter *m_pTsPinFilter[B2C2_FILTER_MAX_TS_PINS];
- IUnknown *m_pTsPinInterfaceFilter[B2C2_FILTER_MAX_TS_PINS];
- IPin *m_pTsOutPin[B2C2_FILTER_MAX_TS_PINS];
- IPin *m_pTsFilterInPin[B2C2_FILTER_MAX_TS_PINS];
-
-#endif //defined WIN32
-
-private: // Member variables
- enum
- {
- B2C2_MAX_ERROR_TEXT = 50,
- B2C2_MAX_DEVICE_NAME_LEN = 256,
- };
-
- TCHAR m_szLastErrorText[B2C2_MAX_ERROR_TEXT];
- DWORD m_dwLastErrorCode;
-
-//
-// Device Notification Handling
-//
-
-#if defined _B2C2_USE_DEVICE_NOTIFICATION
-
-public: //Device Notification Methods
-
- BOOL RegisterDeviceNotification(HANDLE hRecipient);
- BOOL UnregisterDeviceNotification();
-
- int IsDeviceArrival(WPARAM wChangeEvent, LPARAM lData);
- int IsDeviceRemoveComplete(WPARAM wChangeEvent, LPARAM lData);
-
-public: // Definitions / member variables
-
- enum E_B2C2_DEVICE
- {
- EDEV_NON_B2C2 = 0,
- EDEV_B2C2_USB,
- EDEV_B2C2_PCI,
- };
-
-protected: // Methods
-
- E_B2C2_DEVICE IsDeviceBroadcastEvent(UINT uiEvent, WPARAM wChangeEvent, LPARAM lData);
- E_B2C2_DEVICE GetB2C2DeviceType (PDEV_BROADCAST_HDR pDevBcHdr);
-
-private: // member variables
-
- HDEVNOTIFY m_hDevNotify;
- HANDLE m_hUser32Dll;
-
-private: // Temporary Variables
-
- TCHAR m_szDeviceId[MAX_DEVICE_ID_LEN];
- TCHAR m_szTmpStr[B2C2_MAX_DEVICE_NAME_LEN];
-
-#endif //defined _B2C2_USE_DEVICE_NOTIFICATION
-
-};
-
-#endif // _b2c2mpeg2adapter_h_
-
View
155 DirectShowFilters/dvblib/Source/Include/ib2c2mpeg2avctrl.h
@@ -1,155 +0,0 @@
-//
-// Copyright (c) 1998-2001 B2C2, Inc. All Rights Reserved.
-//
-
-// IB2C2MPEG2AVCtrl.h
-
-// Note: Contains interfaces IB2C2MPEG2AVCtrl and IB2C2MPEG2AVCtrl2
-
-
-#ifndef _IB2C2MPEG2AVCTRL_H_
-#define _IB2C2MPEG2AVCTRL_H_
-
-#if defined __linux__ // Class implementation for Linux
-
-typedef unsigned short WORD;
-typedef unsigned char BYTE;
-
-class CAVSrcFilter;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// IB2C2MPEG2AVCtrl
-//
-
-class IB2C2MPEG2AVCtrl
-{
-protected: // Data
-
- CAVSrcFilter * m_pFilter;
-
-public: // Constructor
- IB2C2MPEG2AVCtrl (CAVSrcFilter *);
-
-#else // COM implementation for Windows
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Interface: IB2C2MPEG2AVCtrl
-
-DECLARE_INTERFACE_(IB2C2MPEG2AVCtrl, IUnknown) {
-
-#endif //defined __linux__
-
- // Argument 1: Audio PID
- // Argument 2: Video PID
-
- STDMETHOD(SetAudioVideoPIDs) (THIS_
- long,
- long
- ) PURE;
-};
-
-// Video window aspect ratios
-
-#define ASPECT_RATIO_INVALID 0
-#define ASPECT_RATIO_SQUARE 1
-#define ASPECT_RATIO_4x3 2
-#define ASPECT_RATIO_16x9 3
-#define USER_DEFINED_ASPECT_RATIO 4
-
-// Frame rate values
-
-#define FRAME_RATE_FORBIDDEN 0
-#define FRAME_RATE_23_97 1 // I.e. 23.97
-#define FRAME_RATE_24 2
-#define FRAME_RATE_25 3
-#define FRAME_RATE_29_97 4
-#define FRAME_RATE_30 5
-#define FRAME_RATE_50 6
-#define FRAME_RATE_59_94 7
-#define FRAME_RATE_60 8
-
-// Interface: IB2C2MPEG2AVCtrl2
-
-// Struct describing video data; this structure will be populated and
-// passed to the user function described below.
-
-typedef struct _VIDEO_INFO
-{
- WORD wHSize; // video data horizontal size in pixels
- WORD wVSize; // video data vertical size in pixels
- BYTE bAspectRatio;
- BYTE bFrameRate;
-} MPEG2_VIDEO_INFO;
-
-// The user function that will be passed to SetCallbackForVideoMode should
-// have the following prototype:
-//
-// UINT __stdcall UserFunc(MPEG2_VIDEO_INFO *);
-//
-// The return value from the user function is currently ignored.
-// To cancel the callback, call SetCallbackForVideoMode with a NULL argument.
-// "UserFunc" should return control as soon as possible as this is a
-// synchronized callback and blocks continuation in the calling thread, which
-// in this case is the B2C2 MPEG2 filter.
-
-#if defined __linux__ // Class implementation for Linux
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// IB2C2MPEG2AVCtrl2
-//
-
-class IB2C2MPEG2AVCtrl2 : public IB2C2MPEG2AVCtrl
-{
-
-
-public: // Constructor
- IB2C2MPEG2AVCtrl2 (CAVSrcFilter *);
-
-#else // COM implementation for Windows
-
-// Interface: IB2C2MPEG2AVCtrl2
-
-DECLARE_INTERFACE_(IB2C2MPEG2AVCtrl2, IB2C2MPEG2AVCtrl) {
-
-#endif //defined __linux__
-
-#if defined WIN32
- // Argument : Function pointer to user function; see comments above for
- // prototype.
-
- STDMETHOD(SetCallbackForVideoMode) (THIS_
- PVOID
- ) PURE;
-#endif //defined WIN32
-
- STDMETHOD(DeleteAudioVideoPIDs) (THIS_
- long,
- long
- ) PURE;
-
- STDMETHOD(GetAudioVideoState) (THIS_
- long *,
- long *,
- long *,
- long *,
- long *,
- long *
- ) PURE;
-};
-
-
-#if defined WIN32
-
-#ifdef __cplusplus
-}
-
-#endif
-
-#endif //defined WIN32
-
-#endif // _IB2C2MPEG2AVCTRL_H_
View
230 DirectShowFilters/dvblib/Source/Include/ib2c2mpeg2datactrl.h
@@ -1,230 +0,0 @@
-/*
-// Copyright (c) 1998-2002 B2C2, Incorporated. All Rights Reserved.
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF B2C2, INCORPORATED.
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-//
-// This file is proprietary source code of B2C2, Incorporated. and is released pursuant to and
-// subject to the restrictions of the non-disclosure agreement and license contract entered
-// into by the parties.
-*/
-
-//
-// File: ib2c2mpeg2datactrl.h
-//
-
-#ifndef _IB2C2MPEG2DataCtrl_H_
-#define _IB2C2MPEG2DataCtrl_H_
-
-#if defined __linux__
-
-#include "linux_windefs.h"
-
-#else // Windows
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#endif //defined __linux__
-
-#if defined __linux__ // Class implementation for Linux
-
-class CAVSrcFilter;
-
-class IB2C2MPEG2DataCtrl
-{
-protected: // Data
-
- CAVSrcFilter * m_pFilter;
-
-public: // Constructor
-
- IB2C2MPEG2DataCtrl (CAVSrcFilter *);
-
- STDMETHOD (Initialize) (THIS_
- VOID
- ) PURE;
-
-#else // COM implementation for Windows
-
-DECLARE_INTERFACE_(IB2C2MPEG2DataCtrl, IUnknown) {
-
-#endif // defined __linux__
-
- // Note: Add new methods ***only*** at the end, after
- // existing methods. Do ***not*** remove methods.
- // These restrictions are necessary due to the need to
- // maintain compatibility in COM with past implementations.
-
-public:
- // Transport Stream methods
-
- STDMETHOD (GetMaxPIDCount) (THIS_
- long *
- ) PURE;
-
- //this function is obselete, please use IB2C2MPEG2DataCtrl2's AddPIDsToPin function
- STDMETHOD (AddPIDs) (THIS_
- long, long *
- ) PURE;
-
- //this function is obselete, please use IB2C2MPEG2DataCtrl2's DeletePIDsFromPin function
- STDMETHOD (DeletePIDs) (THIS_
- long, long *
- ) PURE;
-
- // IP methods
-
- STDMETHOD (GetMaxIpPIDCount) (THIS_
- long *
- ) PURE;
-
- STDMETHOD (AddIpPIDs) (THIS_
- long, long *
- ) PURE;
-
- STDMETHOD (DeleteIpPIDs) (THIS_
- long, long *
- ) PURE;
-
- STDMETHOD (GetIpPIDs) (THIS_
- long *, long *
- ) PURE;
-
- // All protocols
-
- STDMETHOD (PurgeGlobalPIDs) (THIS_
- VOID
- ) PURE;
-
- STDMETHOD (GetMaxGlobalPIDCount) (THIS_
- long *
- ) PURE;
-
- STDMETHOD (GetGlobalPIDs) (THIS_
- long *, long *
- ) PURE;
-
-#if defined WIN32
-
- STDMETHOD (ResetDataReceptionStats) (THIS_
- ) PURE;
-
- STDMETHOD (GetDataReceptionStats) (THIS_
- long *, long *
- ) PURE;
-
-#endif //defined WIN32
-
-// Add new methods to IB2C2MPEG2DataCtrl2
-
-};
-
-#if defined __linux__ // Class implementation for Linux
-
-class IB2C2MPEG2DataCtrl2 : public IB2C2MPEG2DataCtrl
-{
-public: // Constructor
- IB2C2MPEG2DataCtrl2 (CAVSrcFilter *);
-
-#else // COM implementation for Windows
-
-DECLARE_INTERFACE_(IB2C2MPEG2DataCtrl2, IB2C2MPEG2DataCtrl) {
-
-#endif // defined __linux__
-
-public:
-#if defined WIN32
-
- STDMETHOD (AddPIDsToPin) (THIS_
- long *, long *, long
- ) PURE;
-
- STDMETHOD (DeletePIDsFromPin) (THIS_
- long, long *, long
- ) PURE;
-
-#endif //defined WIN32
-
-#if defined __linux__
-
- STDMETHOD (GetBufferPos) (THIS_
- long unsigned int *
- ) PURE;
-
-#endif //defined __linux__
-};
-
-#if defined __linux__ // Class implementation for Linux
-
-class IB2C2MPEG2DataCtrl3 : public IB2C2MPEG2DataCtrl2
-{
-public: // Constructor
- IB2C2MPEG2DataCtrl3 (CAVSrcFilter *);
-
-#else // COM implementation for Windows
-
-DECLARE_INTERFACE_(IB2C2MPEG2DataCtrl3, IB2C2MPEG2DataCtrl2) {
-
-#endif // defined __linux__
-
-public:
- STDMETHOD (AddTsPIDs) (THIS_
- long, long *
- ) PURE;
-
- STDMETHOD (DeleteTsPIDs) (THIS_
- long, long *
- ) PURE;
-
- STDMETHOD (GetTsState) (THIS_
- long * plOpen,
- long * plRunning,
- long * plCount,
- long * plPIDArray
- ) PURE;
-
- STDMETHOD (GetIpState) (THIS_
- long * plOpen,
- long * plRunning,
- long * plCount,
- long * plPIDArray
- ) PURE;
-
- STDMETHOD (GetReceivedDataIp) (THIS_
- __int64 *, __int64 *
- ) PURE;
-
- STDMETHOD (AddMulticastMacAddress) (THIS_
- tMacAddressList * pMacAddrList
- ) PURE;
-
- STDMETHOD (GetMulticastMacAddressList) (THIS_
- tMacAddressList * pMacAddrList
- ) PURE;
-
- STDMETHOD (DeleteMulticastMacAddress) (THIS_
- tMacAddressList * pMacAddrList
- ) PURE;
-
- STDMETHOD (SetUnicastMacAddress) (THIS_
- unsigned char * pMacAddr
- ) PURE;
-
- STDMETHOD (GetUnicastMacAddress) (THIS_
- unsigned char * pMacAddr
- ) PURE;
-
- STDMETHOD (RestoreUnicastMacAddress) (THIS_
- ) PURE;
-};
-
-#if defined WIN32
-#ifdef __cplusplus
-}
-#endif
-#endif //defined WIN32
-
-#endif // ! _IB2C2MPEG2DataCtrl_H_
View
245 DirectShowFilters/dvblib/Source/Include/ib2c2mpeg2tunerctrl.h
@@ -1,245 +0,0 @@
-/*
-// Copyright (c) 1998-2002 B2C2, Incorporated. All Rights Reserved.
-//
-// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF B2C2, INCORPORATED.
-// The copyright notice above does not evidence any
-// actual or intended publication of such source code.
-//
-// This file is proprietary source code of B2C2, Incorporated. and is released pursuant to and
-// subject to the restrictions of the non-disclosure agreement and license contract entered
-// into by the parties.
-*/
-
-//
-// File: ib2c2mpeg2tunerctrl.h
-//
-
-#ifndef _IB2C2MPEG2TunerCtrl_H_
-#define _IB2C2MPEG2TunerCtrl_H_
-
-#if defined __linux__
-
-#include "linux_windefs.h"
-
-#endif //defined __linux__
-
-#include "b2c2_defs.h"
-
-#if defined __linux__ // Class implementation for Linux
-
-class CAVSrcFilter;
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// IB2C2MPEG2TunerCtrl
-//
-
-class IB2C2MPEG2TunerCtrl
-{
-protected: // Data
-
- CAVSrcFilter * m_pFilter;
-
-public: // Constructor
- IB2C2MPEG2TunerCtrl (CAVSrcFilter *);
-
-#else // COM implementation for Windows
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-DECLARE_INTERFACE_(IB2C2MPEG2TunerCtrl, IUnknown)
-{
-
-#endif // defined __linux__
-
- // Note: Add new methods ***only*** at the end, after
- // existing methods. Do ***not*** remove methods.
- // These restrictions are necessary due to the need to
- // maintain compatibility in COM with past implementations.
-
- // Satellite, Cable, Terrestrial (ATSC and DVB)
-
- STDMETHOD(SetFrequency) (THIS_
- long
- ) PURE;
-
- // Satellite, Cable
-
- STDMETHOD(SetSymbolRate) (THIS_
- long
- ) PURE;
-
- // Satellite only
-
- STDMETHOD(SetLnbFrequency) (THIS_
- long
- ) PURE;
-
- STDMETHOD(SetFec) (THIS_
- long
- ) PURE;
-
- STDMETHOD(SetPolarity) (THIS_
- long
- ) PURE;
-
- STDMETHOD(SetLnbKHz) (THIS_
- long
- ) PURE;
-
- STDMETHOD(SetDiseqc) (THIS_
- long
- ) PURE;
-
- // Cable only
-
- STDMETHOD(SetModulation) (THIS_
- long
- ) PURE;
-
- // All tuners
-
- STDMETHOD(Initialize) (THIS_
- VOID
- ) PURE;
-
- STDMETHOD(SetTunerStatus) (THIS_
- VOID
- ) PURE;
-
- STDMETHOD(CheckLock) (THIS_
- VOID
- ) PURE;
-
- STDMETHOD(GetTunerCapabilities) (THIS_
- tTunerCapabilities *, long *
- ) PURE;
-
- // Terrestrial (ATSC)
-
- STDMETHOD(GetFrequency) (THIS_
- long *
- ) PURE;
-
- STDMETHOD(GetSymbolRate) (THIS_
- long *
- ) PURE;
-
- STDMETHOD(GetModulation) (THIS_
- long *
- ) PURE;
-
- STDMETHOD(GetSignalStrength) (THIS_
- long *
- ) PURE;
-
- STDMETHOD(GetSignalLevel) (THIS_
- float *
- ) PURE;
-
- STDMETHOD(GetSNR) (THIS_
- float *
- ) PURE;
-
- STDMETHOD(GetPreErrorCorrectionBER) (THIS_
- float *, bool
- ) PURE;
-
- STDMETHOD(GetUncorrectedBlocks) (THIS_
- long *
- ) PURE;
-
- STDMETHOD(GetTotalBlocks) (THIS_
- long *
- ) PURE;
-
- STDMETHOD(GetChannel) (THIS_
- long *
- ) PURE;
-
- STDMETHOD(SetChannel) (THIS_
- long
- ) PURE;
-
-// Add new methods to IB2C2MPEG2TunerCtrl2
-
-}; // DECLARE_INTERFACE_(IB2C2MPEG2TunerCtrl, IUnknown) - END
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// IB2C2MPEG2TunerCtrl2
-//
-
-#if defined __linux__ // Class implementation for Linux
-
-class IB2C2MPEG2TunerCtrl2 : public IB2C2MPEG2TunerCtrl
-{
-public: // Constructor
- IB2C2MPEG2TunerCtrl2 (CAVSrcFilter *);
-
-#else // COM implementation for Windows
-
-DECLARE_INTERFACE_(IB2C2MPEG2TunerCtrl2, IB2C2MPEG2TunerCtrl)
-{
-
-#endif // defined __linux__
-
- STDMETHOD(SetTunerStatusEx) (THIS_
- long
- ) PURE;
-
- STDMETHOD(SetFrequencyKHz) (THIS_
- long
- ) PURE;
-
- // Terrestrial DVB only
-
- STDMETHOD(SetGuardInterval) (THIS_
- long
- ) PURE;
-
- STDMETHOD(GetGuardInterval) (THIS_
- long *
- ) PURE;
-
- STDMETHOD(GetFec) (THIS_
- long * plFec
- ) PURE;
-
- STDMETHOD(GetPolarity) (THIS_
- long * plPolarity
- ) PURE;
-
- STDMETHOD(GetDiseqc) (THIS_
- long * plDiseqc
- ) PURE;
-
- STDMETHOD(GetLnbKHz) (THIS_
- long * plLnbKHz
-
- ) PURE;
-
- STDMETHOD(GetLnbFrequency) (THIS_
- long * plFrequencyMHz
- ) PURE;
-
- STDMETHOD(GetCorrectedBlocks) (THIS_
- long * plCorrectedBlocks
- ) PURE;
-
- STDMETHOD(GetSignalQuality) (THIS_
- long * pdwSignalQuality
- ) PURE;
-
-}; // DECLARE_INTERFACE_(IB2C2MPEG2TunerCtrl2, IB2C2MPEG2TunerCtrl) - END
-
-#if !defined __linux__
-#ifdef __cplusplus
-}
-#endif
-#endif //!defined __linux__
-
-#endif // ! _IB2C2MPEG2TunerCtrl_H_
View
16 DirectShowFilters/dvblib/Source/Resource.h
@@ -1,16 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by dvblib.RC
-//
-
-// Nächste Standardwerte für neue Objekte
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-
-#define _APS_NEXT_RESOURCE_VALUE 2000
-#define _APS_NEXT_CONTROL_VALUE 2000
-#define _APS_NEXT_SYMED_VALUE 2000
-#define _APS_NEXT_COMMAND_VALUE 32771
-#endif
-#endif
View
BIN DirectShowFilters/dvblib/Source/dvblib.aps
Binary file not shown.
View
936 DirectShowFilters/dvblib/Source/dvblib.cpp
@@ -1,936 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Team MediaPortal
- * Author: Agree
- * http://www.team-mediaportal.com
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Make; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#include <stdio.h>
-#include "stdafx.h"
-#include <initguid.h>
-#include <streams.h>
-//#include <dshowasf.h>
-#include <comdef.h>
-//#include <Dshow.h>
-#include <bdaiface.h>
-#include "Include\b2c2mpeg2adapter.h"
-#include "mpeg2data.h"
-#include "dvblib.h"
-#include "Include\b2c2_defs.h"
-#include "Include\B2C2_Guids.h"
-#include "Include\b2c2mpeg2adapter.h"
-#include "Include\ib2c2mpeg2tunerctrl.h"
-#include "Include\ib2c2mpeg2datactrl.h"
-#include "Include\ib2c2mpeg2avctrl.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-#define MAX_IP_PIDS 34
-#define MAX_TS_PIDS 39
-
-#define PID_MAX 0x1fff
-
-// copied from "../sky2pcavsrc/constants.h"; better move b2c2_defs.h
-#define SKY2PC_E_OUTOFLOCK 0x90010115
-#define ALPHA_VALUE 0.6f // Alpha value for bitmap (0.0 to 1.0)
-#define BMP_SIZE_X 0.3f // Width of bitmap in comp. space
-#define BMP_SIZE_Y 0.3f // Height of bitmap in comp. space
-
-DEFINE_GUID(CLSID_Demux, 0xAFB6C280, 0x2C41, 0x11D3, 0x8A, 0x60, 0x00, 0x00, 0xF8, 0x1E, 0x0E, 0x4A);
-DEFINE_GUID(CLSID_MPSECTAB, 0xC666E115, 0xBB62, 0x4027, 0xA1, 0x13, 0x82, 0xD6, 0x43, 0xFE, 0x2D, 0x99);
-DEFINE_GUID(MPEG_SEC_TYPE,0x455f176c, 0x4b06, 0x47ce, 0x9a, 0xef, 0x8c, 0xae, 0xf7, 0x3d, 0xf7, 0xb5);
-DEFINE_GUID(CLSID_GrabberSample,
-0x2fa4f053, 0x6d60, 0x4cb0, 0x95, 0x3, 0x8e, 0x89, 0x23, 0x4f, 0x3f, 0x73);
-
-DEFINE_GUID(IID_IGrabberSample,
-0x6b652fff, 0x11fe, 0x4fce, 0x92, 0xad, 0x02, 0x66, 0xb5, 0xd7, 0xc7, 0x8f);
-
-//
-DeliverSectionData m_callBack;
-#define MAX_DATA_PIDS_PER_PIN 39
-// pid array
-long m_pidArray[39];
-long m_pidArrayCount;
-//
-//
-IMpeg2Data *m_mpegSIInterface=NULL;
-IBaseFilter *m_demux=NULL;
-IBaseFilter *m_mpeg2Data=NULL;
-ISectionList *m_sectionList=NULL;
-
-typedef enum
-{
- DATA_PIN_0,
- DATA_PIN_1,
- DATA_PIN_2,
- DATA_PIN_3
-} tDataPinIndex;
-//
-// callbacks
-
-#if defined WIN32
- #define MAX_ADDR_FORMAT_STR "%02X-%02X-%02X-%02X-%02X-%02X"
-#else // __linux__
- #define MAX_ADDR_FORMAT_STR "%02X:%02X:%02X:%02X:%02X:%02X"
-#endif //defined WIN32
-
-
-
-
-BEGIN_MESSAGE_MAP(CdvblibApp, CWinApp)
-END_MESSAGE_MAP()
-
-static char* logbuffer=NULL;
-
-void Log(const char *fmt, ...)
-{
- if (logbuffer==NULL)
- {
- logbuffer=new char[100000];
- }
- va_list ap;
- va_start(ap,fmt);
-
- int tmp;
- va_start(ap,fmt);
- tmp=vsprintf(logbuffer, fmt, ap);
- va_end(ap);
-
- FILE* fp = fopen("log/dvb.log","a+");
- if (fp!=NULL)
- {
- SYSTEMTIME systemTime;
- GetLocalTime(&systemTime);
- fprintf(fp,"%02.2d-%02.2d-%04.4d %02.2d:%02.2d:%02.2d %s\n",
- systemTime.wDay, systemTime.wMonth, systemTime.wYear,
- systemTime.wHour,systemTime.wMinute,systemTime.wSecond,
- logbuffer);
- fclose(fp);
- }
-};
-
-// CdvblibApp-Erstellung
-
-CdvblibApp::CdvblibApp()
-{
- // TODO: Hier Code zur Konstruktion einfügen
- // Alle wichtigen Initialisierungen in InitInstance positionieren
-
-}
-
-
-// Das einzige CdvblibApp-Objekt
-
-CdvblibApp theApp;
-
-
-// CdvblibApp Initialisierung
-
-BOOL CdvblibApp::InitInstance()
-{
- CWinApp::InitInstance();
- return TRUE;
-}
-HRESULT GetSNR(IB2C2MPEG2TunerCtrl2 *pTunerCtrl,long *sigStrength,long *sigQuality)
-{
- pTunerCtrl->GetSignalStrength(sigStrength);
- pTunerCtrl->GetSignalQuality(sigQuality);
- return S_OK;
-}
-bool GetSectionData(IBaseFilter *filter,PID pid,TID tid,WORD *sectionCount,int tableSection,int timeout)
-{
-
- IMpeg2Data *pMPEG=NULL;
- HRESULT hr;
- IMpeg2Stream *pStream = NULL;
-
- if(filter==NULL)
- {
- filter=m_mpeg2Data;
- if(m_mpeg2Data==NULL)
- return false;
- }
-
- hr=filter->QueryInterface(__uuidof(IMpeg2Data),(void**)&pMPEG);
- if(FAILED(hr))
- return false;
-
- // s
- if(timeout<1 || timeout>20000) // max. timeout 20 sec
- timeout=1;
- // grab table or section
- if(tableSection==0)
- hr = pMPEG->GetTable(pid, tid, NULL, (DWORD)timeout, &m_sectionList);
- else
- hr = pMPEG->GetSection(pid, tid, NULL, (DWORD)timeout, &m_sectionList);
-
- // ok?
- if (SUCCEEDED(hr))
- {
-
- m_sectionList->GetNumberOfSections(sectionCount);
- return true;
- }
-
- return false;
-}
-//
-//
-
-bool GetSectionPtr(int section,long *dataPointer,int *len,int *header,int *tableExtId,int *version,int *secNum,int *lastSecNum)
-{
- if(m_sectionList!=NULL)
- {
- SECTION *sec=NULL;
- DWORD size=0;
- m_sectionList->GetSectionData(section,&size,&sec);
- LONG_SECTION *pLongSection = (LONG_SECTION*) sec;
- *dataPointer=(long)pLongSection->RemainingData;
- *len=size;
- *header=sec->Header.W;
- *tableExtId=pLongSection->TableIdExtension;
- *secNum=pLongSection->SectionNumber;
- *lastSecNum=pLongSection->LastSectionNumber;
- *version=pLongSection->Version.B;
- return true;
- }
- return false;
-}
-bool ReleaseSectionsBuffer(void)
-{
- if(m_sectionList!=NULL)
- m_sectionList->Release();
- m_sectionList=NULL;
- return true;
-}
-//
-//
-//
-
-BOOL GetSectionCount(IBaseFilter *filter,PID pid,TID tid,int sectionNumber,WORD *sectionCount,long *dataLen)
-{
- IMpeg2Data *pMPEG=NULL;
- ISectionList *pSectionList=NULL;
- long len=0;
- HRESULT hr;
-
- hr=filter->QueryInterface(__uuidof(IMpeg2Data),(void**)&pMPEG);
- if(FAILED(hr))
- return false;
-
- hr = pMPEG->GetTable(pid, tid, NULL, 5000L, &pSectionList);
- if (SUCCEEDED(hr))
- {
- SECTION *pSection;
-
- DWORD cbSize;
-
- hr=pSectionList->GetNumberOfSections(sectionCount);
- for(WORD i=0;i<*sectionCount;i++)
- {
- hr=pSectionList->GetSectionData(i,&cbSize,&pSection);
-
- len+=cbSize;
- }
- *dataLen=len;
- pSectionList->Release();
- pMPEG->Release();
- delete pSection;
- }else
- return false;
-
- return true;
-}
-//
-
-BOOL DeleteAllPIDs(IB2C2MPEG2DataCtrl3 *pB2C2FilterDataCtrl,long pin)
-{
- HRESULT hr;
- long pidCount=39;
- long pids[39];
-
-
- if(pB2C2FilterDataCtrl)
- {
- do
- {
- hr=pB2C2FilterDataCtrl->GetTsState(NULL,NULL,&pidCount,pids);
- if(SUCCEEDED(hr))
- {
- hr=pB2C2FilterDataCtrl->DeletePIDsFromPin(pidCount,pids,pin);
- } else
- return false;
-
- }while(pidCount>0);
- }
-
- return true;
-}
-
-//
-// get tab without tune request
-//
-
-
-long SetPidToPin(IB2C2MPEG2DataCtrl3 *pB2C2FilterDataCtrl,long pin,long pid)
-{
- long count=1;
- long pids[2];
- HRESULT hr;
-
- pids[0]=pid;
-
- if(pB2C2FilterDataCtrl)
- {
- hr=pB2C2FilterDataCtrl->AddPIDsToPin(&count,pids,pin);
- if(SUCCEEDED(hr))
- return count;
- }
- return 0;
-}
-HRESULT GetPidMap(IPin* pin, unsigned long* pid, unsigned long* mediasampletype)
-{
- IMPEG2PIDMap *pMap=NULL;
- IEnumPIDMap *pPidEnum=NULL;
-
- int hr=pin->QueryInterface(__uuidof(IMPEG2PIDMap),(void**)&pMap);
- if(FAILED(hr))
- return 1;
- //
- hr=pMap->EnumPIDMap(&pPidEnum);
- if(FAILED(hr))
- return 5;
- // enum and unmap the pids
- PID_MAP pm;
- ULONG count;
- if(pPidEnum->Next(1,&pm,&count)== S_OK)
- {
- *pid=pm.ulPID;
- *mediasampletype=pm.MediaSampleContent;
- }
-
- pPidEnum->Release();
- pMap->Release();
- return 0;
-}
-
-HRESULT DeliverMediaSample(IPin *inputPin,IMediaSample *mediaSample)
-{
- IMemInputPin *pMIP=NULL;
- HRESULT hr;
-
- hr=inputPin->QueryInterface(IID_IMemInputPin,(void**)&pMIP);
- if(FAILED(hr))
- return hr;
-
- hr=pMIP->Receive(mediaSample);
- if(FAILED(hr))
- return hr;
-
- return S_OK;
-}
-
-HRESULT SetupDemuxer(IPin *pVideo,int videoPID,IPin *pAudio,int audioPID,IPin *pAudioAC3,int AC3PID)
-{
- IMPEG2PIDMap *pMap=NULL;
- IEnumPIDMap *pPidEnum=NULL;
- ULONG pid;
- PID_MAP pm;
- ULONG count;
- ULONG umPid;
- int maxCounter;
- HRESULT hr=0;
-
- // video
- if (pVideo!=NULL)
- {
- hr=pVideo->QueryInterface(__uuidof(IMPEG2PIDMap),(void**)&pMap);
- if(FAILED(hr) || pMap==NULL)
- {
- Log("unable to get IMPEG2PIDMap :0x%x",hr);
- return 1;
- }
- //
- hr=pMap->EnumPIDMap(&pPidEnum);
- if(FAILED(hr) || pPidEnum==NULL)
- {
- Log("unable to get IEnumPIDMap :0x%x",hr);
- return 5;
- }
- // enum and unmap the pids
- maxCounter=30;
- while(pPidEnum->Next(1,&pm,&count)== S_OK)
- {
- maxCounter--;
- if (maxCounter<0) break;
- if (count !=1) break;
-
- Log("unable unmap pid :0x%x",pm.ulPID);
- umPid=pm.ulPID;
- hr=pMap->UnmapPID(1,&umPid);
- if(FAILED(hr))
- {
- Log("unable to unmap pid :0x%x",hr);
- return 6;
- }
- }
- pPidEnum->Release();
- if (videoPID>0 && videoPID<0x1fff)
- {
- // map new pid
- pid = (ULONG)videoPID;
- hr=pMap->MapPID(1,&pid,MEDIA_ELEMENTARY_STREAM);
- if(FAILED(hr))