From eb37606060a706079df97cdda852204f6e5370ff Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Sat, 13 Jul 2019 14:08:08 +0200 Subject: [PATCH] Add videoFilters property to the video recording params --- .../ios/IOSStartScreenRecordingOptions.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/io/appium/java_client/ios/IOSStartScreenRecordingOptions.java b/src/main/java/io/appium/java_client/ios/IOSStartScreenRecordingOptions.java index 2835b807a..ff45f7e08 100644 --- a/src/main/java/io/appium/java_client/ios/IOSStartScreenRecordingOptions.java +++ b/src/main/java/io/appium/java_client/ios/IOSStartScreenRecordingOptions.java @@ -31,6 +31,7 @@ public class IOSStartScreenRecordingOptions private String videoType; private String videoQuality; private String videoScale; + private String videoFilters; private Integer fps; public static IOSStartScreenRecordingOptions startScreenRecordingOptions() { @@ -82,6 +83,7 @@ public IOSStartScreenRecordingOptions withFps(int fps) { /** * The scaling value to apply. Read https://trac.ffmpeg.org/wiki/Scaling for possible values. * No scale is applied by default. + * If filters are set then the scale setting is effectively ignored. * * @since Appium 1.10.0 * @param videoScale ffmpeg-compatible scale format specifier. @@ -106,6 +108,21 @@ public IOSStartScreenRecordingOptions withTimeLimit(Duration timeLimit) { return super.withTimeLimit(timeLimit); } + /** + * The FFMPEG video filters to apply. These filters allow to scale, flip, rotate and do many + * other useful transformations on the source video stream. The format of the property + * must comply with https://ffmpeg.org/ffmpeg-filters.html. + * + * @since Appium 1.15 + * @param filters One or more filters to apply to the resulting video stream, + * for example "transpose=1" to rotate the resulting video 90 degrees clockwise. + * @return self instance for chaining. + */ + public IOSStartScreenRecordingOptions withVideoFilters(String filters) { + this.videoFilters = filters; + return this; + } + @Override public Map build() { final ImmutableMap.Builder builder = ImmutableMap.builder(); @@ -113,6 +130,7 @@ public Map build() { ofNullable(videoType).map(x -> builder.put("videoType", x)); ofNullable(videoQuality).map(x -> builder.put("videoQuality", x)); ofNullable(videoScale).map(x -> builder.put("videoScale", x)); + ofNullable(videoFilters).map(x -> builder.put("videoFilters", x)); ofNullable(fps).map(x -> builder.put("videoFps", x)); return builder.build(); }