-
Notifications
You must be signed in to change notification settings - Fork 7
Add local video track support #2
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
base: main
Are you sure you want to change the base?
Conversation
| room->Connect(URL, TOKEN); | ||
|
|
||
| // TODO Non blocking ? | ||
| while (!room->GetLocalParticipant()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should implement a correct way to handle events.
Should we expose all events in a virtual class (observer)?
| listenerId_ = FfiClient::getInstance().AddListener( | ||
| std::bind(&LocalParticipant::OnEvent, this, std::placeholders::_1)); | ||
|
|
||
| // cv_.wait(lock, [this] { return publishCallback_ != nullptr; }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should block here, but we should have a LocalTrackPublished event
| request.mutable_publish_track(); | ||
| publishTrackRequest->set_track_handle( | ||
| track->ffiHandle_.GetHandleId()); | ||
| *publishTrackRequest->mutable_options() = options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like your forgot to put the participant_handle inside the request
| const proto::TrackPublishOptions& options); | ||
|
|
||
| private: | ||
| std::condition_variable cv_; // Should we block? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should have a blocking API.
Maybe it is OK to add callback pointers inside the arguments?
include/livekit/participant.h
Outdated
| uint64_t publishAsyncId_; | ||
| FfiClient::ListenerId listenerId_{0}; | ||
| std::unique_ptr<proto::PublishTrackCallback> publishCallback_; | ||
| std::weak_ptr<Room> room_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new FFI version, it is no longer required to keep a reference to the room here (request don't need it)
include/livekit/ffi_client.h
Outdated
| FfiClient(); | ||
| ~FfiClient() = default; | ||
| FfiHandle(FfiHandle const&) = delete; | ||
| FfiHandle& operator=(FfiHandle const&) = delete; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add a unit tests that use the operator= (You said you saw issues related to dropping twice an handle)
|
Open to feedbacks wrt exposing events to the users (Should we do a virtual class? Event polling?) |
Add local video track support and publishing hue video track example