Skip to content

Audio patch#20942

Merged
alalek merged 3 commits intoopencv:masterfrom
MaximMilashchenko:AudioPatch
Oct 26, 2021
Merged

Audio patch#20942
alalek merged 3 commits intoopencv:masterfrom
MaximMilashchenko:AudioPatch

Conversation

@MaximMilashchenko
Copy link
Copy Markdown
Contributor

  • Fixed microphone
  • Fixed audio position
  • Changed behavior when an audio stream is incorrectly installed (open returns false)
  • Added a test case for checking file opening

@alalek


class CheckIsOpen : public IsOpenTestFixture{};

TEST_P(CheckIsOpen, audio)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TEST_P(CheckIsOpen, audio)

TEST_P(AudioOpenCheck, bad_arg)

TEST_P(CheckIsOpen, audio)
{
if (!videoio_registry::hasBackend(cv::VideoCaptureAPIs(backend)))
throw SkipTestException(cv::videoio_registry::getBackendName(backend) + " backend was not found");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open() should fail anyway, so backend check is not necessary.

if (!videoio_registry::hasBackend(cv::VideoCaptureAPIs(backend)))
throw SkipTestException(cv::videoio_registry::getBackendName(backend) + " backend was not found");

doTest();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really don't need to parametrize these tests on such detailed level (or parametrize backend only).
Test code is small with one check and parameters just increase complexity.

Also test names would become more descriptive: bad_arg_invalid_audio_stream

@alalek alalek merged commit 0a71063 into opencv:master Oct 26, 2021
@MaximMilashchenko MaximMilashchenko deleted the AudioPatch branch November 28, 2021 20:58
@alalek alalek mentioned this pull request Dec 30, 2021
@alalek alalek mentioned this pull request Feb 22, 2022
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
Audio patch

* fixed microphone, audio position

* fixed docs

* changed AudioOpenCheck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants