OSVR-Core
ConnectTwoFilters.h
Go to the documentation of this file.
1 
11 // Copyright 2015 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 #ifndef INCLUDED_ConnectTwoFilters_h_GUID_2F465D2A_B6CB_4CBD_E976_22BB9613AC94
26 #define INCLUDED_ConnectTwoFilters_h_GUID_2F465D2A_B6CB_4CBD_E976_22BB9613AC94
27 
28 // Internal Includes
29 #include "GetPin.h"
30 
31 // Library/third-party includes
32 #include <strmif.h>
33 
34 // Standard includes
35 // - none
36 
39 inline HRESULT ConnectTwoFilters(IGraphBuilder &pGraph, IBaseFilter &pFirst,
40  IBaseFilter &pSecond) {
41  auto pOut = GetPin(pFirst, PINDIR_OUTPUT);
42  auto pIn = GetPin(pSecond, PINDIR_INPUT);
43  return pGraph.Connect(pOut.get(), pIn.get());
44 }
45 
46 #endif // INCLUDED_ConnectTwoFilters_h_GUID_2F465D2A_B6CB_4CBD_E976_22BB9613AC94
HRESULT ConnectTwoFilters(IGraphBuilder &pGraph, IBaseFilter &pFirst, IBaseFilter &pSecond)
Helper function for connecting (the first) output pin on one filter to (the first) input pin on anoth...
Definition: ConnectTwoFilters.h:39
Header.
comutils::Ptr< IPin > GetPin(IBaseFilter &pFilter, PIN_DIRECTION const PinDir)
Helper function to get a pin of a particular direction.
Definition: GetPin.h:38