开发者

Error: SkImageDecoder::Factory returned null

开发者 https://www.devze.com 2023-04-10 13:17 出处:网络
I am working on a project which is using MPEG2 codec for decoding of a video. My codec is in C. After decoding a video it is returning unsigned char pointer of RGB buffer which is a pointer to an im

I am working on a project which is using MPEG2 codec for decoding of a video. My codec is in C.

After decoding a video it is returning unsigned char pointer of RGB buffer which is a pointer to an image bits which are stored as an byte Array. My display function is in Android, so I have to send that information to Android using JNI.

Before calling to display function I hav开发者_Go百科e copied that RGB buffer data in to byte Array and pass it to display function:

BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inDither = false;
opt.inPreferredConfig = Bitmap.Config.RGB_565;

Bitmap bit=BitmapFactory.decodeByteArray(data, 0,   data.length,opt);
canvas.drawBitmap(bit, draw_x, draw_y, null);

But when I am running the application the message is coming:

DEBUG/skia(327):SkImageDecoder::Factory returned null.

I don't know why bitmapFactory is returning null. Since I am beginner with Android, I don't know too much about Android programming. Can anybody please help me..


Yes I solved this error. What I have done I have added bitmap header before the RGB data and then copied that data into byte array and then pass it to the display function which is in android. And then use

Bitmap bit=BitmapFactory.decodeByteArray(data, 0, data.length);
canvas.drawBitmap(bit, draw_x, draw_y, null);

It will return the bitmap and draw that image...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号