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] Add support GstEGLImage to improve playback performance #67

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

makotosato-at
Copy link
Contributor

Hello.

I added GstEGLImage support to improve video_player playback performance.
If gst_is_dmabuf_memory() is TRUE, GstEGLImage can be used to improve performance without gst_buffer_extract().
Relevant issue: #64

This requires the following PR:
sony/flutter-embedded-linux#327
and the option -DUSE_EGL_IMAGE_DMABUF is required at build time.

@makotosato-at
Copy link
Contributor Author

I agree to delegate all rights related to this PR to Sony.

Copy link
Collaborator

@HidenoriMatsubayashi HidenoriMatsubayashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the following files, too:

#ifdef USE_EGL_IMAGE_DMABUF
gboolean res = gst_video_info_from_caps(&gstVideoInfo_, caps);
if (!res) {
std::cerr << "Failed to get a gst_video_info";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add std::endl

Comment on lines 88 to 91
GstVideoInfo gstVideoInfo_;
GstEGLImage* gsteglimage_ = NULL;
GstGLContext* gstglctx_ = NULL;
GstGLDisplayEGL* gldisplayegl_ = NULL;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow Google's coding style.

e.g.
gstVideoInfo_ -> gst_video_info_

packages/video_player/elinux/CMakeLists.txt Show resolved Hide resolved

gint fd = gst_dmabuf_memory_get_fd(memory);
gldisplayegl_ =
gst_gl_display_egl_new_with_egl_display((gpointer)egl_display);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use static_cast

gldisplayegl_ =
gst_gl_display_egl_new_with_egl_display((gpointer)egl_display);
gstglctx_ = gst_gl_context_new_wrapped(
GST_GL_DISPLAY_CAST(gldisplayegl_), (guintptr)egl_context,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@makotosato-at
Copy link
Contributor Author

I fixed code.

Copy link
Collaborator

@HidenoriMatsubayashi HidenoriMatsubayashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks a lot.

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

Successfully merging this pull request may close these issues.

2 participants