Closed
Bug 1004396
Opened 11 years ago
Closed 11 years ago
Make peerconnection video bitrates configurable
Categories
(Core :: WebRTC, defect)
Core
WebRTC
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: jesup, Assigned: jesup)
References
Details
Attachments
(1 file, 1 obsolete file)
7.88 KB,
patch
|
ekr
:
review+
|
Details | Diff | Splinter Review |
Default bitrates should always have been configurable...
Assignee | ||
Comment 1•11 years ago
|
||
Assignee | ||
Comment 2•11 years ago
|
||
Comment on attachment 8418896 [details] [diff] [review]
Make video codec default bitrates configurable for WebRTC
Also removes some tabs that got added, and a few mis-indents
Attachment #8418896 -
Flags: review?(ekr)
Comment 3•11 years ago
|
||
Comment on attachment 8418896 [details] [diff] [review]
Make video codec default bitrates configurable for WebRTC
Review of attachment 8418896 [details] [diff] [review]:
-----------------------------------------------------------------
::: media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ +203,5 @@
> CSFLogDebug(logTag, "%s this=%p other=%p", __FUNCTION__, this, other);
>
> +#ifdef MOZILLA_INTERNAL_API
> + // already know we must be on MainThread barring unit test weirdness
> + if (NS_IsMainThread()) {
If that's true, why isn't this an assert? the unit tests do not define MOZILLA_INTERNAL_API
@@ +206,5 @@
> + // already know we must be on MainThread barring unit test weirdness
> + if (NS_IsMainThread()) {
> + nsresult rv;
> + nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
> + if (NS_SUCCEEDED(rv))
Can this fail? It should also be an assert.
@@ +215,5 @@
> + {
> + branch->GetBoolPref("media.video.test_latency", &mVideoLatencyTestEnable);
> + branch->GetIntPref("media.peerconnection.video.min_bitrate", &mMinBitrate);
> + branch->GetIntPref("media.peerconnection.video.start_bitrate", &mStartBitrate);
> + branch->GetIntPref("media.peerconnection.video.max_bitrate", &mMaxBitrate);
These all seem like they can fail, so there should be error checks, right?
Attachment #8418896 -
Flags: review?(ekr) → review-
Comment 4•11 years ago
|
||
Comment on attachment 8418896 [details] [diff] [review]
Make video codec default bitrates configurable for WebRTC
Review of attachment 8418896 [details] [diff] [review]:
-----------------------------------------------------------------
::: media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ +215,5 @@
> + {
> + branch->GetBoolPref("media.video.test_latency", &mVideoLatencyTestEnable);
> + branch->GetIntPref("media.peerconnection.video.min_bitrate", &mMinBitrate);
> + branch->GetIntPref("media.peerconnection.video.start_bitrate", &mStartBitrate);
> + branch->GetIntPref("media.peerconnection.video.max_bitrate", &mMaxBitrate);
If the argument here is that they remain unchanged, then maybe just an assert so we catch failure to store them?
Assignee | ||
Comment 5•11 years ago
|
||
(In reply to Eric Rescorla (:ekr) from comment #4)
> Comment on attachment 8418896 [details] [diff] [review]
> Make video codec default bitrates configurable for WebRTC
>
> Review of attachment 8418896 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
> @@ +215,5 @@
> > + {
> > + branch->GetBoolPref("media.video.test_latency", &mVideoLatencyTestEnable);
> > + branch->GetIntPref("media.peerconnection.video.min_bitrate", &mMinBitrate);
> > + branch->GetIntPref("media.peerconnection.video.start_bitrate", &mStartBitrate);
> > + branch->GetIntPref("media.peerconnection.video.max_bitrate", &mMaxBitrate);
>
> If the argument here is that they remain unchanged, then maybe just an
> assert so we catch failure to store them?
We can; it doesn't actually buy us anything. Since those keep the (safe) defaults if that were to somehow fail, I don't see much being gained by doing so. Generally with prefs if there are safe defaults we ignore the result of GetXxxxPref().
> > +#ifdef MOZILLA_INTERNAL_API
> > + // already know we must be on MainThread barring unit test weirdness
> > + if (NS_IsMainThread()) {
>
> If that's true, why isn't this an assert? the unit tests do not define MOZILLA_INTERNAL_API
I moved the code and added more prefs; it was that way before. Likely cruft due to the unit tests not running on MainThread.... perhaps with ehugg's work we can relax that (or do so soon). I'll swap it to an #ifdef'd assert.
> > + nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
> > + if (NS_SUCCEEDED(rv))
>
> Can this fail? It should also be an assert.
Everyplace else I looked does something like NS_ENSURE_SUCCESS (and a few places don't check). None I saw asserted on it. I can do NS_WARN_IF if you like.
Comment 6•11 years ago
|
||
(In reply to Randell Jesup [:jesup] from comment #5)
> (In reply to Eric Rescorla (:ekr) from comment #4)
> > Comment on attachment 8418896 [details] [diff] [review]
> > Make video codec default bitrates configurable for WebRTC
> >
> > Review of attachment 8418896 [details] [diff] [review]:
> > -----------------------------------------------------------------
> >
> > ::: media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
> > @@ +215,5 @@
> > > + {
> > > + branch->GetBoolPref("media.video.test_latency", &mVideoLatencyTestEnable);
> > > + branch->GetIntPref("media.peerconnection.video.min_bitrate", &mMinBitrate);
> > > + branch->GetIntPref("media.peerconnection.video.start_bitrate", &mStartBitrate);
> > > + branch->GetIntPref("media.peerconnection.video.max_bitrate", &mMaxBitrate);
> >
> > If the argument here is that they remain unchanged, then maybe just an
> > assert so we catch failure to store them?
>
> We can; it doesn't actually buy us anything. Since those keep the (safe)
> defaults if that were to somehow fail, I don't see much being gained by
> doing so. Generally with prefs if there are safe defaults we ignore the
> result of GetXxxxPref().
My thinking here is that this would detect these being accidentally removed
from all.js. Right now, they are duplicated.
> > > +#ifdef MOZILLA_INTERNAL_API
> > > + // already know we must be on MainThread barring unit test weirdness
> > > + if (NS_IsMainThread()) {
> >
> > If that's true, why isn't this an assert? the unit tests do not define MOZILLA_INTERNAL_API
>
> I moved the code and added more prefs; it was that way before. Likely cruft
> due to the unit tests not running on MainThread.... perhaps with ehugg's
> work we can relax that (or do so soon). I'll swap it to an #ifdef'd assert.
SGTM.
> > > + nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
> > > + if (NS_SUCCEEDED(rv))
> >
> > Can this fail? It should also be an assert.
>
> Everyplace else I looked does something like NS_ENSURE_SUCCESS (and a few
> places don't check). None I saw asserted on it. I can do NS_WARN_IF if you
> like.
OK.
Assignee | ||
Comment 7•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Attachment #8418896 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #8420474 -
Flags: review?(ekr)
Comment 8•11 years ago
|
||
Comment on attachment 8420474 [details] [diff] [review]
Make video codec default bitrates configurable for WebRTC
Review of attachment 8420474 [details] [diff] [review]:
-----------------------------------------------------------------
r+ once signed/unsigned agreement fixed.
::: media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ +195,5 @@
> return result;
> }
>
> /**
> + * Peforms initialization of the MANDATORY components of the Video Engine
Fix typo. "Performs"
@@ +1138,5 @@
> cinst.maxFramerate = codecInfo->mMaxFrameRate;
> }
> + cinst.minBitrate = mMinBitrate;
> + cinst.startBitrate = mStartBitrate;
> + cinst.maxBitrate = mMaxBitrate;
These are unsigned in VideoCodec, but the members are signed.
unsigned int startBitrate; // kilobits/sec.
unsigned int maxBitrate; // kilobits/sec.
unsigned int minBitrate; // kilobits/sec.
It appears that GetIntPref() takes an int32_t, so probably
best to make the members unsigned int and then range check
the values returned from GetIntPref.
Attachment #8420474 -
Flags: review?(ekr) → review+
Assignee | ||
Comment 9•11 years ago
|
||
Target Milestone: --- → mozilla32
Comment 10•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•