Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Video Player] Support gstreamer dmabuf in video_player #64

Open
makotosato-at opened this issue Nov 30, 2022 · 4 comments
Open

[Video Player] Support gstreamer dmabuf in video_player #64

makotosato-at opened this issue Nov 30, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@makotosato-at
Copy link
Contributor

Hello.
I have i.MX8MP board and using video_player.
This SoC has a VPU(Video Proccessing Unit) so that it can hardware decode H.264 with gstreamer.
But, 1080p 30fps or 60fps video, the following gst_buffer_extract() is the bottleneck and playback is slow.
(gst_extract_buffer() takes about 60ms.)
gst_video_player.cc:

const uint8_t* GstVideoPlayer::GetFrameBuffer() {
  std::shared_lock<std::shared_mutex> lock(mutex_buffer_);
  if (!gst_.buffer) {
    return nullptr;
  }

  const uint32_t pixel_bytes = width_ * height_ * 4;
  gst_buffer_extract(gst_.buffer, 0, pixels_.get(), pixel_bytes);
  return reinterpret_cast<const uint8_t*>(pixels_.get());
}

I think the availability of dmabuf would solve this problem.
Are there any plans to support gstreamer dmabuf in video_player?
(In my environment, gst_is_dmabuf_memory() returns TRUE, so I can use dmabuf.)

@HidenoriMatsubayashi
Copy link
Collaborator

We have two options here to improve the performance. The first option is dmabuf you mentioned above. The other is GPU texture (see also sony/flutter-embedded-linux#157).

I think the availability of dmabuf would solve this problem.
Are there any plans to support gstreamer dmabuf in video_player?

I think that's good. If you have a patch for that, can you please send a PR?

@Kofhein
Copy link

Kofhein commented Nov 30, 2022

@makotosato-at , you may try to set qos to TRUE, for me it improved playback and also resolved issue with disappearing sound. But for sure 60ms bottleneck is problem that should be solved.

@makotosato-at
Copy link
Contributor Author

@Kofhein Thank you for the information. I tried that, but it didn't solve the problem...

@HidenoriMatsubayashi Sorry, I don't have any patches...

@Kofhein
Copy link

Kofhein commented Jan 21, 2023

@makotosato-at , my comment might be helpful to you too #63 (comment) I've resolved similar issue, but in my case I've got desktop HW, so in my case gst_buffer_extract wasn't bottleneck.
Also I've seen dma buf based implementation here https://github.com/ardera/flutter-pi/blob/master/src/plugins/gstreamer_video_player/player.c , but it's C based solution for RasbPi and seems there GPU textures already implemented. In most cases I've seen this kind of dmabuf implementation it was connected to GPU texture using Frame buffer and rendering buffer with planes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants