Commit 69761ae7 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

strmbase: Shift source/destination rectangle when updating top or left property.

parent 96d2593e
...@@ -134,14 +134,14 @@ static void test_basic_video(void) ...@@ -134,14 +134,14 @@ static void test_basic_video(void)
hr = IBasicVideo_GetSourcePosition(pbv, &left, &top, &width, &height); hr = IBasicVideo_GetSourcePosition(pbv, &left, &top, &width, &height);
ok(hr == S_OK, "Cannot get source position returned: %x\n", hr); ok(hr == S_OK, "Cannot get source position returned: %x\n", hr);
ok(left == video_width/3, "expected %d, got %d\n", video_width/3, left); ok(left == video_width/3, "expected %d, got %d\n", video_width/3, left);
todo_wine ok(width == video_width/3+1, "expected %d, got %d\n", video_width/3+1, width); ok(width == video_width/3+1, "expected %d, got %d\n", video_width/3+1, width);
hr = IBasicVideo_put_SourceTop(pbv, video_height/3); hr = IBasicVideo_put_SourceTop(pbv, video_height/3);
ok(hr==S_OK, "Cannot put source top returned: %x\n", hr); ok(hr==S_OK, "Cannot put source top returned: %x\n", hr);
hr = IBasicVideo_GetSourcePosition(pbv, &left, &top, &width, &height); hr = IBasicVideo_GetSourcePosition(pbv, &left, &top, &width, &height);
ok(hr == S_OK, "Cannot get source position returned: %x\n", hr); ok(hr == S_OK, "Cannot get source position returned: %x\n", hr);
ok(top == video_height/3, "expected %d, got %d\n", video_height/3, top); ok(top == video_height/3, "expected %d, got %d\n", video_height/3, top);
todo_wine ok(height == video_height/3+1, "expected %d, got %d\n", video_height/3+1, height); ok(height == video_height/3+1, "expected %d, got %d\n", video_height/3+1, height);
hr = IBasicVideo_put_SourceWidth(pbv, video_width/4+1); hr = IBasicVideo_put_SourceWidth(pbv, video_width/4+1);
ok(hr==S_OK, "Cannot put source width returned: %x\n", hr); ok(hr==S_OK, "Cannot put source width returned: %x\n", hr);
...@@ -222,14 +222,14 @@ static void test_basic_video(void) ...@@ -222,14 +222,14 @@ static void test_basic_video(void)
hr = IBasicVideo_GetDestinationPosition(pbv, &left, &top, &width, &height); hr = IBasicVideo_GetDestinationPosition(pbv, &left, &top, &width, &height);
ok(hr == S_OK, "Cannot get source position returned: %x\n", hr); ok(hr == S_OK, "Cannot get source position returned: %x\n", hr);
ok(left == video_width/3, "expected %d, got %d\n", video_width/3, left); ok(left == video_width/3, "expected %d, got %d\n", video_width/3, left);
todo_wine ok(width == video_width/3+1, "expected %d, got %d\n", video_width/3+1, width); ok(width == video_width/3+1, "expected %d, got %d\n", video_width/3+1, width);
hr = IBasicVideo_put_DestinationTop(pbv, video_height/3); hr = IBasicVideo_put_DestinationTop(pbv, video_height/3);
ok(hr==S_OK, "Cannot put destination top returned: %x\n", hr); ok(hr==S_OK, "Cannot put destination top returned: %x\n", hr);
hr = IBasicVideo_GetDestinationPosition(pbv, &left, &top, &width, &height); hr = IBasicVideo_GetDestinationPosition(pbv, &left, &top, &width, &height);
ok(hr == S_OK, "Cannot get source position returned: %x\n", hr); ok(hr == S_OK, "Cannot get source position returned: %x\n", hr);
ok(top == video_height/3, "expected %d, got %d\n", video_height/3, top); ok(top == video_height/3, "expected %d, got %d\n", video_height/3, top);
todo_wine ok(height == video_height/3+1, "expected %d, got %d\n", video_height/3+1, height); ok(height == video_height/3+1, "expected %d, got %d\n", video_height/3+1, height);
hr = IBasicVideo_put_DestinationWidth(pbv, video_width/4+1); hr = IBasicVideo_put_DestinationWidth(pbv, video_width/4+1);
ok(hr==S_OK, "Cannot put destination width returned: %x\n", hr); ok(hr==S_OK, "Cannot put destination width returned: %x\n", hr);
......
...@@ -178,6 +178,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG Sour ...@@ -178,6 +178,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG Sour
TRACE("(%p/%p)->(%d)\n", This, iface, SourceLeft); TRACE("(%p/%p)->(%d)\n", This, iface, SourceLeft);
This->pFuncsTable->pfnGetSourceRect(This, &SourceRect); This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
SourceRect.right = (SourceRect.right - SourceRect.left) + SourceLeft;
SourceRect.left = SourceLeft; SourceRect.left = SourceLeft;
This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); This->pFuncsTable->pfnSetSourceRect(This, &SourceRect);
...@@ -232,6 +233,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG Sourc ...@@ -232,6 +233,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG Sourc
TRACE("(%p/%p)->(%d)\n", This, iface, SourceTop); TRACE("(%p/%p)->(%d)\n", This, iface, SourceTop);
This->pFuncsTable->pfnGetSourceRect(This, &SourceRect); This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
SourceRect.bottom = (SourceRect.bottom - SourceRect.top) + SourceTop;
SourceRect.top = SourceTop; SourceRect.top = SourceTop;
This->pFuncsTable->pfnSetSourceRect(This, &SourceRect); This->pFuncsTable->pfnSetSourceRect(This, &SourceRect);
...@@ -287,6 +289,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG ...@@ -287,6 +289,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG
TRACE("(%p/%p)->(%d)\n", This, iface, DestinationLeft); TRACE("(%p/%p)->(%d)\n", This, iface, DestinationLeft);
This->pFuncsTable->pfnGetTargetRect(This, &DestRect); This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
DestRect.right = (DestRect.right - DestRect.left) + DestinationLeft;
DestRect.left = DestinationLeft; DestRect.left = DestinationLeft;
This->pFuncsTable->pfnSetTargetRect(This, &DestRect); This->pFuncsTable->pfnSetTargetRect(This, &DestRect);
...@@ -341,6 +344,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG ...@@ -341,6 +344,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG
TRACE("(%p/%p)->(%d)\n", This, iface, DestinationTop); TRACE("(%p/%p)->(%d)\n", This, iface, DestinationTop);
This->pFuncsTable->pfnGetTargetRect(This, &DestRect); This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
DestRect.bottom = (DestRect.bottom - DestRect.top) + DestinationTop;
DestRect.top = DestinationTop; DestRect.top = DestinationTop;
This->pFuncsTable->pfnSetTargetRect(This, &DestRect); This->pFuncsTable->pfnSetTargetRect(This, &DestRect);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment