Create an endpoint to view basic video info eg canvas size#319
Conversation
Palakis
left a comment
There was a problem hiding this comment.
Thanks for this! Needs some changes before it's good to merge.
* Switch to camelCase for output properties * Remove done TODO * Properly document all of the information returned
|
Adjusted per comments/recommendations. I'm not sure what the difference is between "Number" and "double" in the documentation. It appears that integers use "Number" but doubles use "double"? But sometimes integers use "int". The JSON data type is the same for all of them anyway. Couldn't find a good example of rendering an enumerated value, so I went with a simple switch statement (with a fallback to integer in case new options get added to OBS). |
|
@Rosuav Thanks, gonna review this.
I do this as well in several places of the source code so it's good as-is. |
Integers should use |
|
Perfect, that answers that question. Going with |
Palakis
left a comment
There was a problem hiding this comment.
Works perfectly and is almost good to merge. Just some minor code structure changes to make.
| obs_data_set_double(response, "fps", (double)ovi.fps_num / ovi.fps_den); | ||
|
|
||
| switch (ovi.output_format) { | ||
| #define CASE(x) case x: obs_data_set_string(response, "videoFormat", #x); break; |
|
Awesome! Thank you! |
I'm not sure that this is the best way to do it, nor if it's the best place to put this code. But it's a start.
Implements #296.