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
dd05490e
Commit
dd05490e
authored
Jan 12, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/video_output/caca.c: ported to win32.
parent
08b86f12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
1 deletion
+62
-1
modules/video_output/caca.c
modules/video_output/caca.c
+62
-1
No files found.
modules/video_output/caca.c
View file @
dd05490e
...
...
@@ -2,7 +2,7 @@
* caca.c: Color ASCII Art video output plugin using libcaca
*****************************************************************************
* Copyright (C) 2003, 2004 VideoLAN
* $Id: caca.c,v 1.
6 2004/01/08 19:22:10 sam
Exp $
* $Id: caca.c,v 1.
7 2004/01/12 16:16:41 gbazin
Exp $
*
* Authors: Sam Hocevar <sam@zoy.org>
*
...
...
@@ -76,6 +76,62 @@ static int Create( vlc_object_t *p_this )
{
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
#if defined( WIN32 ) && !defined( UNDER_CE )
if
(
AllocConsole
()
)
{
CONSOLE_SCREEN_BUFFER_INFO
csbiInfo
;
SMALL_RECT
rect
;
COORD
coord
;
HANDLE
hstdout
=
CreateConsoleScreenBuffer
(
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
CONSOLE_TEXTMODE_BUFFER
,
NULL
);
if
(
!
hstdout
||
hstdout
==
INVALID_HANDLE_VALUE
)
{
msg_Err
(
p_vout
,
"cannot create screen buffer"
);
FreeConsole
();
return
VLC_EGENERIC
;
}
if
(
!
SetConsoleActiveScreenBuffer
(
hstdout
)
)
{
msg_Err
(
p_vout
,
"cannot set active screen buffer"
);
FreeConsole
();
return
VLC_EGENERIC
;
}
coord
=
GetLargestConsoleWindowSize
(
hstdout
);
msg_Dbg
(
p_vout
,
"SetConsoleWindowInfo: %ix%i"
,
coord
.
X
,
coord
.
Y
);
/* Force size for now */
coord
.
X
=
100
;
coord
.
Y
=
40
;
if
(
!
SetConsoleScreenBufferSize
(
hstdout
,
coord
)
)
msg_Warn
(
p_vout
,
"SetConsoleScreenBufferSize %i %i"
,
coord
.
X
,
coord
.
Y
);
/* Get the current screen buffer size and window position. */
if
(
GetConsoleScreenBufferInfo
(
hstdout
,
&
csbiInfo
)
)
{
rect
.
Top
=
0
;
rect
.
Left
=
0
;
rect
.
Right
=
csbiInfo
.
dwMaximumWindowSize
.
X
-
1
;
rect
.
Bottom
=
csbiInfo
.
dwMaximumWindowSize
.
Y
-
1
;
if
(
!
SetConsoleWindowInfo
(
hstdout
,
TRUE
,
&
rect
)
)
msg_Dbg
(
p_vout
,
"SetConsoleWindowInfo failed: %ix%i"
,
rect
.
Right
,
rect
.
Bottom
);
}
}
else
{
msg_Err
(
p_vout
,
"cannot create console"
);
return
VLC_EGENERIC
;
}
SetConsoleTitle
(
VOUT_TITLE
" - Colour AsCii Art (caca)"
);
#endif
/* Allocate structure */
p_vout
->
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
...
...
@@ -185,6 +241,11 @@ static void Destroy( vlc_object_t *p_this )
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
caca_end
();
#if defined( WIN32 ) && !defined( UNDER_CE )
FreeConsole
();
#endif
free
(
p_vout
->
p_sys
);
}
...
...
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