mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
Fix bug #6682 (Can't change resolution for YUY2 camera with DShow)
This commit is contained in:
parent
7fea7e0629
commit
3f2ab5d3b5
@ -2447,13 +2447,15 @@ static bool setSizeAndSubtype(videoDevice * VD, int attemptWidth, int attemptHei
|
||||
VD->pAmMediaType->subtype = mediatype;
|
||||
|
||||
//buffer size
|
||||
if (mediatype == MEDIASUBTYPE_RGB24)
|
||||
{
|
||||
VD->pAmMediaType->lSampleSize = attemptWidth*attemptHeight*3;
|
||||
if (mediatype == MEDIASUBTYPE_RGB24){
|
||||
VD->pAmMediaType->lSampleSize = attemptWidth*attemptHeight * 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
// For compressed data, the value can be zero.
|
||||
else if ((mediatype == MEDIASUBTYPE_YUY2) || (mediatype == MEDIASUBTYPE_YVYU) ||
|
||||
(mediatype == MEDIASUBTYPE_UYVY)){
|
||||
|
||||
VD->pAmMediaType->lSampleSize = attemptWidth*attemptHeight * 2;
|
||||
}
|
||||
else{
|
||||
VD->pAmMediaType->lSampleSize = 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user