积分330 / 贡献0

提问8答案被采纳4文章53

[经验分享] OpenHarmony-v4.1-Release分支适配rtsp流播放 原创

润开鸿_闻飞 显示全部楼层 发表于 7 天前

OpenHarmony本身当前本身并不支持rtsp拉流,但是我们经常又有rtsp播放的需求,因此我们需要移植gstreamer插件来完成我们的功能,关于适配rtsp,当前通过video标签来适配,具体适配过程涉及到build、multimedia_player_framework、arkui_ace_engine、third_party_gstreamer和third_party_glib等5个仓。具体的修改patch参见如下:

1、build仓修改

diff --git a/compile_standard_whitelist.json b/compile_standard_whitelist.json
index 99e19d10..d8ec2230 100644
--- a/compile_standard_whitelist.json
+++ b/compile_standard_whitelist.json
@@ -89,6 +89,7 @@
         "//device/soc/rockchip/rk3588/hardware/omx_il/osal:RkOMX_OSAL",
         "//foundation/arkui/napi/sample/native_module_systemtest:systemtestnapi",
         "//ide/tools/previewer:lite_previewer",
+        "//third_party/glib:gio",
         "//vendor/hihope/rk3568/bluetooth:libbt_vendor",
         "//vendor/hihope/ipcamera/bluetooth:libbt_vendor"
     ],
@@ -424,6 +425,7 @@
         "//test/xts/acts/hiviewdfx/utils/native:utilskit",
         "//third_party/flutter/build/skia:ace_fontmgr_standard",
         "//third_party/flutter/build/skia:skia_shared",
+        "//third_party/glib:gio",
         "//third_party/vk-gl-cts/framework/platform/ohos/rosen_context:rosen_context",
         "//third_party/vk-gl-cts/framework/platform:libdeqp_ohos_platform",
         "//third_party/libdrm:libdrm",
@@ -532,6 +534,7 @@
         "//foundation/communication/ipc/ipc/test/auxiliary/native:ipc_test_helper",
         "//foundation/communication/ipc/ipc/test/auxiliary/native:ipc_test_helper_extra",
         "//foundation/resourceschedule/memmgr/services/memmgrservice:memmgrservice",
+        "//third_party/glib:gio",
         "//test/xts/acts/arkui/ace_napi_test/entry/src/main/cpp:napitest",
         "//test/xts/acts/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp:ImagePixelMapNDKTest",
         "//test/xts/acts/multimedia/image/image_js_standard/imageReceiverNDK/entry/src/main/cpp:ImageReceiverNDKTest",
@@ -650,6 +653,7 @@
         "//foundation/window/window_manager/wmserver:libwms",
         "//test/xts/acts/hiviewdfx/utils/native:utilskit",
         "//test/xts/hats/hdf/display/composer/common:disp_dev_hdi_test",
+        "//third_party/glib:gio",
         "//third_party/libfuse:libfuse",
         "//third_party/libdrm:libdrm",
         "//wetools:wetools",
@@ -829,6 +833,7 @@
         "//third_party/flutter/build/skia:ace_fontmgr_windows",
         "//third_party/flutter/build/skia:ace_xml",
         "//third_party/flutter/build/skia:skia_shared",
+        "//third_party/glib:gio",
         "//third_party/glslang/OGLCompilersDLL:libdeqp_OGLCompiler",
         "//third_party/glslang/SPIRV:SPIRV_source",
         "//third_party/glslang/SPIRV:libdeqp_spirv",

2、multimedia_player_framework仓修改

diff --git a/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.cpp b/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.cpp
index cfa0f35e..028c9a0e 100644
--- a/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.cpp
+++ b/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.cpp
@@ -175,9 +175,13 @@ int32_t PlayBinCtrlerBase::SetSource(const std::string &url)
     drmInfo_.clear();
     if (url.find("http") == 0 || url.find("https") == 0 || EnableBufferingBySysParam()) {
         isNetWorkPlay_ = true;
+    } else if (url.find("rtsp") == 0) {
+        uri_ = "rtsp://admin:wen1REN2fei3@10.20.72.100:554/Streaming/Channels/101";
+        isRtspWorkPlay_ = true;
     }

     MEDIA_LOGI("Set source: %{public}s", url.c_str());
+    MEDIA_LOGI("Set source: uri_ %{public}s", uri_.c_str());
     return MSERR_OK;
 }

