Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add videoFilters property to the video recording params #1180

Merged
merged 1 commit into from
Jul 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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.
Expand All @@ -106,13 +108,29 @@ 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<String, Object> build() {
final ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
builder.putAll(super.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();
}
Expand Down