Skip to content

Commit 891636a

Browse files
mykola-mokhnachSrinivasanTarget
authored andcommitted
Add videoFilters property to the video recording params (#1180)
1 parent 20fc505 commit 891636a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/main/java/io/appium/java_client/ios/IOSStartScreenRecordingOptions.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class IOSStartScreenRecordingOptions
3131
private String videoType;
3232
private String videoQuality;
3333
private String videoScale;
34+
private String videoFilters;
3435
private Integer fps;
3536

3637
public static IOSStartScreenRecordingOptions startScreenRecordingOptions() {
@@ -82,6 +83,7 @@ public IOSStartScreenRecordingOptions withFps(int fps) {
8283
/**
8384
* The scaling value to apply. Read https://trac.ffmpeg.org/wiki/Scaling for possible values.
8485
* No scale is applied by default.
86+
* If filters are set then the scale setting is effectively ignored.
8587
*
8688
* @since Appium 1.10.0
8789
* @param videoScale ffmpeg-compatible scale format specifier.
@@ -106,13 +108,29 @@ public IOSStartScreenRecordingOptions withTimeLimit(Duration timeLimit) {
106108
return super.withTimeLimit(timeLimit);
107109
}
108110

111+
/**
112+
* The FFMPEG video filters to apply. These filters allow to scale, flip, rotate and do many
113+
* other useful transformations on the source video stream. The format of the property
114+
* must comply with https://ffmpeg.org/ffmpeg-filters.html.
115+
*
116+
* @since Appium 1.15
117+
* @param filters One or more filters to apply to the resulting video stream,
118+
* for example "transpose=1" to rotate the resulting video 90 degrees clockwise.
119+
* @return self instance for chaining.
120+
*/
121+
public IOSStartScreenRecordingOptions withVideoFilters(String filters) {
122+
this.videoFilters = filters;
123+
return this;
124+
}
125+
109126
@Override
110127
public Map<String, Object> build() {
111128
final ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
112129
builder.putAll(super.build());
113130
ofNullable(videoType).map(x -> builder.put("videoType", x));
114131
ofNullable(videoQuality).map(x -> builder.put("videoQuality", x));
115132
ofNullable(videoScale).map(x -> builder.put("videoScale", x));
133+
ofNullable(videoFilters).map(x -> builder.put("videoFilters", x));
116134
ofNullable(fps).map(x -> builder.put("videoFps", x));
117135
return builder.build();
118136
}

0 commit comments

Comments
 (0)