Skip to content

Commit 6027cca

Browse files
committed
Revert "video player: disable hw decoding for gstreamer < 1.22.8"
On Raspberry Pi, the fix is now backported to 1.22: RPi-Distro/repo#391 This reverts commit dc0ff2a.
1 parent 18bdd03 commit 6027cca

File tree

1 file changed

+4
-30
lines changed

1 file changed

+4
-30
lines changed

src/plugins/gstplayer.c

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -735,19 +735,9 @@ void on_source_setup(GstElement *playbin, GstElement *source, gpointer userdata)
735735
* See: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gst-plugins-base/gst/playback/gstplay-enum.h
736736
*/
737737
typedef enum {
738-
GST_PLAY_FLAG_VIDEO = (1 << 0),
739-
GST_PLAY_FLAG_AUDIO = (1 << 1),
740-
GST_PLAY_FLAG_TEXT = (1 << 2),
741-
GST_PLAY_FLAG_VIS = (1 << 3),
742-
GST_PLAY_FLAG_SOFT_VOLUME = (1 << 4),
743-
GST_PLAY_FLAG_NATIVE_AUDIO = (1 << 5),
744-
GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 6),
745-
GST_PLAY_FLAG_DOWNLOAD = (1 << 7),
746-
GST_PLAY_FLAG_BUFFERING = (1 << 8),
747-
GST_PLAY_FLAG_DEINTERLACE = (1 << 9),
748-
GST_PLAY_FLAG_SOFT_COLORBALANCE = (1 << 10),
749-
GST_PLAY_FLAG_FORCE_FILTERS = (1 << 11),
750-
GST_PLAY_FLAG_FORCE_SW_DECODERS = (1 << 12),
738+
GST_PLAY_FLAG_VIDEO = (1 << 0),
739+
GST_PLAY_FLAG_AUDIO = (1 << 1),
740+
GST_PLAY_FLAG_TEXT = (1 << 2)
751741
} GstPlayFlags;
752742

753743
UNUSED static void on_element_setup(GstElement *playbin, GstElement *element, gpointer userdata) {
@@ -859,13 +849,8 @@ struct gstplayer *gstplayer_new(struct flutterpi *flutterpi, const char *uri, vo
859849
change_notifier_init(&p->error_notifier);
860850
change_notifier_init(&p->eos_notifier);
861851

862-
// playbin3 doesn't let use disable hardware decoders,
863-
// which we need to do for gstreamer < 1.22.8.
864-
#if THIS_GSTREAMER_VER < GSTREAMER_VER(1, 22, 8)
865-
p->playbin = gst_element_factory_make("playbin", "playbin");
866-
#else
852+
/// TODO: Use playbin or playbin3?
867853
p->playbin = gst_element_factory_make("playbin3", "playbin");
868-
#endif
869854
if (p->playbin == NULL) {
870855
LOG_PLAYER_ERROR(p, "Couldn't create playbin instance.\n");
871856
goto fail_free_p;
@@ -893,17 +878,6 @@ struct gstplayer *gstplayer_new(struct flutterpi *flutterpi, const char *uri, vo
893878
flags &= ~GST_PLAY_FLAG_TEXT;
894879
}
895880

896-
// Gstreamer older than 1.22.8 has a buffer management issue when seeking.
897-
// https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4465
898-
//
899-
// This is a bit more coarse than necessary; we technically only
900-
// need to disable the v4l2 decoders.
901-
#if THIS_GSTREAMER_VER < GSTREAMER_VER(1, 22, 8)
902-
flags |= GST_PLAY_FLAG_FORCE_SW_DECODERS;
903-
#else
904-
flags &= ~GST_PLAY_FLAG_FORCE_SW_DECODERS;
905-
#endif
906-
907881
g_object_set(p->playbin, "flags", flags, NULL);
908882

909883
if (play_video) {

0 commit comments

Comments
 (0)