OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Implement a DirectShow input pin used for receiving captured frames from | 5 // Implement a DirectShow input pin used for receiving captured frames from |
6 // a DirectShow Capture filter. | 6 // a DirectShow Capture filter. |
7 | 7 |
8 #ifndef MEDIA_VIDEO_CAPTURE_WIN_SINK_INPUT_PIN_WIN_H_ | 8 #ifndef MEDIA_VIDEO_CAPTURE_WIN_SINK_INPUT_PIN_WIN_H_ |
9 #define MEDIA_VIDEO_CAPTURE_WIN_SINK_INPUT_PIN_WIN_H_ | 9 #define MEDIA_VIDEO_CAPTURE_WIN_SINK_INPUT_PIN_WIN_H_ |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 // Input pin of the SinkFilter. | 21 // Input pin of the SinkFilter. |
22 class SinkInputPin : public PinBase { | 22 class SinkInputPin : public PinBase { |
23 public: | 23 public: |
24 SinkInputPin(IBaseFilter* filter, SinkFilterObserver* observer); | 24 SinkInputPin(IBaseFilter* filter, SinkFilterObserver* observer); |
25 | 25 |
26 void SetRequestedMediaFormat(VideoPixelFormat pixel_format, | 26 void SetRequestedMediaFormat(VideoPixelFormat pixel_format, |
27 float frame_rate, | 27 float frame_rate, |
28 const BITMAPINFOHEADER& info_header); | 28 const BITMAPINFOHEADER& info_header); |
29 // Returns the capability that is negotiated when this | 29 // Returns the capability that is negotiated when this |
30 // pin is connected to a media filter. | 30 // pin is connected to a media filter. |
31 const VideoCaptureFormat& ResultingFormat(); | 31 const VideoCaptureFormat& resulting_format() const { |
| 32 return resulting_format_; |
| 33 } |
32 | 34 |
33 // Implement PinBase. | 35 // Implement PinBase. |
34 bool IsMediaTypeValid(const AM_MEDIA_TYPE* media_type) override; | 36 bool IsMediaTypeValid(const AM_MEDIA_TYPE* media_type) override; |
35 bool GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) override; | 37 bool GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) override; |
36 | 38 |
37 STDMETHOD(Receive)(IMediaSample* media_sample) override; | 39 STDMETHOD(Receive)(IMediaSample* media_sample) override; |
38 | 40 |
39 private: | 41 private: |
40 ~SinkInputPin() override; | 42 ~SinkInputPin() override; |
41 | 43 |
42 VideoPixelFormat requested_pixel_format_; | 44 VideoPixelFormat requested_pixel_format_; |
43 float requested_frame_rate_; | 45 float requested_frame_rate_; |
44 BITMAPINFOHEADER requested_info_header_; | 46 BITMAPINFOHEADER requested_info_header_; |
45 VideoCaptureFormat resulting_format_; | 47 VideoCaptureFormat resulting_format_; |
46 SinkFilterObserver* observer_; | 48 SinkFilterObserver* observer_; |
47 | 49 |
48 DISALLOW_IMPLICIT_CONSTRUCTORS(SinkInputPin); | 50 DISALLOW_IMPLICIT_CONSTRUCTORS(SinkInputPin); |
49 }; | 51 }; |
50 | 52 |
51 } // namespace media | 53 } // namespace media |
52 | 54 |
53 #endif // MEDIA_VIDEO_CAPTURE_WIN_SINK_INPUT_PIN_WIN_H_ | 55 #endif // MEDIA_VIDEO_CAPTURE_WIN_SINK_INPUT_PIN_WIN_H_ |
OLD | NEW |