Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't limit max width for h264 streams to the window width #663

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions src/components/codecSupportHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,9 @@ export function getMaxBitrateSupport(): number {
/**
* Get the max supported video width the active Cast device supports.
* @param deviceId - Cast device id.
* @param codec - Video codec.
* @returns Max supported width.
*/
export function getMaxWidthSupport(
deviceId: DeviceIds,
codec?: string
): number {
if (codec === 'h264') {
// with HLS, it will produce a manifest error if we
// send any stream larger than the screen size...
return window.innerWidth;
}

// mkv playback can use the device limitations.
// The devices are capable of decoding and downscaling,
// they just refuse to do it with HLS. This increases
// the rate of direct playback.
export function getMaxWidthSupport(deviceId: DeviceIds): number {
switch (deviceId) {
case DeviceIds.ULTRA:
case DeviceIds.CCGTV:
Expand Down
2 changes: 1 addition & 1 deletion src/components/deviceprofileBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function getCodecProfiles(): CodecProfile[] {
createProfileCondition(
ProfileConditionValue.Width,
ProfileConditionType.LessThanEqual,
getMaxWidthSupport(currentDeviceId, 'h264').toString(),
getMaxWidthSupport(currentDeviceId).toString(),
true
)
],
Expand Down
Loading