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 constructors #50

Merged
merged 3 commits into from Oct 13, 2019
Merged

Add constructors #50

merged 3 commits into from Oct 13, 2019

Conversation

MasayukiSuda
Copy link
Owner

add constructors

    public Mp4Composer(@NonNull final String srcPath, @NonNull final String destPath) {
        this.srcDataSource = new FilePathDataSource(srcPath, logger, errorDataSource);
        this.destPath = destPath;
    }

    public Mp4Composer(@NonNull final FileDescriptor srcFileDescriptor, @NonNull final String destPath) {
        this.srcDataSource = new FileDescriptorDataSource(srcFileDescriptor);
        this.destPath = destPath;
    }

    public Mp4Composer(@NonNull final Uri srcUri, @NonNull final String destPath, @NonNull final Context context) {
        this.srcDataSource = new UriDataSource(srcUri, context, logger, errorDataSource);
        this.destPath = destPath;
    }

    @TargetApi(Build.VERSION_CODES.O)
    public Mp4Composer(@NonNull final FileDescriptor srcFileDescriptor, @NonNull final FileDescriptor destFileDescriptor) {
        if (Build.VERSION.SDK_INT < 26) {
            throw new IllegalArgumentException("destFileDescriptor can not use");
        }
        this.srcDataSource = new FileDescriptorDataSource(srcFileDescriptor);
        this.destPath = null;
        this.destFileDescriptor = destFileDescriptor;
    }

    @TargetApi(Build.VERSION_CODES.O)
    public Mp4Composer(@NonNull final Uri srcUri, @NonNull final FileDescriptor destFileDescriptor, @NonNull final Context context) {
        if (Build.VERSION.SDK_INT < 26) {
            throw new IllegalArgumentException("destFileDescriptor can not use");
        }
        this.srcDataSource = new UriDataSource(srcUri, context, logger, errorDataSource);
        this.destPath = null;
        this.destFileDescriptor = destFileDescriptor;
    }

related issues

#48

@MasayukiSuda MasayukiSuda merged commit 6371458 into master Oct 13, 2019
@MasayukiSuda MasayukiSuda deleted the add_constructors branch October 13, 2019 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant