Home | History | Annotate | Download | only in win
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 // Implement a DirectShow sink filter used for receiving captured frames from
      6 // a DirectShow Capture filter.
      7 
      8 #ifndef MEDIA_VIDEO_CAPTURE_WIN_SINK_FILTER_WIN_H_
      9 #define MEDIA_VIDEO_CAPTURE_WIN_SINK_FILTER_WIN_H_
     10 
     11 #include <windows.h>
     12 
     13 #include "base/memory/ref_counted.h"
     14 #include "media/video/capture/video_capture_device.h"
     15 #include "media/video/capture/video_capture_types.h"
     16 #include "media/video/capture/win/filter_base_win.h"
     17 #include "media/video/capture/win/sink_filter_observer_win.h"
     18 
     19 // Define GUID for I420. This is the color format we would like to support but
     20 // it is not defined in the DirectShow SDK.
     21 // http://msdn.microsoft.com/en-us/library/dd757532.aspx
     22 // 30323449-0000-0010-8000-00AA00389B71.
     23 extern GUID kMediaSubTypeI420;
     24 
     25 namespace media {
     26 
     27 class SinkInputPin;
     28 
     29 class __declspec(uuid("88cdbbdc-a73b-4afa-acbf-15d5e2ce12c3"))
     30     SinkFilter : public FilterBase {
     31  public:
     32   explicit SinkFilter(SinkFilterObserver* observer);
     33   virtual ~SinkFilter();
     34 
     35   void SetRequestedMediaFormat(const VideoCaptureFormat& format);
     36   // Returns the format that is negotiated when this
     37   // filter is connected to a media filter.
     38   const VideoCaptureFormat& ResultingFormat();
     39 
     40   // Implement FilterBase.
     41   virtual size_t NoOfPins();
     42   virtual IPin* GetPin(int index);
     43 
     44   STDMETHOD(GetClassID)(CLSID* clsid);
     45 
     46  private:
     47   scoped_refptr<SinkInputPin> input_pin_;
     48 
     49   DISALLOW_IMPLICIT_CONSTRUCTORS(SinkFilter);
     50 };
     51 
     52 }  // namespace media
     53 
     54 #endif  // MEDIA_VIDEO_CAPTURE_WIN_SINK_FILTER_WIN_H_
     55