Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
e84db3b0
Commit
e84db3b0
authored
Mar 27, 2009
by
Hugo Beauzee-Luyssen
Browse files
Added some methods to Media & OutputMedia
parent
de2b7706
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/Media.cpp
View file @
e84db3b0
...
...
@@ -119,3 +119,14 @@ qint64 Media::getLength()
{
return
m_vlcMediaPlayer
->
getLength
();
}
void
Media
::
play
()
{
m_vlcMediaPlayer
->
play
();
}
QImage
&
Media
::
getImage
()
{
return
*
m_image
;
}
src/Media.h
View file @
e84db3b0
...
...
@@ -47,6 +47,7 @@ public:
bool
isSeekable
();
qint64
getLength
();
QImage
&
getImage
();
void
play
();
private:
LibVLCpp
::
Media
*
m_vlcMedia
;
...
...
src/OutputMedia.cpp
View file @
e84db3b0
#include <QtDebug>
#include "OutputMedia.h"
OutputMedia
::
OutputMedia
()
:
m_pixelBuffer
(
NULL
)
...
...
@@ -24,9 +25,9 @@ OutputMedia::OutputMedia() : m_pixelBuffer( NULL )
char
width
[
64
],
height
[
64
],
lock
[
64
],
unlock
[
64
],
data
[
64
];
sprintf
(
width
,
":invmem-width=%i"
,
VIDEOWIDTH
);
sprintf
(
height
,
":invmem-height=%i"
,
VIDEOHEIGHT
);
sprintf
(
lock
,
":invmem-lock
:
%lld"
,
(
long
long
int
)(
intptr_t
)
&
OutputMedia
::
lock
);
sprintf
(
unlock
,
":invmem-unlock
:
%lld"
,
(
long
long
int
)(
intptr_t
)
&
OutputMedia
::
unlock
);
sprintf
(
data
,
":invmem-data
:
%lld"
,
(
long
long
int
)(
intptr_t
)
m_dataCtx
);
sprintf
(
lock
,
":invmem-lock
=
%lld"
,
(
long
long
int
)(
intptr_t
)
&
OutputMedia
::
lock
);
sprintf
(
unlock
,
":invmem-unlock
=
%lld"
,
(
long
long
int
)(
intptr_t
)
&
OutputMedia
::
unlock
);
sprintf
(
data
,
":invmem-data
=
%lld"
,
(
long
long
int
)(
intptr_t
)
m_dataCtx
);
m_vlcMedia
->
addOption
(
width
);
m_vlcMedia
->
addOption
(
height
);
...
...
@@ -39,6 +40,7 @@ OutputMedia::OutputMedia() : m_pixelBuffer( NULL )
uchar
*
OutputMedia
::
lock
(
OutputMedia
::
DataCtx
*
dataCtx
)
{
qDebug
()
<<
"Copying into invmem"
;
dataCtx
->
mutex
->
lock
();
return
dataCtx
->
outputMedia
->
m_pixelBuffer
;
}
...
...
@@ -48,6 +50,7 @@ void OutputMedia::unlock( OutputMedia::DataCtx* dataCtx )
//FIXME: use class Image to avoid alloc/free...
delete
dataCtx
->
outputMedia
->
m_pixelBuffer
;
dataCtx
->
mutex
->
unlock
();
qDebug
()
<<
"Unlocked invmem"
;
}
void
OutputMedia
::
setVmem
(
uchar
*
pixelBuffer
)
...
...
@@ -56,3 +59,8 @@ void OutputMedia::setVmem( uchar* pixelBuffer )
m_pixelBuffer
=
pixelBuffer
;
m_dataCtx
->
mutex
->
unlock
();
}
void
OutputMedia
::
play
()
{
m_vlcMediaPlayer
->
play
();
}
src/OutputMedia.h
View file @
e84db3b0
...
...
@@ -41,6 +41,7 @@ public:
static
void
unlock
(
OutputMedia
::
DataCtx
*
dataCtx
);
void
setVmem
(
uchar
*
pixelBuffer
);
void
play
();
private:
LibVLCpp
::
Media
*
m_vlcMedia
;
...
...
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