Skip to content

add is_screencast to VideoSource#575

Open
theomonnom wants to merge 3 commits intomainfrom
theo/is_screencast
Open

add is_screencast to VideoSource#575
theomonnom wants to merge 3 commits intomainfrom
theo/is_screencast

Conversation

@theomonnom
Copy link
Member

No description provided.

@theomonnom theomonnom requested review from a team and davidzhao February 15, 2026 01:56
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

req.new_video_source.type = proto_video.VideoSourceType.VIDEO_SOURCE_NATIVE
req.new_video_source.resolution.width = width
req.new_video_source.resolution.height = height
req.new_video_source.is_screencast = is_screencast

Choose a reason for hiding this comment

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

🔴 Setting is_screencast on protobuf message that lacks this field causes AttributeError at runtime

The code sets req.new_video_source.is_screencast = is_screencast on line 29, but the NewVideoSourceRequest protobuf message does not have an is_screencast field. This causes an AttributeError every time VideoSource.__init__ is called, making the class completely unusable.

Root Cause

The protobuf definition for NewVideoSourceRequest only has two fields: type and resolution (confirmed in livekit-rtc/livekit/rtc/_proto/video_frame_pb2.pyi:242-265 and verified at runtime). The PR adds req.new_video_source.is_screencast = is_screencast but the corresponding .proto file was never updated to include the is_screencast field.

Runtime verification:

>>> msg = video_frame_pb2.NewVideoSourceRequest()
>>> msg.is_screencast = True
AttributeError: Protocol message NewVideoSourceRequest has no "is_screencast" field.

Impact: Every call to VideoSource(width, height) — even without passing is_screencast — will crash with AttributeError because False (the default) is still assigned to the non-existent field. This is a complete regression that breaks all video source creation.

Prompt for agents
The protobuf definition for NewVideoSourceRequest in video_frame_pb2.py needs to be regenerated from an updated .proto file that includes the is_screencast field. The .proto file (likely video_frame.proto) should add a field like `optional bool is_screencast = 3;` to the NewVideoSourceRequest message. Then regenerate the Python protobuf bindings (video_frame_pb2.py and video_frame_pb2.pyi). Without this proto update, the line `req.new_video_source.is_screencast = is_screencast` in video_source.py:29 will always raise an AttributeError at runtime.
Open in Devin Review

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant