source: trunk/DirectShowSpy/BdaHooks/Common.h @ 95

Last change on this file since 95 was 95, checked in by roman, 10 years ago

DirectShowSpy? moved from Assembla

  • Property svn:keywords set to Id
File size: 4.0 KB
Line 
1////////////////////////////////////////////////////////////
2// Copyright (C) Roman Ryltsov, 2008-2009
3// Created by Roman Ryltsov roman@alax.info
4//
5// $Id: Common.h 95 2012-08-17 17:21:13Z roman $
6
7#pragma once
8
9#include <dshow.h>
10#include <ks.h>
11#include <ksmedia.h>
12#include <bdatypes.h>
13#include <bdamedia.h>
14#include <bdatif.h>
15#include <mpeg2data.h>
16#include "rodshow.h"
17#include "..\DirectShowSpy_i.h"
18
19inline VOID TraceLocator(ILocator* pLocator)
20{
21        _A(pLocator);
22        LONG nCarrierFrequency;
23        if(SUCCEEDED(pLocator->get_CarrierFrequency(&nCarrierFrequency)))
24                _Z2(atlTraceGeneral, 2, _T("nCarrierFrequency %d\n"), nCarrierFrequency);
25        FECMethod InnerFec;
26        if(SUCCEEDED(pLocator->get_InnerFEC(&InnerFec)))
27                _Z2(atlTraceGeneral, 2, _T("InnerFec %d\n"), InnerFec);
28        BinaryConvolutionCodeRate InnerFecRate;
29        if(SUCCEEDED(pLocator->get_InnerFECRate(&InnerFecRate)))
30                _Z2(atlTraceGeneral, 2, _T("InnerFecRate %d\n"), InnerFecRate);
31        FECMethod OuterFec;
32        if(SUCCEEDED(pLocator->get_OuterFEC(&OuterFec)))
33                _Z2(atlTraceGeneral, 2, _T("OuterFec %d\n"), OuterFec);
34        BinaryConvolutionCodeRate OuterFecRate;
35        if(SUCCEEDED(pLocator->get_OuterFECRate(&OuterFecRate)))
36                _Z2(atlTraceGeneral, 2, _T("OuterFecRate %d\n"), OuterFecRate);
37        ModulationType Modulation;
38        if(SUCCEEDED(pLocator->get_Modulation(&Modulation)))
39                _Z2(atlTraceGeneral, 2, _T("Modulation %d\n"), Modulation);
40        LONG nSymbolRate;
41        if(SUCCEEDED(pLocator->get_SymbolRate(&nSymbolRate)))
42                _Z2(atlTraceGeneral, 2, _T("nSymbolRate %d\n"), nSymbolRate);
43}
44
45inline VOID TraceTuningSpace(ITuningSpace* pTuningSpace)
46{
47        _A(pTuningSpace);
48        CComBSTR sUniqueName;
49        if(SUCCEEDED(pTuningSpace->get_UniqueName(&sUniqueName)))
50                _Z2(atlTraceGeneral, 2, _T("sUniqueName %ls\n"), sUniqueName);
51        CComBSTR sFriendlyName;
52        if(SUCCEEDED(pTuningSpace->get_FriendlyName(&sFriendlyName)))
53                _Z2(atlTraceGeneral, 2, _T("sFriendlyName %ls\n"), sFriendlyName);
54        CComBSTR sClassIdentifier;
55        if(SUCCEEDED(pTuningSpace->get_CLSID(&sClassIdentifier)))
56                _Z2(atlTraceGeneral, 2, _T("CLSID %ls\n"), sClassIdentifier);
57        CComBSTR sNetworkType;
58        if(SUCCEEDED(pTuningSpace->get_NetworkType(&sNetworkType)))
59                _Z2(atlTraceGeneral, 2, _T("sNetworkType %ls\n"), sNetworkType);
60        //pTuningSpace->EnumCategoryGUIDs
61        //pTuningSpace->EnumDeviceMonikers
62        //pTuningSpace->get_DefaultPreferredComponentTypes
63        CComBSTR sFrequencyMapping;
64        if(SUCCEEDED(pTuningSpace->get_FrequencyMapping(&sFrequencyMapping)))
65                _Z2(atlTraceGeneral, 2, _T("sFrequencyMapping %ls\n"), sFrequencyMapping);
66        CComPtr<ILocator> pDefaultLocator;
67    if(SUCCEEDED(pTuningSpace->get_DefaultLocator(&pDefaultLocator)))
68        {
69                _Z2(atlTraceGeneral, 2, _T("pDefaultLocator %ls\n"), pDefaultLocator);
70                if(pDefaultLocator)
71                        TraceLocator(pDefaultLocator);
72        }
73}
74
75inline VOID TraceScanningTuner(IScanningTuner* pScanningTuner)
76{
77        _A(pScanningTuner);
78        CComPtr<ITuningSpace> pTuningSpace;
79        const HRESULT nGetTuningSpaceResult = pScanningTuner->get_TuningSpace(&pTuningSpace);
80        if(SUCCEEDED(nGetTuningSpaceResult))
81                TraceTuningSpace(pTuningSpace);
82        else
83                _Z2(atlTraceGeneral, 2, _T("nGetTuningSpaceResult 0x%08x\n"), nGetTuningSpaceResult);
84        CComPtr<ITuneRequest> pTuneRequest;
85        const HRESULT nGetTuneRequestResult = pScanningTuner->get_TuneRequest(&pTuneRequest);
86        if(SUCCEEDED(nGetTuneRequestResult))
87        {
88                CComPtr<ITuningSpace> pTuningSpace;
89                const HRESULT nGetTuningSpaceResult = pTuneRequest->get_TuningSpace(&pTuningSpace);
90                if(SUCCEEDED(nGetTuningSpaceResult))
91                        TraceTuningSpace(pTuningSpace);
92                else
93                        _Z2(atlTraceGeneral, 2, _T("nGetTuningSpaceResult 0x%08x\n"), nGetTuningSpaceResult);
94                //pTuneRequest->get_Components(
95                CComPtr<ILocator> pLocator;
96                const HRESULT nGetLocatorResult = pTuneRequest->get_Locator(&pLocator);
97                if(SUCCEEDED(nGetLocatorResult))
98                        TraceLocator(pLocator);
99                else
100                        _Z2(atlTraceGeneral, 2, _T("nGetLocatorResult 0x%08x\n"), nGetLocatorResult);
101                // ...
102        } else
103                _Z2(atlTraceGeneral, 2, _T("nGetTuneRequestResult 0x%08x\n"), nGetTuneRequestResult);
104        // ...
105        //pScanningTuner->get_PreferredComponentTypes(
106        //pScanningTuner->get_SignalStrength(
107}
Note: See TracBrowser for help on using the repository browser.