Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
359a9baf
Commit
359a9baf
authored
Jul 27, 2004
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* screen module for OSX. Does not yet work. Seems close, but can't find the problem for now..
parent
7c928551
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
186 additions
and
2 deletions
+186
-2
configure.ac
configure.ac
+7
-2
modules/access/screen/Modules.am
modules/access/screen/Modules.am
+4
-0
modules/access/screen/mac.c
modules/access/screen/mac.c
+175
-0
No files found.
configure.ac
View file @
359a9baf
...
...
@@ -1621,8 +1621,13 @@ dnl Screen capture module
dnl
AC_ARG_ENABLE(screen,
[ --enable-screen Screen capture support (default enabled)])
if test "${enable_screen}" != "no" && test "${SYS}" != "darwin"; then
if test "${SYS}" = "mingw32"; then
if test "${enable_screen}" != "no"; then
if test "${SYS}" == "darwin"; then
AC_CHECK_HEADERS(ApplicationServices/ApplicationServices.h, [
VLC_ADD_PLUGINS([screen])
VLC_ADD_LDFLAGS([screen],[-framework ApplicationServices])
])
elif test "${SYS}" != "mingw32"; then
VLC_ADD_PLUGINS([screen])
VLC_ADD_LDFLAGS([screen],[-lgdi32])
elif test "${SYS}" = "beos"; then
...
...
modules/access/screen/Modules.am
View file @
359a9baf
...
...
@@ -4,9 +4,13 @@ else
if HAVE_BEOS
screen_extra = beos.cpp
else
if HAVE_DARWIN
screen_extra = mac.c
else
screen_extra = x11.c
endif
endif
endif
SOURCES_screen = \
screen.c \
screen.h \
...
...
modules/access/screen/mac.c
0 → 100644
View file @
359a9baf
/*****************************************************************************
* mac.c: Screen capture module for the Mac.
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id: x11.c 8290 2004-07-26 20:29:24Z gbazin $
*
* Authors: Derk-Jan Hartman <hartman at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h>
#include <vlc/vlc.h>
#include <vlc/input.h>
#include <Carbon/Carbon.h>
#include <ApplicationServices/ApplicationServices.h>
typedef
int
CGSConnectionRef
;
extern
CGError
CGSNewConnection
(
void
*
unknown
,
CGSConnectionRef
*
newConnection
);
extern
CGError
CGSReleaseConnection
(
CGSConnectionRef
connection
);
#include "screen.h"
struct
screen_data_t
{
RGBColor
oldForeColor
,
oldBackColor
;
PenState
oldState
;
CGDirectDisplayID
displayID
;
CGSConnectionRef
gConnection
;
GDHandle
gMainDevice
;
char
gDeviceState
;
PixMapHandle
gDevicePix
;
GWorldPtr
LocalBufferGW
;
PixMapHandle
LocalBufferPix
;
};
int
screen_InitCapture
(
demux_t
*
p_demux
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
screen_data_t
*
p_data
;
int
i_chroma
;
p_sys
->
p_data
=
p_data
=
(
screen_data_t
*
)
malloc
(
sizeof
(
screen_data_t
)
);
p_data
->
gConnection
=
NULL
;
p_data
->
gMainDevice
=
NULL
;
p_data
->
gDevicePix
=
NULL
;
p_data
->
gDeviceState
=
NULL
;
p_data
->
LocalBufferGW
=
NULL
;
p_data
->
LocalBufferPix
=
NULL
;
p_data
->
displayID
=
CGMainDisplayID
();
(
void
)
GetMainDevice
();
if
(
CGDisplaySamplesPerPixel
(
p_data
->
displayID
)
!=
3
)
{
msg_Err
(
p_demux
,
"screenformat not supported"
);
}
switch
(
CGDisplaySamplesPerPixel
(
p_data
->
displayID
)
*
CGDisplayBitsPerSample
(
p_data
->
displayID
)
)
{
case
8
:
/* FIXME: set the palette */
i_chroma
=
VLC_FOURCC
(
'R'
,
'G'
,
'B'
,
'2'
);
break
;
case
15
:
i_chroma
=
VLC_FOURCC
(
'R'
,
'V'
,
'1'
,
'5'
);
break
;
case
16
:
i_chroma
=
VLC_FOURCC
(
'R'
,
'V'
,
'1'
,
'6'
);
break
;
case
24
:
i_chroma
=
VLC_FOURCC
(
'R'
,
'V'
,
'2'
,
'4'
);
break
;
case
32
:
i_chroma
=
VLC_FOURCC
(
'R'
,
'V'
,
'3'
,
'2'
);
break
;
default:
msg_Err
(
p_demux
,
"unknown screen depth"
);
return
VLC_EGENERIC
;
}
GetBackColor
(
&
p_data
->
oldBackColor
);
GetPenState
(
&
p_data
->
oldState
);
// ForeColor(blackColor);
// BackColor(whiteColor);
p_data
->
gMainDevice
=
GetMainDevice
();
p_data
->
gDeviceState
=
HGetState
((
Handle
)
p_data
->
gMainDevice
);
HLock
((
Handle
)
p_data
->
gMainDevice
);
p_data
->
gDevicePix
=
(
**
p_data
->
gMainDevice
).
gdPMap
;
NewGWorld
(
&
p_data
->
LocalBufferGW
,
(
**
p_data
->
gDevicePix
).
pixelSize
,
&
(
**
p_data
->
gDevicePix
).
bounds
,
(
**
p_data
->
gDevicePix
).
pmTable
,
NULL
,
0
);
p_data
->
LocalBufferPix
=
GetGWorldPixMap
(
p_data
->
LocalBufferGW
);
LockPixels
(
p_data
->
LocalBufferPix
);
es_format_Init
(
&
p_sys
->
fmt
,
VIDEO_ES
,
i_chroma
);
p_sys
->
fmt
.
video
.
i_width
=
CGDisplayPixelsWide
(
p_data
->
displayID
);
p_sys
->
fmt
.
video
.
i_height
=
CGDisplayPixelsHigh
(
p_data
->
displayID
);
p_sys
->
fmt
.
video
.
i_bits_per_pixel
=
CGDisplaySamplesPerPixel
(
p_data
->
displayID
)
*
CGDisplayBitsPerSample
(
p_data
->
displayID
);
GetForeColor
(
&
p_data
->
oldForeColor
);
assert
(
CGSNewConnection
(
NULL
,
&
p_data
->
gConnection
)
==
kCGErrorSuccess
);
HSetState
(
(
Handle
)
p_data
->
gMainDevice
,
p_data
->
gDeviceState
);
SetPenState
(
&
p_data
->
oldState
);
RGBForeColor
(
&
p_data
->
oldForeColor
);
RGBBackColor
(
&
p_data
->
oldBackColor
);
return
VLC_SUCCESS
;
}
int
screen_CloseCapture
(
demux_t
*
p_demux
)
{
screen_data_t
*
p_data
=
(
screen_data_t
*
)
p_demux
->
p_sys
->
p_data
;
assert
(
CGSReleaseConnection
(
p_data
->
gConnection
)
==
kCGErrorSuccess
);
if
(
p_data
->
LocalBufferPix
)
UnlockPixels
(
p_data
->
LocalBufferPix
);
p_data
->
LocalBufferPix
=
NULL
;
if
(
p_data
->
LocalBufferGW
)
DisposeGWorld
(
p_data
->
LocalBufferGW
);
p_data
->
LocalBufferGW
=
NULL
;
return
VLC_SUCCESS
;
}
block_t
*
screen_Capture
(
demux_t
*
p_demux
)
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
screen_data_t
*
p_data
=
(
screen_data_t
*
)
p_sys
->
p_data
;
block_t
*
p_block
;
int
i_size
;
i_size
=
p_sys
->
fmt
.
video
.
i_height
*
CGDisplayBytesPerRow
(
p_data
->
displayID
);
if
(
!
(
p_block
=
block_New
(
p_demux
,
i_size
)
)
)
{
msg_Warn
(
p_demux
,
"cannot get block"
);
return
0
;
}
GetForeColor
(
&
p_data
->
oldForeColor
);
GetBackColor
(
&
p_data
->
oldBackColor
);
GetPenState
(
&
p_data
->
oldState
);
// ForeColor(blackColor);
// BackColor(whiteColor);
p_data
->
gMainDevice
=
GetMainDevice
();
p_data
->
gDeviceState
=
HGetState
((
Handle
)
p_data
->
gMainDevice
);
HLock
((
Handle
)
p_data
->
gMainDevice
);
p_data
->
gDevicePix
=
(
**
p_data
->
gMainDevice
).
gdPMap
;
CopyBits
((
BitMap
*
)
*
p_data
->
gDevicePix
,
(
BitMap
*
)
*
p_data
->
LocalBufferPix
,
&
(
**
p_data
->
gDevicePix
).
bounds
,
&
(
**
p_data
->
gDevicePix
).
bounds
,
srcCopy
,
NULL
);
HSetState
(
(
Handle
)
p_data
->
gMainDevice
,
p_data
->
gDeviceState
);
SetPenState
(
&
p_data
->
oldState
);
RGBForeColor
(
&
p_data
->
oldForeColor
);
RGBBackColor
(
&
p_data
->
oldBackColor
);
memcpy
(
p_block
->
p_buffer
,
(
**
p_data
->
LocalBufferPix
).
baseAddr
,
i_size
);
return
p_block
;
}
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