1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5  * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 #ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_BASEINPUTPIN_H_
8 #define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_BASEINPUTPIN_H_
9 
10 
11 #include "BasePin.h"
12 
13 namespace mozilla {
14 namespace media {
15 
16 _COM_SMARTPTR_TYPEDEF(IMemAllocator, __uuidof(IMemAllocator));
17 
18 class BaseInputPin : public BasePin
19                    , public IMemInputPin
20 {
21 protected:
22   BaseInputPin(
23     const wchar_t* aObjectName,
24     BaseFilter *aFilter,
25     CriticalSection *aLock,
26     HRESULT *aHR,
27     const wchar_t* aName)
28     : BasePin(aFilter, aLock, aName, PINDIR_INPUT)
29     , mFlushing(false)
30     , mReadOnly(false)
31   {
32     *aHR = S_OK;
33   }
34 
35   STDMETHODIMP BeginFlush();
36   STDMETHODIMP EndFlush();
37   STDMETHODIMP QueryInterface(REFIID aIId, void **aInterface);
38   STDMETHODIMP_(ULONG) AddRef() { return mFilter->AddRef(); }
39   STDMETHODIMP_(ULONG) Release() { return mFilter->Release(); }
40 
41   STDMETHODIMP GetAllocator(IMemAllocator **aAllocator);
42   STDMETHODIMP NotifyAllocator(IMemAllocator *aAllocator, BOOL aReadOnly);
43   STDMETHODIMP GetAllocatorRequirements(ALLOCATOR_PROPERTIES *aProps);
44   STDMETHODIMP Receive(IMediaSample *aSample);
45   STDMETHODIMP ReceiveMultiple(IMediaSample **aSamples, long aSampleCount, long *aProcessedCount);
46   STDMETHODIMP ReceiveCanBlock();
47 protected:
48   bool mFlushing;
49   bool mReadOnly;
50   IMemAllocatorPtr mAllocator;
51 };
52 
53 }
54 }
55 
56 #endif
57