Skip to content

Commit 3efc24a

Browse files
committed
video player: don't handle dma_drm video info
Only supported since gstreamer 1.24.0 and requires some more work to implement correctly.
1 parent 1fd62ad commit 3efc24a

File tree

1 file changed

+9
-18
lines changed
  • src/plugins/gstreamer_video_player

1 file changed

+9
-18
lines changed

src/plugins/gstreamer_video_player/frame.c

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -828,14 +828,11 @@ static struct video_frame *frame_new_egl_imported(struct frame_interface *interf
828828
} while (false)
829829
struct video_frame *frame;
830830
struct plane_info planes[MAX_N_PLANES];
831-
GstVideoInfoDmaDrm drm_video_info;
832831
GstVideoInfo video_info;
833832
EGLBoolean egl_ok;
834833
GstBuffer *buffer;
835834
EGLImageKHR egl_image;
836835
gboolean gst_ok;
837-
uint32_t drm_format;
838-
uint64_t drm_modifier;
839836
GstCaps *caps;
840837
GLuint texture;
841838
GLenum gl_error;
@@ -850,22 +847,20 @@ static struct video_frame *frame_new_egl_imported(struct frame_interface *interf
850847
return NULL;
851848
}
852849

853-
bool is_drm_video_info = false;
854-
855850
// If we don't have an explicit info given, we determine it from the sample caps.
856851
if (info == NULL) {
857852
caps = gst_sample_get_caps(sample);
858853
if (caps == NULL) {
859854
return NULL;
860855
}
861856

862-
is_drm_video_info = gst_video_info_dma_drm_from_caps(&drm_video_info, caps);
863-
864-
gst_ok = gst_video_info_from_caps(&drm_video_info, caps);
857+
gst_ok = gst_video_info_from_caps(&video_info, caps);
865858
if (gst_ok == FALSE) {
866859
LOG_ERROR("Could not get video info from caps.\n");
867860
return NULL;
868861
}
862+
863+
info = &video_info;
869864
} else {
870865
caps = NULL;
871866
}
@@ -875,17 +870,13 @@ static struct video_frame *frame_new_egl_imported(struct frame_interface *interf
875870
height = GST_VIDEO_INFO_HEIGHT(info);
876871
n_planes = GST_VIDEO_INFO_N_PLANES(info);
877872

878-
if (is_drm_video_info) {
879-
drm_format = drm_video_info.drm_fourcc;
880-
drm_modifier = drm_video_info.drm_modifier;
881-
} else {
882-
drm_modifier = DRM_FORMAT_MOD_LINEAR;
883-
drm_format = drm_format = drm_format_from_gst_info(info);
884-
if (drm_format == DRM_FORMAT_INVALID) {
885-
LOG_ERROR("Video format has no EGL equivalent.\n");
886-
return NULL;
887-
}
873+
uint64_t drm_modifier = DRM_FORMAT_MOD_LINEAR;
874+
uint32_t drm_format = drm_format_from_gst_info(info);
875+
if (drm_format == DRM_FORMAT_INVALID) {
876+
LOG_ERROR("Video format has no EGL equivalent.\n");
877+
return NULL;
888878
}
879+
889880

890881
bool external_only;
891882
for_each_format_in_frame_interface(i, format, interface) {

0 commit comments

Comments
 (0)