@@ -1130,7 +1134,7 @@ void PlayBinCtrlerBase::HandleCacheCtrl(int32_t percent)

 void PlayBinCtrlerBase::HandleCacheCtrlCb(const InnerMessage &msg)
 {
-    if (isNetWorkPlay_) {
+    if (isNetWorkPlay_ || isRtspWorkPlay_) {
         cachePercent_ = msg.detail1;
         HandleCacheCtrl(cachePercent_);
     }
@@ -1491,7 +1495,7 @@ void PlayBinCtrlerBase::OnElementSetup(GstElement &elem)
 #endif
     OnAdaptiveElementSetup(elem);
     std::string elementName(GST_ELEMENT_NAME(&elem));
-    if (isNetWorkPlay_ == false && elementName.find("uridecodebin") != std::string::npos) {
+    if ((isNetWorkPlay_ == false || isRtspWorkPlay_ == false) && elementName.find("uridecodebin") != std::string::npos) {
         PlayBinCtrlerWrapper *wrapper = new(std::nothrow) PlayBinCtrlerWrapper(shared_from_this());
         CHECK_AND_RETURN_LOG(wrapper != nullptr, "can not create this wrapper");
         gulong id = g_signal_connect_data(&elem, "autoplug-sort",
diff --git a/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.h b/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.h
index 60689eaf..54feb614 100644
--- a/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.h
+++ b/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.h
@@ -265,6 +265,7 @@ private:
     bool isBuffering_ = false;
     bool isSelectBitRate_ = false;
     bool isNetWorkPlay_ = false;
+    bool isRtspWorkPlay_ = false;
     bool isUserSetPlay_ = false;
     bool isUserSetPause_ = false;
     bool isReplay_ = false;
@@ -296,4 +297,4 @@ private:
 };
 } // namespace Media
 } // namespace OHOS
-#endif // PLAYBIN_CTRLER_BASE_H
\ No newline at end of file
+#endif // PLAYBIN_CTRLER_BASE_H

3、arkui_ace_engine仓修改

diff --git a/frameworks/core/components_ng/render/adapter/rosen_media_player.cpp b/frameworks/core/components_ng/render/adapter/rosen_media_player.cpp
index d333c0c21f..0183cca3ef 100644
--- a/frameworks/core/components_ng/render/adapter/rosen_media_player.cpp
+++ b/frameworks/core/components_ng/render/adapter/rosen_media_player.cpp
@@ -290,6 +290,12 @@ bool RosenMediaPlayer::SetMediaSource(std::string& filePath, int32_t& fd, bool&
     } else if (StringUtils::StartWith(filePath, "resource://RAWFILE")) {
         // file path: resource/rawfile/xxx.xx --> resource://rawfile/xxx.xx
         return RawFilePlay(filePath);
+    } else if (StringUtils::StartWith(filePath, "rtsp")) {
+        // rtsp
+        if (mediaPlayer_ && mediaPlayer_->SetSource(filePath) != 0) {
+            LOGE("Player SetSource failed");
+            return false;
+        }
     } else if (StringUtils::StartWith(filePath, "http")) {
         // http or https
         if (mediaPlayer_ && mediaPlayer_->SetSource(filePath) != 0) {

4、third_party_gstreamer仓修改

diff --git a/gstplugins_base/BUILD.gn b/gstplugins_base/BUILD.gn
index d5a9d5dc..19337b47 100644
--- a/gstplugins_base/BUILD.gn
+++ b/gstplugins_base/BUILD.gn
@@ -23,6 +23,10 @@ group("gstplugins_base_packages") {
     ":gsttypefindfunctions",
     ":gstvideoconvert",
     ":gstvideoscale",
+    ":gstsdplib",
+    ":gstrtplib",
+    ":gstrtsplib",
+    ":gsttcp",
   ]
 }

@@ -72,6 +76,7 @@ ohos_source_set("gstplayback_source") {
     "gst/playback/gstplaybackplugin.c",
     "gst/playback/gstplaybackutils.c",
     "gst/playback/gstplaybin2.c",
+    "gst/playback/gstplaybin3.c",
     "gst/playback/gstplaysink.c",
     "gst/playback/gstplaysinkaudioconvert.c",
     "gst/playback/gstplaysinkconvertbin.c",
@@ -494,7 +499,7 @@ ohos_source_set("rtp_source") {
   configs = [ ":gst_plugins_config" ]
 }

-ohos_shared_library("gstrtp") {
+ohos_shared_library("gstlibrtp") {
   deps = [
     ":rtp_source",
     "//third_party/glib:glib",
@@ -595,3 +600,137 @@ ohos_shared_library("gstapp_plugin") {
   part_name = "gstreamer"
   subsystem_name = "thirdparty"
 }
+
+ohos_source_set("sdplib_source") {
+  sources = [
+    "gst-libs/gst/sdp/gstmikey.c",
+    "gst-libs/gst/sdp/gstsdpmessage.c",
+  ]
+
+  configs = [ ":gst_plugins_config" ]
+}
+
+ohos_shared_library("gstsdplib") {
+  deps = [
+    ":sdplib_source",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+    "//third_party/gstreamer/gstplugins_base:gstrtplib",
+    "//third_party/gstreamer/gstplugins_base:gstpbutils",
+    "//third_party/glib:glib_packages",
+    "//third_party/glib:glib",
+    "//third_party/glib:gmodule",
+    "//third_party/glib:gobject",
+  ]
+
+  # relative_install_dir = "media/plugins"
+  install_images = [ "system" ]
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
+
+ohos_source_set("rtplib_source") {
+  sources = [
+    "gst-libs/gst/rtp/gstrtcpbuffer.c",
+    "gst-libs/gst/rtp/gstrtp-enumtypes.c",
+    "gst-libs/gst/rtp/gstrtpbaseaudiopayload.c",
+    "gst-libs/gst/rtp/gstrtpbasedepayload.c",
+    "gst-libs/gst/rtp/gstrtpbasepayload.c",
+    "gst-libs/gst/rtp/gstrtpbuffer.c",
+    "gst-libs/gst/rtp/gstrtphdrext.c",
+    "gst-libs/gst/rtp/gstrtpmeta.c",
+    "gst-libs/gst/rtp/gstrtppayloads.c",
+  ]
+
+  configs = [ ":gst_plugins_config" ]
+}
+
+ohos_shared_library("gstrtplib") {
+  deps = [
+    ":rtplib_source",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+    "//third_party/glib:glib_packages",
+    "//third_party/glib:glib",
+    "//third_party/glib:gmodule",
+    "//third_party/glib:gobject",
+  ]
+
+  # relative_install_dir = "media/plugins"
+  install_images = [ "system" ]
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
+
+ohos_source_set("rtsplib_source") {
+  sources = [
+    "gst-libs/gst/rtsp/gstrtsp-enumtypes.c",
+    "gst-libs/gst/rtsp/gstrtspconnection.c",
+    "gst-libs/gst/rtsp/gstrtspdefs.c",
+    "gst-libs/gst/rtsp/gstrtspextension.c",
+    "gst-libs/gst/rtsp/gstrtspmessage.c",
+    "gst-libs/gst/rtsp/gstrtsprange.c",
+    "gst-libs/gst/rtsp/gstrtsptransport.c",
+    "gst-libs/gst/rtsp/gstrtspurl.c",
+  ]
+
+  configs = [ ":gst_plugins_config" ]
+}
+
+ohos_shared_library("gstrtsplib") {
+  deps = [
+    ":rtsplib_source",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+    "//third_party/glib:glib_packages",
+    "//third_party/glib:glib",
+    "//third_party/glib:gmodule",
+    "//third_party/glib:gobject",
+  ]
+
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
+
+ohos_source_set("tcp_source") {
+  sources = [
+    "./gst/tcp/gstmultifdsink.c",
+    "./gst/tcp/gstmultihandlesink.c",
+    "./gst/tcp/gstmultisocketsink.c",
+    "./gst/tcp/gstsocketsrc.c",
+    "./gst/tcp/gsttcpclientsink.c",
+    "./gst/tcp/gsttcpclientsrc.c",
+    "./gst/tcp/gsttcpelements.c",
+    "./gst/tcp/gsttcpplugin.c",
+    "./gst/tcp/gsttcpserversink.c",
+    "./gst/tcp/gsttcpserversrc.c",
+    "./gst/tcp/gsttcpsrcstats.c",
+  ]
+
+  configs = [ ":gst_plugins_config" ]
+}
+
+ohos_shared_library("gsttcp") {
+  deps = [
+    ":tcp_source",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+    "//third_party/glib:glib_packages",
+    "//third_party/glib:glib",
+    "//third_party/glib:gmodule",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstreamer:gstnet",
+  ]
+
+  relative_install_dir = "media/plugins"
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
diff --git a/gstplugins_good/BUILD.gn b/gstplugins_good/BUILD.gn
index 3616a918..e995059d 100644
--- a/gstplugins_good/BUILD.gn
+++ b/gstplugins_good/BUILD.gn
@@ -15,12 +15,21 @@ import("//build/ohos.gni")

 group("gstplugins_good_packages") {
   deps = [
+    ":gstalpha",
     ":gstaudiofx",
     ":gstaudioparsers",
+    ":gstauparse",
+    ":gstavi",
     ":gstisomp4",
     ":gstmatroska",
     ":gstmultifile",
+    ":gstsoup",
     ":gstwavparse",
+    ":gstrtp",
+    ":gstrtsp",
+    ":gstrtsptest",
+    ":gstudp",
+    ":gstrtpmanager",
   ]
 }

@@ -41,7 +50,10 @@ config("gst_plugins_config") {
     "//third_party/glib",
     "//third_party/glib/gmodule",
     "//third_party/zlib",
+    "//third_party/libsoup",
+    "//third_party/gettext/gettext-runtime/intl",
     "//third_party/bzip2",
+    "//device/soc/thead/c9xx/hardware/demo_log/include",
   ]

   cflags = [
@@ -65,6 +77,32 @@ config("gst_plugins_config") {
   ]
 }

+ohos_source_set("alpha_source") {
+  sources = [
+    "gst/alpha/gstalpha.c",
+    "gst/alpha/gstalphacolor.c",
+  ]
+
+  configs = [ ":gst_plugins_config" ]
+}
+
+ohos_shared_library("gstalpha") {
+  deps = [
+    ":alpha_source",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstplugins_base:gstpbutils",
+    "//third_party/gstreamer/gstplugins_base:gsttag",
+    "//third_party/gstreamer/gstplugins_base:gstvideo",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+  ]
+
+  relative_install_dir = "media/plugins"
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
+
 ohos_source_set("audioparsers_source") {
   sources = [
     "gst/audioparsers/gstaacparse.c",
@@ -92,6 +130,31 @@ ohos_shared_library("gstaudioparsers") {
   subsystem_name = "thirdparty"
 }

+ohos_source_set("auparse_source") {
+  sources = [
+    "gst/auparse/gstauparse.c",
+  ]
+
+  configs = [ ":gst_plugins_config" ]
+}
+
+ohos_shared_library("gstauparse") {
+  deps = [
+    ":auparse_source",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstplugins_base:gstpbutils",
+    "//third_party/gstreamer/gstplugins_base:gsttag",
+    "//third_party/gstreamer/gstplugins_base:gstaudio",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+  ]
+
+  relative_install_dir = "media/plugins"
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
+
 ohos_source_set("autodetect_source") {
   sources = [
     "gst/autodetect/gstautoaudiosink.c",
@@ -121,6 +184,35 @@ ohos_shared_library("gstautodetect") {
   subsystem_name = "thirdparty"
 }

+ohos_source_set("avi_source") {
+  sources = [
+    "gst/autodetect/gstautoaudiosink.c",
+    "gst/autodetect/gstautoaudiosrc.c",
+    "gst/autodetect/gstautodetect.c",
+    "gst/autodetect/gstautodetectelement.c",
+    "gst/autodetect/gstautodetectplugin.c",
+    "gst/autodetect/gstautovideosink.c",
+    "gst/autodetect/gstautovideosrc.c",
+  ]
+
+  configs = [ ":gst_plugins_config" ]
+}
+
+ohos_shared_library("gstavi") {
+  deps = [
+    ":avi_source",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstplugins_base:gstpbutils",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+  ]
+
+  relative_install_dir = "media/plugins"
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
+
 ohos_source_set("id3demux_source") {
   sources = [ "gst/id3demux/gstid3demux.c" ]

@@ -259,6 +351,34 @@ ohos_shared_library("gstaudiofx") {
   subsystem_name = "thirdparty"
 }

+ohos_source_set("gstsoup_source") {
+  sources = [
+    "ext/soup/gstsoup.c",
+    "ext/soup/gstsoupelement.c",
+    "ext/soup/gstsouphttpsrc.c",
+    "ext/soup/gstsouploader.c",
+    "ext/soup/gstsouputils.c",
+  ]
+
+  configs = [ ":gst_plugins_config" ]
+}
+
+ohos_shared_library("gstsoup") {
+  deps = [
+    ":gstsoup_source",
+    "//third_party/glib:gio",
+    "//third_party/glib:glib",
+    "//third_party/glib:gmodule",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstplugins_base:gsttag",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+  ]
+  relative_install_dir = "media/plugins"
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
+
 ohos_source_set("matroska_source") {
   sources = [
     "gst/matroska/ebml-read.c",
@@ -293,3 +413,317 @@ ohos_shared_library("gstmatroska") {
   part_name = "gstreamer"
   subsystem_name = "thirdparty"
 }
+
+ohos_source_set("rtps_source") {
+  sources = [
+    "gst/rtp/dboolhuff.c",
+    "gst/rtp/fnv1hash.c",
+    "gst/rtp/gstasteriskh263.c",
+    "gst/rtp/gstbuffermemory.c",
+    "gst/rtp/gstrtpac3depay.c",
+    "gst/rtp/gstrtpac3pay.c",
+    "gst/rtp/gstrtpamrdepay.c",
+    "gst/rtp/gstrtpamrpay.c",
+    "gst/rtp/gstrtpbvdepay.c",
+    "gst/rtp/gstrtpbvpay.c",
+    "gst/rtp/gstrtp.c",
+    "gst/rtp/gstrtpceltdepay.c",
+    "gst/rtp/gstrtpceltpay.c",
+    "gst/rtp/gstrtpchannels.c",
+    "gst/rtp/gstrtpdvdepay.c",
+    "gst/rtp/gstrtpdvpay.c",
+    "gst/rtp/gstrtpelement.c",
+    "gst/rtp/gstrtpg722depay.c",
+    "gst/rtp/gstrtpg722pay.c",
+    "gst/rtp/gstrtpg723depay.c",
+    "gst/rtp/gstrtpg723pay.c",
+    "gst/rtp/gstrtpg726depay.c",
+    "gst/rtp/gstrtpg726pay.c",
+    "gst/rtp/gstrtpg729depay.c",
+    "gst/rtp/gstrtpg729pay.c",
+    "gst/rtp/gstrtpgsmdepay.c",
+    "gst/rtp/gstrtpgsmpay.c",
+    "gst/rtp/gstrtpgstdepay.c",
+    "gst/rtp/gstrtpgstpay.c",
+    "gst/rtp/gstrtph261depay.c",
+    "gst/rtp/gstrtph261pay.c",
+    "gst/rtp/gstrtph263depay.c",
+    "gst/rtp/gstrtph263pay.c",
+    "gst/rtp/gstrtph263pdepay.c",
+    "gst/rtp/gstrtph263ppay.c",
+    "gst/rtp/gstrtph264depay.c",
+    "gst/rtp/gstrtph264pay.c",
+    "gst/rtp/gstrtph265depay.c",
+    "gst/rtp/gstrtph265pay.c",
+    "gst/rtp/gstrtphdrext-colorspace.c",
+    "gst/rtp/gstrtpilbcdepay.c",
+    "gst/rtp/gstrtpilbcpay.c",
+    "gst/rtp/gstrtpisacdepay.c",
+    "gst/rtp/gstrtpisacpay.c",
+    "gst/rtp/gstrtpj2kdepay.c",
+    "gst/rtp/gstrtpj2kpay.c",
+    "gst/rtp/gstrtpjpegdepay.c",
+    "gst/rtp/gstrtpjpegpay.c",
+    "gst/rtp/gstrtpklvdepay.c",
+    "gst/rtp/gstrtpklvpay.c",
+    "gst/rtp/gstrtpL16depay.c",
+    "gst/rtp/gstrtpL16pay.c",
+    "gst/rtp/gstrtpL24depay.c",
+    "gst/rtp/gstrtpL24pay.c",
+    "gst/rtp/gstrtpL8depay.c",
+    "gst/rtp/gstrtpL8pay.c",
+    "gst/rtp/gstrtpldacpay.c",
+    "gst/rtp/gstrtpmp1sdepay.c",
+    "gst/rtp/gstrtpmp2tdepay.c",
+    "gst/rtp/gstrtpmp2tpay.c",
+    "gst/rtp/gstrtpmp4adepay.c",
+    "gst/rtp/gstrtpmp4apay.c",
+    "gst/rtp/gstrtpmp4gdepay.c",
+    "gst/rtp/gstrtpmp4gpay.c",
+    "gst/rtp/gstrtpmp4vdepay.c",
+    "gst/rtp/gstrtpmp4vpay.c",
+    "gst/rtp/gstrtpmpadepay.c",
+    "gst/rtp/gstrtpmpapay.c",
+    "gst/rtp/gstrtpmparobustdepay.c",
+    "gst/rtp/gstrtpmpvdepay.c",
+    "gst/rtp/gstrtpmpvpay.c",
+    "gst/rtp/gstrtpopusdepay.c",
+    "gst/rtp/gstrtpopuspay.c",
+    "gst/rtp/gstrtppcmadepay.c",
+    "gst/rtp/gstrtppcmapay.c",
+    "gst/rtp/gstrtppcmudepay.c",
+    "gst/rtp/gstrtppcmupay.c",
+    "gst/rtp/gstrtpqcelpdepay.c",
+    "gst/rtp/gstrtpqdmdepay.c",
+    "gst/rtp/gstrtpreddec.c",
+    "gst/rtp/gstrtpredenc.c",
+    "gst/rtp/gstrtpsbcpay.c",
+    "gst/rtp/gstrtpsirendepay.c",
+    "gst/rtp/gstrtpsirenpay.c",
+    "gst/rtp/gstrtpspeexdepay.c",
+    "gst/rtp/gstrtpspeexpay.c",
+    "gst/rtp/gstrtpstorage.c",
+    "gst/rtp/gstrtpstreamdepay.c",
+    "gst/rtp/gstrtpstreampay.c",
+    "gst/rtp/gstrtpsv3vdepay.c",
+    "gst/rtp/gstrtptheoradepay.c",
+    "gst/rtp/gstrtptheorapay.c",
+    "gst/rtp/gstrtpulpfecdec.c",
+    "gst/rtp/gstrtpulpfecenc.c",
+    "gst/rtp/gstrtputils.c",
+    "gst/rtp/gstrtpvorbisdepay.c",
+    "gst/rtp/gstrtpvorbispay.c",
+    "gst/rtp/gstrtpvp8depay.c",
+    "gst/rtp/gstrtpvp8pay.c",
+    "gst/rtp/gstrtpvp9depay.c",
+    "gst/rtp/gstrtpvp9pay.c",
+    "gst/rtp/gstrtpvrawdepay.c",
+    "gst/rtp/gstrtpvrawpay.c",
+    "gst/rtp/rtpredcommon.c",
+    "gst/rtp/rtpstorage.c",
+    "gst/rtp/rtpstoragestream.c",
+    "gst/rtp/rtpulpfeccommon.c",
+  ]
+
+  configs = [ ":gst_plugins_config" ]
+}
+
+ohos_shared_library("gstrtp") {
+  deps = [
+    ":rtps_source",
+    "//third_party/bzip2:libbz2",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstplugins_base:gstaudio",
+    "//third_party/gstreamer/gstplugins_base:gstpbutils",
+    "//third_party/gstreamer/gstplugins_base:gstriff",
+    "//third_party/gstreamer/gstplugins_base:gsttag",
+    "//third_party/gstreamer/gstplugins_base:gstvideo",
+    "//third_party/gstreamer/gstplugins_base:gstrtsplib",
+    "//third_party/gstreamer/gstplugins_base:gstrtplib",
+    "//third_party/gstreamer/gstplugins_base:gstsdplib",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstnet",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+    "//third_party/glib:glib_packages",
+    "//third_party/glib:glib",
+    "//third_party/glib:gmodule",
+    "//third_party/glib:gobject",
+  ]
+
+  relative_install_dir = "media/plugins"
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
+
+ohos_source_set("rtsp_source") {
+  sources = [
+    "gst/rtsp/gstrtpdec.c",
+    "gst/rtsp/gstrtsp.c",
+    "gst/rtsp/gstrtspelement.c",
+    "gst/rtsp/gstrtspsrc.c",
+    "gst/rtsp/gstrtspext.c",
+  ]
+
+  configs = [ ":gst_plugins_config" ]
+}
+
+ohos_shared_library("gstrtsp") {
+  deps = [
+    ":rtsp_source",
+    "//third_party/bzip2:libbz2",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstplugins_base:gstaudio",
+    "//third_party/gstreamer/gstplugins_base:gstpbutils",
+    "//third_party/gstreamer/gstplugins_base:gstriff",
+    "//third_party/gstreamer/gstplugins_base:gsttag",
+    "//third_party/gstreamer/gstplugins_base:gstvideo",
+    "//third_party/gstreamer/gstplugins_base:gstrtsplib",
+    "//third_party/gstreamer/gstplugins_base:gstrtplib",
+    "//third_party/gstreamer/gstplugins_base:gstsdplib",
+    "//third_party/gstreamer/gstplugins_base:gstplayback",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstnet",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+    "//third_party/glib:glib_packages",
+    "//third_party/glib:glib",
+    "//third_party/glib:gmodule",
+    "//third_party/glib:gobject",
+  ]
+
+  relative_install_dir = "media/plugins"
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
+
+ohos_executable("gstrtsptest") {
+  sources = [
+    "//third_party/gstreamer/gstplugins_good/tests/examples/rtsp/test-onvif.c",
+  ]
+  configs = [ ":gst_plugins_config" ]
+  deps = [
+    "//third_party/bzip2:libbz2",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstplugins_base:gstaudio",
+    "//third_party/gstreamer/gstplugins_base:gstpbutils",
+    "//third_party/gstreamer/gstplugins_base:gstriff",
+    "//third_party/gstreamer/gstplugins_base:gsttag",
+    "//third_party/gstreamer/gstplugins_base:gstvideo",
+    "//third_party/gstreamer/gstplugins_base:gstrtsplib",
+    "//third_party/gstreamer/gstplugins_base:gstrtplib",
+    "//third_party/gstreamer/gstplugins_base:gstsdplib",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstnet",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+    "//third_party/glib:glib_packages",
+    "//third_party/glib:glib",
+    "//third_party/glib:gmodule",
+    "//third_party/glib:gobject",
+  ]
+
+  install_enable = true
+  install_images = [ "system" ]
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
+
+ohos_source_set("udp_source") {
+  sources = [
+    "gst/udp/gstdynudpsink.c",
+    "gst/udp/gstmultiudpsink.c",
+    "gst/udp/gstudp.c",
+    "gst/udp/gstudpelement.c",
+    "gst/udp/gstudpnetutils.c",
+    "gst/udp/gstudpsink.c",
+    "gst/udp/gstudpsrc.c",
+  ]
+
+  configs = [ ":gst_plugins_config" ]
+}
+
+ohos_shared_library("gstudp") {
+  deps = [
+    ":udp_source",
+    "//third_party/bzip2:libbz2",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstplugins_base:gstaudio",
+    "//third_party/gstreamer/gstplugins_base:gstpbutils",
+    "//third_party/gstreamer/gstplugins_base:gstriff",
+    "//third_party/gstreamer/gstplugins_base:gsttag",
+    "//third_party/gstreamer/gstplugins_base:gstvideo",
+    "//third_party/gstreamer/gstplugins_base:gstrtsplib",
+    "//third_party/gstreamer/gstplugins_base:gstrtplib",
+    "//third_party/gstreamer/gstplugins_base:gstsdplib",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstnet",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+    "//third_party/glib:glib_packages",
+    "//third_party/glib:glib",
+    "//third_party/glib:gmodule",
+    "//third_party/glib:gobject",
+  ]
+
+  relative_install_dir = "media/plugins"
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
+
+ohos_source_set("rtpmanager_source") {
+  sources = [
+    "gst/rtpmanager/gstrtpbin.c",
+    "gst/rtpmanager/gstrtpdtmfmux.c",
+    "gst/rtpmanager/gstrtpfunnel.c",
+    "gst/rtpmanager/gstrtphdrext-clientaudiolevel.c",
+    "gst/rtpmanager/gstrtphdrext-twcc.c",
+    "gst/rtpmanager/gstrtpjitterbuffer.c",
+    "gst/rtpmanager/gstrtpmanager.c",
+    "gst/rtpmanager/gstrtpmux.c",
+    "gst/rtpmanager/gstrtpptdemux.c",
+    "gst/rtpmanager/gstrtprtxqueue.c",
+    "gst/rtpmanager/gstrtprtxreceive.c",
+    "gst/rtpmanager/gstrtprtxsend.c",
+    "gst/rtpmanager/gstrtpsession.c",
+    "gst/rtpmanager/gstrtpssrcdemux.c",
+    "gst/rtpmanager/gstrtpst2022-1-fecdec.c",
+    "gst/rtpmanager/gstrtpst2022-1-fecenc.c",
+    "gst/rtpmanager/rtpjitterbuffer.c",
+    "gst/rtpmanager/rtpsession.c",
+    "gst/rtpmanager/rtpsource.c",
+    "gst/rtpmanager/rtpstats.c",
+    "gst/rtpmanager/rtptimerqueue.c",
+    "gst/rtpmanager/rtptwcc.c",
+  ]
+
+  configs = [ ":gst_plugins_config" ]
+}
+
+ohos_shared_library("gstrtpmanager") {
+  deps = [
+    ":rtpmanager_source",
+    "//third_party/bzip2:libbz2",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstplugins_base:gstaudio",
+    "//third_party/gstreamer/gstplugins_base:gstpbutils",
+    "//third_party/gstreamer/gstplugins_base:gstriff",
+    "//third_party/gstreamer/gstplugins_base:gsttag",
+    "//third_party/gstreamer/gstplugins_base:gstvideo",
+    "//third_party/gstreamer/gstplugins_base:gstrtsplib",
+    "//third_party/gstreamer/gstplugins_base:gstrtplib",
+    "//third_party/gstreamer/gstplugins_base:gstsdplib",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstnet",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+    "//third_party/glib:glib_packages",
+    "//third_party/glib:glib",
+    "//third_party/glib:gmodule",
+    "//third_party/glib:gobject",
+  ]
+
+  relative_install_dir = "media/plugins"
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
diff --git a/gstplugins_good/gst/rtp/gstrtp.c b/gstplugins_good/gst/rtp/gstrtp.c
index 9528ffb1..4e761e0e 100644
--- a/gstplugins_good/gst/rtp/gstrtp.c
+++ b/gstplugins_good/gst/rtp/gstrtp.c
@@ -101,7 +101,7 @@ plugin_init (GstPlugin * plugin)
   ret |= GST_ELEMENT_REGISTER (rtpmp4gpay, plugin);
   ret |= GST_ELEMENT_REGISTER (rtpqcelpdepay, plugin);
   ret |= GST_ELEMENT_REGISTER (rtpqdm2depay, plugin);
-  ret |= GST_ELEMENT_REGISTER (rtpsbcdepay, plugin);
+  /* ret |= GST_ELEMENT_REGISTER (rtpsbcdepay, plugin); */
   ret |= GST_ELEMENT_REGISTER (rtpsbcpay, plugin);
   ret |= GST_ELEMENT_REGISTER (rtpsirenpay, plugin);
   ret |= GST_ELEMENT_REGISTER (rtpsirendepay, plugin);
diff --git a/gstplugins_good/gst/udp/gstudpsrc.c b/gstplugins_good/gst/udp/gstudpsrc.c
index f9570074..bde3142b 100644
--- a/gstplugins_good/gst/udp/gstudpsrc.c
+++ b/gstplugins_good/gst/udp/gstudpsrc.c
@@ -105,7 +105,9 @@
  * Also all these have to be before glib.h is included as
  * otherwise struct in6_pktinfo is not defined completely
  * due to broken glibc headers */
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 /* Needed for OSX/iOS to define the IPv6 variants */
 #define __APPLE_USE_RFC_3542
 #include <sys/types.h>
diff --git a/gstplugins_good/tests/examples/rtsp/test-onvif.c b/gstplugins_good/tests/examples/rtsp/test-onvif.c
index 2f47445e..111bc4d1 100644
--- a/gstplugins_good/tests/examples/rtsp/test-onvif.c
+++ b/gstplugins_good/tests/examples/rtsp/test-onvif.c
@@ -86,7 +86,7 @@ main (int argc, char *argv[])
   if (argc >= 2)
     location = argv[1];
   else
-    location = "rtsp://127.0.0.1:8554/test";
+    location = "rtsp://admin:nbt123456@10.20.72.51:554/Streaming/Channels/101";

   loop = g_main_loop_new (NULL, FALSE);

diff --git a/gstreamer/BUILD.gn b/gstreamer/BUILD.gn
index 3ceb9f16..f11552bc 100644
--- a/gstreamer/BUILD.gn
+++ b/gstreamer/BUILD.gn
@@ -18,6 +18,7 @@ group("gstreamer_packages") {
     ":gst-inspect",
     ":gst-launch",
     ":gstbase",
+    ":gstnet",
     ":gstcoreelements",
     ":gstreamer",
   ]
@@ -253,6 +254,34 @@ ohos_shared_library("gstbase") {
   subsystem_name = "thirdparty"
 }

+ohos_source_set("gstnet_source") {
+  sources = [
+    "libs/gst/net/gstnetaddressmeta.c",
+    "libs/gst/net/gstnetclientclock.c",
+    "libs/gst/net/gstnetcontrolmessagemeta.c",
+    "libs/gst/net/gstnettimepacket.c",
+    "libs/gst/net/gstnettimeprovider.c",
+    "libs/gst/net/gstnetutils.c",
+    "libs/gst/net/gstntppacket.c",
+    "libs/gst/net/gstptpclock.c",
+  ]
+
+  configs = [ ":gstbase_config" ]
+}
+
+ohos_shared_library("gstnet") {
+  deps = [
+    ":gstnet_source",
+    ":gstreamer",
+    "//third_party/glib:gobject",
+    "//third_party/glib:glib_packages",
+    "//third_party/glib:glib",
+    "//third_party/glib:gmodule",
+  ]
+  part_name = "gstreamer"
+  subsystem_name = "thirdparty"
+}
+
 config("gstcoreelements_config") {
   include_dirs = [
     ".",
@@ -262,6 +291,21 @@ config("gstcoreelements_config") {
     "//third_party/glib/glib",
     "//third_party/glib",
     "//third_party/glib/gmodule",
+    "//third_party/gstreamer/gstplugins_good/gst/rtsp",
+    "//third_party/gstreamer/gstplugins_good/gst-libs",
+    "//third_party/gstreamer/gstplugins_good/gst/isomp4",
+    "//third_party/gstreamer/gstplugins_good/gst/audiofx",
+    "//third_party/gstreamer/gstreamer",
+    "//third_party/gstreamer/gstreamer/libs",
+    "//third_party/gstreamer/gstplugins_base",
+    "//third_party/gstreamer/gstplugins_base/gst-libs",
+    "//third_party/glib/glib",
+    "//third_party/glib",
+    "//third_party/glib/gmodule",
+    "//third_party/zlib",
+    "//third_party/libsoup",
+    "//third_party/gettext/gettext-runtime/intl",
+    "//third_party/bzip2",
   ]

   cflags = [
@@ -294,7 +338,9 @@ ohos_source_set("gstcoreelements_source") {
     "plugins/elements/gstqueue.c",
     "plugins/elements/gstqueue2.c",
     "plugins/elements/gsttee.c",
+    "plugins/elements/gstfilesink.c",
     "plugins/elements/gsttypefindelement.c",
+    "plugins/elements/gstfakesrc.c",
   ]

   configs = [ ":gstcoreelements_config" ]
@@ -358,6 +404,22 @@ ohos_shared_library("gstcoretracers") {
     ":gstreamer",
     "//third_party/glib:glib",
     "//third_party/glib:gobject",
+    "//third_party/bzip2:libbz2",
+    "//third_party/glib:glib",
+    "//third_party/glib:gobject",
+    "//third_party/gstreamer/gstplugins_base:gstaudio",
+    "//third_party/gstreamer/gstplugins_base:gstpbutils",
+    "//third_party/gstreamer/gstplugins_base:gstriff",
+    "//third_party/gstreamer/gstplugins_base:gsttag",
+    "//third_party/gstreamer/gstplugins_base:gstvideo",
+    "//third_party/gstreamer/gstplugins_base:gstrtsplib",
+    "//third_party/gstreamer/gstplugins_base:gstrtplib",
+    "//third_party/gstreamer/gstplugins_base:gstsdplib",
+    "//third_party/gstreamer/gstreamer:gstbase",
+    "//third_party/gstreamer/gstreamer:gstnet",
+    "//third_party/gstreamer/gstreamer:gstreamer",
+    "//third_party/glib:glib_packages",
+    "//third_party/glib:gmodule",
   ]

   relative_install_dir = "media/plugins"
diff --git a/gstreamer/plugins/elements/gstcoreelementselements.h b/gstreamer/plugins/elements/gstcoreelementselements.h
index c909171f..db875184 100644
--- a/gstreamer/plugins/elements/gstcoreelementselements.h
+++ b/gstreamer/plugins/elements/gstcoreelementselements.h
@@ -53,6 +53,8 @@ GST_ELEMENT_REGISTER_DECLARE (valve);
 #else
 GST_ELEMENT_REGISTER_DECLARE (capsfilter);
 GST_ELEMENT_REGISTER_DECLARE (fakesink);
+GST_ELEMENT_REGISTER_DECLARE (filesink);
+GST_ELEMENT_REGISTER_DECLARE (fakesrc);
 #if defined(HAVE_SYS_SOCKET_H) || defined(_MSC_VER)
 GST_ELEMENT_REGISTER_DECLARE (fdsrc);
 GST_ELEMENT_REGISTER_DECLARE (fdsink);
diff --git a/gstreamer/plugins/elements/gstcoreelementsplugin.c b/gstreamer/plugins/elements/gstcoreelementsplugin.c
index f80e1369..f8860984 100644
--- a/gstreamer/plugins/elements/gstcoreelementsplugin.c
+++ b/gstreamer/plugins/elements/gstcoreelementsplugin.c
@@ -80,6 +80,8 @@ plugin_init (GstPlugin * plugin)
   ret |= GST_ELEMENT_REGISTER (tee, plugin);
   ret |= GST_ELEMENT_REGISTER (typefind, plugin);
   ret |= GST_ELEMENT_REGISTER (multiqueue, plugin);
+  ret |= GST_ELEMENT_REGISTER (filesink, plugin);
+  ret |= GST_ELEMENT_REGISTER (fakesrc, plugin);
 #endif

   return ret;

5、third_party_glib仓修改

diff --git a/BUILD.gn b/BUILD.gn
index f738a47..87a1dc7 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -100,6 +100,7 @@ ohos_shared_library("glibpcre") {

 group("glib_packages") {
   deps = [
+    ":gio",
     ":glib",
     ":gmodule",
     ":gobject",
@@ -340,6 +341,310 @@ ohos_shared_library("gobject") {
 #############################################################################
 #############################################################################

+config("gio_config") {
+  visibility = [ ":*" ]
+  include_dirs = [
+    ".",
+    "gio",
+    "glib",
+    "gio/xdgmime",
+    "gio/inotify",
+    "gmodule",
+    "//third_party/gettext/gettext-runtime/intl",
+    "//third_party/zlib",
+  ]
+  cflags = [
+    "-DG_LOG_DOMAIN=\"GLib-GIO\"",
+
+    #"-DGOBJECT_COMPILATION",
+    "-Wno-sign-compare",
+    "-Wno-unused-function",
+    "-Wno-int-conversion",
+    "-DGIO_COMPILATION",
+    "-DGIO_MODULE_DIR=\"\"",
+    "-DLOCALSTATEDIR=\"var\"",
+    "-Wno-implicit-function-declaration",
+    "-Wno-format",
+    "-Wno-conditional-type-mismatch",
+    "-Wno-self-assign",
+    "-Wno-unused-value",
+    "-Wno-unused-function",
+    "-Wno-pointer-sign",
+    "-fvisibility=hidden",
+    "-DMAJOR_IN_SYSMACROS",
+    "-DG_ENABLE_DEBUG",
+  ]
+}
+
+ohos_source_set("gio_source") {
+  sources = [
+    # application_sources
+    "gio/gaction.c",
+    "gio/gactiongroup.c",
+    "gio/gactiongroupexporter.c",
+    "gio/gactionmap.c",
+    "gio/gapplication.c",
+    "gio/gapplicationcommandline.c",
+    "gio/gapplicationimpl-dbus.c",
+    "gio/gdbusactiongroup.c",
+    "gio/gdbusmenumodel.c",
+    "gio/gmenu.c",
+    "gio/gmenuexporter.c",
+    "gio/gmenumodel.c",
+    "gio/gnotification.c",
+    "gio/gnotificationbackend.c",
+    "gio/gpropertyaction.c",
+    "gio/gremoteactiongroup.c",
+    "gio/gsimpleaction.c",
+    "gio/gsimpleactiongroup.c",
+
+    # settings_sources
+    "gio/gdelayedsettingsbackend.c",
+    "gio/gkeyfilesettingsbackend.c",
+    "gio/gmemorysettingsbackend.c",
+    "gio/gnullsettingsbackend.c",
+    "gio/gsettings-mapping.c",
+    "gio/gsettings.c",
+    "gio/gsettingsbackend.c",
+    "gio/gsettingsschema.c",
+    "gio/gvdb/gvdb-reader.c",
+
+    # gdbus_sources
+    "gio/gdbusaddress.c",
+    "gio/gdbusauth.c",
+    "gio/gdbusauthmechanism.c",
+    "gio/gdbusauthmechanismanon.c",
+    "gio/gdbusauthmechanismexternal.c",
+    "gio/gdbusauthmechanismsha1.c",
+    "gio/gdbusauthobserver.c",
+    "gio/gdbusconnection.c",
+    "gio/gdbuserror.c",
+    "gio/gdbusinterface.c",
+    "gio/gdbusinterfaceskeleton.c",
+    "gio/gdbusintrospection.c",
+    "gio/gdbusmessage.c",
+    "gio/gdbusmethodinvocation.c",
+    "gio/gdbusnameowning.c",
+    "gio/gdbusnamewatching.c",
+    "gio/gdbusobject.c",
+    "gio/gdbusobjectmanager.c",
+    "gio/gdbusobjectmanagerclient.c",
+    "gio/gdbusobjectmanagerserver.c",
+    "gio/gdbusobjectproxy.c",
+    "gio/gdbusobjectskeleton.c",
+    "gio/gdbusprivate.c",
+    "gio/gdbusproxy.c",
+    "gio/gdbusserver.c",
+    "gio/gdbusutils.c",
+    "gio/gtestdbus.c",
+
+    # portal_sources
+    "gio/gdocumentportal.c",
+    "gio/gmemorymonitorportal.c",
+    "gio/gnetworkmonitorportal.c",
+    "gio/gopenuriportal.c",
+    "gio/gportalnotificationbackend.c",
+    "gio/gportalsupport.c",
+    "gio/gproxyresolverportal.c",
+    "gio/gtrashportal.c",
+
+    # local_sources
+    "gio/ghttpproxy.c",
+    "gio/glocalfile.c",
+    "gio/glocalfileenumerator.c",
+    "gio/glocalfileinfo.c",
+    "gio/glocalfileinputstream.c",
+    "gio/glocalfileiostream.c",
+    "gio/glocalfilemonitor.c",
+    "gio/glocalfileoutputstream.c",
+    "gio/glocalvfs.c",
+    "gio/gsocks4aproxy.c",
+    "gio/gsocks4proxy.c",
+    "gio/gsocks5proxy.c",
+    "gio/thumbnail-verify.c",
+
+    # unix_sources + HAVE_NETLINK
+    "gio/gnetworkmonitornetlink.c",
+    "gio/gnetworkmonitornm.c",
+
+    # unix_sources
+    "gio/gfdonotificationbackend.c",
+    "gio/gfiledescriptorbased.c",
+    "gio/ggtknotificationbackend.c",
+    "gio/giounix-private.c",
+    "gio/gunixconnection.c",
+    "gio/gunixcredentialsmessage.c",
+    "gio/gunixfdlist.c",
+    "gio/gunixfdmessage.c",
+    "gio/gunixinputstream.c",
+    "gio/gunixmount.c",
+    "gio/gunixmounts.c",
+    "gio/gunixoutputstream.c",
+    "gio/gunixsocketaddress.c",
+    "gio/gunixvolume.c",
+    "gio/gunixvolumemonitor.c",
+
+    # appinfo_sources
+    "gio/gdesktopappinfo.c",
+
+    # contenttype_sources
+    "gio/gcontenttype.c",
+
+    # gdbus_daemon_sources
+    "gio/gdbusdaemon.c",
+
+    # gio_sources
+    "gio/gappinfo.c",
+    "gio/gasynchelper.c",
+    "gio/gasyncinitable.c",
+    "gio/gasyncresult.c",
+    "gio/gbufferedinputstream.c",
+    "gio/gbufferedoutputstream.c",
+    "gio/gbytesicon.c",
+    "gio/gcancellable.c",
+    "gio/gcharsetconverter.c",
+    "gio/gcontextspecificgroup.c",
+    "gio/gconverter.c",
+    "gio/gconverterinputstream.c",
+    "gio/gconverteroutputstream.c",
+    "gio/gcredentials.c",
+    "gio/gdatagrambased.c",
+    "gio/gdatainputstream.c",
+    "gio/gdataoutputstream.c",
+    "gio/gdrive.c",
+    "gio/gdtlsclientconnection.c",
+    "gio/gdtlsconnection.c",
+    "gio/gdtlsserverconnection.c",
+    "gio/gdummyfile.c",
+    "gio/gdummyproxyresolver.c",
+    "gio/gdummytlsbackend.c",
+    "gio/gemblem.c",
+    "gio/gemblemedicon.c",
+    "gio/gfile.c",
+    "gio/gfileattribute.c",
+    "gio/gfileenumerator.c",
+    "gio/gfileicon.c",
+    "gio/gfileinfo.c",
+    "gio/gfileinputstream.c",
+    "gio/gfileiostream.c",
+    "gio/gfilemonitor.c",
+    "gio/gfilenamecompleter.c",
+    "gio/gfileoutputstream.c",
+    "gio/gfilterinputstream.c",
+    "gio/gfilteroutputstream.c",
+    "gio/gicon.c",
+    "gio/ginetaddress.c",
+    "gio/ginetaddressmask.c",
+    "gio/ginetsocketaddress.c",
+    "gio/ginitable.c",
+    "gio/ginputstream.c",
+    "gio/gioerror.c",
+    "gio/giomodule-priv.c",
+    "gio/giomodule.c",
+    "gio/gioscheduler.c",
+    "gio/giostream.c",
+    "gio/glistmodel.c",
+    "gio/gliststore.c",
+    "gio/gloadableicon.c",
+    "gio/gmarshal-internal.c",
+    "gio/gmemoryinputstream.c",
+    "gio/gmemorymonitor.c",
+    "gio/gmemorymonitordbus.c",
+    "gio/gmemoryoutputstream.c",
+    "gio/gmount.c",
+    "gio/gmountoperation.c",
+    "gio/gnativesocketaddress.c",
+    "gio/gnativevolumemonitor.c",
+    "gio/gnetworkaddress.c",
+    "gio/gnetworking.c",
+    "gio/gnetworkmonitor.c",
+    "gio/gnetworkmonitorbase.c",
+    "gio/gnetworkservice.c",
+    "gio/goutputstream.c",
+    "gio/gpermission.c",
+    "gio/gpollableinputstream.c",
+    "gio/gpollableoutputstream.c",
+    "gio/gpollableutils.c",
+    "gio/gpollfilemonitor.c",
+    "gio/gproxy.c",
+    "gio/gproxyaddress.c",
+    "gio/gproxyaddressenumerator.c",
+    "gio/gproxyresolver.c",
+    "gio/gresolver.c",
+    "gio/gresource.c",
+    "gio/gresourcefile.c",
+    "gio/gseekable.c",
+    "gio/gsimpleasyncresult.c",
+    "gio/gsimpleiostream.c",
+    "gio/gsimplepermission.c",
+    "gio/gsimpleproxyresolver.c",
+    "gio/gsocket.c",
+    "gio/gsocketaddress.c",
+    "gio/gsocketaddressenumerator.c",
+    "gio/gsocketclient.c",
+    "gio/gsocketconnectable.c",
+    "gio/gsocketconnection.c",
+    "gio/gsocketcontrolmessage.c",
+    "gio/gsocketinputstream.c",
+    "gio/gsocketlistener.c",
+    "gio/gsocketoutputstream.c",
+    "gio/gsocketservice.c",
+    "gio/gsrvtarget.c",
+    "gio/gsubprocess.c",
+    "gio/gsubprocesslauncher.c",
+    "gio/gtask.c",
+    "gio/gtcpconnection.c",
+    "gio/gtcpwrapperconnection.c",
+    "gio/gthemedicon.c",
+    "gio/gthreadedresolver.c",
+    "gio/gthreadedresolver.h",
+    "gio/gthreadedsocketservice.c",
+    "gio/gtlsbackend.c",
+    "gio/gtlscertificate.c",
+    "gio/gtlsclientconnection.c",
+    "gio/gtlsconnection.c",
+    "gio/gtlsdatabase.c",
+    "gio/gtlsfiledatabase.c",
+    "gio/gtlsinteraction.c",
+    "gio/gtlspassword.c",
+    "gio/gtlsserverconnection.c",
+    "gio/gunionvolumemonitor.c",
+    "gio/gvfs.c",
+    "gio/gvolume.c",
+    "gio/gvolumemonitor.c",
+    "gio/gzlibcompressor.c",
+    "gio/gzlibdecompressor.c",
+
+    # out
+    "gio/gdbus-daemon-generated.c",
+    "gio/gioenumtypes.c",
+    "gio/xdp-dbus.c",
+
+    # g type
+    "gio/gpowerprofilemonitordbus.c",
+    "gio/gdebugcontrollerdbus.c",
+    "gio/gpowerprofilemonitorportal.c",
+    "gio/gdebugcontroller.c",
+    "gio/gpowerprofilemonitor.c"
+  ]
+
+  configs = [ ":gio_config" ]
+}
+
+ohos_shared_library("gio") {
+  deps = [
+    ":ginotify",
+    ":gio_source",
+    ":glib",
+    ":gmodule",
+    ":gobject",
+    ":gxdgmime",
+    # "//third_party/gettext:libgettext",
+    "//third_party/zlib:libz",
+  ]
+  part_name = "glib"
+  subsystem_name = "thirdparty"
+}
 config("g_mem_dfx_config") {
   include_dirs = [
     "glibmemdfx",
@@ -386,3 +691,76 @@ ohos_shared_library("g_mem_dfx") {
   subsystem_name = "thirdparty"
   part_name = "glib"
 }
+
+config("ginotify_config") {
+  visibility = [ ":*" ]
+  include_dirs = [
+    ".",
+    "gmodule",
+    "glib",
+  ]
+  cflags = [
+    "-DXDG_PREFIX=_gio_xdg",
+    "-fvisibility=hidden",
+    "-Wno-shift-negative-value",
+    "-Wno-sign-compare",
+    "-DGIO_COMPILATION",
+  ]
+}
+
+ohos_source_set("ginotify_source") {
+  sources = [
+    "gio/inotify/ginotifyfilemonitor.c",
+    "gio/inotify/inotify-helper.c",
+    "gio/inotify/inotify-kernel.c",
+    "gio/inotify/inotify-missing.c",
+    "gio/inotify/inotify-path.c",
+    "gio/inotify/inotify-sub.c",
+  ]
+
+  configs = [ ":ginotify_config" ]
+}
+
+ohos_static_library("ginotify") {
+  deps = [ ":ginotify_source" ]
+  part_name = "glib"
+  subsystem_name = "thirdparty"
+}
+
+
+config("gxdgmime_config") {
+  visibility = [ ":*" ]
+  include_dirs = [
+    ".",
+    "gmodule",
+    "glib",
+  ]
+  cflags = [
+    "-DXDG_PREFIX=_gio_xdg",
+    "-fvisibility=hidden",
+    "-Wno-shift-negative-value",
+    "-Wno-sign-compare",
+    "-Wno-error"
+  ]
+}
+
+ohos_source_set("gxdgmime_source") {
+  sources = [
+    "gio/xdgmime/xdgmime.c",
+    "gio/xdgmime/xdgmimealias.c",
+    "gio/xdgmime/xdgmimecache.c",
+    "gio/xdgmime/xdgmimeglob.c",
+    "gio/xdgmime/xdgmimeicon.c",
+    "gio/xdgmime/xdgmimeint.c",
+    "gio/xdgmime/xdgmimemagic.c",
+    "gio/xdgmime/xdgmimeparent.c",
+  ]
+
+  configs = [ ":gxdgmime_config" ]
+}
+
+ohos_static_library("gxdgmime") {
+  deps = [ ":gxdgmime_source" ]
+  part_name = "glib"
+  subsystem_name = "thirdparty"
+}

itopen组织 1、提供OpenHarmony优雅实用的小工具 2、手把手适配riscv + qemu + linux的三方库移植 3、未来计划riscv + qemu + ohos的三方库移植 + 小程序开发 4、一切拥抱开源,拥抱国产化

©著作权归作者所有,转载或内容合作请联系作者

您尚未登录,无法参与评论,登录后可以:
参与开源共建问题交流
认同或收藏高质量问答
获取积分成为开源共建先驱

Copyright   ©2025  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

返回顶部