ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
Loading...
Searching...
No Matches
cast_utils.cpp File Reference

Picture sizes and frame rates a Chromecast can be sent. More...

#include "cast_utils.h"
#include <algorithm>
#include <cctype>
Include dependency graph for cast_utils.cpp:

Functions

const std::vector< CastResolution > & toolx::streams::castResolutions ()
 All the picture sizes offered for casting, smallest first.
const std::vector< uint32_t > & toolx::streams::castFramerates ()
 The frame rates offered for casting, in ascending order.
uint32_t toolx::streams::castMaxHeight (const std::string &model, bool supports_video)
 The tallest picture a device plays, judged from its model name.
uint32_t toolx::streams::castMaxFramerate (uint32_t height)
 The highest frame rate for a picture height.
uint32_t toolx::streams::castBitrate (uint32_t width, uint32_t height, uint32_t framerate)
 The bit rate to encode a picture at.

Detailed Description

Picture sizes and frame rates a Chromecast can be sent.

Function Documentation

◆ castBitrate()

uint32_t toolx::streams::castBitrate ( uint32_t width,
uint32_t height,
uint32_t framerate )

The bit rate to encode a picture at.

About 0.1 bit per pixel per frame, limited to what a Chromecast plays.

Parameters
widththe picture width in pixels
heightthe picture height in pixels
framerateframes per second
Returns
uint32_t bits per second

◆ castFramerates()

const std::vector< uint32_t > & toolx::streams::castFramerates ( )

The frame rates offered for casting, in ascending order.

Returns
const std::vector<uint32_t>& frames per second

◆ castMaxFramerate()

uint32_t toolx::streams::castMaxFramerate ( uint32_t height)

The highest frame rate for a picture height.

4K is limited to 30 frames per second with H.264.

Parameters
heightthe picture height in pixels
Returns
uint32_t frames per second

◆ castMaxHeight()

uint32_t toolx::streams::castMaxHeight ( const std::string & model,
bool supports_video )

The tallest picture a device plays, judged from its model name.

A Chromecast does not announce what it can play, only its model name and a capability bit field. The sizes are therefore those documented for the model: older and HD Chromecasts and most TVs play 1080p, Ultra, Google TV and Streamer models play 4K and smart displays (Nest Hub) 720p. An unknown model is assumed to play 1080p.

Parameters
modelthe model name announced by the device, e.g. "Chromecast Ultra"
supports_videothe device announces that it can show video
Returns
uint32_t the tallest picture in pixels, 0 if the device can not show video

◆ castResolutions()

const std::vector< CastResolution > & toolx::streams::castResolutions ( )

All the picture sizes offered for casting, smallest first.

Returns
const std::vector<CastResolution>& the list, in ascending order of height