SkHeifCodec & HeifDecoder is an empty implementation ?

135 views
Skip to first unread message

sodino chen

unread,
Oct 20, 2022, 11:57:13 AM10/20/22
to skia-discuss
I config 'skia_use_libheif = true' in my args.gn, and compile against a new libskia.so .
Then try to decode a .heif image.

But it failed!.

After debugged codes, I found 'HeifDecoder' is an empty impelmentation, 
SkHeifCodec::MakeFromStream()  always return nullptr
As shown in the screenshot below.
 
Why ?
And how to decode a .heif image?
Thank!


WeChatWorkScreenshot_5fdb2a16-d757-4ff4-876f-8b428306ecb1.png

Leon Scroggins

unread,
Oct 20, 2022, 5:31:35 PM10/20/22
to skia-d...@googlegroups.com
The real implementation lives in Android. This empty implementation is only there so that if we make changes to SkHeifCodec we don't accidentally break Android.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/108db56a-c0dd-4850-b2a9-c4b63dc5233fn%40googlegroups.com.


--

 •  Leon Scroggins

 •  scr...@google.com


Message has been deleted

sodino chen

unread,
Oct 20, 2022, 8:44:09 PM10/20/22
to skia-discuss
So, is there any the related methods of skia can be called to decode the .heif image and then can get a SkBitmap ?

Leon Scroggins

unread,
Oct 21, 2022, 10:23:10 AM10/21/22
to skia-d...@googlegroups.com
Depends on where you're running Skia. If you're running on Android, you can use SkImageGeneratorNDKSkImageGeneratorCG might work on iOS, but I'm not sure.



--

 •  Leon Scroggins

 •  scr...@google.com


sodino chen

unread,
Oct 22, 2022, 10:31:14 AM10/22/22
to skia-discuss
* Create a generator that uses the Android NDK's APIs for decoding images.
*
* Only supported on devices where __ANDROID_API__ >= 30.

-----
Get it!  
Thanks.
Reply all
Reply to author
Forward
0 new messages