agsh / onvif

ONVIF node.js implementation
https://onvif.pages.dev
MIT License
703 stars 240 forks source link

Add Encoder support #11

Closed chriswiggins closed 9 years ago

chriswiggins commented 9 years ago

This is a first run at adding encoder support.

If the library gets a result with multiple video sources, it sets the first as default, and then stores the others in this.videoSources and the profiles in this.defaultProfiles

Tests so far on a Vivotek encoder we have shows that it works. Running the test suite causes everything else to work as expected with a single video source

agsh commented 9 years ago

Wow! Thanks a lot! I'll check all other code in a few days to test and merge it. Could you provide some tests for encoder support, cause I've got no one real device?

chriswiggins commented 9 years ago

Absolutely @agsh - I will get these to you tomorrow or the next day and add them to a test routine. Are you happy with the approach of how the code works?

agsh commented 9 years ago

Sure! Everything is well, including code style, appreciate you for that. But your change affects a lot. I've never ever thought about different videosources.

chriswiggins commented 9 years ago

It only adds two variables though right. This doesn't affect how the library runs at all however if you want to pass a specific encoder port to getMediaUri (for example) then you can just pass in the token from the relevant this.videoSources profile.

Happy to change this all around and do it differently if you like! :-)

chriswiggins commented 9 years ago

@agsh I've added the test as asked. Where I'm using this extra addition is to just loop through each of the videoSource tokens and then calling getMediaUri on each one. This then allows me to get the RTSP URI of each port on the encoder and works really well.