| 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& resulting_format() const { | 31 const VideoCaptureFormat& ResultingFormat(); |
| 32 return resulting_format_; | |
| 33 } | |
| 34 | 32 |
| 35 // Implement PinBase. | 33 // Implement PinBase. |
| 36 bool IsMediaTypeValid(const AM_MEDIA_TYPE* media_type) override; | 34 bool IsMediaTypeValid(const AM_MEDIA_TYPE* media_type) override; |
| 37 bool GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) override; | 35 bool GetValidMediaType(int index, AM_MEDIA_TYPE* media_type) override; |
| 38 | 36 |
| 39 STDMETHOD(Receive)(IMediaSample* media_sample) override; | 37 STDMETHOD(Receive)(IMediaSample* media_sample) override; |
| 40 | 38 |
| 41 private: | 39 private: |
| 42 ~SinkInputPin() override; | 40 ~SinkInputPin() override; |
| 43 | 41 |
| 44 VideoPixelFormat requested_pixel_format_; | 42 VideoPixelFormat requested_pixel_format_; |
| 45 float requested_frame_rate_; | 43 float requested_frame_rate_; |
| 46 BITMAPINFOHEADER requested_info_header_; | 44 BITMAPINFOHEADER requested_info_header_; |
| 47 VideoCaptureFormat resulting_format_; | 45 VideoCaptureFormat resulting_format_; |
| 48 SinkFilterObserver* observer_; | 46 SinkFilterObserver* observer_; |
| 49 | 47 |
| 50 DISALLOW_IMPLICIT_CONSTRUCTORS(SinkInputPin); | 48 DISALLOW_IMPLICIT_CONSTRUCTORS(SinkInputPin); |
| 51 }; | 49 }; |
| 52 | 50 |
| 53 } // namespace media | 51 } // namespace media |
| 54 | 52 |
| 55 #endif // MEDIA_VIDEO_CAPTURE_WIN_SINK_INPUT_PIN_WIN_H_ | 53 #endif // MEDIA_VIDEO_CAPTURE_WIN_SINK_INPUT_PIN_WIN_H_ |
| OLD | NEW |