[vlc-commits] [Git][videolan/vlc][master] chromecast: Disable HEVC for original Chromecast devices
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Mon Dec 1 16:44:37 UTC 2025
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
a4aaf856 by Gautier at 2025-12-01T17:44:31+01:00
chromecast: Disable HEVC for original Chromecast devices
- - - - -
5 changed files:
- modules/gui/qt/tests/test_renderer_manager_model.cpp
- modules/stream_out/chromecast/cast.cpp
- modules/stream_out/chromecast/chromecast.h
- modules/stream_out/chromecast/chromecast_ctrl.cpp
- src/misc/renderer_discovery.c
Changes:
=====================================
modules/gui/qt/tests/test_renderer_manager_model.cpp
=====================================
@@ -47,7 +47,7 @@ private:
QModelIndex idx = m_model->index(row, 0);
QCOMPARE(m_model->data(idx, RendererManager::TYPE), "type");
QCOMPARE(m_model->data(idx, RendererManager::NAME), QString("name%1").arg(id));
- QCOMPARE(m_model->data(idx, RendererManager::SOUT), QString("dummy{ip=%1.%1.%1.%1,port=%1,extra sout}").arg(id));
+ QCOMPARE(m_model->data(idx, RendererManager::SOUT), QString("dummy{ip=%1.%1.%1.%1,port=%1,device-name=name%1,extra sout}").arg(id));
QCOMPARE(m_model->data(idx, RendererManager::ICON_URI), QString("icon://"));
QCOMPARE(m_model->data(idx, RendererManager::FLAGS), id);
}
=====================================
modules/stream_out/chromecast/cast.cpp
=====================================
@@ -188,7 +188,7 @@ static int AccessOpen(vlc_object_t *);
static void AccessClose(vlc_object_t *);
static const char *const ppsz_sout_options[] = {
- "ip", "port", "http-port", "video", NULL
+ "ip", "port", "http-port", "video", "device-name", NULL
};
/*****************************************************************************
@@ -223,6 +223,8 @@ vlc_module_begin ()
change_private()
add_integer(SOUT_CFG_PREFIX "port", CHROMECAST_CONTROL_PORT, NULL, NULL)
change_private()
+ add_string(SOUT_CFG_PREFIX "device-name", NULL, NULL, NULL)
+ change_private()
add_bool(SOUT_CFG_PREFIX "video", true, NULL, NULL)
change_private()
add_integer(SOUT_CFG_PREFIX "http-port", HTTP_PORT, HTTP_PORT_TEXT, HTTP_PORT_LONGTEXT)
@@ -767,10 +769,19 @@ bool sout_stream_sys_t::canDecodeVideo( const es_format_t *es ) const
{
if( transcoding_state & TRANSCODING_VIDEO )
return false;
+
+ const std::string suffix = "(Chromecast)";
+ const std::string name = p_intf->getDeviceName();
+ const bool original_chromecast = name.size() >= suffix.size() &&
+ std::equal(suffix.rbegin(), suffix.rend(), name.rbegin());
+
switch( es->i_codec )
{
- case VLC_CODEC_H264:
case VLC_CODEC_HEVC:
+ if (original_chromecast)
+ // Original Chromecasts do not support HEVC
+ return false;
+ case VLC_CODEC_H264:
return true;
case VLC_CODEC_VP8:
if (es_format_HasVpxAlpha(es)) // contains alpha extradata
=====================================
modules/stream_out/chromecast/chromecast.h
=====================================
@@ -191,6 +191,8 @@ struct intf_sys_t
std::string getHttpStreamPath() const;
std::string getHttpArtRoot() const;
+ std::string getDeviceName() const { return m_device_name; };
+
int httpd_file_fill( uint8_t *psz_request, uint8_t **pp_data, size_t *pi_data );
void interrupt_wake_up();
private:
@@ -249,6 +251,7 @@ private:
const int m_device_port;
std::string m_mime;
std::string m_device_addr;
+ std::string m_device_name;
std::string m_appTransportId;
unsigned m_last_request_id;
=====================================
modules/stream_out/chromecast/chromecast_ctrl.cpp
=====================================
@@ -37,6 +37,7 @@
#include <cerrno>
#include <iomanip>
+#include <vlc_fixups.h>
#include <vlc_stream.h>
#include <vlc_rand.h>
#include <vlc_threads.h>
@@ -153,6 +154,7 @@ intf_sys_t::intf_sys_t(vlc_object_t * const p_this, int port, std::string device
, m_cc_time_date( VLC_TICK_INVALID )
, m_cc_time( VLC_TICK_INVALID )
, m_pingRetriesLeft( PING_WAIT_RETRIES )
+ , m_device_name(_("Unknown"))
{
m_communication = new ChromecastCommunication( p_this,
getHttpStreamPath(), getHttpStreamPort(),
@@ -166,6 +168,13 @@ intf_sys_t::intf_sys_t(vlc_object_t * const p_this, int port, std::string device
ss << "http://" << m_communication->getServerIp() << ":" << port;
m_art_http_ip = ss.str();
+ char *device_name = var_GetString(p_this, "sout-chromecast-device-name");
+ if (device_name)
+ {
+ m_device_name = device_name;
+ free(device_name);
+ }
+
m_common.p_opaque = this;
m_common.pf_set_demux_enabled = set_demux_enabled;
m_common.pf_get_time = get_time;
=====================================
src/misc/renderer_discovery.c
=====================================
@@ -83,8 +83,10 @@ vlc_renderer_item_new(const char *psz_type, const char *psz_name,
if (p_item->psz_name == NULL)
goto error;
- if (asprintf(&p_item->psz_sout, "%s{ip=%s,port=%u%s%s}",
+ if (asprintf(&p_item->psz_sout, "%s{ip=%s,port=%u,%s%s%s%s}",
url.psz_protocol, url.psz_host, url.i_port,
+ psz_name != NULL ? "device-name=" : "",
+ psz_name != NULL ? psz_name : "",
psz_extra_sout != NULL ? "," : "",
psz_extra_sout != NULL ? psz_extra_sout : "") == -1)
{
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a4aaf856fa7aa43682fb5e72f5885414bab1e393
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a4aaf856fa7aa43682fb5e72f5885414bab1e393
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list