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

[Depends on #8344] Implement ApiHandler functions and add JsonWriter #8379

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

show50726
Copy link
Contributor

This PR should be merged after #8344 is in.

  • Implement APIs inside ApiHandler
    • GET /api/framegraphs: for getting all active frame graph info
    • GET /api/framegraph?fg={fgid}: for getting specific view's frame graph info
    • GET /api/status: for long polling, notify the client if there's any view's frame graph updated
  • Add JsonWriter class for converting FrameGraphInfo to json format

@show50726 show50726 requested review from pixelflinger and poweifeng and removed request for pixelflinger January 22, 2025 15:31
@show50726 show50726 added the internal Issue/PR does not affect clients label Jan 22, 2025
Copy link
Collaborator

@pixelflinger pixelflinger left a comment

Choose a reason for hiding this comment

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

some question around mCurrentStatus

// This variable is to implement a *hanging* effect for /api/status. The call to /api/status
// will always block until statusMaterialId is updated again. The client is expected to keep
// calling /api/status (a constant "pull" to simulate a push).
std::atomic<uint64_t> mCurrentStatus = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand why this needs to be an atomic since it's protected by the mutex? Also I don't see it being updated anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we might not need to make it atomic. I've updated the code.

Also, I add the call to updateFrameGraph when a view is created and updated, and it will only be updated when the content of the info is changed.

libs/fgviewer/CMakeLists.txt Outdated Show resolved Hide resolved
libs/fgviewer/src/ApiHandler.cpp Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Issue/PR does not affect clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants