Closed easycui closed 13 years ago
Hi I am creating bitmap with ffmpeg screen size, than I pull pixels from this bitmap and pass them to ffmpeg, so ffmpeg is drawing directly into android's bitmap(this solution should be the most fastest). This code initializes pixels:
void* pixels; if (Output::VideoDriver_getPixels(stream->codec->width, stream->codec->height, &pixels) != ANDROID_SURFACE_RESULT_SUCCESS) { return INVALID_OPERATION; }
mFrame = avcodec_alloc_frame();
if (mFrame == NULL) {
return INVALID_OPERATION;
}
// pass pixels from android bitmap into ffmpeg
avpicture_fill((AVPicture *) mFrame,
(uint8_t *) pixels,
PIX_FMT_RGB565,
stream->codec->width,
stream->codec->height);
Get it. Thanks a lot!
There is such a code "Output::VideoDriver_updateSurface();" in "void MediaPlayer::decode(AVFrame* frame, double pts)". I guess it would show the decoded frame( sPlayer->mFrame). But i cannot realize that how it works and how it sends the data of frame to video driver. Could you give me some help?