Skip to content

[skottie] Handle non-seekable streams - #2126

Merged
mattleibow merged 1 commit into
mainfrom
dev/skottie-nonseekable
Jun 26, 2022
Merged

[skottie] Handle non-seekable streams#2126
mattleibow merged 1 commit into
mainfrom
dev/skottie-nonseekable

Conversation

@mattleibow

@mattleibow mattleibow commented Jun 25, 2022

Copy link
Copy Markdown
Contributor

Description of Change

On Android, the streams for the Assets are not seekable - and the same with streams from the internet. So in order to actually read those, we first need to read the whole thing into a memory buffer.

This is not as expensive as it may sound as this is what happens internally. In C++, the full stream is read into a SKData instance, so pre-doing it in C# is the same thing. In fact, doing it via a data instance in C# opens up the potential to reduce the number of times we hop the interop boundary.

Bugs Fixed

None.

API Changes

class Animation {
  public static Animation? Create (SKData data);
  public static bool TryCreate (SKData data, out Animation? animation);
}

Behavioral Changes
Non-seekable streams can now be used to create animations.

Required skia PR

None.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Merged related skia PRs
  • Changes adhere to coding standard
  • Updated documentation

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.

1 participant