win-capture-audio icon indicating copy to clipboard operation
win-capture-audio copied to clipboard

Add integration with game-capture

Open bozbez opened this issue 3 years ago • 4 comments

As mentioned in #1, currently the user must select a game in both the game-capture and audio-capture settings windows (if they are not using the hotkeys). An idea to improve this would be to add a third mode "Same as game-capture" with a dropdown of the game-capture sources the user has in their current scene.

As far as my (limited) knowledge of OBS plugins goes, to implement this we would need to:

  1. Enumerate the game-capture sources in the scene
  2. Extract either the game-capture private context or the private obs_data_t settings object
  3. Peek the required information for us to identify the same process as the game-capture source
  4. Monitor updates to said context or settings object to track and updates to the target process

Step 1 is likely quite easy, but 2, 3 and especially 4 look to be awkward and hacky. For now this is somewhat out of scope until the stability and compatability of the hook has improved.

Alternatives such as integrating directly with the game-capture plugin are also worth considering, but would require the plugin to be merged into OBS master.

bozbez avatar Aug 18 '21 00:08 bozbez

If this is not merged into the main plugin, obsproject/obs-studio/pull/2659 could be handy.

henke37 avatar Aug 18 '21 16:08 henke37

Ah yes that looks perfect, and even without that I see you pulling the handle directly from the game-capture source in your window follower plugin. Thanks!

bozbez avatar Aug 18 '21 17:08 bozbez

Please don't follow my example with reaching deep into several internal structs. Push for the PR instead.

henke37 avatar Aug 18 '21 19:08 henke37

Yeah for sure, was just good to see that I wasn't completely off the rails with my first idea.

bozbez avatar Aug 18 '21 20:08 bozbez