Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
fda713ec
Commit
fda713ec
authored
May 02, 2007
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- direct3d: fix for cropping, closes #1185
parent
3ce51320
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
modules/video_output/directx/direct3d.c
modules/video_output/directx/direct3d.c
+8
-5
modules/video_output/directx/events.c
modules/video_output/directx/events.c
+11
-5
No files found.
modules/video_output/directx/direct3d.c
View file @
fda713ec
...
@@ -404,7 +404,8 @@ static int Manage( vout_thread_t *p_vout )
...
@@ -404,7 +404,8 @@ static int Manage( vout_thread_t *p_vout )
SetWindowPos
(
p_vout
->
p_sys
->
hwnd
,
0
,
0
,
0
,
SetWindowPos
(
p_vout
->
p_sys
->
hwnd
,
0
,
0
,
0
,
rect_parent
.
right
-
rect_parent
.
left
,
rect_parent
.
right
-
rect_parent
.
left
,
rect_parent
.
bottom
-
rect_parent
.
top
,
0
);
rect_parent
.
bottom
-
rect_parent
.
top
,
SWP_NOZORDER
);
}
}
}
}
else
else
...
@@ -624,7 +625,9 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic )
...
@@ -624,7 +625,9 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic )
LPDIRECT3DDEVICE9
p_d3ddev
=
p_vout
->
p_sys
->
p_d3ddev
;
LPDIRECT3DDEVICE9
p_d3ddev
=
p_vout
->
p_sys
->
p_d3ddev
;
// Present the back buffer contents to the display
// Present the back buffer contents to the display
// stretching and filtering happens here
// stretching and filtering happens here
HRESULT
hr
=
IDirect3DDevice9_Present
(
p_d3ddev
,
NULL
,
NULL
,
NULL
,
NULL
);
HRESULT
hr
=
IDirect3DDevice9_Present
(
p_d3ddev
,
&
(
p_vout
->
p_sys
->
rect_src_clipped
),
NULL
,
NULL
,
NULL
);
if
(
FAILED
(
hr
)
)
if
(
FAILED
(
hr
)
)
msg_Dbg
(
p_vout
,
"%s:%d (hr=0x%0lX)"
,
__FUNCTION__
,
__LINE__
,
hr
);
msg_Dbg
(
p_vout
,
"%s:%d (hr=0x%0lX)"
,
__FUNCTION__
,
__LINE__
,
hr
);
}
}
...
@@ -643,7 +646,7 @@ static void FirstDisplay( vout_thread_t *p_vout, picture_t *p_pic )
...
@@ -643,7 +646,7 @@ static void FirstDisplay( vout_thread_t *p_vout, picture_t *p_pic )
** Video window is initially hidden, show it now since we got a
** Video window is initially hidden, show it now since we got a
** picture to show.
** picture to show.
*/
*/
SetWindowPos
(
p_vout
->
p_sys
->
hvideownd
,
NULL
,
0
,
0
,
0
,
0
,
SetWindowPos
(
p_vout
->
p_sys
->
hvideownd
,
0
,
0
,
0
,
0
,
0
,
SWP_ASYNCWINDOWPOS
|
SWP_ASYNCWINDOWPOS
|
SWP_FRAMECHANGED
|
SWP_FRAMECHANGED
|
SWP_SHOWWINDOW
|
SWP_SHOWWINDOW
|
...
@@ -754,7 +757,7 @@ static int Direct3DFillPresentationParameters(vout_thread_t *p_vout, D3DPRESENT_
...
@@ -754,7 +757,7 @@ static int Direct3DFillPresentationParameters(vout_thread_t *p_vout, D3DPRESENT_
d3dpp
->
hDeviceWindow
=
p_vout
->
p_sys
->
hvideownd
;
d3dpp
->
hDeviceWindow
=
p_vout
->
p_sys
->
hvideownd
;
d3dpp
->
BackBufferWidth
=
p_vout
->
output
.
i_width
;
d3dpp
->
BackBufferWidth
=
p_vout
->
output
.
i_width
;
d3dpp
->
BackBufferHeight
=
p_vout
->
output
.
i_height
;
d3dpp
->
BackBufferHeight
=
p_vout
->
output
.
i_height
;
d3dpp
->
SwapEffect
=
D3DSWAPEFFECT_
DISCARD
;
d3dpp
->
SwapEffect
=
D3DSWAPEFFECT_
COPY
;
d3dpp
->
MultiSampleType
=
D3DMULTISAMPLE_NONE
;
d3dpp
->
MultiSampleType
=
D3DMULTISAMPLE_NONE
;
d3dpp
->
PresentationInterval
=
D3DPRESENT_INTERVAL_DEFAULT
;
d3dpp
->
PresentationInterval
=
D3DPRESENT_INTERVAL_DEFAULT
;
d3dpp
->
BackBufferFormat
=
d3ddm
.
Format
;
d3dpp
->
BackBufferFormat
=
d3ddm
.
Format
;
...
@@ -911,7 +914,7 @@ static D3DFORMAT Direct3DVoutSelectFormat( vout_thread_t *p_vout, D3DFORMAT targ
...
@@ -911,7 +914,7 @@ static D3DFORMAT Direct3DVoutSelectFormat( vout_thread_t *p_vout, D3DFORMAT targ
return
D3DFMT_UNKNOWN
;
return
D3DFMT_UNKNOWN
;
}
}
D3DFORMAT
Direct3DVoutFindFormat
(
vout_thread_t
*
p_vout
,
int
i_chroma
,
D3DFORMAT
target
)
static
D3DFORMAT
Direct3DVoutFindFormat
(
vout_thread_t
*
p_vout
,
int
i_chroma
,
D3DFORMAT
target
)
{
{
if
(
p_vout
->
p_sys
->
b_hw_yuv
&&
!
_got_vista_or_above
)
if
(
p_vout
->
p_sys
->
b_hw_yuv
&&
!
_got_vista_or_above
)
{
{
...
...
modules/video_output/directx/events.c
View file @
fda713ec
...
@@ -630,8 +630,9 @@ void E_(DirectXUpdateRects)( vout_thread_t *p_vout, vlc_bool_t b_force )
...
@@ -630,8 +630,9 @@ void E_(DirectXUpdateRects)( vout_thread_t *p_vout, vlc_bool_t b_force )
&
i_x
,
&
i_y
,
&
i_width
,
&
i_height
);
&
i_x
,
&
i_y
,
&
i_width
,
&
i_height
);
if
(
p_vout
->
p_sys
->
hvideownd
)
if
(
p_vout
->
p_sys
->
hvideownd
)
SetWindowPos
(
p_vout
->
p_sys
->
hvideownd
,
HWND_TOP
,
SetWindowPos
(
p_vout
->
p_sys
->
hvideownd
,
0
,
i_x
,
i_y
,
i_width
,
i_height
,
0
);
i_x
,
i_y
,
i_width
,
i_height
,
SWP_NOCOPYBITS
|
SWP_NOZORDER
|
SWP_ASYNCWINDOWPOS
);
/* Destination image position and dimensions */
/* Destination image position and dimensions */
rect_dest
.
left
=
point
.
x
+
i_x
;
rect_dest
.
left
=
point
.
x
+
i_x
;
...
@@ -653,7 +654,6 @@ void E_(DirectXUpdateRects)( vout_thread_t *p_vout, vlc_bool_t b_force )
...
@@ -653,7 +654,6 @@ void E_(DirectXUpdateRects)( vout_thread_t *p_vout, vlc_bool_t b_force )
p_vout
->
p_sys
->
i_align_dest_size
/
2
)
&
p_vout
->
p_sys
->
i_align_dest_size
/
2
)
&
~
p_vout
->
p_sys
->
i_align_dest_size
)
+
rect_dest
.
left
;
~
p_vout
->
p_sys
->
i_align_dest_size
)
+
rect_dest
.
left
;
}
}
#endif
/* UpdateOverlay directdraw function doesn't automatically clip to the
/* UpdateOverlay directdraw function doesn't automatically clip to the
* display size so we need to do it otherwise it will fail */
* display size so we need to do it otherwise it will fail */
...
@@ -680,6 +680,12 @@ void E_(DirectXUpdateRects)( vout_thread_t *p_vout, vlc_bool_t b_force )
...
@@ -680,6 +680,12 @@ void E_(DirectXUpdateRects)( vout_thread_t *p_vout, vlc_bool_t b_force )
SetRectEmpty
(
&
rect_src_clipped
);
SetRectEmpty
(
&
rect_src_clipped
);
return
;
return
;
}
}
#else
/* MODULE_NAME_IS_vout_directx */
/* AFAIK, there are no clipping constraints in Direct3D or OpenGL */
rect_dest_clipped
=
rect_dest
;
#endif
/* src image dimensions */
/* src image dimensions */
rect_src
.
left
=
0
;
rect_src
.
left
=
0
;
...
@@ -727,6 +733,7 @@ void E_(DirectXUpdateRects)( vout_thread_t *p_vout, vlc_bool_t b_force )
...
@@ -727,6 +733,7 @@ void E_(DirectXUpdateRects)( vout_thread_t *p_vout, vlc_bool_t b_force )
rect_src_clipped.right, rect_src_clipped.bottom );
rect_src_clipped.right, rect_src_clipped.bottom );
#endif
#endif
#ifdef MODULE_NAME_IS_vout_directx
/* The destination coordinates need to be relative to the current
/* The destination coordinates need to be relative to the current
* directdraw primary surface (display) */
* directdraw primary surface (display) */
rect_dest_clipped
.
left
-=
p_vout
->
p_sys
->
rect_display
.
left
;
rect_dest_clipped
.
left
-=
p_vout
->
p_sys
->
rect_display
.
left
;
...
@@ -734,7 +741,6 @@ void E_(DirectXUpdateRects)( vout_thread_t *p_vout, vlc_bool_t b_force )
...
@@ -734,7 +741,6 @@ void E_(DirectXUpdateRects)( vout_thread_t *p_vout, vlc_bool_t b_force )
rect_dest_clipped
.
top
-=
p_vout
->
p_sys
->
rect_display
.
top
;
rect_dest_clipped
.
top
-=
p_vout
->
p_sys
->
rect_display
.
top
;
rect_dest_clipped
.
bottom
-=
p_vout
->
p_sys
->
rect_display
.
top
;
rect_dest_clipped
.
bottom
-=
p_vout
->
p_sys
->
rect_display
.
top
;
#ifdef MODULE_NAME_IS_vout_directx
if
(
p_vout
->
p_sys
->
b_using_overlay
)
if
(
p_vout
->
p_sys
->
b_using_overlay
)
E_
(
DirectXUpdateOverlay
)(
p_vout
);
E_
(
DirectXUpdateOverlay
)(
p_vout
);
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment