[vlc-commits] sout: chromecast: add stream info helpers

Filip Roséen git at videolan.org
Tue Jul 24 16:08:22 CEST 2018


vlc/vlc-3.0 | branch: master | Filip Roséen <filip at atch.se> | Mon Jul 23 19:56:58 2018 +0200| [a17b7c99903b1da2d0dfb07d4cf299db7a235ca2] | committer: Jean-Baptiste Kempf

sout: chromecast: add stream info helpers

The previous implementation had hard-coded paths in several places,
and each place relied on other relevant part using the same paths.
>From a maintainability perspective this is a mess, and bound to fail
one way or another.

These changes introduce helper-functions that can be called in places
where the values are needed, effectively adding a layer of protection
to maintainability issues by making sure everything is using the same
values.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>
(cherry picked from commit 92c90c5b0a98a01d3f81d1a8d9ffeea0e230a7a2)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=a17b7c99903b1da2d0dfb07d4cf299db7a235ca2
---

 modules/stream_out/chromecast/chromecast.h        |  4 ++++
 modules/stream_out/chromecast/chromecast_ctrl.cpp | 15 +++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/modules/stream_out/chromecast/chromecast.h b/modules/stream_out/chromecast/chromecast.h
index 19b0c9dea1..6bcb77624c 100644
--- a/modules/stream_out/chromecast/chromecast.h
+++ b/modules/stream_out/chromecast/chromecast.h
@@ -182,6 +182,10 @@ struct intf_sys_t
     void sendInputEvent(enum cc_input_event event, union cc_input_arg arg);
     mtime_t getPauseDelay();
 
+    unsigned int getHttpStreamPort() const;
+    std::string getHttpStreamPath() const;
+    std::string getHttpArtRoot() const;
+
     int httpd_file_fill( uint8_t *psz_request, uint8_t **pp_data, int *pi_data );
     void interrupt_wake_up();
 private:
diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index 2b47268e1c..9e1ac6b368 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -1112,6 +1112,21 @@ mtime_t intf_sys_t::getPauseDelay()
     return m_pause_delay;
 }
 
+unsigned int intf_sys_t::getHttpStreamPort() const
+{
+    return m_streaming_port;
+}
+
+std::string intf_sys_t::getHttpStreamPath() const
+{
+    return "/stream";
+}
+
+std::string intf_sys_t::getHttpArtRoot() const
+{
+    return "/art";
+}
+
 bool intf_sys_t::isFinishedPlaying()
 {
     return m_cc_eof || isStateError() || m_state == Stopped;



More information about the vlc-commits mailing list