summaryrefslogtreecommitdiff
path: root/sys/dshowvideosink/dshowvideofakesrc.h
blob: cf3017fdee18c11e5100aaaf5ad872b6c1fef579 (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
/* GStreamer
 * Copyright (C) 2008 Pioneers of the Inevitable <songbird@songbirdnest.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */
#ifndef __DSHOWVIDEOFAKESRC_H__
#define __DSHOWVIDEOFAKESRC_H__

#include <streams.h>
#include <gst/gst.h>

class VideoFakeSrcPin : public CDynamicOutputPin
{
protected:
  /* members */
  CMediaType m_MediaType;
  unsigned int m_SampleSize;

public:
  /* methods */
  VideoFakeSrcPin (CBaseFilter *pFilter, CCritSec *sec, HRESULT *hres);
  ~VideoFakeSrcPin ();

  STDMETHODIMP CopyToDestinationBuffer (byte *src, byte *dst);
  GstFlowReturn (PushBuffer) (GstBuffer *buf);

  /* Overrides */
  virtual HRESULT CheckMediaType(const CMediaType *pmt);
  HRESULT GetMediaType(int iPosition, CMediaType *pMediaType);
  virtual HRESULT DecideBufferSize (IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest);
  virtual HRESULT BreakConnect();
  virtual HRESULT CompleteConnect(IPin *pReceivePin);
  virtual HRESULT Inactive();
  STDMETHOD (SetMediaType) (AM_MEDIA_TYPE *pmt);
  STDMETHOD (Flush) ();
  STDMETHODIMP Notify(IBaseFilter * pSender, Quality q);
  STDMETHODIMP Disconnect();
  STDMETHODIMP Block(DWORD dwBlockFlags, HANDLE hEvent);
};

class VideoFakeSrc : public CBaseFilter
{
private:
  /* members */
  CCritSec m_critsec;
  VideoFakeSrcPin *m_pOutputPin;

  CAMEvent m_evFilterStoppingEvent;

public:
  /* methods */
  VideoFakeSrc  (void);
  ~VideoFakeSrc (void) {};

  VideoFakeSrcPin *GetOutputPin();

  /* Overrides */
  int       GetPinCount();
  CBasePin *GetPin(int n);

  STDMETHODIMP Run(REFERENCE_TIME tStart);
  STDMETHODIMP Stop(void);
  STDMETHODIMP Pause(void);
  STDMETHODIMP JoinFilterGraph(IFilterGraph* pGraph, LPCWSTR pName);
};

#endif /* __DSHOWVIDEOFAKESRC_H__ */