Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(828)

Unified Diff: webrtc/sdk/objc/Framework/Classes/avfoundationformatmapper.mm

Issue 2526813002: Add unit tests for avfoundation format mapper functions and fix wrong implementation. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/objc/Framework/Classes/avfoundationformatmapper.mm
diff --git a/webrtc/sdk/objc/Framework/Classes/avfoundationformatmapper.mm b/webrtc/sdk/objc/Framework/Classes/avfoundationformatmapper.mm
index 19afa337683bacbeb7b1a14e2cd539cf821b6f09..1f44fe464e354802faf90aa56997232d8ad1b5cb 100644
--- a/webrtc/sdk/objc/Framework/Classes/avfoundationformatmapper.mm
+++ b/webrtc/sdk/objc/Framework/Classes/avfoundationformatmapper.mm
@@ -22,12 +22,13 @@ static inline BOOL IsMediaSubTypeSupported(FourCharCode mediaSubType) {
}
static inline BOOL IsFrameRateWithinRange(int fps, AVFrameRateRange* range) {
- return range.minFrameRate <= fps && range.maxFrameRate >= fps;
+ return range.minFrameRate <= fps && range.maxFrameRate <= fps;
magjed_webrtc 2016/11/24 13:42:59 Is this really a fix? The previous implementation
daniela-webrtc 2016/11/25 08:58:15 Ah you are right! I got i mixed up. Basically we w
}
+namespace webrtc {
magjed_webrtc 2016/11/24 13:42:59 Why have you moved the namespace up here? Function
daniela-webrtc 2016/11/25 08:58:15 Done.
// Returns filtered array of device formats based on predefined constraints our
// stack imposes.
-static NSArray<AVCaptureDeviceFormat*>* GetEligibleDeviceFormats(
+NSArray<AVCaptureDeviceFormat*>* GetEligibleDeviceFormats(
const AVCaptureDevice* device,
int supportedFps) {
NSMutableArray<AVCaptureDeviceFormat*>* eligibleDeviceFormats =
@@ -54,7 +55,7 @@ static NSArray<AVCaptureDeviceFormat*>* GetEligibleDeviceFormats(
}
// Mapping from cricket::VideoFormat to AVCaptureDeviceFormat.
-static AVCaptureDeviceFormat* GetDeviceFormatForVideoFormat(
+AVCaptureDeviceFormat* GetDeviceFormatForVideoFormat(
const AVCaptureDevice* device,
const cricket::VideoFormat& videoFormat) {
AVCaptureDeviceFormat* desiredDeviceFormat = nil;
@@ -81,7 +82,7 @@ static AVCaptureDeviceFormat* GetDeviceFormatForVideoFormat(
return desiredDeviceFormat;
}
-namespace webrtc {
+
std::set<cricket::VideoFormat> GetSupportedVideoFormatsForDevice(
AVCaptureDevice* device) {
std::set<cricket::VideoFormat> supportedFormats;

Powered by Google App Engine
This is Rietveld 408576698