Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
dfbabf4e
Commit
dfbabf4e
authored
Jan 27, 2004
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/vout.m: fixed OpenGL aspect ratio
parent
e38e99ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
18 deletions
+30
-18
modules/gui/macosx/vout.m
modules/gui/macosx/vout.m
+30
-18
No files found.
modules/gui/macosx/vout.m
View file @
dfbabf4e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* vout.m: MacOS X video output module
* vout.m: MacOS X video output module
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.7
1 2004/01/26 20:00:33
titer Exp $
* $Id: vout.m,v 1.7
2 2004/01/27 12:11:48
titer Exp $
*
*
* Authors: Colin Delacroix <colin@zoy.org>
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
* Florian G. Pflug <fgp@phlo.org>
...
@@ -1284,9 +1284,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
...
@@ -1284,9 +1284,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
glPixelStorei
(
GL_UNPACK_ALIGNMENT
,
1
);
glPixelStorei
(
GL_UNPACK_ALIGNMENT
,
1
);
glTexEnvi
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_REPLACE
);
glTexEnvi
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_REPLACE
);
glClearColor
(
1
.
0
,
1
.
0
,
1
.
0
,
1
.
0
);
glClearColor
(
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
);
glColor4f
(
1
.
0
,
1
.
0
,
1
.
0
,
1
.
0
);
glClearColor
(
0
.
5
,
0
.
5
,
0
.
5
,
0
.
5
);
i_init_done
=
0
;
i_init_done
=
0
;
i_textures_loaded
=
0
;
i_textures_loaded
=
0
;
...
@@ -1296,12 +1294,9 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
...
@@ -1296,12 +1294,9 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
-
(
void
)
reshape
-
(
void
)
reshape
{
{
NSRect
bounds
;
[[
self
openGLContext
]
update
];
NSRect
bounds
=
[
self
bounds
];
[[
self
openGLContext
]
update
];
glViewport
(
0
,
0
,
(
GLint
)
bounds
.
size
.
width
,
(
GLint
)
bounds
.
size
.
height
);
bounds
=
[
self
bounds
];
glViewport
(
0
,
0
,
(
GLsizei
)
bounds
.
size
.
width
,
(
GLsizei
)
bounds
.
size
.
height
);
}
}
-
(
void
)
drawRect
:(
NSRect
)
rect
-
(
void
)
drawRect
:(
NSRect
)
rect
...
@@ -1314,10 +1309,11 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
...
@@ -1314,10 +1309,11 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
/* Make this current context */
/* Make this current context */
[[
self
openGLContext
]
makeCurrentContext
];
[[
self
openGLContext
]
makeCurrentContext
];
/* Black background */
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
);
if
(
!
i_init_done
)
if
(
!
i_init_done
)
{
{
/* Nothing to display, blank the view */
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
);
return
;
return
;
}
}
...
@@ -1333,7 +1329,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
...
@@ -1333,7 +1329,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
glBindTexture
(
GL_TEXTURE_RECTANGLE_EXT
,
pi_textures
[
i_index
]);
glBindTexture
(
GL_TEXTURE_RECTANGLE_EXT
,
pi_textures
[
i_index
]);
/* Map our buffer to the texture */
/* Map our buffer to the texture */
glTexImage2D
(
GL_TEXTURE_RECTANGLE_EXT
,
0
,
GL_RGB
8
,
glTexImage2D
(
GL_TEXTURE_RECTANGLE_EXT
,
0
,
GL_RGB
A
,
p_vout
->
output
.
i_width
,
p_vout
->
output
.
i_height
,
0
,
p_vout
->
output
.
i_width
,
p_vout
->
output
.
i_height
,
0
,
GL_YCBCR_422_APPLE
,
GL_UNSIGNED_SHORT_8_8_APPLE
,
GL_YCBCR_422_APPLE
,
GL_UNSIGNED_SHORT_8_8_APPLE
,
PP_OUTPUTPICTURE
[
i_index
]
->
p_data
);
PP_OUTPUTPICTURE
[
i_index
]
->
p_data
);
...
@@ -1370,20 +1366,36 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
...
@@ -1370,20 +1366,36 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
/* Draw a quad with our texture on it */
/* Draw a quad with our texture on it */
NSRect
bounds
=
[
self
bounds
];
float
f_x
,
f_y
;
if
(
bounds
.
size
.
height
*
p_vout
->
i_window_width
<
bounds
.
size
.
width
*
p_vout
->
i_window_height
)
{
f_x
=
bounds
.
size
.
height
*
p_vout
->
i_window_width
/
bounds
.
size
.
width
/
p_vout
->
i_window_height
;
f_y
=
1
.
0
;
}
else
{
f_x
=
1
.
0
;
f_y
=
bounds
.
size
.
width
*
p_vout
->
i_window_height
/
bounds
.
size
.
height
/
p_vout
->
i_window_width
;
}
glBegin
(
GL_QUADS
);
glBegin
(
GL_QUADS
);
/* Top left */
/* Top left */
glTexCoord2f
(
0
.
0
f
,
0
.
0
f
);
glTexCoord2f
(
0
.
0
f
,
0
.
0
f
);
glVertex2f
(
-
1
.
0
f
,
1
.
0
f
);
glVertex2f
(
-
f_x
,
f_y
);
/* Bottom left */
/* Bottom left */
glTexCoord2f
(
0
.
0
f
,
(
float
)
p_vout
->
output
.
i_height
);
glTexCoord2f
(
0
.
0
f
,
(
float
)
p_vout
->
output
.
i_height
);
glVertex2f
(
-
1
.
0
f
,
-
1
.
0
f
);
glVertex2f
(
-
f_x
,
-
f_y
);
/* Bottom right */
/* Bottom right */
glTexCoord2f
(
(
float
)
p_vout
->
output
.
i_width
,
glTexCoord2f
(
(
float
)
p_vout
->
output
.
i_width
,
(
float
)
p_vout
->
output
.
i_height
);
(
float
)
p_vout
->
output
.
i_height
);
glVertex2f
(
1
.
0
f
,
-
1
.
0
f
);
glVertex2f
(
f_x
,
-
f_y
);
/* Top right */
/* Top right */
glTexCoord2f
(
(
float
)
p_vout
->
output
.
i_width
,
0
.
0
f
);
glTexCoord2f
(
(
float
)
p_vout
->
output
.
i_width
,
0
.
0
f
);
glVertex2f
(
1
.
0
f
,
1
.
0
f
);
glVertex2f
(
f_x
,
f_y
);
glEnd
();
glEnd
();
/* Wait for the job to be done */
/* Wait for the job to be done */
...
...
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