Updating XTBs based on .GRDs from branch master
[chromium-blink-merge.git] / media / capture / video / win / sink_input_pin_win.h
blobb0d2f16547ffca5945c05b6d5ee594246f933ead
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.
5 // Implement a DirectShow input pin used for receiving captured frames from
6 // a DirectShow Capture filter.
8 #ifndef MEDIA_VIDEO_CAPTURE_WIN_SINK_INPUT_PIN_WIN_H_
9 #define MEDIA_VIDEO_CAPTURE_WIN_SINK_INPUT_PIN_WIN_H_
11 #include "media/base/video_capture_types.h"
12 #include "media/capture/video/video_capture_device.h"
13 #include "media/capture/video/win/pin_base_win.h"
14 #include "media/capture/video/win/sink_filter_win.h"
16 namespace media {
18 // Const used for converting Seconds to REFERENCE_TIME.
19 extern const REFERENCE_TIME kSecondsToReferenceTime;
21 // Input pin of the SinkFilter.
22 class SinkInputPin : public PinBase {
23 public:
24 SinkInputPin(IBaseFilter* filter, SinkFilterObserver* observer);
26 void SetRequestedMediaFormat(VideoCapturePixelFormat pixel_format,
27 float frame_rate,
28 const BITMAPINFOHEADER& info_header);
29 // Returns the capability that is negotiated when this
30 // pin is connected to a media filter.
31 const VideoCaptureFormat& ResultingFormat();
33 // Implement PinBase.
34 bool IsMediaTypeValid(const AM_MEDIA_TYPE* media_type) override;
35 bool GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) override;
37 STDMETHOD(Receive)(IMediaSample* media_sample) override;
39 private:
40 ~SinkInputPin() override;
42 VideoCapturePixelFormat requested_pixel_format_;
43 float requested_frame_rate_;
44 BITMAPINFOHEADER requested_info_header_;
45 VideoCaptureFormat resulting_format_;
46 SinkFilterObserver* observer_;
48 DISALLOW_IMPLICIT_CONSTRUCTORS(SinkInputPin);
51 } // namespace media
53 #endif // MEDIA_VIDEO_CAPTURE_WIN_SINK_INPUT_PIN_WIN_H_