Support arbitrary video resolution in getUserMedia API
[WebKit-https.git] / Source / WebCore / platform / mediastream / mac / MockRealtimeVideoSourceMac.h
index 73129e1..0b6e0ab 100644 (file)
@@ -43,6 +43,8 @@ typedef struct __CVPixelBufferPool *CVPixelBufferPoolRef;
 
 namespace WebCore {
 
+class PixelBufferResizer;
+
 class MockRealtimeVideoSourceMac final : public MockRealtimeVideoSource, private OrientationNotifier::Observer {
 public:
     virtual ~MockRealtimeVideoSourceMac() = default;
@@ -57,15 +59,17 @@ private:
     PlatformLayer* platformLayer() const;
     void updateSampleBuffer() final;
     void settingsDidChange(OptionSet<RealtimeMediaSourceSettings::Flag>) final;
+    bool canResizeVideoFrames() const final { return true; }
+    void setSizeAndFrameRateWithPreset(IntSize, double, RefPtr<VideoPreset>) final;
 
     void orientationChanged(int orientation) final;
     void monitorOrientation(OrientationNotifier&) final;
 
-    mutable RetainPtr<CGImageRef> m_previewImage;
-    mutable RetainPtr<PlatformLayer> m_previewLayer;
     mutable RetainPtr<CVPixelBufferPoolRef> m_bufferPool;
     MediaSample::VideoRotation m_deviceOrientation { MediaSample::VideoRotation::None };
     std::unique_ptr<PixelBufferConformerCV> m_pixelBufferConformer;
+    std::unique_ptr<PixelBufferResizer> m_pixelBufferResizer;
+    IntSize m_presetSize;
 };
 
 } // namespace WebCore