mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1920460 - WebRTC backport: PipeWire camera: get max FPS for each format when specified as list r=pehrsons,webrtc-reviewers
In many cases, the framerate can be specified as list of possible values and in that case, we would end up with max FPS to be set to 0 as this case was not handled. This is a simple backport of an WebRTC upstream change. Upstream commit: 3aa47cfd30dc965446cf1405bb062b756a62e6d1 Differential Revision: https://phabricator.services.mozilla.com/D223112
This commit is contained in:
parent
4f3878bfa8
commit
9d035f7287
@ -17,6 +17,8 @@
|
||||
#include <spa/param/video/raw.h>
|
||||
#include <spa/pod/parser.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "common_video/libyuv/include/webrtc_libyuv.h"
|
||||
#include "modules/video_capture/device_info_impl.h"
|
||||
#include "rtc_base/logging.h"
|
||||
@ -152,9 +154,15 @@ void PipeWireNode::OnNodeParam(void* data,
|
||||
|
||||
fract = static_cast<spa_fraction*>(SPA_POD_BODY(val));
|
||||
|
||||
if (choice == SPA_CHOICE_None)
|
||||
if (choice == SPA_CHOICE_None) {
|
||||
cap.maxFPS = 1.0 * fract[0].num / fract[0].denom;
|
||||
else if (choice == SPA_CHOICE_Range && fract[1].num > 0)
|
||||
} else if (choice == SPA_CHOICE_Enum) {
|
||||
for (uint32_t i = 1; i < n_items; i++) {
|
||||
cap.maxFPS = std::max(
|
||||
static_cast<int32_t>(1.0 * fract[i].num / fract[i].denom),
|
||||
cap.maxFPS);
|
||||
}
|
||||
} else if (choice == SPA_CHOICE_Range && fract[1].num > 0)
|
||||
cap.maxFPS = 1.0 * fract[1].num / fract[1].denom;
|
||||
}
|
||||
}
|
||||
|
1
third_party/libwebrtc/moz-patch-stack/3aa47cfd30.no-op-cherry-pick-msg
vendored
Normal file
1
third_party/libwebrtc/moz-patch-stack/3aa47cfd30.no-op-cherry-pick-msg
vendored
Normal file
@ -0,0 +1 @@
|
||||
We cherry-picked this in bug 1920460.
|
Loading…
Reference in New Issue
Block a user