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
5ae5a11f
Kaydet (Commit)
5ae5a11f
authored
Agu 05, 2013
tarafından
Minh Ngo
Kaydeden (comit)
Michael Meeks
Agu 21, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
VLC::Instance Wrapper class for libvlc_instance_t
Change-Id: I46beb65c13ed349b0faadfab1be888d6cbd10ff9
üst
3e51dc6f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
10 deletions
+84
-10
Library_avmediavlc.mk
avmedia/Library_avmediavlc.mk
+1
-0
vlcplayer.cxx
avmedia/source/vlc/vlcplayer.cxx
+5
-7
vlcplayer.hxx
avmedia/source/vlc/vlcplayer.hxx
+3
-3
Instance.cxx
avmedia/source/vlc/wrapper/Instance.cxx
+32
-0
Instance.hxx
avmedia/source/vlc/wrapper/Instance.hxx
+43
-0
No files found.
avmedia/Library_avmediavlc.mk
Dosyayı görüntüle @
5ae5a11f
...
...
@@ -45,6 +45,7 @@ $(eval $(call gb_Library_add_exception_objects,avmediavlc,\
avmedia/source/vlc/vlcuno
\
avmedia/source/vlc/vlcwindow
\
avmedia/source/vlc/vlcframegrabber
\
avmedia/source/vlc/wrapper/Instance
\
))
# vim: set noet sw=4 ts=4:
avmedia/source/vlc/vlcplayer.cxx
Dosyayı görüntüle @
5ae5a11f
...
...
@@ -4,6 +4,7 @@
#include "vlcplayer.hxx"
#include "vlcwindow.hxx"
#include "vlcframegrabber.hxx"
#include "wrapper/Instance.hxx"
using
namespace
::
com
::
sun
::
star
;
...
...
@@ -14,31 +15,28 @@ const ::rtl::OUString AVMEDIA_VLC_PLAYER_IMPLEMENTATIONNAME = "com.sun.star.comp
const
::
rtl
::
OUString
AVMEDIA_VLC_PLAYER_SERVICENAME
=
"com.sun.star.media.Player_VLC"
;
const
char
*
const
VLC_ARGS
[]
=
{
// "-I",
"-Vdummy"
,
"--snapshot-format=png"
,
// "--ignore-config",
"--ffmpeg-threads"
,
"--verbose=-1"
,
// "--quiet"
};
const
int
MS_IN_SEC
=
1000
;
// Millisec in sec
namespace
{
libvlc_media_t
*
InitMedia
(
const
rtl
::
OUString
&
url
,
boost
::
shared_ptr
<
libvlc_instance_t
>
&
instance
)
libvlc_media_t
*
InitMedia
(
const
rtl
::
OUString
&
url
,
VLC
::
Instance
&
instance
)
{
rtl
::
OString
dest
;
url
.
convertToString
(
&
dest
,
RTL_TEXTENCODING_UTF8
,
0
);
return
libvlc_media_new_path
(
instance
.
get
()
,
dest
.
getStr
());
return
libvlc_media_new_path
(
instance
,
dest
.
getStr
());
}
}
VLCPlayer
::
VLCPlayer
(
const
rtl
::
OUString
&
url
)
:
VLC_Base
(
m_aMutex
)
,
mInstance
(
libvlc_new
(
sizeof
(
VLC_ARGS
)
/
sizeof
(
VLC_ARGS
[
0
]
),
VLC_ARGS
),
libvlc_release
)
,
mInstance
(
sizeof
(
VLC_ARGS
)
/
sizeof
(
VLC_ARGS
[
0
]
),
VLC_ARGS
)
,
mMedia
(
InitMedia
(
url
,
mInstance
),
libvlc_media_release
)
,
mPlayer
(
libvlc_media_player_new_from_media
(
mMedia
.
get
()
),
libvlc_media_player_release
)
,
mUrl
(
url
)
...
...
@@ -108,7 +106,7 @@ namespace
case
libvlc_MediaPlayerEndReached
:
boost
::
shared_ptr
<
libvlc_media_player_t
>
player
=
*
static_cast
<
boost
::
shared_ptr
<
libvlc_media_player_t
>*
>
(
pData
);
libvlc_media_player_stop
(
player
.
get
()
);
libvlc_media_player_play
(
player
.
get
()
)
libvlc_media_player_play
(
player
.
get
()
)
;
break
;
}
}
...
...
avmedia/source/vlc/vlcplayer.hxx
Dosyayı görüntüle @
5ae5a11f
...
...
@@ -27,6 +27,7 @@
#include <com/sun/star/media/XPlayer.hpp>
#include <cppuhelper/basemutex.hxx>
#include "wrapper/Instance.hxx"
namespace
avmedia
{
namespace
vlc
{
...
...
@@ -37,7 +38,7 @@ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer,
class
VLCPlayer
:
public
::
cppu
::
BaseMutex
,
public
VLC_Base
{
boost
::
shared_ptr
<
libvlc_instance_t
>
mInstance
;
VLC
::
Instance
mInstance
;
boost
::
shared_ptr
<
libvlc_media_t
>
mMedia
;
boost
::
shared_ptr
<
libvlc_media_player_t
>
mPlayer
;
const
rtl
::
OUString
mUrl
;
...
...
@@ -74,4 +75,4 @@ public:
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
avmedia/source/vlc/wrapper/Instance.cxx
0 → 100644
Dosyayı görüntüle @
5ae5a11f
#include <rtl/ustring.hxx>
#include "Instance.hxx"
#include "SymbolLoader.hxx"
namespace
VLC
{
namespace
{
libvlc_instance_t
*
(
*
libvlc_new
)
(
int
argc
,
const
char
*
const
*
argv
);
void
(
*
libvlc_release
)
(
libvlc_instance_t
*
p_instance
);
ApiMap
VLC_INSTANCE_API
[]
=
{
SYM_MAP
(
libvlc_new
),
SYM_MAP
(
libvlc_release
)
};
}
Instance
::
Instance
(
int
argc
,
const
char
*
const
*
argv
)
{
InitApiMap
(
VLC_INSTANCE_API
);
mInstance
=
libvlc_new
(
argc
,
argv
);
}
Instance
::~
Instance
()
{
libvlc_release
(
mInstance
);
}
}
avmedia/source/vlc/wrapper/Instance.hxx
0 → 100644
Dosyayı görüntüle @
5ae5a11f
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef _WRAPPER_INSTANCE_HXX
#define _WRAPPER_INSTANCE_HXX
struct
libvlc_instance_t
;
namespace
VLC
{
class
Instance
{
public
:
Instance
(
int
argc
,
const
char
*
const
*
argv
);
virtual
~
Instance
();
inline
operator
libvlc_instance_t
*
()
{
return
mInstance
;
}
private
:
libvlc_instance_t
*
mInstance
;
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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