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 19namespace media { 20 21// Define GUID for I420. This is the color format we would like to support but 22// it is not defined in the DirectShow SDK. 23// http://msdn.microsoft.com/en-us/library/dd757532.aspx 24// 30323449-0000-0010-8000-00AA00389B71. 25extern GUID kMediaSubTypeI420; 26 27// UYVY synonym with BT709 color components, used in HD video. This variation 28// might appear in non-USB capture cards and it's implemented as a normal YUV 29// pixel format with the characters HDYC encoded in the first array word. 30extern GUID kMediaSubTypeHDYC; 31 32class SinkInputPin; 33 34class __declspec(uuid("88cdbbdc-a73b-4afa-acbf-15d5e2ce12c3")) 35 SinkFilter : public FilterBase { 36 public: 37 explicit SinkFilter(SinkFilterObserver* observer); 38 virtual ~SinkFilter(); 39 40 void SetRequestedMediaFormat(const VideoCaptureFormat& format); 41 // Returns the format that is negotiated when this 42 // filter is connected to a media filter. 43 const VideoCaptureFormat& ResultingFormat(); 44 45 // Implement FilterBase. 46 virtual size_t NoOfPins(); 47 virtual IPin* GetPin(int index); 48 49 STDMETHOD(GetClassID)(CLSID* clsid); 50 51 private: 52 scoped_refptr<SinkInputPin> input_pin_; 53 54 DISALLOW_IMPLICIT_CONSTRUCTORS(SinkFilter); 55}; 56 57} // namespace media 58 59#endif // MEDIA_VIDEO_CAPTURE_WIN_SINK_FILTER_WIN_H_ 60