Skip to content

Commit

Permalink
Bug 1304597 - Remove hardcoded capabilities on OSX that are no longer…
Browse files Browse the repository at this point in the history
… used r=jesup

MozReview-Commit-ID: 4vENDI1Q9U1

UltraBlame original commit: 29c1b972c04d1b88be2c68547ab71cb78a371cc5
  • Loading branch information
marco-c committed Sep 30, 2019
1 parent a3ef512 commit 620be3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 40 deletions.
2 changes: 1 addition & 1 deletion dom/media/webrtc/MediaEngineCameraVideoSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ MediaEngineCameraVideoSource::GetCapability(size_t aIndex,
webrtc::CaptureCapability& aOut) const
{
MOZ_ASSERT(aIndex < mHardcodedCapabilities.Length());
aOut = mHardcodedCapabilities[aIndex];
aOut = mHardcodedCapabilities.SafeElementAt(aIndex, webrtc::CaptureCapability());
}

uint32_t
Expand Down
44 changes: 5 additions & 39 deletions dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,53 +420,19 @@ MediaEngineRemoteVideoSource::DeliverFrame(unsigned char* buffer,
size_t
MediaEngineRemoteVideoSource::NumCapabilities() const
{
mHardcodedCapabilities.Clear();
int num = mozilla::camera::GetChildAndCall(
&mozilla::camera::CamerasChild::NumberOfCapabilities,
mCapEngine,
GetUUID().get());
if (num > 0) {
return num;
}

switch(mMediaSource) {
case dom::MediaSourceEnum::Camera:
#ifdef XP_MACOSX

if (num < 1) {





if (mHardcodedCapabilities.IsEmpty()) {
for (int i = 0; i < 9; i++) {
webrtc::CaptureCapability c;
c.width = 1920 - i*128;
c.height = 1080 - i*72;
c.maxFPS = 30;
mHardcodedCapabilities.AppendElement(c);
}
for (int i = 0; i < 16; i++) {
webrtc::CaptureCapability c;
c.width = 640 - i*40;
c.height = 480 - i*30;
c.maxFPS = 30;
mHardcodedCapabilities.AppendElement(c);
}
}
break;
#endif
default:
webrtc::CaptureCapability c;


c.width = 0;
c.height = 0;
c.maxFPS = 0;
mHardcodedCapabilities.AppendElement(c);
break;
mHardcodedCapabilities.AppendElement(webrtc::CaptureCapability());
num = mHardcodedCapabilities.Length();
}

return mHardcodedCapabilities.Length();
return num;
}

bool
Expand Down

0 comments on commit 620be3f

Please sign in to comment.