|
template<typename T > |
std::ostream & | shaka::operator<< (std::ostream &os, const ShakaRect< T > &rect) |
|
template<typename T > |
std::ostream & | shaka::operator<< (std::ostream &os, const Rational< T > &bar) |
|
template<typename T , typename U , typename = typename std::enable_if<std::is_arithmetic<T>::value>::type> |
Rational< typename std::common_type< T, U >::type > | shaka::operator* (T a, const Rational< U > &b) |
|
template<typename T , typename U , typename = typename std::enable_if<std::is_arithmetic<T>::value>::type> |
Rational< typename std::common_type< T, U >::type > | shaka::operator/ (T a, const Rational< U > &b) |
|
void | shaka::FitVideoToRegion (ShakaRect< uint32_t > frame, ShakaRect< uint32_t > bounds, Rational< uint32_t > sample_aspect_ratio, VideoFillMode mode, ShakaRect< uint32_t > *src, ShakaRect< uint32_t > *dest) |
|
std::string | shaka::EscapeKeySystem (const std::string &key_system) |
|
std::string | shaka::LicenseServerConfig (const std::string &key_system) |
|
std::string | shaka::AdvancedDrmConfig (const std::string &key_system, const std::string &property) |
|
A number of utility methods that an app may want to use.
§ VideoFillMode
Defines possible fill modes for the video. When drawing the video onto a region, this determines how the video gets resized to fit. The video frame will always be centered within the region.
Enumerator |
---|
MaintainRatio | Maintain the aspect ratio of the original video and size the video based on the smaller of the extents. There will be black bars around the video if the region's aspect ratio isn't the same as the video's
|
Stretch | Stretch the video to completely fill the region.
|
Zoom | Maintain the aspect ratio of the original video and size the video based on the larger of the extents. This will cause the video to be cropped to fit in the region, but there won't be any black bars around the video.
|
Definition at line 41 of file utils.h.
§ AdvancedDrmConfig()
std::string shaka::AdvancedDrmConfig |
( |
const std::string & |
key_system, |
|
|
const std::string & |
property |
|
) |
| |
|
inline |
This creates a configuration key for advanced DRM configuration.
Definition at line 284 of file utils.h.
§ EscapeKeySystem()
std::string shaka::EscapeKeySystem |
( |
const std::string & |
key_system | ) |
|
|
inline |
Escapes the given key-system name so it can appear in a config name path.
- Parameters
-
key_system | The key system name (e.g. com.widevine.alpha ). |
- Returns
- A name path usable as part of Player::Configure.
Definition at line 253 of file utils.h.
§ FitVideoToRegion()
Creates two rectangles that can be used as rendering destination to draw a video with the given fill mode. If the video exceeds the bounds specified, this will use the src attribute to specify the region of the frame to draw; otherwise that stores the full bounds of the frame. The dest field will contain the bounds to draw on the window.
- Parameters
-
frame | The bounds of the video. |
bounds | The bounds to draw the frame within. |
sample_aspect_ratio | The sample aspect ratio; this is the aspect ratio of the pixels in the image. (0, 0) is treated as (1, 1). |
mode | The fill mode to fit to. |
src | Where to put the source rectangle. This represents the sub-region of the frame to draw. |
dest | Where to put the destination rectangle. This represents the region on the window to draw to. |
Definition at line 23 of file shaka_utils.cc.
§ LicenseServerConfig()
std::string shaka::LicenseServerConfig |
( |
const std::string & |
key_system | ) |
|
|
inline |
This creates a configuration key that sets the license server URL for the given key system.
"https://example.com/server");
Definition at line 272 of file utils.h.
§ operator*()
template<typename T , typename U , typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
§ operator/()
template<typename T , typename U , typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
§ operator<<() [1/2]
template<typename T >
std::ostream& shaka::operator<< |
( |
std::ostream & |
os, |
|
|
const ShakaRect< T > & |
rect |
|
) |
| |
§ operator<<() [2/2]
template<typename T >
std::ostream& shaka::operator<< |
( |
std::ostream & |
os, |
|
|
const Rational< T > & |
bar |
|
) |
| |