Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libraries
Phonon VLC
Commits
43eeb5f2
Commit
43eeb5f2
authored
Mar 24, 2011
by
Casian Andrei
Browse files
Add screen capture virtual device for video capture
parent
acb27cce
Changes
3
Hide whitespace changes
Inline
Side-by-side
vlc/devicemanager.cpp
View file @
43eeb5f2
...
...
@@ -157,7 +157,10 @@ void DeviceManager::updateDeviceList()
int
i
;
// Setup a list of available capture devices
// TODO
DeviceInfo
screenDevice
(
"Screen"
,
"Virtual device for screen capture"
,
false
);
screenDevice
.
capabilities
=
DeviceInfo
::
VideoCapture
;
screenDevice
.
accessList
.
append
(
QPair
<
QByteArray
,
QString
>
(
"screen"
,
""
));
vcs
.
append
(
screenDevice
);
// See the device capabilities and sort them accordingly
for
(
i
=
0
;
i
<
devices
.
count
();
++
i
)
{
...
...
vlc/mediaobject.cpp
View file @
43eeb5f2
...
...
@@ -262,12 +262,15 @@ void MediaObject::setSource(const MediaSource &source)
{
debug
()
<<
Q_FUNC_INFO
;
// Reset previous streameraders
// Reset previous streamer
e
aders
if
(
m_streamReader
)
{
m_streamReader
->
unlock
();
m_streamReader
=
0
;
}
// Reset previous isScreen flag
m_isScreen
=
false
;
m_mediaSource
=
source
;
QByteArray
driverName
;
...
...
@@ -346,6 +349,11 @@ void MediaObject::setSource(const MediaSource &source)
}
loadMedia
(
"alsa://"
+
deviceName
);
}
else
if
(
driverName
==
"screen"
)
{
loadMedia
(
"screen://"
+
deviceName
);
// Set the isScreen flag needed to add extra options in playInternal
m_isScreen
=
true
;
}
else
{
error
()
<<
Q_FUNC_INFO
<<
"unsupported MediaSource::CaptureDevice:"
<<
driverName
;
break
;
...
...
@@ -536,6 +544,11 @@ void MediaObject::playInternal()
}
}
if
(
m_isScreen
)
{
addOption
(
m_media
,
QString
(
"screen-fps=24.0"
));
addOption
(
m_media
,
QString
(
"screen-caching=300"
));
}
foreach
(
SinkNode
*
sink
,
m_sinks
)
{
sink
->
addToMedia
(
m_media
);
}
...
...
vlc/mediaobject.h
View file @
43eeb5f2
...
...
@@ -453,6 +453,7 @@ private:
QList
<
SinkNode
*>
m_sinks
;
bool
m_hasVideo
;
bool
m_isScreen
;
bool
m_seekable
;
qint64
m_seekpoint
;
...
...
Write
Preview
Supports
Markdown
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