[vlmc-devel] IService

Yikai Lu git at videolan.org
Sun Jun 26 06:01:12 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Sun Jun 12 00:15:20 2016 +0900| [36d5f9815ca1c8536a707b96103379cb2ca1018d] | committer: Yikai Lu

IService

> https://code.videolan.org/videolan/vlmc/commit/36d5f9815ca1c8536a707b96103379cb2ca1018d
---

 src/Backend/IService.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/CMakeLists.txt     |  1 +
 2 files changed, 55 insertions(+)

diff --git a/src/Backend/IService.h b/src/Backend/IService.h
new file mode 100644
index 0000000..45190e9
--- /dev/null
+++ b/src/Backend/IService.h
@@ -0,0 +1,54 @@
+/*****************************************************************************
+ * IService.h: Defines an interface of a common base of
+ *             consumer and producer.
+ *****************************************************************************
+ * Copyright (C) 2008-2016 VideoLAN
+ *
+ * Authors: Yikei Lu <luyikei.qmltu at gmail.com>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef ISERVICE_H
+#define ISERVICE_H
+
+#include <string>
+
+namespace Backend
+{
+    class IProfile;
+    class IFilter;
+    class IService
+    {
+    public:
+        virtual ~IService() = default;
+
+        virtual std::string     identifier() const = 0;
+        virtual IService* consumer() const = 0;
+        virtual IService* producer() const = 0;
+        virtual IProfile* profile() const = 0;
+        virtual bool      attach( IFilter& filter ) = 0;
+        virtual bool      detach( IFilter& filter ) = 0;
+        virtual bool      detach( int index ) = 0;
+        virtual int       filterCount() const = 0;
+        // Indexes
+        virtual bool      moveFilter( int from, int to ) = 0;
+        virtual IFilter*  filter( int index ) const = 0;
+        virtual void      setProfile( IProfile& profile ) = 0;
+        virtual bool      isValid() const = 0;
+    };
+}
+
+#endif // ISERVICE_H
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ce245b6..345653f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -58,6 +58,7 @@ SET(CMAKE_AUTOMOC ON)
 SET(VLMC_SRCS
     Commands/Commands.cpp
     Backend/IBackend.h
+    Backend/IService.h
     Backend/VLC/VLCBackend.cpp
     Backend/VLC/VLCSourceRenderer.cpp
     Backend/VLC/VLCVmemRenderer.cpp



More information about the Vlmc-devel mailing list