MixedRealityCompanionKit icon indicating copy to clipboard operation
MixedRealityCompanionKit copied to clipboard

Spectator view dynamic camera config (load video frame settings at runtime)

Open Ybalrid opened this issue 6 years ago • 5 comments

Hi, I've made some changes internally on the spectator view compositor.

I find it quite annoying to have to rebuild the DLLs if the frame size or framerate of the camera changes.

The changes consist on the following:

  • If a file called camera.cfg is found inside the User's Document folder (next to the folder where the HologramCapture would be found), the value used will be the ones in the folder for things like the frame height, width and the video FPS.
  • If the file is not found, it will silently fallback to use the values set to CompositorConstants.h" as it always had. This doesn't change the behavior for existing users.

The way it works is basically just a few static variables that are exported from CompositorDLL. With a header to import it on the UnityCompositorInterface and a simple config file reader that is called at plugin initialization (or from the main() function of the calibration app).

The place where theses variables (FRAME_WIDTH, etc...) are originally mentioned in the README files has been updated with a not explaining that it is possible to create this file and use it that way.

That way, a user just has to build the DLL once, with the configuration for his capture card (adding or not the necessary SDKs).

Ybalrid avatar Jun 14 '18 14:06 Ybalrid

And this has been built on top of the current master, that include #271

Ybalrid avatar Jun 14 '18 14:06 Ybalrid

Love this contribution, thanks!

Can you update this readme section to mention this config file as an option (include file name, file location, expected file contents)

fieldsJacksonG avatar Jun 14 '18 22:06 fieldsJacksonG

Thanks for the feedback @fieldsJacksonG! Will push fixes on this PR during business hours in France today (Friday)

Ybalrid avatar Jun 15 '18 00:06 Ybalrid

@fieldsJacksonG I think I got around to do all your requested changes, can you review again?

Ybalrid avatar Jun 15 '18 08:06 Ybalrid

@fieldsJacksonG Just so you know, I'm finishing an internship in two weeks, after that I will not have access to any HoloLens hardware. It will be harder for me to contribute on this without being able to test anything :wink:

Ybalrid avatar Jul 13 '18 08:07 Ybalrid