edgexfoundry / device-usb-camera

Owner: Device WG
Apache License 2.0
12 stars 28 forks source link

feat: select stream for api commands #266

Closed ChristianDarr-personal closed 1 year ago

ChristianDarr-personal commented 1 year ago

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

Testing Instructions

  1. Execute each command with no query parameters and see status code 200.
  2. Execute each command with the PathIndex set to the appropriate value. For standard usb cameras, this can only be 0, and for RealSense cameras this can be 0, 1, or 2. If the index is outside of that range, it will send an error.
  3. Execute each command with the StreamFormat set to the appropriate value. For standard usb cameras, this can only be "RGB", and for RealSense cameras this can be "RGB", "Greyscale" or "Depth". If the value is not supported, it will send an error.
  4. For realsense, start streaming for each index and check that the stream is working (using vlc or mplayer) and there are no errors. Also make sure that the streams are accurate, ie rgb shows rgb, etc. Make sure to stop streaming after checking the stream. Note: Some commands will return the "/dev/video" stream. Make sure that matches the stream that you supplied in the query parameter. Note: The stop streaming command does not need one of these query parameters.

New Dependency Instructions (If applicable)

codecov-commenter commented 1 year ago

Codecov Report

Merging #266 (7ded8c3) into main (bd38f51) will decrease coverage by 0.30%. The diff coverage is 0.00%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff            @@
##            main    #266      +/-   ##
========================================
- Coverage   5.12%   4.83%   -0.30%     
========================================
  Files          8       8              
  Lines       1210    1283      +73     
========================================
  Hits          62      62              
- Misses      1148    1221      +73     
Files Changed Coverage Δ
internal/driver/device.go 2.83% <0.00%> (-0.15%) :arrow_down:
internal/driver/driver.go 3.31% <0.00%> (-0.17%) :arrow_down:
internal/driver/ffmpeg.go 16.50% <0.00%> (ø)
internal/driver/metadata.go 0.00% <0.00%> (ø)
vyshali-chitikeshi commented 1 year ago

Everything looks good from validation perspective. Below are details Imported postman collection from this PR branch and ran below tests. Standard USB camera: Executed each API command in collection without any query parameters - Pass Executed each API command in collection with valid pathindex query- Pass Executed some of API commands (start streaming and some other API's randomly tested) in collection with invalid path index (negative test)- Pass Executed each API command in collection with valid stream format query- Pass Executed some of API commands (start streaming and some other API's randomly tested) in collection with invalid stream format query(negative test)- Pass Real sense camera: Standard USB camera:

  1. Executed each API command in collection without any query parameters - Pass
  2. Executed each API command in collection with valid path index query(0,1,2)- Pass
  3. Executed some of API commands (start streaming and some other API's randomly tested) in collection with invalid path index (negative test)- Pass
  4. Executed each API command in collection with valid stream format query("RGB", Greyscale","Depth")- Pass
  5. Executed some of API commands (start streaming and some other API's randomly tested) in collection with invalid stream format query(negative test)- Pass
  6. Checking its executing stream matches with input query parameters given- Pass
vyshali-chitikeshi commented 1 year ago

Validation looks good with latest code