summaryrefslogtreecommitdiff
path: root/audio/sysvad/EndpointsCommon/a2dphpspeakertopo.cpp
blob: 0f24a4dcabf992daf41d666859e511354f07e8aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*++

Copyright (c) Microsoft Corporation All Rights Reserved

Module Name:

    a2dphpspeakertopo.cpp

Abstract:

    Implementation of topology miniport for the A2DP Headphone speaker (external).

--*/
#ifdef SYSVAD_A2DP_SIDEBAND

#pragma warning (disable : 4127)

#include <sysvad.h>
#include "simple.h"
#include "mintopo.h"
#include "a2dphptopo.h"
#include "a2dphpspeakertopo.h"
#include "a2dphpspeakertoptable.h"

//=============================================================================
#pragma code_seg("PAGE")
NTSTATUS
PropertyHandler_A2dpHpSpeakerTopoFilter
( 
    _In_ PPCPROPERTY_REQUEST      PropertyRequest 
)
/*++

Routine Description:

  Redirects property request to miniport object

Arguments:

  PropertyRequest - 

Return Value:

  NT status code.

--*/
{
    PAGED_CODE();

    ASSERT(PropertyRequest);

    DPF_ENTER(("[PropertyHandler_A2dpHpSpeakerTopoFilter]"));

    // PropertryRequest structure is filled by portcls. 
    // MajorTarget is a pointer to miniport object for miniports.
    //
    NTSTATUS            ntStatus = STATUS_INVALID_DEVICE_REQUEST;

    if (IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, KSPROPSETID_Jack))
    {
        switch(PropertyRequest->PropertyItem->Id)
        {
            case KSPROPERTY_JACK_DESCRIPTION:
                ntStatus = PropertyHandler_A2dpHpJackDescription(
                    PropertyRequest,
                    ARRAYSIZE(A2dpHpSpeakerJackDescriptions),
                    A2dpHpSpeakerJackDescriptions);
                break;
                
            case KSPROPERTY_JACK_DESCRIPTION2:
                ntStatus = PropertyHandler_A2dpHpJackDescription2(
                    PropertyRequest,
                    ARRAYSIZE(A2dpHpSpeakerJackDescriptions),
                    A2dpHpSpeakerJackDescriptions);
                break;
                
            case KSPROPERTY_JACK_CONTAINERID:
                ntStatus = PropertyHandler_A2dpHpJackContainerId(
                    PropertyRequest,
                    ARRAYSIZE(A2dpHpSpeakerJackDescriptions),
                    A2dpHpSpeakerJackDescriptions);
                break;
        }
    }
    else if (IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, KSPROPSETID_BtAudio))
    {
        switch (PropertyRequest->PropertyItem->Id)
        {
            case KSPROPERTY_ONESHOT_RECONNECT:
                ntStatus = PropertyHandler_A2dpHpOneShotReconnect(PropertyRequest);
                break;

            case KSPROPERTY_ONESHOT_DISCONNECT:
                ntStatus = PropertyHandler_A2dpHpOneShotDisconnect(PropertyRequest);
                break;
        }
    }

    return ntStatus;
} // PropertyHandler_A2dpHpSpeakerTopoFilter

//=============================================================================
#pragma code_seg()
NTSTATUS
PropertyHandler_A2dpHpSpeakerTopoFilterEvent
(
    _In_    PPCEVENT_REQUEST    EventRequest
)
{
    ASSERT(EventRequest);

    DPF_ENTER(("[PropertyHandler_A2dpHpSpeakerTopoFilterEvent]"));

    return PropertyHandler_A2dpHpTopoNodeEvent(EventRequest);
}

#pragma code_seg()
#endif  // SYSVAD_A2DP_SIDEBAND