OSVR-Core
SampleGrabberWrapper.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_SampleGrabberWrapper_h_GUID_3A2E02D3_5BD5_44B2_E95F_A31FE3B13ED1
26 #define INCLUDED_SampleGrabberWrapper_h_GUID_3A2E02D3_5BD5_44B2_E95F_A31FE3B13ED1
27 
28 // Internal Includes
29 #include "MediaSampleExchange.h"
30 #include "comutils/ComPtr.h"
31 
32 // Library/third-party includes
33 // - none
34 
35 // Standard includes
36 #include <strmif.h>
37 
38 // Forward declarations
40 
42  public:
45 
47  MediaSampleExchangePtr getExchange() const { return sampleExchange_; }
48 
50  comutils::Ptr<IBaseFilter> getFilter() { return sampleGrabber_; }
51 
53  void getConnectedMediaType(AM_MEDIA_TYPE &mt);
54 
56  void shutdown();
57 
58  private:
59  struct Impl;
60  std::unique_ptr<Impl> impl_;
61  MediaSampleExchangePtr sampleExchange_;
62  comutils::Ptr<IBaseFilter> sampleGrabber_;
63  std::unique_ptr<directx_samplegrabber_callback> callback_;
64 };
65 #endif // INCLUDED_SampleGrabberWrapper_h_GUID_3A2E02D3_5BD5_44B2_E95F_A31FE3B13ED1
Header with a template alias for the desired COM smart pointer.
MediaSampleExchangePtr getExchange() const
Get the producer/consumer object used to consume samples.
Definition: SampleGrabberWrapper.h:47
void shutdown()
Gets the callback to finish up all its samples.
Definition: SampleGrabberWrapper.cpp:92
comutils::Ptr< IBaseFilter > getFilter()
Get the SampleGrabber filter by its IBaseFilter interface.
Definition: SampleGrabberWrapper.h:50
void getConnectedMediaType(AM_MEDIA_TYPE &mt)
Forwards call on to SampleGrabber.
Definition: SampleGrabberWrapper.cpp:82
boost::intrusive_ptr< T > Ptr
Template alias for our desired COM smart pointer.
Definition: ComPtr.h:40
Definition: SampleGrabberWrapper.cpp:38
Definition: directx_samplegrabber_callback.h:44
Definition: SampleGrabberWrapper.h:41