Temporary fix for the invalid tbm_surface error#80
Temporary fix for the invalid tbm_surface error#80swift-kim wants to merge 1 commit intoflutter-tizen:flutter-2.0.1-tizenfrom
Conversation
|
@swift-kim I'm sorry for making you misunderstand. This part of the evasgl renderer is unfinished work. I had a plan to discuss with the video plugin team to remove the internal api, but I didn't... IMO, This issue is caused by a mismatch between what we get from the decoder( Here's a rough idea that I had at that time.
FLUTTER_EXPORT int64_t
FlutterRegisterExternalTexture(FlutterTextureRegistrarRef texture_registrar, int texture_type);
FLUTTER_EXPORT bool FlutterMarkExternalTextureFrameAvailable(
FlutterTextureRegistrarRef texture_registrar, int64_t texture_id,
void* [tbm_surface or media_packet]);
void VideoPlayer::onVideoFrameDecoded(media_packet_h packet, void *data) {
/*
VideoPlayer *player = (VideoPlayer *)data;
tbm_surface_h surface;
int ret = media_packet_get_tbm_surface(packet, &surface);
if (ret != MEDIA_PACKET_ERROR_NONE) {
LOG_ERROR(
"[VideoPlayer.onVideoFrameDecoded] media_packet_get_tbm_surface "
"failed, error: %d",
ret);
media_packet_destroy(packet);
return;
}
*/
FlutterMarkExternalTextureFrameAvailable(player->textureRegistrar_,
player->textureId_, packet);
// media_packet_destroy(packet);
}
void ExternalTextureGL::DestructionTbmSurface() {
if (!texture_tbm_surface_) {
FT_LOGE("tbm_surface_h is NULL");
return;
}
// tbm_surface_destroy(texture_tbm_surface_);
media_packet_destroy(texture_tbm_surface_);
texture_tbm_surface_ = NULL;
}Of course, this type of processing should be in both media_packet and tbm. |
|
tbm_surface_internal_ref and tbm_surface_internal_unref are used to lock/unlock the tbm surface from free by mmplayer, so they can't be deleted. Except these two APIs, we can also use tbm_surface_map/tbm_surface_unmap to lock/unlock surface, but they are expensive. |
|
Superseded by #81. |
|
@bwikbs I didn't get it. You use media_packet instead of tbm surface, but how to generate texture by using media_packet? |
This partially reverts the change of #67.
Video frames are not displayed if the ref count is not properly increased (
tbm_surface_internal_ref).The internal APIs
tbm_surface_internal_refandtbm_surface_internal_unrefcannot be used in wearable profile so we need a better solution than this change.@xuelian-bai @xiaowei-guan @bwikbs Could you take a look if you have any idea?
cc @bbrto21