[vlc-devel] [PATCH] chromecast: move some code in a header

Steve Lhomme robux4 at videolabs.io
Fri Dec 18 12:50:25 CET 2015


--
this header will be shared with other modules
---
 modules/stream_out/chromecast/cast.cpp     | 16 ++--------
 modules/stream_out/chromecast/chromecast.h | 48 ++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 14 deletions(-)
 create mode 100644 modules/stream_out/chromecast/chromecast.h

diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index b8f2cb9..5fa57bf 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -29,12 +29,12 @@
 # include "config.h"
 #endif
 
+#include "chromecast.h"
+
 #ifdef HAVE_POLL
 # include <poll.h>
 #endif
 
-#include <vlc_common.h>
-#include <vlc_plugin.h>
 #include <vlc_sout.h>
 #include <vlc_tls.h>
 #include <vlc_url.h>
@@ -47,21 +47,9 @@
 
 #include <google/protobuf/io/zero_copy_stream_impl.h>
 #include <google/protobuf/io/coded_stream.h>
-#include "cast_channel.pb.h"
 
 #include "../../misc/webservices/json.h"
 
-// Status
-enum
-{
-    CHROMECAST_DISCONNECTED,
-    CHROMECAST_TLS_CONNECTED,
-    CHROMECAST_AUTHENTICATED,
-    CHROMECAST_APP_STARTED,
-    CHROMECAST_MEDIA_LOAD_SENT,
-    CHROMECAST_CONNECTION_DEAD,
-};
-
 #define PACKET_MAX_LEN 10 * 1024
 #define PACKET_HEADER_LEN 4
 
diff --git a/modules/stream_out/chromecast/chromecast.h b/modules/stream_out/chromecast/chromecast.h
new file mode 100644
index 0000000..7253b51
--- /dev/null
+++ b/modules/stream_out/chromecast/chromecast.h
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * chromecast.cpp: Chromecast module for vlc
+ *****************************************************************************
+ * Copyright © 2014-2015 VideoLAN
+ *
+ * Authors: Adrien Maglo <magsoft at videolan.org>
+ *          Jean-Baptiste Kempf <jb at videolan.org>
+ *          Steve Lhomme <robux4 at videolabs.io>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+
+#ifndef VLC_CHROMECAST_H
+#define VLC_CHROMECAST_H
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
+
+#include "cast_channel.pb.h"
+
+// Status
+enum
+{
+    CHROMECAST_DISCONNECTED,
+    CHROMECAST_TLS_CONNECTED,
+    CHROMECAST_AUTHENTICATED,
+    CHROMECAST_APP_STARTED,
+    CHROMECAST_MEDIA_LOAD_SENT,
+    CHROMECAST_CONNECTION_DEAD,
+};
+
+#endif /* VLC_CHROMECAST_H */
-- 
2.6.3



More information about the vlc-devel mailing list