Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
6a9d3e7f
Kaydet (Commit)
6a9d3e7f
authored
Eyl 14, 2013
tarafından
Minh Ngo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avmedia/VLC component code refactoring.
Change-Id: Ibba5874e63356069d1af725d98980910dbaf8eb1
üst
b3e0c808
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
207 additions
and
122 deletions
+207
-122
vlcframegrabber.cxx
avmedia/source/vlc/vlcframegrabber.cxx
+2
-2
vlcframegrabber.hxx
avmedia/source/vlc/vlcframegrabber.hxx
+13
-14
vlcmanager.cxx
avmedia/source/vlc/vlcmanager.cxx
+1
-1
vlcmanager.hxx
avmedia/source/vlc/vlcmanager.hxx
+2
-2
vlcplayer.cxx
avmedia/source/vlc/vlcplayer.cxx
+2
-2
vlcplayer.hxx
avmedia/source/vlc/vlcplayer.hxx
+7
-7
vlcwindow.cxx
avmedia/source/vlc/vlcwindow.cxx
+5
-2
Common.cxx
avmedia/source/vlc/wrapper/Common.cxx
+10
-3
Common.hxx
avmedia/source/vlc/wrapper/Common.hxx
+8
-1
EventHandler.cxx
avmedia/source/vlc/wrapper/EventHandler.cxx
+8
-2
EventHandler.hxx
avmedia/source/vlc/wrapper/EventHandler.hxx
+10
-3
EventManager.cxx
avmedia/source/vlc/wrapper/EventManager.cxx
+20
-16
EventManager.hxx
avmedia/source/vlc/wrapper/EventManager.hxx
+11
-6
Instance.cxx
avmedia/source/vlc/wrapper/Instance.cxx
+14
-9
Instance.hxx
avmedia/source/vlc/wrapper/Instance.hxx
+7
-1
Media.cxx
avmedia/source/vlc/wrapper/Media.cxx
+21
-15
Media.hxx
avmedia/source/vlc/wrapper/Media.hxx
+7
-1
Player.cxx
avmedia/source/vlc/wrapper/Player.cxx
+35
-26
Player.hxx
avmedia/source/vlc/wrapper/Player.hxx
+7
-1
SymbolLoader.hxx
avmedia/source/vlc/wrapper/SymbolLoader.hxx
+10
-4
ThreadsafeQueue.hxx
avmedia/source/vlc/wrapper/ThreadsafeQueue.hxx
+7
-4
No files found.
avmedia/source/vlc/vlcframegrabber.cxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -35,7 +35,7 @@ namespace
...
@@ -35,7 +35,7 @@ namespace
};
};
}
}
VLCFrameGrabber
::
VLCFrameGrabber
(
VLC
::
EventHandler
&
eh
,
const
rtl
::
OUString
&
url
)
VLCFrameGrabber
::
VLCFrameGrabber
(
wrapper
::
EventHandler
&
eh
,
const
rtl
::
OUString
&
url
)
:
FrameGrabber_BASE
()
:
FrameGrabber_BASE
()
,
mInstance
(
sizeof
(
VLC_ARGS
)
/
sizeof
(
VLC_ARGS
[
0
]
),
VLC_ARGS
)
,
mInstance
(
sizeof
(
VLC_ARGS
)
/
sizeof
(
VLC_ARGS
[
0
]
),
VLC_ARGS
)
,
mMedia
(
url
,
mInstance
)
,
mMedia
(
url
,
mInstance
)
...
@@ -51,7 +51,7 @@ VLCFrameGrabber::VLCFrameGrabber( VLC::EventHandler& eh, const rtl::OUString& ur
...
@@ -51,7 +51,7 @@ VLCFrameGrabber::VLCFrameGrabber( VLC::EventHandler& eh, const rtl::OUString& ur
const
rtl
::
OUString
&
fileName
=
utl
::
TempFile
::
CreateTempName
();
const
rtl
::
OUString
&
fileName
=
utl
::
TempFile
::
CreateTempName
();
{
{
VLC
::
EventManager
manager
(
mPlayer
,
mEventHandler
);
wrapper
::
EventManager
manager
(
mPlayer
,
mEventHandler
);
manager
.
onPaused
(
boost
::
bind
(
&
osl
::
Condition
::
set
,
&
condition
));
manager
.
onPaused
(
boost
::
bind
(
&
osl
::
Condition
::
set
,
&
condition
));
if
(
!
mPlayer
.
play
()
)
if
(
!
mPlayer
.
play
()
)
...
...
avmedia/source/vlc/vlcframegrabber.hxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -26,11 +26,6 @@
...
@@ -26,11 +26,6 @@
#include "vlccommon.hxx"
#include "vlccommon.hxx"
#include "wrapper/Wrapper.hxx"
#include "wrapper/Wrapper.hxx"
namespace
VLC
{
class
EventHandler
;
}
namespace
avmedia
{
namespace
avmedia
{
namespace
vlc
{
namespace
vlc
{
...
@@ -39,18 +34,22 @@ typedef ::cppu::WeakImplHelper2< ::com::sun::star::media::XFrameGrabber,
...
@@ -39,18 +34,22 @@ typedef ::cppu::WeakImplHelper2< ::com::sun::star::media::XFrameGrabber,
class
VLCFrameGrabber
:
public
FrameGrabber_BASE
class
VLCFrameGrabber
:
public
FrameGrabber_BASE
{
{
VLC
::
Instance
mInstance
;
wrapper
::
Instance
mInstance
;
VLC
::
Media
mMedia
;
wrapper
::
Media
mMedia
;
VLC
::
Player
mPlayer
;
wrapper
::
Player
mPlayer
;
VLC
::
EventHandler
&
mEventHandler
;
wrapper
::
EventHandler
&
mEventHandler
;
public
:
public
:
VLCFrameGrabber
(
VLC
::
EventHandler
&
eh
,
const
rtl
::
OUString
&
url
);
VLCFrameGrabber
(
wrapper
::
EventHandler
&
eh
,
const
rtl
::
OUString
&
url
);
::
com
::
sun
::
star
::
uno
::
Reference
<
css
::
graphic
::
XGraphic
>
SAL_CALL
grabFrame
(
double
fMediaTime
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Reference
<
css
::
graphic
::
XGraphic
>
SAL_CALL
grabFrame
(
double
fMediaTime
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
rtl
::
OUString
SAL_CALL
getImplementationName
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
rtl
::
OUString
SAL_CALL
getImplementationName
()
::
sal_Bool
SAL_CALL
supportsService
(
const
::
rtl
::
OUString
&
serviceName
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
rtl
::
OUString
>
SAL_CALL
getSupportedServiceNames
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
sal_Bool
SAL_CALL
supportsService
(
const
::
rtl
::
OUString
&
serviceName
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
rtl
::
OUString
>
SAL_CALL
getSupportedServiceNames
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
};
};
}
}
...
...
avmedia/source/vlc/vlcmanager.cxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -37,7 +37,7 @@ Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr )
...
@@ -37,7 +37,7 @@ Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr )
:
mEventHandler
()
:
mEventHandler
()
,
mxMgr
(
rxMgr
)
,
mxMgr
(
rxMgr
)
{
{
using
namespace
VLC
;
using
namespace
wrapper
;
static
bool
success
=
Instance
::
LoadSymbols
()
&&
EventManager
::
LoadSymbols
()
static
bool
success
=
Instance
::
LoadSymbols
()
&&
EventManager
::
LoadSymbols
()
&&
Media
::
LoadSymbols
()
&&
Player
::
LoadSymbols
()
&&
Media
::
LoadSymbols
()
&&
Player
::
LoadSymbols
()
&&
Common
::
LoadSymbols
();
&&
Common
::
LoadSymbols
();
...
...
avmedia/source/vlc/vlcmanager.hxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -30,8 +30,8 @@ namespace vlc {
...
@@ -30,8 +30,8 @@ namespace vlc {
class
Manager
:
public
::
cppu
::
WeakImplHelper2
<
::
com
::
sun
::
star
::
media
::
XManager
,
class
Manager
:
public
::
cppu
::
WeakImplHelper2
<
::
com
::
sun
::
star
::
media
::
XManager
,
::
com
::
sun
::
star
::
lang
::
XServiceInfo
>
::
com
::
sun
::
star
::
lang
::
XServiceInfo
>
{
{
boost
::
scoped_ptr
<
VLC
::
Instance
>
mInstance
;
boost
::
scoped_ptr
<
wrapper
::
Instance
>
mInstance
;
VLC
::
EventHandler
mEventHandler
;
wrapper
::
EventHandler
mEventHandler
;
public
:
public
:
Manager
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>&
rxMgr
);
Manager
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>&
rxMgr
);
~
Manager
();
~
Manager
();
...
...
avmedia/source/vlc/vlcplayer.cxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -22,8 +22,8 @@ namespace
...
@@ -22,8 +22,8 @@ namespace
}
}
VLCPlayer
::
VLCPlayer
(
const
rtl
::
OUString
&
url
,
VLCPlayer
::
VLCPlayer
(
const
rtl
::
OUString
&
url
,
VLC
::
Instance
&
instance
,
wrapper
::
Instance
&
instance
,
VLC
::
EventHandler
&
eh
)
wrapper
::
EventHandler
&
eh
)
:
VLC_Base
(
m_aMutex
)
:
VLC_Base
(
m_aMutex
)
,
mInstance
(
instance
)
,
mInstance
(
instance
)
,
mEventHandler
(
eh
)
,
mEventHandler
(
eh
)
...
...
avmedia/source/vlc/vlcplayer.hxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -42,19 +42,19 @@ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer,
...
@@ -42,19 +42,19 @@ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer,
class
VLCPlayer
:
public
::
cppu
::
BaseMutex
,
class
VLCPlayer
:
public
::
cppu
::
BaseMutex
,
public
VLC_Base
public
VLC_Base
{
{
VLC
::
Instance
&
mInstance
;
wrapper
::
Instance
&
mInstance
;
VLC
::
EventHandler
&
mEventHandler
;
wrapper
::
EventHandler
&
mEventHandler
;
VLC
::
Media
mMedia
;
wrapper
::
Media
mMedia
;
VLC
::
Player
mPlayer
;
wrapper
::
Player
mPlayer
;
VLC
::
EventManager
mEventManager
;
wrapper
::
EventManager
mEventManager
;
const
rtl
::
OUString
mUrl
;
const
rtl
::
OUString
mUrl
;
bool
mPlaybackLoop
;
bool
mPlaybackLoop
;
::
com
::
sun
::
star
::
uno
::
Reference
<
css
::
media
::
XFrameGrabber
>
mrFrameGrabber
;
::
com
::
sun
::
star
::
uno
::
Reference
<
css
::
media
::
XFrameGrabber
>
mrFrameGrabber
;
public
:
public
:
VLCPlayer
(
const
rtl
::
OUString
&
url
,
VLCPlayer
(
const
rtl
::
OUString
&
url
,
VLC
::
Instance
&
instance
,
wrapper
::
Instance
&
instance
,
VLC
::
EventHandler
&
eh
);
wrapper
::
EventHandler
&
eh
);
void
SAL_CALL
start
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
void
SAL_CALL
start
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
void
SAL_CALL
stop
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
void
SAL_CALL
stop
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
...
...
avmedia/source/vlc/vlcwindow.cxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -6,8 +6,11 @@ using namespace ::com::sun::star;
...
@@ -6,8 +6,11 @@ using namespace ::com::sun::star;
namespace
avmedia
{
namespace
avmedia
{
namespace
vlc
{
namespace
vlc
{
const
::
rtl
::
OUString
AVMEDIA_VLC_WINDOW_IMPLEMENTATIONNAME
=
"com.sun.star.comp.avmedia.Window_VLC"
;
namespace
const
::
rtl
::
OUString
AVMEDIA_VLC_WINDOW_SERVICENAME
=
"com.sun.star.media.Window_VLC"
;
{
const
::
rtl
::
OUString
AVMEDIA_VLC_WINDOW_IMPLEMENTATIONNAME
=
"com.sun.star.comp.avmedia.Window_VLC"
;
const
::
rtl
::
OUString
AVMEDIA_VLC_WINDOW_SERVICENAME
=
"com.sun.star.media.Window_VLC"
;
}
VLCWindow
::
VLCWindow
()
VLCWindow
::
VLCWindow
()
{
{
...
...
avmedia/source/vlc/wrapper/Common.cxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -9,13 +9,17 @@
...
@@ -9,13 +9,17 @@
#include "Common.hxx"
#include "Common.hxx"
#include "SymbolLoader.hxx"
#include "SymbolLoader.hxx"
namespace
VLC
{
namespace
namespace
{
{
const
char
*
(
*
libvlc_get_version
)
(
void
);
const
char
*
(
*
libvlc_get_version
)
(
void
);
}
}
namespace
avmedia
{
namespace
vlc
{
namespace
wrapper
{
bool
Common
::
LoadSymbols
()
bool
Common
::
LoadSymbols
()
{
{
ApiMap
VLC_COMMON_API
[]
=
ApiMap
VLC_COMMON_API
[]
=
...
@@ -30,4 +34,6 @@ const char* Common::Version()
...
@@ -30,4 +34,6 @@ const char* Common::Version()
{
{
return
libvlc_get_version
();
return
libvlc_get_version
();
}
}
}
}
}
}
\ No newline at end of file
avmedia/source/vlc/wrapper/Common.hxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -10,7 +10,11 @@
...
@@ -10,7 +10,11 @@
#ifndef _WRAPPER_COMMON_HXX
#ifndef _WRAPPER_COMMON_HXX
#define _WRAPPER_COMMON_HXX
#define _WRAPPER_COMMON_HXX
namespace
VLC
namespace
avmedia
{
namespace
vlc
{
namespace
wrapper
{
{
class
Common
class
Common
{
{
...
@@ -19,6 +23,8 @@ namespace VLC
...
@@ -19,6 +23,8 @@ namespace VLC
static
const
char
*
Version
();
static
const
char
*
Version
();
};
};
}
}
}
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
avmedia/source/vlc/wrapper/EventHandler.cxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -9,7 +9,11 @@
...
@@ -9,7 +9,11 @@
#include "EventHandler.hxx"
#include "EventHandler.hxx"
namespace
VLC
namespace
avmedia
{
namespace
vlc
{
namespace
wrapper
{
{
EventHandler
::
EventHandler
()
EventHandler
::
EventHandler
()
:
::
osl
::
Thread
()
:
::
osl
::
Thread
()
...
@@ -35,7 +39,8 @@ void EventHandler::run()
...
@@ -35,7 +39,8 @@ void EventHandler::run()
callback
();
callback
();
}
while
(
true
);
}
while
(
true
);
}
}
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
avmedia/source/vlc/wrapper/EventHandler.hxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -10,12 +10,17 @@
...
@@ -10,12 +10,17 @@
#ifndef _WRAPPER_EVENT_HANDLER_HXX
#ifndef _WRAPPER_EVENT_HANDLER_HXX
#define _WRAPPER_EVENT_HANDLER_HXX
#define _WRAPPER_EVENT_HANDLER_HXX
#include <boost/function.hpp>
#include <boost/function.hpp>
#include <boost/noncopyable.hpp>
#include <salhelper/thread.hxx>
#include <salhelper/thread.hxx>
#include "ThreadsafeQueue.hxx"
#include "ThreadsafeQueue.hxx"
namespace
VLC
namespace
avmedia
{
{
class
EventHandler
:
public
::
osl
::
Thread
namespace
vlc
{
namespace
wrapper
{
class
EventHandler
:
public
::
osl
::
Thread
,
boost
::
noncopyable
{
{
public
:
public
:
EventHandler
();
EventHandler
();
...
@@ -26,9 +31,11 @@ namespace VLC
...
@@ -26,9 +31,11 @@ namespace VLC
public
:
public
:
typedef
boost
::
function
<
void
()
>
TCallback
;
typedef
boost
::
function
<
void
()
>
TCallback
;
avmedia
::
vlc
::
ThreadsafeQueue
<
TCallback
>
mCallbackQueue
;
ThreadsafeQueue
<
TCallback
>
mCallbackQueue
;
};
};
}
}
}
}
#endif // _WRAPPER_EVENT_HANDLER_HXX
#endif // _WRAPPER_EVENT_HANDLER_HXX
...
...
avmedia/source/vlc/wrapper/EventManager.cxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -12,25 +12,28 @@
...
@@ -12,25 +12,28 @@
#include "EventHandler.hxx"
#include "EventHandler.hxx"
#include "Types.hxx"
#include "Types.hxx"
namespace
VLC
namespace
{
{
namespace
libvlc_event_manager_t
*
(
*
libvlc_media_player_event_manager
)
(
libvlc_media_player_t
*
p_mi
);
{
int
(
*
libvlc_event_attach
)
(
libvlc_event_manager_t
*
p_event_manager
,
libvlc_event_manager_t
*
(
*
libvlc_media_player_event_manager
)
(
libvlc_media_player_t
*
p_mi
);
libvlc_event_type_t
i_event_type
,
int
(
*
libvlc_event_attach
)
(
libvlc_event_manager_t
*
p_event_manager
,
libvlc_callback_t
f_callback
,
libvlc_event_type_t
i_event_type
,
void
*
user_data
);
libvlc_callback_t
f_callback
,
void
(
*
libvlc_event_detach
)
(
libvlc_event_manager_t
*
p_event_manager
,
void
*
user_data
);
libvlc_event_type_t
i_event_type
,
void
(
*
libvlc_event_detach
)
(
libvlc_event_manager_t
*
p_event_manager
,
libvlc_callback_t
f_callback
,
libvlc_event_type_t
i_event_type
,
void
*
p_user_data
);
libvlc_callback_t
f_callback
,
}
void
*
p_user_data
);
}
namespace
avmedia
{
namespace
vlc
{
namespace
wrapper
{
void
EventManager
::
Handler
(
const
libvlc_event_t
*
event
,
void
*
pData
)
void
EventManager
::
Handler
(
const
libvlc_event_t
*
event
,
void
*
pData
)
{
{
EventManager
*
instance
=
static_cast
<
EventManager
*>
(
pData
);
EventManager
*
instance
=
static_cast
<
EventManager
*>
(
pData
);
std
::
cout
<<
"HANDLER"
<<
std
::
endl
;
switch
(
event
->
type
)
switch
(
event
->
type
)
{
{
case
libvlc_MediaPlayerPaused
:
case
libvlc_MediaPlayerPaused
:
...
@@ -54,7 +57,7 @@ bool EventManager::LoadSymbols()
...
@@ -54,7 +57,7 @@ bool EventManager::LoadSymbols()
return
InitApiMap
(
VLC_EVENT_MANAGER_API
);
return
InitApiMap
(
VLC_EVENT_MANAGER_API
);
}
}
EventManager
::
EventManager
(
VLC
::
Player
&
player
,
VLC
::
EventHandler
&
eh
)
EventManager
::
EventManager
(
Player
&
player
,
EventHandler
&
eh
)
:
mEventHandler
(
eh
)
:
mEventHandler
(
eh
)
,
mManager
(
libvlc_media_player_event_manager
(
player
)
)
,
mManager
(
libvlc_media_player_event_manager
(
player
)
)
{
{
...
@@ -80,7 +83,8 @@ void EventManager::onEndReached( const Callback& callback )
...
@@ -80,7 +83,8 @@ void EventManager::onEndReached( const Callback& callback )
mOnEndReached
=
callback
;
mOnEndReached
=
callback
;
registerSignal
(
libvlc_MediaPlayerEndReached
,
callback
);
registerSignal
(
libvlc_MediaPlayerEndReached
,
callback
);
}
}
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
avmedia/source/vlc/wrapper/EventManager.hxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -11,30 +11,33 @@
...
@@ -11,30 +11,33 @@
#define _WRAPPER_EVENT_MANAGER_HXX
#define _WRAPPER_EVENT_MANAGER_HXX
#include <boost/function.hpp>
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/noncopyable.hpp>
#include "Player.hxx"
#include "Player.hxx"
struct
libvlc_event_manager_t
;
struct
libvlc_event_manager_t
;
struct
libvlc_event_t
;
struct
libvlc_event_t
;
namespace
VLC
namespace
avmedia
{
namespace
vlc
{
namespace
wrapper
{
{
class
EventHandler
;
class
EventHandler
;
class
EventManager
class
EventManager
:
boost
::
noncopyable
{
{
public
:
public
:
static
bool
LoadSymbols
();
static
bool
LoadSymbols
();
typedef
boost
::
function
<
void
()
>
Callback
;
typedef
boost
::
function
<
void
()
>
Callback
;
EventManager
(
VLC
::
Player
&
player
,
VLC
::
EventHandler
&
eh
);
EventManager
(
Player
&
player
,
EventHandler
&
eh
);
void
onPaused
(
const
Callback
&
callback
=
Callback
()
);
void
onPaused
(
const
Callback
&
callback
=
Callback
()
);
void
onEndReached
(
const
Callback
&
callback
=
Callback
()
);
void
onEndReached
(
const
Callback
&
callback
=
Callback
()
);
private
:
private
:
VLC
::
EventHandler
&
mEventHandler
;
EventHandler
&
mEventHandler
;
typedef
boost
::
function
<
void
()
>
TCallback
;
typedef
boost
::
function
<
void
()
>
TCallback
;
libvlc_event_manager_t
*
mManager
;
libvlc_event_manager_t
*
mManager
;
TCallback
mOnPaused
;
TCallback
mOnPaused
;
...
@@ -45,6 +48,8 @@ namespace VLC
...
@@ -45,6 +48,8 @@ namespace VLC
static
void
Handler
(
const
libvlc_event_t
*
event
,
void
*
pData
);
static
void
Handler
(
const
libvlc_event_t
*
event
,
void
*
pData
);
};
};
}
}
}
}
#endif
#endif
...
...
avmedia/source/vlc/wrapper/Instance.cxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -10,15 +10,19 @@
...
@@ -10,15 +10,19 @@
#include "Instance.hxx"
#include "Instance.hxx"
#include "SymbolLoader.hxx"
#include "SymbolLoader.hxx"
namespace
VLC
namespace
{
{
namespace
libvlc_instance_t
*
(
*
libvlc_new
)
(
int
argc
,
const
char
*
const
*
argv
);
{
void
(
*
libvlc_release
)
(
libvlc_instance_t
*
p_instance
);
libvlc_instance_t
*
(
*
libvlc_new
)
(
int
argc
,
const
char
*
const
*
argv
);
void
(
*
libvlc_retain
)
(
libvlc_instance_t
*
p_instance
);
void
(
*
libvlc_release
)
(
libvlc_instance_t
*
p_instance
);
}
void
(
*
libvlc_retain
)
(
libvlc_instance_t
*
p_instance
);
}
namespace
avmedia
{
namespace
vlc
{
namespace
wrapper
{
bool
Instance
::
LoadSymbols
()
bool
Instance
::
LoadSymbols
()
{
{
ApiMap
VLC_INSTANCE_API
[]
=
ApiMap
VLC_INSTANCE_API
[]
=
...
@@ -38,7 +42,7 @@ namespace VLC
...
@@ -38,7 +42,7 @@ namespace VLC
Instance
::
Instance
(
const
Instance
&
other
)
Instance
::
Instance
(
const
Instance
&
other
)
{
{
operator
=
(
other
);
operator
=
(
other
);
}
}
const
Instance
&
Instance
::
operator
=
(
const
Instance
&
other
)
const
Instance
&
Instance
::
operator
=
(
const
Instance
&
other
)
...
@@ -53,7 +57,8 @@ namespace VLC
...
@@ -53,7 +57,8 @@ namespace VLC
{
{
libvlc_release
(
mInstance
);
libvlc_release
(
mInstance
);
}
}
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
avmedia/source/vlc/wrapper/Instance.hxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -12,7 +12,11 @@
...
@@ -12,7 +12,11 @@
struct
libvlc_instance_t
;
struct
libvlc_instance_t
;
namespace
VLC
namespace
avmedia
{
namespace
vlc
{
namespace
wrapper
{
{
class
Instance
class
Instance
{
{
...
@@ -32,6 +36,8 @@ namespace VLC
...
@@ -32,6 +36,8 @@ namespace VLC
libvlc_instance_t
*
mInstance
;
libvlc_instance_t
*
mInstance
;
};
};
}
}
}
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
avmedia/source/vlc/wrapper/Media.cxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -14,23 +14,28 @@
...
@@ -14,23 +14,28 @@
#include "Types.hxx"
#include "Types.hxx"
struct
libvlc_instance_t
;
struct
libvlc_instance_t
;
namespace
VLC
namespace
avmedia
{
{
namespace
namespace
vlc
{
{
libvlc_media_t
*
(
*
libvlc_media_new_path
)
(
libvlc_instance_t
*
p_instance
,
const
char
*
path
);
namespace
wrapper
void
(
*
libvlc_media_release
)
(
libvlc_media_t
*
p_md
);
{
void
(
*
libvlc_media_retain
)
(
libvlc_media_t
*
p_md
);
namespace
libvlc_time_t
(
*
libvlc_media_get_duration
)
(
libvlc_media_t
*
p_md
);
{
libvlc_media_t
*
(
*
libvlc_media_new_path
)
(
libvlc_instance_t
*
p_instance
,
const
char
*
path
);
void
(
*
libvlc_media_release
)
(
libvlc_media_t
*
p_md
);
void
(
*
libvlc_media_retain
)
(
libvlc_media_t
*
p_md
);
libvlc_time_t
(
*
libvlc_media_get_duration
)
(
libvlc_media_t
*
p_md
);
libvlc_media_t
*
InitMedia
(
const
rtl
::
OUString
&
url
,
VLC
::
Instance
&
instance
)
libvlc_media_t
*
InitMedia
(
const
rtl
::
OUString
&
url
,
Instance
&
instance
)
{
{
rtl
::
OString
dest
;
rtl
::
OString
dest
;
url
.
convertToString
(
&
dest
,
RTL_TEXTENCODING_UTF8
,
0
);
url
.
convertToString
(
&
dest
,
RTL_TEXTENCODING_UTF8
,
0
);
return
libvlc_media_new_path
(
instance
,
dest
.
getStr
());
return
libvlc_media_new_path
(
instance
,
dest
.
getStr
());
}
}
}
}
bool
Media
::
LoadSymbols
()
bool
Media
::
LoadSymbols
()
{
{
...
@@ -52,7 +57,7 @@ Media::Media( const rtl::OUString& url, Instance& instance )
...
@@ -52,7 +57,7 @@ Media::Media( const rtl::OUString& url, Instance& instance )
Media
::
Media
(
const
Media
&
other
)
Media
::
Media
(
const
Media
&
other
)
{
{
operator
=
(
other
);
operator
=
(
other
);
}
}
const
Media
&
Media
::
operator
=
(
const
Media
&
other
)
const
Media
&
Media
::
operator
=
(
const
Media
&
other
)
...
@@ -77,7 +82,8 @@ Media::~Media()
...
@@ -77,7 +82,8 @@ Media::~Media()
{
{
libvlc_media_release
(
mMedia
);
libvlc_media_release
(
mMedia
);
}
}
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
avmedia/source/vlc/wrapper/Media.hxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -14,7 +14,11 @@ struct libvlc_media_t;
...
@@ -14,7 +14,11 @@ struct libvlc_media_t;
namespace
rtl
{
class
OUString
;
}
namespace
rtl
{
class
OUString
;
}
namespace
VLC
namespace
avmedia
{
namespace
vlc
{
namespace
wrapper
{
{
class
Instance
;
class
Instance
;
class
Media
class
Media
...
@@ -38,6 +42,8 @@ namespace VLC
...
@@ -38,6 +42,8 @@ namespace VLC
libvlc_media_t
*
mMedia
;
libvlc_media_t
*
mMedia
;
};
};
}
}
}
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
avmedia/source/vlc/wrapper/Player.cxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -14,40 +14,47 @@
...
@@ -14,40 +14,47 @@
#include "SymbolLoader.hxx"
#include "SymbolLoader.hxx"
struct
libvlc_media_t
;
struct
libvlc_media_t
;
namespace
VLC
namespace
{
{
namespace
void
(
*
libvlc_media_player_retain
)
(
libvlc_media_player_t
*
p_mi
);
{
libvlc_media_player_t
*
(
*
libvlc_media_player_new_from_media
)
(
libvlc_media_t
*
p_md
);
void
(
*
libvlc_media_player_retain
)
(
libvlc_media_player_t
*
p_mi
);
void
(
*
libvlc_media_player_release
)
(
libvlc_media_player_t
*
p_mi
);
libvlc_media_player_t
*
(
*
libvlc_media_player_new_from_media
)
(
libvlc_media_t
*
p_md
);
int
(
*
libvlc_media_player_play
)
(
libvlc_media_player_t
*
p_mi
);
void
(
*
libvlc_media_player_relea
se
)
(
libvlc_media_player_t
*
p_mi
);
void
(
*
libvlc_media_player_pau
se
)
(
libvlc_media_player_t
*
p_mi
);
int
(
*
libvlc_media_player_play
)
(
libvlc_media_player_t
*
p_mi
);
int
(
*
libvlc_media_player_is_playing
)
(
libvlc_media_player_t
*
p_mi
);
void
(
*
libvlc_media_player_pause
)
(
libvlc_media_player_t
*
p_mi
);
void
(
*
libvlc_media_player_stop
)
(
libvlc_media_player_t
*
p_mi
);
int
(
*
libvlc_media_player_is_playing
)
(
libvlc_media_player_t
*
p_mi
);
void
(
*
libvlc_media_player_set_time
)
(
libvlc_media_player_t
*
p_mi
,
libvlc_time_t
i_time
);
void
(
*
libvlc_media_player_stop
)
(
libvlc_media_player_t
*
p_mi
);
libvlc_time_t
(
*
libvlc_media_player_get_time
)
(
libvlc_media_player_t
*
p_mi
);
void
(
*
libvlc_media_player_set_time
)
(
libvlc_media_player_t
*
p_mi
,
libvlc_time_t
i_time
);
float
(
*
libvlc_media_player_get_rate
)(
libvlc_media_player_t
*
p_mi
);
libvlc_time_t
(
*
libvlc_media_player_get_time
)
(
libvlc_media_player_t
*
p_mi
);
int
(
*
libvlc_audio_set_volume
)
(
libvlc_media_player_t
*
p_mi
,
int
i_volume
);
float
(
*
libvlc_media_player_get_rate
)
(
libvlc_media_player_t
*
p_mi
);
int
(
*
libvlc_audio_get_volume
)
(
libvlc_media_player_t
*
p_mi
);
int
(
*
libvlc_audio_set_volume
)
(
libvlc_media_player_t
*
p_mi
,
int
i_volume
);
int
(
*
libvlc_audio_get_mute
)
(
libvlc_media_player_t
*
p_mi
);
int
(
*
libvlc_audio_get_volume
)
(
libvlc_media_player_t
*
p_mi
);
void
(
*
libvlc_audio_set_mute
)
(
libvlc_media_player_t
*
p_mi
,
int
status
);
int
(
*
libvlc_audio_get_mute
)
(
libvlc_media_player_t
*
p_mi
);
int
(
*
libvlc_video_take_snapshot
)
(
libvlc_media_player_t
*
p_mi
,
void
(
*
libvlc_audio_set_mute
)
(
libvlc_media_player_t
*
p_mi
,
int
status
);
unsigned
num
,
int
(
*
libvlc_video_take_snapshot
)
(
libvlc_media_player_t
*
p_mi
,
unsigned
num
,
const
char
*
psz_filepath
,
const
char
*
psz_filepath
,
unsigned
int
i_width
,
unsigned
int
i_width
,
unsigned
int
i_height
);
unsigned
int
i_height
);
#if defined UNX
#if defined UNX
void
(
*
libvlc_media_player_set_xwindow
)
(
libvlc_media_player_t
*
p_mi
,
uint32_t
drawable
);
void
(
*
libvlc_media_player_set_xwindow
)
(
libvlc_media_player_t
*
p_mi
,
uint32_t
drawable
);
#elif defined MACOSX
#elif defined MACOSX
void
(
*
libvlc_media_player_set_nsobject
)
(
libvlc_media_player_t
*
p_mi
,
void
*
drawable
);
void
(
*
libvlc_media_player_set_nsobject
)
(
libvlc_media_player_t
*
p_mi
,
void
*
drawable
);
#elif defined WNT
#elif defined WNT
void
(
*
libvlc_media_player_set_hwnd
)
(
libvlc_media_player_t
*
p_mi
,
void
*
drawable
);
void
(
*
libvlc_media_player_set_hwnd
)
(
libvlc_media_player_t
*
p_mi
,
void
*
drawable
);
#else
#else
#error unknown OS
#error unknown OS
#endif
#endif
unsigned
(
*
libvlc_media_player_has_vout
)
(
libvlc_media_player_t
*
p_mi
);
unsigned
(
*
libvlc_media_player_has_vout
)
(
libvlc_media_player_t
*
p_mi
);
void
(
*
libvlc_video_set_mouse_input
)
(
libvlc_media_player_t
*
p_mi
,
unsigned
on
);
void
(
*
libvlc_video_set_mouse_input
)
(
libvlc_media_player_t
*
p_mi
,
unsigned
on
);
}
}
namespace
avmedia
{
namespace
vlc
{
namespace
wrapper
{
bool
Player
::
LoadSymbols
()
bool
Player
::
LoadSymbols
()
{
{
ApiMap
VLC_PLAYER_API
[]
=
ApiMap
VLC_PLAYER_API
[]
=
...
@@ -190,5 +197,7 @@ namespace VLC
...
@@ -190,5 +197,7 @@ namespace VLC
return
libvlc_media_player_has_vout
(
mPlayer
);
return
libvlc_media_player_has_vout
(
mPlayer
);
}
}
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
avmedia/source/vlc/wrapper/Player.hxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -20,7 +20,11 @@ namespace rtl
...
@@ -20,7 +20,11 @@ namespace rtl
class
OUString
;
class
OUString
;
}
}
namespace
VLC
namespace
avmedia
{
namespace
vlc
{
namespace
wrapper
{
{
class
Media
;
class
Media
;
class
Player
class
Player
...
@@ -63,6 +67,8 @@ namespace VLC
...
@@ -63,6 +67,8 @@ namespace VLC
libvlc_media_player_t
*
mPlayer
;
libvlc_media_player_t
*
mPlayer
;
};
};
}
}
}
}
#endif
#endif
...
...
avmedia/source/vlc/wrapper/SymbolLoader.hxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -19,6 +19,12 @@
...
@@ -19,6 +19,12 @@
#define SYM_MAP(a) { #a, (SymbolFunc *)&a }
#define SYM_MAP(a) { #a, (SymbolFunc *)&a }
namespace
avmedia
{
namespace
vlc
{
namespace
wrapper
{
typedef
void
(
*
SymbolFunc
)
(
void
);
typedef
void
(
*
SymbolFunc
)
(
void
);
struct
ApiMap
struct
ApiMap
...
@@ -70,7 +76,7 @@ namespace
...
@@ -70,7 +76,7 @@ namespace
(
aModule
,
OUString
::
createFromAscii
(
pMap
[
i
].
symName
).
pData
);
(
aModule
,
OUString
::
createFromAscii
(
pMap
[
i
].
symName
).
pData
);
if
(
!
aMethod
)
if
(
!
aMethod
)
{
{
std
::
cerr
<<
"Cannot load method "
<<
pMap
[
i
].
symName
<<
std
::
endl
;
SAL_WARN
(
"avmedia"
,
"Cannot load method "
<<
pMap
[
i
].
symName
)
;
*
pMap
[
i
].
refValue
=
NULL
;
*
pMap
[
i
].
refValue
=
NULL
;
return
false
;
return
false
;
}
}
...
@@ -82,8 +88,6 @@ namespace
...
@@ -82,8 +88,6 @@ namespace
}
}
}
}
namespace
VLC
{
template
<
size_t
N
>
template
<
size_t
N
>
bool
InitApiMap
(
const
ApiMap
(
&
pMap
)[
N
]
)
bool
InitApiMap
(
const
ApiMap
(
&
pMap
)[
N
]
)
{
{
...
@@ -98,7 +102,7 @@ namespace VLC
...
@@ -98,7 +102,7 @@ namespace VLC
if
(
aModule
==
NULL
)
if
(
aModule
==
NULL
)
{
{
std
::
cerr
<<
"Cannot load libvlc"
<<
std
::
endl
;
SAL_WARN
(
"avmedia"
,
"Cannot load libvlc"
)
;
return
false
;
return
false
;
}
}
...
@@ -112,6 +116,8 @@ namespace VLC
...
@@ -112,6 +116,8 @@ namespace VLC
return
false
;
return
false
;
}
}
}
}
}
}
#endif
#endif
...
...
avmedia/source/vlc/wrapper/ThreadsafeQueue.hxx
Dosyayı görüntüle @
6a9d3e7f
...
@@ -24,9 +24,12 @@
...
@@ -24,9 +24,12 @@
#include <osl/conditn.hxx>
#include <osl/conditn.hxx>
#include <boost/noncopyable.hpp>
#include <boost/noncopyable.hpp>
namespace
avmedia
{
namespace
avmedia
namespace
vlc
{
{
namespace
vlc
{
namespace
wrapper
{
template
<
class
T
>
template
<
class
T
>
class
ThreadsafeQueue
:
boost
::
noncopyable
class
ThreadsafeQueue
:
boost
::
noncopyable
{
{
...
@@ -70,7 +73,7 @@ void ThreadsafeQueue<T>::pop( T& data )
...
@@ -70,7 +73,7 @@ void ThreadsafeQueue<T>::pop( T& data )
data
=
mQueue
.
front
();
data
=
mQueue
.
front
();
mQueue
.
pop
();
mQueue
.
pop
();
}
}
}
}
}
}
}
...
...
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