Closed Bug 1406935 Opened 7 years ago Closed 7 years ago

Write unittest for configuring VideoConduit

Categories

(Core :: WebRTC: Audio/Video, enhancement, P3)

58 Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox58 --- wontfix
firefox59 --- fixed

People

(Reporter: pehrsons, Assigned: dminor)

References

(Blocks 1 open bug)

Details

Attachments

(6 files)

Configure VideoConduit similar to how our signaling layer does it, and see that we call into a mocked encoder stack with the right values. Repeat for different signaling properties, like b=TIAS, max-fs, max-fr. See VideoCodecConfig.
Rank: 28
See Also: → 1404992
Assignee: nobody → dminor
Status: NEW → ASSIGNED
Comment on attachment 8930618 [details] Bug 1406935 - Add unittests for ConfigureSendMediaCodec; https://reviewboard.mozilla.org/r/201738/#review207032 C/C++ static analysis found 2 defects in this patch. You can run this analysis locally with: `./mach static-analysis check path/to/file.cpp` ::: media/webrtc/signaling/gtest/videoconduit_unittests.cpp:69 (Diff revision 1) > + UniquePtr<cricket::VideoAdapter>(mAdapter)); > + std::vector<unsigned int> ssrcs = {42}; > + mVideoConduit->SetLocalSSRCs(ssrcs); > + } > + > + ~VideoConduitTest() Warning: Annotate this function with 'override' or (rarely) 'final' [clang-tidy: modernize-use-override] ~VideoConduitTest() ^ override ::: media/webrtc/signaling/gtest/videoconduit_unittests.cpp:69 (Diff revision 1) > + UniquePtr<cricket::VideoAdapter>(mAdapter)); > + std::vector<unsigned int> ssrcs = {42}; > + mVideoConduit->SetLocalSSRCs(ssrcs); > + } > + > + ~VideoConduitTest() Warning: Use '= default' to define a trivial destructor [clang-tidy: modernize-use-equals-default]
Comment on attachment 8930617 [details] Bug 1406935 - Add mocks for AudioStreams, VideoStreams and Call; https://reviewboard.mozilla.org/r/201736/#review207312 ::: media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h:81 (Diff revision 1) > mCall.reset(webrtc::Call::Create(config)); > } > + > + explicit WebRtcCallWrapper(webrtc::Call* aCall) > + { > + mCall.reset(aCall); Assert that aCall is non-null here. And let this and `Create(Call)` take a `UniquePtr<Call>&&` instead, since it transfers ownership?
Attachment #8930617 - Flags: review?(apehrson) → review+
Comment on attachment 8930618 [details] Bug 1406935 - Add unittests for ConfigureSendMediaCodec; https://reviewboard.mozilla.org/r/201738/#review207314 Great! ::: media/webrtc/signaling/gtest/videoconduit_unittests.cpp:83 (Diff revision 1) > + unsigned int cbcrplane_length = (width*height + 1)/2; > + unsigned int video_length = yplane_length + cbcrplane_length; > + uint8_t* buffer = new uint8_t[video_length]; > + memset(buffer, 0x10, yplane_length); > + memset(buffer + yplane_length, 0x80, cbcrplane_length); > + return conduit->SendVideoFrame(buffer, video_length, width, height, Should this call into mVideoConduit instead? Or make it a static function. ::: media/webrtc/signaling/src/media-conduit/VideoConduit.cpp:833 (Diff revision 1) > + } else { > + // Reset to defaults > + mSendStreamConfig.rtp.ulpfec.ulpfec_payload_type = -1; > + mSendStreamConfig.rtp.ulpfec.red_payload_type = -1; > + mSendStreamConfig.rtp.ulpfec.red_rtx_payload_type = -1; Are these fixes you found thanks to the tests? If so (great!) could you put them in their own patch? :-)
Attachment #8930618 - Flags: review?(apehrson) → review+
Comment on attachment 8930619 [details] Bug 1406935 - Add unittests for ConfigureRecvMediaCodecs; https://reviewboard.mozilla.org/r/201740/#review207324 ::: media/webrtc/signaling/gtest/videoconduit_unittests.cpp:199 (Diff revision 1) > + codecs.push_back(&codecConfig); > + codecs.push_back(&codecConfig); Why two?
Attachment #8930619 - Flags: review?(apehrson) → review+
Comment on attachment 8931018 [details] Bug 1406935 - Reset FEC payload types in ConfigureSendMediaCodec; https://reviewboard.mozilla.org/r/202112/#review207570 Looks good to me.
Attachment #8931018 - Flags: review?(mfroman) → review+
Comment on attachment 8931019 [details] Bug 1406935 - Initialize mRembFbSet in VideoCodecConfig ctor; https://reviewboard.mozilla.org/r/202114/#review207572 Looks good to me.
Attachment #8931019 - Flags: review?(mfroman) → review+
Comment on attachment 8931017 [details] Bug 1406935 - Ensure maximum bitrate is at least minimum bitrate in VideoConduit; https://reviewboard.mozilla.org/r/202110/#review207784
Attachment #8931017 - Flags: review?(apehrson) → review+
Pushed by dminor@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/74ecfa0dab0b Add mocks for AudioStreams, VideoStreams and Call; r=pehrsons https://hg.mozilla.org/integration/autoland/rev/b1e08eeccbc8 Ensure maximum bitrate is at least minimum bitrate in VideoConduit; r=pehrsons https://hg.mozilla.org/integration/autoland/rev/34cf807c35e4 Reset FEC payload types in ConfigureSendMediaCodec; r=mjf https://hg.mozilla.org/integration/autoland/rev/854d24a58633 Add unittests for ConfigureSendMediaCodec; r=pehrsons https://hg.mozilla.org/integration/autoland/rev/6838edf96b1c Initialize mRembFbSet in VideoCodecConfig ctor; r=mjf https://hg.mozilla.org/integration/autoland/rev/a6631a517973 Add unittests for ConfigureRecvMediaCodecs; r=pehrsons
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: