webRTC: Pass 'maxaveragebitrate' and 'usedtx' from fmtp line to Opus encoder.
Categories
(Core :: WebRTC: Signaling, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: thomas, Assigned: drno)
References
(Blocks 1 open bug)
Details
Attachments
(10 files)
11.71 KB,
patch
|
drno
:
review-
|
Details | Diff | Splinter Review |
4.73 KB,
patch
|
Details | Diff | Splinter Review | |
1.56 KB,
patch
|
Details | Diff | Splinter Review | |
1.03 KB,
patch
|
Details | Diff | Splinter Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Reporter | ||
Comment 2•7 years ago
|
||
Reporter | ||
Comment 3•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Assignee | ||
Comment 4•7 years ago
|
||
Reporter | ||
Comment 5•7 years ago
|
||
Comment 7•7 years ago
|
||
Comment 8•7 years ago
|
||
Comment 10•7 years ago
|
||
Assignee | ||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
Assignee | ||
Comment 13•7 years ago
|
||
Comment 14•7 years ago
|
||
Assignee | ||
Comment 15•7 years ago
|
||
Comment 16•7 years ago
|
||
Comment 17•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Assignee | ||
Updated•7 years ago
|
Assignee | ||
Comment 18•7 years ago
|
||
Comment 19•7 years ago
|
||
Comment 20•7 years ago
|
||
Comment 21•7 years ago
|
||
Comment 22•7 years ago
|
||
Assignee | ||
Comment 23•7 years ago
|
||
Comment 24•7 years ago
|
||
Assignee | ||
Comment 25•7 years ago
|
||
Comment 26•7 years ago
|
||
Comment 27•7 years ago
|
||
Reporter | ||
Comment 28•7 years ago
|
||
Comment 29•6 years ago
|
||
Comment 30•6 years ago
|
||
Comment 31•5 years ago
•
|
||
(In reply to bpantazhs from comment #26)
Thanks Nils! Here are some questions so I am sure I follow you before I
commit anything:In sdp_unittests.cpp you added two new asserts. I think we should have
another test where we assert that the parser in fact correctly parses
'usedtx=1' and some random number for maxaveragebitrate. We should have in
the end two places where we do these checks: one where we verify that these
values are in fact zero (that exists already in your patchset) and another
place where we check for non-null values.So the assert comparisons to 0 remain and there needs to be added something
like:ASSERT_EQ(48000U, opus_parameters->maxaveragebitrate);
ASSERT_EQ(1U, opus_parameters->useDTX);It is not clear to me where to place these as only in TEST_P(NewSdpTest,
CheckFormatParameters)
it seems to check for the parameters' values, could you shed some light on
this please?
You could modify the SDP that |CheckFormatParameters| uses, by adding maxaveragebitrate and usedtx. Then you can check that the expected values are parsed. Or, you could write a standalone test similar to one of the other test-cases that looks at fmtp (eg; CheckTelephoneEventWithDefaultEvents).
And then we need a test to verify that we in fact will answer with usedtx=1
if it was offered. The best place to do that would be in
jsep_session_unittest.cpp. If you take a look at the test where you added
two new asserts it create the offer here
https://searchfox.org/mozilla-central/rev/
38bddf549db0f26d4d7575cf695958ff703a3ed7/media/webrtc/signaling/gtest/
jsep_session_unittest.cpp#3357 I would create a new test which does exactly
the same thing up to and include the CreateOffer() call. Then I would search
and replace in that resulting string 'usedtx=0' with 'usedtx=1'. For example
something like here
https://searchfox.org/mozilla-central/rev/
38bddf549db0f26d4d7575cf695958ff703a3ed7/media/webrtc/signaling/gtest/
jsep_session_unittest.cpp#3437 you also then need to SetLocalOffer() and
SetRemoteOffer() with your modified offer. Then call CreateAnswer() and
assert that the answer contains 'usedtx=1'.I think I follow this but I am not entirely sure so as to commit a patch. If
I understand correctly you would like to see a new test that looks something
like this:TEST_F(JsepSessionTest, ValidateOfferedDTXParameter)
{
types.push_back(SdpMediaSection::kAudio);
types.push_back(SdpMediaSection::kVideo);RefPtr<JsepTransceiver> audio(new
JsepTransceiver(SdpMediaSection::kAudio));
audio->mSendTrack.UpdateTrackIds(std::vector<std::string>(1,
"offerer_stream"), "a1");
mSessionOff->AddTransceiver(audio);RefPtr<JsepTransceiver> video(new
JsepTransceiver(SdpMediaSection::kVideo));
video->mSendTrack.UpdateTrackIds(std::vector<std::string>(1,
"offerer_stream"), "v1");
mSessionOff->AddTransceiver(video);std::string offer = CreateOffer();
size_t start = offer.find("usedtx=0");
size_t end = offer.find("\r\n", start);
offer.replace(start, end+2-start, "usedtx=1");SetLocalOffer(offer);
SetRemoteOffer(offer);ASSERT_NE(std::string::npos,answer.find("usedtx=1"));
}Thanks for all your help!
Sort of, but it could be simpler. See this as an example, since you are only doing audio: https://searchfox.org/mozilla-central/rev/38bddf549db0f26d4d7575cf695958ff703a3ed7/media/webrtc/signaling/gtest/jsep_session_unittest.cpp#4960 Also, you would rewrite the offer only for the remote side, between the SetLocalOffer and SetRemoteOffer calls. Lastly, you will need to create an answer.
Updated•5 years ago
|
Comment 32•5 years ago
|
||
(In reply to Byron Campen [:bwc] from comment #31)
You could modify the SDP that |CheckFormatParameters| uses, by adding maxaveragebitrate and usedtx. Then you can check that the expected values are parsed. Or, you could write a standalone test similar to one of the other test-cases that looks at fmtp (eg; CheckTelephoneEventWithDefaultEvents).
I'd like to simply add what's necessary to CheckFormatParameters however since I have already added a check it's not clear to me what more is necessary. Could you provide me with an example please?
Sort of, but it could be simpler. See this as an example, since you are only doing audio: https://searchfox.org/mozilla-central/rev/38bddf549db0f26d4d7575cf695958ff703a3ed7/media/webrtc/signaling/gtest/jsep_session_unittest.cpp#4960 Also, you would rewrite the offer only for the remote side, between the SetLocalOffer and SetRemoteOffer calls. Lastly, you will need to create an answer.
So you are suggesting something like this:
TEST_F(JsepSessionTest, ValidateOfferedDTXParameter)
{
types.push_back(SdpMediaSection::kAudio);
AddTracks(*mSessionOff, "audio");
AddTracks(*mSessionAns, "audio");
std::string offer = CreateOffer();
SetLocalOffer(offer);
size_t start = offer.find("usedtx=0");
size_t end = offer.find("\r\n", start);
offer.replace(start, end+2-start, "usedtx=1");
SetRemoteOffer(offer);
std::string answer = CreateAnswer();
ASSERT_EQ(std::string::npos, answer.find("usedtx=1")); // is this what we need from the answer?
}
Also I have a question about patching. I no longer possess the Firefox code that was used to create the above patches. I do have the changed webrtc files though. What would be the simplest way to recreate this code base in order to be able to submit an additional patch (when that is completed)?
Thank you for your help!
Comment 33•5 years ago
|
||
(In reply to bpantazhs from comment #32)
(In reply to Byron Campen [:bwc] from comment #31)
You could modify the SDP that |CheckFormatParameters| uses, by adding maxaveragebitrate and usedtx. Then you can check that the expected values are parsed. Or, you could write a standalone test similar to one of the other test-cases that looks at fmtp (eg; CheckTelephoneEventWithDefaultEvents).
I'd like to simply add what's necessary to CheckFormatParameters however since I have already added a check it's not clear to me what more is necessary. Could you provide me with an example please?
So you already know how to check the values of these new parameters, all that remains is to add them to kH264AudioVideoOffer, and then check that you can get the right values in CheckFormatParameters.
Sort of, but it could be simpler. See this as an example, since you are only doing audio: https://searchfox.org/mozilla-central/rev/38bddf549db0f26d4d7575cf695958ff703a3ed7/media/webrtc/signaling/gtest/jsep_session_unittest.cpp#4960 Also, you would rewrite the offer only for the remote side, between the SetLocalOffer and SetRemoteOffer calls. Lastly, you will need to create an answer.
So you are suggesting something like this:
TEST_F(JsepSessionTest, ValidateOfferedDTXParameter)
{
types.push_back(SdpMediaSection::kAudio);
AddTracks(*mSessionOff, "audio");
AddTracks(*mSessionAns, "audio");
std::string offer = CreateOffer();
SetLocalOffer(offer);
size_t start = offer.find("usedtx=0");
size_t end = offer.find("\r\n", start);
offer.replace(start, end+2-start, "usedtx=1");
SetRemoteOffer(offer);
std::string answer = CreateAnswer();
ASSERT_EQ(std::string::npos, answer.find("usedtx=1")); // is this what we need from the answer?
}
Yes, this is closer to what you want.
Also I have a question about patching. I no longer possess the Firefox code that was used to create the above patches. I do have the changed webrtc files though. What would be the simplest way to recreate this code base in order to be able to submit an additional patch (when that is completed)?
You should clone mozilla-central, apply the patches you have so far on this bug, fix up any conflicts, and work from there.
Comment 34•5 years ago
|
||
(In reply to Byron Campen [:bwc] from comment #33)
(In reply to bpantazhs from comment #32)
(In reply to Byron Campen [:bwc] from comment #31)
You could modify the SDP that |CheckFormatParameters| uses, by adding maxaveragebitrate and usedtx. Then you can check that the expected values are parsed. Or, you could write a standalone test similar to one of the other test-cases that looks at fmtp (eg; CheckTelephoneEventWithDefaultEvents).
I'd like to simply add what's necessary to CheckFormatParameters however since I have already added a check it's not clear to me what more is necessary. Could you provide me with an example please?
So you already know how to check the values of these new parameters, all that remains is to add them to kH264AudioVideoOffer, and then check that you can get the right values in CheckFormatParameters.
Thanks, I think I got the picture, so I need to add those to "a=fmtp:109 maxplaybackrate=32000;stereo=1;useinbandfec=1" . But should I use the value 1 for usedtx and a random value, say 48000 for the maxaveragebitrate (as it has been proposed)? If so what happens to the 0 value case?
Sort of, but it could be simpler. See this as an example, since you are only doing audio: https://searchfox.org/mozilla-central/rev/38bddf549db0f26d4d7575cf695958ff703a3ed7/media/webrtc/signaling/gtest/jsep_session_unittest.cpp#4960 Also, you would rewrite the offer only for the remote side, between the SetLocalOffer and SetRemoteOffer calls. Lastly, you will need to create an answer.
So you are suggesting something like this:
TEST_F(JsepSessionTest, ValidateOfferedDTXParameter)
{
types.push_back(SdpMediaSection::kAudio);
AddTracks(*mSessionOff, "audio");
AddTracks(*mSessionAns, "audio");
std::string offer = CreateOffer();
SetLocalOffer(offer);
size_t start = offer.find("usedtx=0");
size_t end = offer.find("\r\n", start);
offer.replace(start, end+2-start, "usedtx=1");
SetRemoteOffer(offer);
std::string answer = CreateAnswer();
ASSERT_EQ(std::string::npos, answer.find("usedtx=1")); // is this what we need from the answer?
}Yes, this is closer to what you want.
Thanks, do you think that this is ready for a patch as it is?
Comment 35•5 years ago
|
||
You'll need to go ahead and update the patches before we can move forward on this.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 36•5 years ago
|
||
Reporter | ||
Comment 37•5 years ago
|
||
Thanks for picking this up again, Nils!
Updated•5 years ago
|
Assignee | ||
Comment 38•5 years ago
|
||
Assignee | ||
Comment 39•5 years ago
|
||
Depends on D71137
Assignee | ||
Comment 40•5 years ago
|
||
Depends on D74492
Assignee | ||
Comment 41•5 years ago
|
||
Depends on D74493
Assignee | ||
Comment 42•5 years ago
|
||
Depends on D74494
Assignee | ||
Comment 43•5 years ago
|
||
Comment 44•5 years ago
|
||
Comment 45•5 years ago
|
||
Comment 46•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9aa0f6298bb3
https://hg.mozilla.org/mozilla-central/rev/8a5be6ac90cb
https://hg.mozilla.org/mozilla-central/rev/e9333131b5cf
https://hg.mozilla.org/mozilla-central/rev/611c3702ed04
https://hg.mozilla.org/mozilla-central/rev/9cd106121925
https://hg.mozilla.org/mozilla-central/rev/d02c2bbda7e1
Description
•