hc
2023-11-22 f743a7adbd6e230d66a6206fa115b59fec2d88eb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From c0e84d5946a615100aa85525213921b0d76385d3 Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Fri, 26 Nov 2021 09:38:19 +0800
Subject: [PATCH 17/17] gstreamer: Support choosing playbin2 and playbin3
 
Neither of them is perfect.
 
The playbin2 (decodebin2) cannot handle multiqueue overrun for some
broken streams:
https://bugzilla.gnome.org/show_bug.cgi?id=775474
 
The playbin3 (decodebin3) might cause memory corruption or ghostpad
activation deadlock in looping.
 
So let's support choosing them by setting QT_GSTREAMER_PLAYBIN env to
playbin or playbin3.
 
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
 src/gsttools/qgstreamerplayersession.cpp                        | 2 +-
 .../gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
 
diff --git a/src/gsttools/qgstreamerplayersession.cpp b/src/gsttools/qgstreamerplayersession.cpp
index b0a37f82..635b6e95 100755
--- a/src/gsttools/qgstreamerplayersession.cpp
+++ b/src/gsttools/qgstreamerplayersession.cpp
@@ -120,7 +120,7 @@ QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent)
 
 void QGstreamerPlayerSession::initPlaybin()
 {
-    m_playbin = gst_element_factory_make(QT_GSTREAMER_PLAYBIN_ELEMENT_NAME, nullptr);
+    m_playbin = gst_element_factory_make(getenv("QT_GSTREAMER_PLAYBIN") ?: QT_GSTREAMER_PLAYBIN_ELEMENT_NAME, NULL);
     if (m_playbin) {
         //GST_PLAY_FLAG_NATIVE_VIDEO omits configuration of ffmpegcolorspace and videoscale,
         //since those elements are included in the video output bin when necessary.
diff --git a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp
index d6b8ad75..6ad6849a 100644
--- a/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp
+++ b/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecodersession.cpp
@@ -91,7 +91,7 @@ QGstreamerAudioDecoderSession::QGstreamerAudioDecoderSession(QObject *parent)
      m_durationQueries(0)
 {
     // Create pipeline here
-    m_playbin = gst_element_factory_make(QT_GSTREAMER_PLAYBIN_ELEMENT_NAME, NULL);
+    m_playbin = gst_element_factory_make(getenv("QT_GSTREAMER_PLAYBIN") ?: QT_GSTREAMER_PLAYBIN_ELEMENT_NAME, NULL);
 
     if (m_playbin != 0) {
         // Sort out messages
-- 
2.20.1