Skip to content

Commit b80b8ee

Browse files
committed
CaptureImplDirectShow: refactor around ComPtr<> changes and some extra robustness for non-DWORD aligned buffers
1 parent 9bab8f2 commit b80b8ee

File tree

2 files changed

+159
-53
lines changed

2 files changed

+159
-53
lines changed

include/cinder/CaptureImplDirectShow.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class CaptureImplDirectShow {
5656

5757
static const std::vector<Capture::DeviceRef>& getDevices( bool forceRefresh = false );
5858

59-
// Public method to update dimensions (used by DirectShow setup)
60-
void updateDimensions( int width, int height );
59+
// Public method to update dimensions with stride awareness (used by DirectShow setup)
60+
void updateDimensions( int width, int height, int rowStride, int imageSizeBytes );
6161

6262
class Device : public Capture::Device {
6363
public:
@@ -83,6 +83,8 @@ class CaptureImplDirectShow {
8383
std::unique_ptr<class SurfaceCache> mSurfaceCache;
8484

8585
int32_t mWidth, mHeight;
86+
int32_t mRowStride; // Actual bytes per row (may include padding)
87+
int32_t mImageSize; // Total buffer size in bytes
8688
mutable Surface8uRef mCurrentFrame;
8789
Capture::DeviceRef mDevice;
8890

0 commit comments

Comments
 (0)