Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/livekit-rtc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"@datastructures-js/deque": "1.0.8",
"@livekit/mutex": "^1.0.0",
"@livekit/rtc-ffi-bindings": "0.12.60",
"@livekit/rtc-ffi-bindings": "0.12.68",
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
"@livekit/typed-emitter": "^3.0.0",
"pino": "^9.0.0",
"pino-pretty": "^13.0.0"
Expand Down
1 change: 1 addition & 0 deletions packages/livekit-rtc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export {
IceTransportType,
TrackPublishOptions,
} from '@livekit/rtc-ffi-bindings';
export { DegradationPreference } from './types.js';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 New enum defined locally rather than re-exported from ffi-bindings

Most enums in the public API (e.g., TrackKind, TrackSource, ConnectionQuality) are re-exported from @livekit/rtc-ffi-bindings (packages/livekit-rtc/src/index.ts:17-39), but DegradationPreference is defined locally in types.ts and exported from there. This is a deliberate pattern choice — possibly because the ffi-bindings don't expose this enum, or because the SDK wants to present a simplified subset. Worth confirming this is intentional, as a locally-defined enum could drift out of sync with the underlying bindings if the protobuf definition changes.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

export {
SimulateScenarioKind,
StreamState,
Expand Down
17 changes: 17 additions & 0 deletions packages/livekit-rtc/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,20 @@ export interface ChatMessage {
editTimestamp?: number;
generated?: boolean;
}

/**
* Controls how the encoder degrades quality when bandwidth is constrained.
*/
export enum DegradationPreference {
/** Balance between framerate and resolution degradation. */
Balanced = 0,
/** Degrade resolution to maintain framerate (prioritize smooth motion). */
MaintainFramerate = 1,
/** Degrade framerate to maintain resolution (prioritize image clarity). */
MaintainResolution = 2,
/**
* Maintain both framerate and resolution. Frames may be dropped before encoding
* if necessary to avoid overusing network and encoder resources.
*/
MaintainFramerateAndResolution = 4,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 DegradationPreference enum value 4 skips value 3 — intentional but worth confirming

The DegradationPreference enum assigns values 0, 1, 2, 4 — skipping 3 (packages/livekit-rtc/src/types.ts:17-26). In WebRTC's libwebrtc, value 3 is typically DISABLED. The skip to 4 for MaintainFramerateAndResolution likely aligns with a newer LiveKit-specific proto definition (the FFI bindings were bumped from 0.12.60 to 0.12.68 in this PR). Since the FFI bindings aren't available for inspection in the repo itself, it's worth confirming that value 4 matches the proto/FFI definition exactly.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

}
50 changes: 25 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading