查看: 73|回复: 0

OpenHarmony-v4.1-Release分支适配rtsp流播放

[复制链接]

2

主题

2

回帖

18

积分

新手上路

积分
18
发表于 2025-4-13 08:32:59 | 显示全部楼层 |阅读模式
OpenHarmony本身当前本身并不支持rtsp拉流,但是我们经常又有rtsp播放的需求,因此我们需要移植gstreamer插件来完成我们的功能,关于适配rtsp,当前通过video标签来适配,具体适配过程涉及到build、multimedia_player_framework、arkui_ace_engine、third_party_gstreamer和third_party_glib等5个仓。具体的修改patch参见如下:
1、build仓修改
  1. diff --git a/compile_standard_whitelist.json b/compile_standard_whitelist.json
  2. index 99e19d10..d8ec2230 100644
  3. --- a/compile_standard_whitelist.json
  4. +++ b/compile_standard_whitelist.json
  5. @@ -89,6 +89,7 @@
  6.          "//device/soc/rockchip/rk3588/hardware/omx_il/osal:RkOMX_OSAL",
  7.          "//foundation/arkui/napi/sample/native_module_systemtest:systemtestnapi",
  8.          "//ide/tools/previewer:lite_previewer",
  9. +        "//third_party/glib:gio",
  10.          "//vendor/hihope/rk3568/bluetooth:libbt_vendor",
  11.          "//vendor/hihope/ipcamera/bluetooth:libbt_vendor"
  12.      ],
  13. @@ -424,6 +425,7 @@
  14.          "//test/xts/acts/hiviewdfx/utils/native:utilskit",
  15.          "//third_party/flutter/build/skia:ace_fontmgr_standard",
  16.          "//third_party/flutter/build/skia:skia_shared",
  17. +        "//third_party/glib:gio",
  18.          "//third_party/vk-gl-cts/framework/platform/ohos/rosen_context:rosen_context",
  19.          "//third_party/vk-gl-cts/framework/platform:libdeqp_ohos_platform",
  20.          "//third_party/libdrm:libdrm",
  21. @@ -532,6 +534,7 @@
  22.          "//foundation/communication/ipc/ipc/test/auxiliary/native:ipc_test_helper",
  23.          "//foundation/communication/ipc/ipc/test/auxiliary/native:ipc_test_helper_extra",
  24.          "//foundation/resourceschedule/memmgr/services/memmgrservice:memmgrservice",
  25. +        "//third_party/glib:gio",
  26.          "//test/xts/acts/arkui/ace_napi_test/entry/src/main/cpp:napitest",
  27.          "//test/xts/acts/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp:ImagePixelMapNDKTest",
  28.          "//test/xts/acts/multimedia/image/image_js_standard/imageReceiverNDK/entry/src/main/cpp:ImageReceiverNDKTest",
  29. @@ -650,6 +653,7 @@
  30.          "//foundation/window/window_manager/wmserver:libwms",
  31.          "//test/xts/acts/hiviewdfx/utils/native:utilskit",
  32.          "//test/xts/hats/hdf/display/composer/common:disp_dev_hdi_test",
  33. +        "//third_party/glib:gio",
  34.          "//third_party/libfuse:libfuse",
  35.          "//third_party/libdrm:libdrm",
  36.          "//wetools:wetools",
  37. @@ -829,6 +833,7 @@
  38.          "//third_party/flutter/build/skia:ace_fontmgr_windows",
  39.          "//third_party/flutter/build/skia:ace_xml",
  40.          "//third_party/flutter/build/skia:skia_shared",
  41. +        "//third_party/glib:gio",
  42.          "//third_party/glslang/OGLCompilersDLL:libdeqp_OGLCompiler",
  43.          "//third_party/glslang/SPIRV:SPIRV_source",
  44.          "//third_party/glslang/SPIRV:libdeqp_spirv",
复制代码
2、multimedia_player_framework仓修改
  1. diff --git a/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.cpp b/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.cpp
  2. index cfa0f35e..028c9a0e 100644
  3. --- a/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.cpp
  4. +++ b/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.cpp
  5. @@ -175,9 +175,13 @@ int32_t PlayBinCtrlerBase::SetSource(const std::string &url)
  6.      drmInfo_.clear();
  7.      if (url.find("http") == 0 || url.find("https") == 0 || EnableBufferingBySysParam()) {
  8.          isNetWorkPlay_ = true;
  9. +    } else if (url.find("rtsp") == 0) {
  10. +        uri_ = "rtsp://admin:wen1REN2fei3@10.20.72.100:554/Streaming/Channels/101";
  11. +        isRtspWorkPlay_ = true;
  12.      }
  13.      MEDIA_LOGI("Set source: %{public}s", url.c_str());
  14. +    MEDIA_LOGI("Set source: uri_ %{public}s", uri_.c_str());
  15.      return MSERR_OK;
  16. }
  17. @@ -1130,7 +1134,7 @@ void PlayBinCtrlerBase::HandleCacheCtrl(int32_t percent)
  18. void PlayBinCtrlerBase::HandleCacheCtrlCb(const InnerMessage &msg)
  19. {
  20. -    if (isNetWorkPlay_) {
  21. +    if (isNetWorkPlay_ || isRtspWorkPlay_) {
  22.          cachePercent_ = msg.detail1;
  23.          HandleCacheCtrl(cachePercent_);
  24.      }
  25. @@ -1491,7 +1495,7 @@ void PlayBinCtrlerBase::OnElementSetup(GstElement &elem)
  26. #endif
  27.      OnAdaptiveElementSetup(elem);
  28.      std::string elementName(GST_ELEMENT_NAME(&elem));
  29. -    if (isNetWorkPlay_ == false && elementName.find("uridecodebin") != std::string::npos) {
  30. +    if ((isNetWorkPlay_ == false || isRtspWorkPlay_ == false) && elementName.find("uridecodebin") != std::string::npos) {
  31.          PlayBinCtrlerWrapper *wrapper = new(std::nothrow) PlayBinCtrlerWrapper(shared_from_this());
  32.          CHECK_AND_RETURN_LOG(wrapper != nullptr, "can not create this wrapper");
  33.          gulong id = g_signal_connect_data(&elem, "autoplug-sort",
  34. diff --git a/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.h b/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.h
  35. index 60689eaf..54feb614 100644
  36. --- a/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.h
  37. +++ b/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.h
  38. @@ -265,6 +265,7 @@ private:
  39.      bool isBuffering_ = false;
  40.      bool isSelectBitRate_ = false;
  41.      bool isNetWorkPlay_ = false;
  42. +    bool isRtspWorkPlay_ = false;
  43.      bool isUserSetPlay_ = false;
  44.      bool isUserSetPause_ = false;
  45.      bool isReplay_ = false;
  46. @@ -296,4 +297,4 @@ private:
  47. };
  48. } // namespace Media
  49. } // namespace OHOS
  50. -#endif // PLAYBIN_CTRLER_BASE_H
  51. \ No newline at end of file
  52. +#endif // PLAYBIN_CTRLER_BASE_H
复制代码
3、arkui_ace_engine仓修改
  1. diff --git a/frameworks/core/components_ng/render/adapter/rosen_media_player.cpp b/frameworks/core/components_ng/render/adapter/rosen_media_player.cpp
  2. index d333c0c21f..0183cca3ef 100644
  3. --- a/frameworks/core/components_ng/render/adapter/rosen_media_player.cpp
  4. +++ b/frameworks/core/components_ng/render/adapter/rosen_media_player.cpp
  5. @@ -290,6 +290,12 @@ bool RosenMediaPlayer::SetMediaSource(std::string& filePath, int32_t& fd, bool&
  6.      } else if (StringUtils::StartWith(filePath, "resource://RAWFILE")) {
  7.          // file path: resource/rawfile/xxx.xx --> resource://rawfile/xxx.xx
  8.          return RawFilePlay(filePath);
  9. +    } else if (StringUtils::StartWith(filePath, "rtsp")) {
  10. +        // rtsp
  11. +        if (mediaPlayer_ && mediaPlayer_->SetSource(filePath) != 0) {
  12. +            LOGE("Player SetSource failed");
  13. +            return false;
  14. +        }
  15.      } else if (StringUtils::StartWith(filePath, "http")) {
  16.          // http or https
  17.          if (mediaPlayer_ && mediaPlayer_->SetSource(filePath) != 0) {
复制代码
4、third_party_gstreamer仓修改
  1. diff --git a/gstplugins_base/BUILD.gn b/gstplugins_base/BUILD.gn
  2. index d5a9d5dc..19337b47 100644
  3. --- a/gstplugins_base/BUILD.gn
  4. +++ b/gstplugins_base/BUILD.gn
  5. @@ -23,6 +23,10 @@ group("gstplugins_base_packages") {
  6.      ":gsttypefindfunctions",
  7.      ":gstvideoconvert",
  8.      ":gstvideoscale",
  9. +    ":gstsdplib",
  10. +    ":gstrtplib",
  11. +    ":gstrtsplib",
  12. +    ":gsttcp",
  13.    ]
  14. }
  15. @@ -72,6 +76,7 @@ ohos_source_set("gstplayback_source") {
  16.      "gst/playback/gstplaybackplugin.c",
  17.      "gst/playback/gstplaybackutils.c",
  18.      "gst/playback/gstplaybin2.c",
  19. +    "gst/playback/gstplaybin3.c",
  20.      "gst/playback/gstplaysink.c",
  21.      "gst/playback/gstplaysinkaudioconvert.c",
  22.      "gst/playback/gstplaysinkconvertbin.c",
  23. @@ -494,7 +499,7 @@ ohos_source_set("rtp_source") {
  24.    configs = [ ":gst_plugins_config" ]
  25. }
  26. -ohos_shared_library("gstrtp") {
  27. +ohos_shared_library("gstlibrtp") {
  28.    deps = [
  29.      ":rtp_source",
  30.      "//third_party/glib:glib",
  31. @@ -595,3 +600,137 @@ ohos_shared_library("gstapp_plugin") {
  32.    part_name = "gstreamer"
  33.    subsystem_name = "thirdparty"
  34. }
  35. +
  36. +ohos_source_set("sdplib_source") {
  37. +  sources = [
  38. +    "gst-libs/gst/sdp/gstmikey.c",
  39. +    "gst-libs/gst/sdp/gstsdpmessage.c",
  40. +  ]
  41. +
  42. +  configs = [ ":gst_plugins_config" ]
  43. +}
  44. +
  45. +ohos_shared_library("gstsdplib") {
  46. +  deps = [
  47. +    ":sdplib_source",
  48. +    "//third_party/glib:glib",
  49. +    "//third_party/glib:gobject",
  50. +    "//third_party/gstreamer/gstreamer:gstbase",
  51. +    "//third_party/gstreamer/gstreamer:gstreamer",
  52. +    "//third_party/gstreamer/gstplugins_base:gstrtplib",
  53. +    "//third_party/gstreamer/gstplugins_base:gstpbutils",
  54. +    "//third_party/glib:glib_packages",
  55. +    "//third_party/glib:glib",
  56. +    "//third_party/glib:gmodule",
  57. +    "//third_party/glib:gobject",
  58. +  ]
  59. +
  60. +  # relative_install_dir = "media/plugins"
  61. +  install_images = [ "system" ]
  62. +  part_name = "gstreamer"
  63. +  subsystem_name = "thirdparty"
  64. +}
  65. +
  66. +ohos_source_set("rtplib_source") {
  67. +  sources = [
  68. +    "gst-libs/gst/rtp/gstrtcpbuffer.c",
  69. +    "gst-libs/gst/rtp/gstrtp-enumtypes.c",
  70. +    "gst-libs/gst/rtp/gstrtpbaseaudiopayload.c",
  71. +    "gst-libs/gst/rtp/gstrtpbasedepayload.c",
  72. +    "gst-libs/gst/rtp/gstrtpbasepayload.c",
  73. +    "gst-libs/gst/rtp/gstrtpbuffer.c",
  74. +    "gst-libs/gst/rtp/gstrtphdrext.c",
  75. +    "gst-libs/gst/rtp/gstrtpmeta.c",
  76. +    "gst-libs/gst/rtp/gstrtppayloads.c",
  77. +  ]
  78. +
  79. +  configs = [ ":gst_plugins_config" ]
  80. +}
  81. +
  82. +ohos_shared_library("gstrtplib") {
  83. +  deps = [
  84. +    ":rtplib_source",
  85. +    "//third_party/glib:glib",
  86. +    "//third_party/glib:gobject",
  87. +    "//third_party/gstreamer/gstreamer:gstbase",
  88. +    "//third_party/gstreamer/gstreamer:gstreamer",
  89. +    "//third_party/glib:glib_packages",
  90. +    "//third_party/glib:glib",
  91. +    "//third_party/glib:gmodule",
  92. +    "//third_party/glib:gobject",
  93. +  ]
  94. +
  95. +  # relative_install_dir = "media/plugins"
  96. +  install_images = [ "system" ]
  97. +  part_name = "gstreamer"
  98. +  subsystem_name = "thirdparty"
  99. +}
  100. +
  101. +ohos_source_set("rtsplib_source") {
  102. +  sources = [
  103. +    "gst-libs/gst/rtsp/gstrtsp-enumtypes.c",
  104. +    "gst-libs/gst/rtsp/gstrtspconnection.c",
  105. +    "gst-libs/gst/rtsp/gstrtspdefs.c",
  106. +    "gst-libs/gst/rtsp/gstrtspextension.c",
  107. +    "gst-libs/gst/rtsp/gstrtspmessage.c",
  108. +    "gst-libs/gst/rtsp/gstrtsprange.c",
  109. +    "gst-libs/gst/rtsp/gstrtsptransport.c",
  110. +    "gst-libs/gst/rtsp/gstrtspurl.c",
  111. +  ]
  112. +
  113. +  configs = [ ":gst_plugins_config" ]
  114. +}
  115. +
  116. +ohos_shared_library("gstrtsplib") {
  117. +  deps = [
  118. +    ":rtsplib_source",
  119. +    "//third_party/glib:glib",
  120. +    "//third_party/glib:gobject",
  121. +    "//third_party/gstreamer/gstreamer:gstbase",
  122. +    "//third_party/gstreamer/gstreamer:gstreamer",
  123. +    "//third_party/glib:glib_packages",
  124. +    "//third_party/glib:glib",
  125. +    "//third_party/glib:gmodule",
  126. +    "//third_party/glib:gobject",
  127. +  ]
  128. +
  129. +  part_name = "gstreamer"
  130. +  subsystem_name = "thirdparty"
  131. +}
  132. +
  133. +ohos_source_set("tcp_source") {
  134. +  sources = [
  135. +    "./gst/tcp/gstmultifdsink.c",
  136. +    "./gst/tcp/gstmultihandlesink.c",
  137. +    "./gst/tcp/gstmultisocketsink.c",
  138. +    "./gst/tcp/gstsocketsrc.c",
  139. +    "./gst/tcp/gsttcpclientsink.c",
  140. +    "./gst/tcp/gsttcpclientsrc.c",
  141. +    "./gst/tcp/gsttcpelements.c",
  142. +    "./gst/tcp/gsttcpplugin.c",
  143. +    "./gst/tcp/gsttcpserversink.c",
  144. +    "./gst/tcp/gsttcpserversrc.c",
  145. +    "./gst/tcp/gsttcpsrcstats.c",
  146. +  ]
  147. +
  148. +  configs = [ ":gst_plugins_config" ]
  149. +}
  150. +
  151. +ohos_shared_library("gsttcp") {
  152. +  deps = [
  153. +    ":tcp_source",
  154. +    "//third_party/glib:glib",
  155. +    "//third_party/glib:gobject",
  156. +    "//third_party/gstreamer/gstreamer:gstbase",
  157. +    "//third_party/gstreamer/gstreamer:gstreamer",
  158. +    "//third_party/glib:glib_packages",
  159. +    "//third_party/glib:glib",
  160. +    "//third_party/glib:gmodule",
  161. +    "//third_party/glib:gobject",
  162. +    "//third_party/gstreamer/gstreamer:gstnet",
  163. +  ]
  164. +
  165. +  relative_install_dir = "media/plugins"
  166. +  part_name = "gstreamer"
  167. +  subsystem_name = "thirdparty"
  168. +}
  169. diff --git a/gstplugins_good/BUILD.gn b/gstplugins_good/BUILD.gn
  170. index 3616a918..e995059d 100644
  171. --- a/gstplugins_good/BUILD.gn
  172. +++ b/gstplugins_good/BUILD.gn
  173. @@ -15,12 +15,21 @@ import("//build/ohos.gni")
  174. group("gstplugins_good_packages") {
  175.    deps = [
  176. +    ":gstalpha",
  177.      ":gstaudiofx",
  178.      ":gstaudioparsers",
  179. +    ":gstauparse",
  180. +    ":gstavi",
  181.      ":gstisomp4",
  182.      ":gstmatroska",
  183.      ":gstmultifile",
  184. +    ":gstsoup",
  185.      ":gstwavparse",
  186. +    ":gstrtp",
  187. +    ":gstrtsp",
  188. +    ":gstrtsptest",
  189. +    ":gstudp",
  190. +    ":gstrtpmanager",
  191.    ]
  192. }
  193. @@ -41,7 +50,10 @@ config("gst_plugins_config") {
  194.      "//third_party/glib",
  195.      "//third_party/glib/gmodule",
  196.      "//third_party/zlib",
  197. +    "//third_party/libsoup",
  198. +    "//third_party/gettext/gettext-runtime/intl",
  199.      "//third_party/bzip2",
  200. +    "//device/soc/thead/c9xx/hardware/demo_log/include",
  201.    ]
  202.    cflags = [
  203. @@ -65,6 +77,32 @@ config("gst_plugins_config") {
  204.    ]
  205. }
  206. +ohos_source_set("alpha_source") {
  207. +  sources = [
  208. +    "gst/alpha/gstalpha.c",
  209. +    "gst/alpha/gstalphacolor.c",
  210. +  ]
  211. +
  212. +  configs = [ ":gst_plugins_config" ]
  213. +}
  214. +
  215. +ohos_shared_library("gstalpha") {
  216. +  deps = [
  217. +    ":alpha_source",
  218. +    "//third_party/glib:glib",
  219. +    "//third_party/glib:gobject",
  220. +    "//third_party/gstreamer/gstplugins_base:gstpbutils",
  221. +    "//third_party/gstreamer/gstplugins_base:gsttag",
  222. +    "//third_party/gstreamer/gstplugins_base:gstvideo",
  223. +    "//third_party/gstreamer/gstreamer:gstbase",
  224. +    "//third_party/gstreamer/gstreamer:gstreamer",
  225. +  ]
  226. +
  227. +  relative_install_dir = "media/plugins"
  228. +  part_name = "gstreamer"
  229. +  subsystem_name = "thirdparty"
  230. +}
  231. +
  232. ohos_source_set("audioparsers_source") {
  233.    sources = [
  234.      "gst/audioparsers/gstaacparse.c",
  235. @@ -92,6 +130,31 @@ ohos_shared_library("gstaudioparsers") {
  236.    subsystem_name = "thirdparty"
  237. }
  238. +ohos_source_set("auparse_source") {
  239. +  sources = [
  240. +    "gst/auparse/gstauparse.c",
  241. +  ]
  242. +
  243. +  configs = [ ":gst_plugins_config" ]
  244. +}
  245. +
  246. +ohos_shared_library("gstauparse") {
  247. +  deps = [
  248. +    ":auparse_source",
  249. +    "//third_party/glib:glib",
  250. +    "//third_party/glib:gobject",
  251. +    "//third_party/gstreamer/gstplugins_base:gstpbutils",
  252. +    "//third_party/gstreamer/gstplugins_base:gsttag",
  253. +    "//third_party/gstreamer/gstplugins_base:gstaudio",
  254. +    "//third_party/gstreamer/gstreamer:gstbase",
  255. +    "//third_party/gstreamer/gstreamer:gstreamer",
  256. +  ]
  257. +
  258. +  relative_install_dir = "media/plugins"
  259. +  part_name = "gstreamer"
  260. +  subsystem_name = "thirdparty"
  261. +}
  262. +
  263. ohos_source_set("autodetect_source") {
  264.    sources = [
  265.      "gst/autodetect/gstautoaudiosink.c",
  266. @@ -121,6 +184,35 @@ ohos_shared_library("gstautodetect") {
  267.    subsystem_name = "thirdparty"
  268. }
  269. +ohos_source_set("avi_source") {
  270. +  sources = [
  271. +    "gst/autodetect/gstautoaudiosink.c",
  272. +    "gst/autodetect/gstautoaudiosrc.c",
  273. +    "gst/autodetect/gstautodetect.c",
  274. +    "gst/autodetect/gstautodetectelement.c",
  275. +    "gst/autodetect/gstautodetectplugin.c",
  276. +    "gst/autodetect/gstautovideosink.c",
  277. +    "gst/autodetect/gstautovideosrc.c",
  278. +  ]
  279. +
  280. +  configs = [ ":gst_plugins_config" ]
  281. +}
  282. +
  283. +ohos_shared_library("gstavi") {
  284. +  deps = [
  285. +    ":avi_source",
  286. +    "//third_party/glib:glib",
  287. +    "//third_party/glib:gobject",
  288. +    "//third_party/gstreamer/gstplugins_base:gstpbutils",
  289. +    "//third_party/gstreamer/gstreamer:gstbase",
  290. +    "//third_party/gstreamer/gstreamer:gstreamer",
  291. +  ]
  292. +
  293. +  relative_install_dir = "media/plugins"
  294. +  part_name = "gstreamer"
  295. +  subsystem_name = "thirdparty"
  296. +}
  297. +
  298. ohos_source_set("id3demux_source") {
  299.    sources = [ "gst/id3demux/gstid3demux.c" ]
  300. @@ -259,6 +351,34 @@ ohos_shared_library("gstaudiofx") {
  301.    subsystem_name = "thirdparty"
  302. }
  303. +ohos_source_set("gstsoup_source") {
  304. +  sources = [
  305. +    "ext/soup/gstsoup.c",
  306. +    "ext/soup/gstsoupelement.c",
  307. +    "ext/soup/gstsouphttpsrc.c",
  308. +    "ext/soup/gstsouploader.c",
  309. +    "ext/soup/gstsouputils.c",
  310. +  ]
  311. +
  312. +  configs = [ ":gst_plugins_config" ]
  313. +}
  314. +
  315. +ohos_shared_library("gstsoup") {
  316. +  deps = [
  317. +    ":gstsoup_source",
  318. +    "//third_party/glib:gio",
  319. +    "//third_party/glib:glib",
  320. +    "//third_party/glib:gmodule",
  321. +    "//third_party/glib:gobject",
  322. +    "//third_party/gstreamer/gstplugins_base:gsttag",
  323. +    "//third_party/gstreamer/gstreamer:gstbase",
  324. +    "//third_party/gstreamer/gstreamer:gstreamer",
  325. +  ]
  326. +  relative_install_dir = "media/plugins"
  327. +  part_name = "gstreamer"
  328. +  subsystem_name = "thirdparty"
  329. +}
  330. +
  331. ohos_source_set("matroska_source") {
  332.    sources = [
  333.      "gst/matroska/ebml-read.c",
  334. @@ -293,3 +413,317 @@ ohos_shared_library("gstmatroska") {
  335.    part_name = "gstreamer"
  336.    subsystem_name = "thirdparty"
  337. }
  338. +
  339. +ohos_source_set("rtps_source") {
  340. +  sources = [
  341. +    "gst/rtp/dboolhuff.c",
  342. +    "gst/rtp/fnv1hash.c",
  343. +    "gst/rtp/gstasteriskh263.c",
  344. +    "gst/rtp/gstbuffermemory.c",
  345. +    "gst/rtp/gstrtpac3depay.c",
  346. +    "gst/rtp/gstrtpac3pay.c",
  347. +    "gst/rtp/gstrtpamrdepay.c",
  348. +    "gst/rtp/gstrtpamrpay.c",
  349. +    "gst/rtp/gstrtpbvdepay.c",
  350. +    "gst/rtp/gstrtpbvpay.c",
  351. +    "gst/rtp/gstrtp.c",
  352. +    "gst/rtp/gstrtpceltdepay.c",
  353. +    "gst/rtp/gstrtpceltpay.c",
  354. +    "gst/rtp/gstrtpchannels.c",
  355. +    "gst/rtp/gstrtpdvdepay.c",
  356. +    "gst/rtp/gstrtpdvpay.c",
  357. +    "gst/rtp/gstrtpelement.c",
  358. +    "gst/rtp/gstrtpg722depay.c",
  359. +    "gst/rtp/gstrtpg722pay.c",
  360. +    "gst/rtp/gstrtpg723depay.c",
  361. +    "gst/rtp/gstrtpg723pay.c",
  362. +    "gst/rtp/gstrtpg726depay.c",
  363. +    "gst/rtp/gstrtpg726pay.c",
  364. +    "gst/rtp/gstrtpg729depay.c",
  365. +    "gst/rtp/gstrtpg729pay.c",
  366. +    "gst/rtp/gstrtpgsmdepay.c",
  367. +    "gst/rtp/gstrtpgsmpay.c",
  368. +    "gst/rtp/gstrtpgstdepay.c",
  369. +    "gst/rtp/gstrtpgstpay.c",
  370. +    "gst/rtp/gstrtph261depay.c",
  371. +    "gst/rtp/gstrtph261pay.c",
  372. +    "gst/rtp/gstrtph263depay.c",
  373. +    "gst/rtp/gstrtph263pay.c",
  374. +    "gst/rtp/gstrtph263pdepay.c",
  375. +    "gst/rtp/gstrtph263ppay.c",
  376. +    "gst/rtp/gstrtph264depay.c",
  377. +    "gst/rtp/gstrtph264pay.c",
  378. +    "gst/rtp/gstrtph265depay.c",
  379. +    "gst/rtp/gstrtph265pay.c",
  380. +    "gst/rtp/gstrtphdrext-colorspace.c",
  381. +    "gst/rtp/gstrtpilbcdepay.c",
  382. +    "gst/rtp/gstrtpilbcpay.c",
  383. +    "gst/rtp/gstrtpisacdepay.c",
  384. +    "gst/rtp/gstrtpisacpay.c",
  385. +    "gst/rtp/gstrtpj2kdepay.c",
  386. +    "gst/rtp/gstrtpj2kpay.c",
  387. +    "gst/rtp/gstrtpjpegdepay.c",
  388. +    "gst/rtp/gstrtpjpegpay.c",
  389. +    "gst/rtp/gstrtpklvdepay.c",
  390. +    "gst/rtp/gstrtpklvpay.c",
  391. +    "gst/rtp/gstrtpL16depay.c",
  392. +    "gst/rtp/gstrtpL16pay.c",
  393. +    "gst/rtp/gstrtpL24depay.c",
  394. +    "gst/rtp/gstrtpL24pay.c",
  395. +    "gst/rtp/gstrtpL8depay.c",
  396. +    "gst/rtp/gstrtpL8pay.c",
  397. +    "gst/rtp/gstrtpldacpay.c",
  398. +    "gst/rtp/gstrtpmp1sdepay.c",
  399. +    "gst/rtp/gstrtpmp2tdepay.c",
  400. +    "gst/rtp/gstrtpmp2tpay.c",
  401. +    "gst/rtp/gstrtpmp4adepay.c",
  402. +    "gst/rtp/gstrtpmp4apay.c",
  403. +    "gst/rtp/gstrtpmp4gdepay.c",
  404. +    "gst/rtp/gstrtpmp4gpay.c",
  405. +    "gst/rtp/gstrtpmp4vdepay.c",
  406. +    "gst/rtp/gstrtpmp4vpay.c",
  407. +    "gst/rtp/gstrtpmpadepay.c",
  408. +    "gst/rtp/gstrtpmpapay.c",
  409. +    "gst/rtp/gstrtpmparobustdepay.c",
  410. +    "gst/rtp/gstrtpmpvdepay.c",
  411. +    "gst/rtp/gstrtpmpvpay.c",
  412. +    "gst/rtp/gstrtpopusdepay.c",
  413. +    "gst/rtp/gstrtpopuspay.c",
  414. +    "gst/rtp/gstrtppcmadepay.c",
  415. +    "gst/rtp/gstrtppcmapay.c",
  416. +    "gst/rtp/gstrtppcmudepay.c",
  417. +    "gst/rtp/gstrtppcmupay.c",
  418. +    "gst/rtp/gstrtpqcelpdepay.c",
  419. +    "gst/rtp/gstrtpqdmdepay.c",
  420. +    "gst/rtp/gstrtpreddec.c",
  421. +    "gst/rtp/gstrtpredenc.c",
  422. +    "gst/rtp/gstrtpsbcpay.c",
  423. +    "gst/rtp/gstrtpsirendepay.c",
  424. +    "gst/rtp/gstrtpsirenpay.c",
  425. +    "gst/rtp/gstrtpspeexdepay.c",
  426. +    "gst/rtp/gstrtpspeexpay.c",
  427. +    "gst/rtp/gstrtpstorage.c",
  428. +    "gst/rtp/gstrtpstreamdepay.c",
  429. +    "gst/rtp/gstrtpstreampay.c",
  430. +    "gst/rtp/gstrtpsv3vdepay.c",
  431. +    "gst/rtp/gstrtptheoradepay.c",
  432. +    "gst/rtp/gstrtptheorapay.c",
  433. +    "gst/rtp/gstrtpulpfecdec.c",
  434. +    "gst/rtp/gstrtpulpfecenc.c",
  435. +    "gst/rtp/gstrtputils.c",
  436. +    "gst/rtp/gstrtpvorbisdepay.c",
  437. +    "gst/rtp/gstrtpvorbispay.c",
  438. +    "gst/rtp/gstrtpvp8depay.c",
  439. +    "gst/rtp/gstrtpvp8pay.c",
  440. +    "gst/rtp/gstrtpvp9depay.c",
  441. +    "gst/rtp/gstrtpvp9pay.c",
  442. +    "gst/rtp/gstrtpvrawdepay.c",
  443. +    "gst/rtp/gstrtpvrawpay.c",
  444. +    "gst/rtp/rtpredcommon.c",
  445. +    "gst/rtp/rtpstorage.c",
  446. +    "gst/rtp/rtpstoragestream.c",
  447. +    "gst/rtp/rtpulpfeccommon.c",
  448. +  ]
  449. +
  450. +  configs = [ ":gst_plugins_config" ]
  451. +}
  452. +
  453. +ohos_shared_library("gstrtp") {
  454. +  deps = [
  455. +    ":rtps_source",
  456. +    "//third_party/bzip2:libbz2",
  457. +    "//third_party/glib:glib",
  458. +    "//third_party/glib:gobject",
  459. +    "//third_party/gstreamer/gstplugins_base:gstaudio",
  460. +    "//third_party/gstreamer/gstplugins_base:gstpbutils",
  461. +    "//third_party/gstreamer/gstplugins_base:gstriff",
  462. +    "//third_party/gstreamer/gstplugins_base:gsttag",
  463. +    "//third_party/gstreamer/gstplugins_base:gstvideo",
  464. +    "//third_party/gstreamer/gstplugins_base:gstrtsplib",
  465. +    "//third_party/gstreamer/gstplugins_base:gstrtplib",
  466. +    "//third_party/gstreamer/gstplugins_base:gstsdplib",
  467. +    "//third_party/gstreamer/gstreamer:gstbase",
  468. +    "//third_party/gstreamer/gstreamer:gstnet",
  469. +    "//third_party/gstreamer/gstreamer:gstreamer",
  470. +    "//third_party/glib:glib_packages",
  471. +    "//third_party/glib:glib",
  472. +    "//third_party/glib:gmodule",
  473. +    "//third_party/glib:gobject",
  474. +  ]
  475. +
  476. +  relative_install_dir = "media/plugins"
  477. +  part_name = "gstreamer"
  478. +  subsystem_name = "thirdparty"
  479. +}
  480. +
  481. +ohos_source_set("rtsp_source") {
  482. +  sources = [
  483. +    "gst/rtsp/gstrtpdec.c",
  484. +    "gst/rtsp/gstrtsp.c",
  485. +    "gst/rtsp/gstrtspelement.c",
  486. +    "gst/rtsp/gstrtspsrc.c",
  487. +    "gst/rtsp/gstrtspext.c",
  488. +  ]
  489. +
  490. +  configs = [ ":gst_plugins_config" ]
  491. +}
  492. +
  493. +ohos_shared_library("gstrtsp") {
  494. +  deps = [
  495. +    ":rtsp_source",
  496. +    "//third_party/bzip2:libbz2",
  497. +    "//third_party/glib:glib",
  498. +    "//third_party/glib:gobject",
  499. +    "//third_party/gstreamer/gstplugins_base:gstaudio",
  500. +    "//third_party/gstreamer/gstplugins_base:gstpbutils",
  501. +    "//third_party/gstreamer/gstplugins_base:gstriff",
  502. +    "//third_party/gstreamer/gstplugins_base:gsttag",
  503. +    "//third_party/gstreamer/gstplugins_base:gstvideo",
  504. +    "//third_party/gstreamer/gstplugins_base:gstrtsplib",
  505. +    "//third_party/gstreamer/gstplugins_base:gstrtplib",
  506. +    "//third_party/gstreamer/gstplugins_base:gstsdplib",
  507. +    "//third_party/gstreamer/gstplugins_base:gstplayback",
  508. +    "//third_party/gstreamer/gstreamer:gstbase",
  509. +    "//third_party/gstreamer/gstreamer:gstnet",
  510. +    "//third_party/gstreamer/gstreamer:gstreamer",
  511. +    "//third_party/glib:glib_packages",
  512. +    "//third_party/glib:glib",
  513. +    "//third_party/glib:gmodule",
  514. +    "//third_party/glib:gobject",
  515. +  ]
  516. +
  517. +  relative_install_dir = "media/plugins"
  518. +  part_name = "gstreamer"
  519. +  subsystem_name = "thirdparty"
  520. +}
  521. +
  522. +ohos_executable("gstrtsptest") {
  523. +  sources = [
  524. +    "//third_party/gstreamer/gstplugins_good/tests/examples/rtsp/test-onvif.c",
  525. +  ]
  526. +  configs = [ ":gst_plugins_config" ]
  527. +  deps = [
  528. +    "//third_party/bzip2:libbz2",
  529. +    "//third_party/glib:glib",
  530. +    "//third_party/glib:gobject",
  531. +    "//third_party/gstreamer/gstplugins_base:gstaudio",
  532. +    "//third_party/gstreamer/gstplugins_base:gstpbutils",
  533. +    "//third_party/gstreamer/gstplugins_base:gstriff",
  534. +    "//third_party/gstreamer/gstplugins_base:gsttag",
  535. +    "//third_party/gstreamer/gstplugins_base:gstvideo",
  536. +    "//third_party/gstreamer/gstplugins_base:gstrtsplib",
  537. +    "//third_party/gstreamer/gstplugins_base:gstrtplib",
  538. +    "//third_party/gstreamer/gstplugins_base:gstsdplib",
  539. +    "//third_party/gstreamer/gstreamer:gstbase",
  540. +    "//third_party/gstreamer/gstreamer:gstnet",
  541. +    "//third_party/gstreamer/gstreamer:gstreamer",
  542. +    "//third_party/glib:glib_packages",
  543. +    "//third_party/glib:glib",
  544. +    "//third_party/glib:gmodule",
  545. +    "//third_party/glib:gobject",
  546. +  ]
  547. +
  548. +  install_enable = true
  549. +  install_images = [ "system" ]
  550. +  part_name = "gstreamer"
  551. +  subsystem_name = "thirdparty"
  552. +}
  553. +
  554. +ohos_source_set("udp_source") {
  555. +  sources = [
  556. +    "gst/udp/gstdynudpsink.c",
  557. +    "gst/udp/gstmultiudpsink.c",
  558. +    "gst/udp/gstudp.c",
  559. +    "gst/udp/gstudpelement.c",
  560. +    "gst/udp/gstudpnetutils.c",
  561. +    "gst/udp/gstudpsink.c",
  562. +    "gst/udp/gstudpsrc.c",
  563. +  ]
  564. +
  565. +  configs = [ ":gst_plugins_config" ]
  566. +}
  567. +
  568. +ohos_shared_library("gstudp") {
  569. +  deps = [
  570. +    ":udp_source",
  571. +    "//third_party/bzip2:libbz2",
  572. +    "//third_party/glib:glib",
  573. +    "//third_party/glib:gobject",
  574. +    "//third_party/gstreamer/gstplugins_base:gstaudio",
  575. +    "//third_party/gstreamer/gstplugins_base:gstpbutils",
  576. +    "//third_party/gstreamer/gstplugins_base:gstriff",
  577. +    "//third_party/gstreamer/gstplugins_base:gsttag",
  578. +    "//third_party/gstreamer/gstplugins_base:gstvideo",
  579. +    "//third_party/gstreamer/gstplugins_base:gstrtsplib",
  580. +    "//third_party/gstreamer/gstplugins_base:gstrtplib",
  581. +    "//third_party/gstreamer/gstplugins_base:gstsdplib",
  582. +    "//third_party/gstreamer/gstreamer:gstbase",
  583. +    "//third_party/gstreamer/gstreamer:gstnet",
  584. +    "//third_party/gstreamer/gstreamer:gstreamer",
  585. +    "//third_party/glib:glib_packages",
  586. +    "//third_party/glib:glib",
  587. +    "//third_party/glib:gmodule",
  588. +    "//third_party/glib:gobject",
  589. +  ]
  590. +
  591. +  relative_install_dir = "media/plugins"
  592. +  part_name = "gstreamer"
  593. +  subsystem_name = "thirdparty"
  594. +}
  595. +
  596. +ohos_source_set("rtpmanager_source") {
  597. +  sources = [
  598. +    "gst/rtpmanager/gstrtpbin.c",
  599. +    "gst/rtpmanager/gstrtpdtmfmux.c",
  600. +    "gst/rtpmanager/gstrtpfunnel.c",
  601. +    "gst/rtpmanager/gstrtphdrext-clientaudiolevel.c",
  602. +    "gst/rtpmanager/gstrtphdrext-twcc.c",
  603. +    "gst/rtpmanager/gstrtpjitterbuffer.c",
  604. +    "gst/rtpmanager/gstrtpmanager.c",
  605. +    "gst/rtpmanager/gstrtpmux.c",
  606. +    "gst/rtpmanager/gstrtpptdemux.c",
  607. +    "gst/rtpmanager/gstrtprtxqueue.c",
  608. +    "gst/rtpmanager/gstrtprtxreceive.c",
  609. +    "gst/rtpmanager/gstrtprtxsend.c",
  610. +    "gst/rtpmanager/gstrtpsession.c",
  611. +    "gst/rtpmanager/gstrtpssrcdemux.c",
  612. +    "gst/rtpmanager/gstrtpst2022-1-fecdec.c",
  613. +    "gst/rtpmanager/gstrtpst2022-1-fecenc.c",
  614. +    "gst/rtpmanager/rtpjitterbuffer.c",
  615. +    "gst/rtpmanager/rtpsession.c",
  616. +    "gst/rtpmanager/rtpsource.c",
  617. +    "gst/rtpmanager/rtpstats.c",
  618. +    "gst/rtpmanager/rtptimerqueue.c",
  619. +    "gst/rtpmanager/rtptwcc.c",
  620. +  ]
  621. +
  622. +  configs = [ ":gst_plugins_config" ]
  623. +}
  624. +
  625. +ohos_shared_library("gstrtpmanager") {
  626. +  deps = [
  627. +    ":rtpmanager_source",
  628. +    "//third_party/bzip2:libbz2",
  629. +    "//third_party/glib:glib",
  630. +    "//third_party/glib:gobject",
  631. +    "//third_party/gstreamer/gstplugins_base:gstaudio",
  632. +    "//third_party/gstreamer/gstplugins_base:gstpbutils",
  633. +    "//third_party/gstreamer/gstplugins_base:gstriff",
  634. +    "//third_party/gstreamer/gstplugins_base:gsttag",
  635. +    "//third_party/gstreamer/gstplugins_base:gstvideo",
  636. +    "//third_party/gstreamer/gstplugins_base:gstrtsplib",
  637. +    "//third_party/gstreamer/gstplugins_base:gstrtplib",
  638. +    "//third_party/gstreamer/gstplugins_base:gstsdplib",
  639. +    "//third_party/gstreamer/gstreamer:gstbase",
  640. +    "//third_party/gstreamer/gstreamer:gstnet",
  641. +    "//third_party/gstreamer/gstreamer:gstreamer",
  642. +    "//third_party/glib:glib_packages",
  643. +    "//third_party/glib:glib",
  644. +    "//third_party/glib:gmodule",
  645. +    "//third_party/glib:gobject",
  646. +  ]
  647. +
  648. +  relative_install_dir = "media/plugins"
  649. +  part_name = "gstreamer"
  650. +  subsystem_name = "thirdparty"
  651. +}
  652. diff --git a/gstplugins_good/gst/rtp/gstrtp.c b/gstplugins_good/gst/rtp/gstrtp.c
  653. index 9528ffb1..4e761e0e 100644
  654. --- a/gstplugins_good/gst/rtp/gstrtp.c
  655. +++ b/gstplugins_good/gst/rtp/gstrtp.c
  656. @@ -101,7 +101,7 @@ plugin_init (GstPlugin * plugin)
  657.    ret |= GST_ELEMENT_REGISTER (rtpmp4gpay, plugin);
  658.    ret |= GST_ELEMENT_REGISTER (rtpqcelpdepay, plugin);
  659.    ret |= GST_ELEMENT_REGISTER (rtpqdm2depay, plugin);
  660. -  ret |= GST_ELEMENT_REGISTER (rtpsbcdepay, plugin);
  661. +  /* ret |= GST_ELEMENT_REGISTER (rtpsbcdepay, plugin); */
  662.    ret |= GST_ELEMENT_REGISTER (rtpsbcpay, plugin);
  663.    ret |= GST_ELEMENT_REGISTER (rtpsirenpay, plugin);
  664.    ret |= GST_ELEMENT_REGISTER (rtpsirendepay, plugin);
  665. diff --git a/gstplugins_good/gst/udp/gstudpsrc.c b/gstplugins_good/gst/udp/gstudpsrc.c
  666. index f9570074..bde3142b 100644
  667. --- a/gstplugins_good/gst/udp/gstudpsrc.c
  668. +++ b/gstplugins_good/gst/udp/gstudpsrc.c
  669. @@ -105,7 +105,9 @@
  670.   * Also all these have to be before glib.h is included as
  671.   * otherwise struct in6_pktinfo is not defined completely
  672.   * due to broken glibc headers */
  673. +#ifndef _GNU_SOURCE
  674. #define _GNU_SOURCE
  675. +#endif
  676. /* Needed for OSX/iOS to define the IPv6 variants */
  677. #define __APPLE_USE_RFC_3542
  678. #include
  679. diff --git a/gstplugins_good/tests/examples/rtsp/test-onvif.c b/gstplugins_good/tests/examples/rtsp/test-onvif.c
  680. index 2f47445e..111bc4d1 100644
  681. --- a/gstplugins_good/tests/examples/rtsp/test-onvif.c
  682. +++ b/gstplugins_good/tests/examples/rtsp/test-onvif.c
  683. @@ -86,7 +86,7 @@ main (int argc, char *argv[])
  684.    if (argc >= 2)
  685.      location = argv[1];
  686.    else
  687. -    location = "rtsp://127.0.0.1:8554/test";
  688. +    location = "rtsp://admin:nbt123456@10.20.72.51:554/Streaming/Channels/101";
  689.    loop = g_main_loop_new (NULL, FALSE);
  690. diff --git a/gstreamer/BUILD.gn b/gstreamer/BUILD.gn
  691. index 3ceb9f16..f11552bc 100644
  692. --- a/gstreamer/BUILD.gn
  693. +++ b/gstreamer/BUILD.gn
  694. @@ -18,6 +18,7 @@ group("gstreamer_packages") {
  695.      ":gst-inspect",
  696.      ":gst-launch",
  697.      ":gstbase",
  698. +    ":gstnet",
  699.      ":gstcoreelements",
  700.      ":gstreamer",
  701.    ]
  702. @@ -253,6 +254,34 @@ ohos_shared_library("gstbase") {
  703.    subsystem_name = "thirdparty"
  704. }
  705. +ohos_source_set("gstnet_source") {
  706. +  sources = [
  707. +    "libs/gst/net/gstnetaddressmeta.c",
  708. +    "libs/gst/net/gstnetclientclock.c",
  709. +    "libs/gst/net/gstnetcontrolmessagemeta.c",
  710. +    "libs/gst/net/gstnettimepacket.c",
  711. +    "libs/gst/net/gstnettimeprovider.c",
  712. +    "libs/gst/net/gstnetutils.c",
  713. +    "libs/gst/net/gstntppacket.c",
  714. +    "libs/gst/net/gstptpclock.c",
  715. +  ]
  716. +
  717. +  configs = [ ":gstbase_config" ]
  718. +}
  719. +
  720. +ohos_shared_library("gstnet") {
  721. +  deps = [
  722. +    ":gstnet_source",
  723. +    ":gstreamer",
  724. +    "//third_party/glib:gobject",
  725. +    "//third_party/glib:glib_packages",
  726. +    "//third_party/glib:glib",
  727. +    "//third_party/glib:gmodule",
  728. +  ]
  729. +  part_name = "gstreamer"
  730. +  subsystem_name = "thirdparty"
  731. +}
  732. +
  733. config("gstcoreelements_config") {
  734.    include_dirs = [
  735.      ".",
  736. @@ -262,6 +291,21 @@ config("gstcoreelements_config") {
  737.      "//third_party/glib/glib",
  738.      "//third_party/glib",
  739.      "//third_party/glib/gmodule",
  740. +    "//third_party/gstreamer/gstplugins_good/gst/rtsp",
  741. +    "//third_party/gstreamer/gstplugins_good/gst-libs",
  742. +    "//third_party/gstreamer/gstplugins_good/gst/isomp4",
  743. +    "//third_party/gstreamer/gstplugins_good/gst/audiofx",
  744. +    "//third_party/gstreamer/gstreamer",
  745. +    "//third_party/gstreamer/gstreamer/libs",
  746. +    "//third_party/gstreamer/gstplugins_base",
  747. +    "//third_party/gstreamer/gstplugins_base/gst-libs",
  748. +    "//third_party/glib/glib",
  749. +    "//third_party/glib",
  750. +    "//third_party/glib/gmodule",
  751. +    "//third_party/zlib",
  752. +    "//third_party/libsoup",
  753. +    "//third_party/gettext/gettext-runtime/intl",
  754. +    "//third_party/bzip2",
  755.    ]
  756.    cflags = [
  757. @@ -294,7 +338,9 @@ ohos_source_set("gstcoreelements_source") {
  758.      "plugins/elements/gstqueue.c",
  759.      "plugins/elements/gstqueue2.c",
  760.      "plugins/elements/gsttee.c",
  761. +    "plugins/elements/gstfilesink.c",
  762.      "plugins/elements/gsttypefindelement.c",
  763. +    "plugins/elements/gstfakesrc.c",
  764.    ]
  765.    configs = [ ":gstcoreelements_config" ]
  766. @@ -358,6 +404,22 @@ ohos_shared_library("gstcoretracers") {
  767.      ":gstreamer",
  768.      "//third_party/glib:glib",
  769.      "//third_party/glib:gobject",
  770. +    "//third_party/bzip2:libbz2",
  771. +    "//third_party/glib:glib",
  772. +    "//third_party/glib:gobject",
  773. +    "//third_party/gstreamer/gstplugins_base:gstaudio",
  774. +    "//third_party/gstreamer/gstplugins_base:gstpbutils",
  775. +    "//third_party/gstreamer/gstplugins_base:gstriff",
  776. +    "//third_party/gstreamer/gstplugins_base:gsttag",
  777. +    "//third_party/gstreamer/gstplugins_base:gstvideo",
  778. +    "//third_party/gstreamer/gstplugins_base:gstrtsplib",
  779. +    "//third_party/gstreamer/gstplugins_base:gstrtplib",
  780. +    "//third_party/gstreamer/gstplugins_base:gstsdplib",
  781. +    "//third_party/gstreamer/gstreamer:gstbase",
  782. +    "//third_party/gstreamer/gstreamer:gstnet",
  783. +    "//third_party/gstreamer/gstreamer:gstreamer",
  784. +    "//third_party/glib:glib_packages",
  785. +    "//third_party/glib:gmodule",
  786.    ]
  787.    relative_install_dir = "media/plugins"
  788. diff --git a/gstreamer/plugins/elements/gstcoreelementselements.h b/gstreamer/plugins/elements/gstcoreelementselements.h
  789. index c909171f..db875184 100644
  790. --- a/gstreamer/plugins/elements/gstcoreelementselements.h
  791. +++ b/gstreamer/plugins/elements/gstcoreelementselements.h
  792. @@ -53,6 +53,8 @@ GST_ELEMENT_REGISTER_DECLARE (valve);
  793. #else
  794. GST_ELEMENT_REGISTER_DECLARE (capsfilter);
  795. GST_ELEMENT_REGISTER_DECLARE (fakesink);
  796. +GST_ELEMENT_REGISTER_DECLARE (filesink);
  797. +GST_ELEMENT_REGISTER_DECLARE (fakesrc);
  798. #if defined(HAVE_SYS_SOCKET_H) || defined(_MSC_VER)
  799. GST_ELEMENT_REGISTER_DECLARE (fdsrc);
  800. GST_ELEMENT_REGISTER_DECLARE (fdsink);
  801. diff --git a/gstreamer/plugins/elements/gstcoreelementsplugin.c b/gstreamer/plugins/elements/gstcoreelementsplugin.c
  802. index f80e1369..f8860984 100644
  803. --- a/gstreamer/plugins/elements/gstcoreelementsplugin.c
  804. +++ b/gstreamer/plugins/elements/gstcoreelementsplugin.c
  805. @@ -80,6 +80,8 @@ plugin_init (GstPlugin * plugin)
  806.    ret |= GST_ELEMENT_REGISTER (tee, plugin);
  807.    ret |= GST_ELEMENT_REGISTER (typefind, plugin);
  808.    ret |= GST_ELEMENT_REGISTER (multiqueue, plugin);
  809. +  ret |= GST_ELEMENT_REGISTER (filesink, plugin);
  810. +  ret |= GST_ELEMENT_REGISTER (fakesrc, plugin);
  811. #endif
  812.    return ret;
复制代码
5、third_party_glib仓修改
  1. diff --git a/BUILD.gn b/BUILD.gn
  2. index f738a47..87a1dc7 100644
  3. --- a/BUILD.gn
  4. +++ b/BUILD.gn
  5. @@ -100,6 +100,7 @@ ohos_shared_library("glibpcre") {
  6. group("glib_packages") {
  7.    deps = [
  8. +    ":gio",
  9.      ":glib",
  10.      ":gmodule",
  11.      ":gobject",
  12. @@ -340,6 +341,310 @@ ohos_shared_library("gobject") {
  13. #############################################################################
  14. #############################################################################
  15. +config("gio_config") {
  16. +  visibility = [ ":*" ]
  17. +  include_dirs = [
  18. +    ".",
  19. +    "gio",
  20. +    "glib",
  21. +    "gio/xdgmime",
  22. +    "gio/inotify",
  23. +    "gmodule",
  24. +    "//third_party/gettext/gettext-runtime/intl",
  25. +    "//third_party/zlib",
  26. +  ]
  27. +  cflags = [
  28. +    "-DG_LOG_DOMAIN="GLib-GIO"",
  29. +
  30. +    #"-DGOBJECT_COMPILATION",
  31. +    "-Wno-sign-compare",
  32. +    "-Wno-unused-function",
  33. +    "-Wno-int-conversion",
  34. +    "-DGIO_COMPILATION",
  35. +    "-DGIO_MODULE_DIR=""",
  36. +    "-DLOCALSTATEDIR="var"",
  37. +    "-Wno-implicit-function-declaration",
  38. +    "-Wno-format",
  39. +    "-Wno-conditional-type-mismatch",
  40. +    "-Wno-self-assign",
  41. +    "-Wno-unused-value",
  42. +    "-Wno-unused-function",
  43. +    "-Wno-pointer-sign",
  44. +    "-fvisibility=hidden",
  45. +    "-DMAJOR_IN_SYSMACROS",
  46. +    "-DG_ENABLE_DEBUG",
  47. +  ]
  48. +}
  49. +
  50. +ohos_source_set("gio_source") {
  51. +  sources = [
  52. +    # application_sources
  53. +    "gio/gaction.c",
  54. +    "gio/gactiongroup.c",
  55. +    "gio/gactiongroupexporter.c",
  56. +    "gio/gactionmap.c",
  57. +    "gio/gapplication.c",
  58. +    "gio/gapplicationcommandline.c",
  59. +    "gio/gapplicationimpl-dbus.c",
  60. +    "gio/gdbusactiongroup.c",
  61. +    "gio/gdbusmenumodel.c",
  62. +    "gio/gmenu.c",
  63. +    "gio/gmenuexporter.c",
  64. +    "gio/gmenumodel.c",
  65. +    "gio/gnotification.c",
  66. +    "gio/gnotificationbackend.c",
  67. +    "gio/gpropertyaction.c",
  68. +    "gio/gremoteactiongroup.c",
  69. +    "gio/gsimpleaction.c",
  70. +    "gio/gsimpleactiongroup.c",
  71. +
  72. +    # settings_sources
  73. +    "gio/gdelayedsettingsbackend.c",
  74. +    "gio/gkeyfilesettingsbackend.c",
  75. +    "gio/gmemorysettingsbackend.c",
  76. +    "gio/gnullsettingsbackend.c",
  77. +    "gio/gsettings-mapping.c",
  78. +    "gio/gsettings.c",
  79. +    "gio/gsettingsbackend.c",
  80. +    "gio/gsettingsschema.c",
  81. +    "gio/gvdb/gvdb-reader.c",
  82. +
  83. +    # gdbus_sources
  84. +    "gio/gdbusaddress.c",
  85. +    "gio/gdbusauth.c",
  86. +    "gio/gdbusauthmechanism.c",
  87. +    "gio/gdbusauthmechanismanon.c",
  88. +    "gio/gdbusauthmechanismexternal.c",
  89. +    "gio/gdbusauthmechanismsha1.c",
  90. +    "gio/gdbusauthobserver.c",
  91. +    "gio/gdbusconnection.c",
  92. +    "gio/gdbuserror.c",
  93. +    "gio/gdbusinterface.c",
  94. +    "gio/gdbusinterfaceskeleton.c",
  95. +    "gio/gdbusintrospection.c",
  96. +    "gio/gdbusmessage.c",
  97. +    "gio/gdbusmethodinvocation.c",
  98. +    "gio/gdbusnameowning.c",
  99. +    "gio/gdbusnamewatching.c",
  100. +    "gio/gdbusobject.c",
  101. +    "gio/gdbusobjectmanager.c",
  102. +    "gio/gdbusobjectmanagerclient.c",
  103. +    "gio/gdbusobjectmanagerserver.c",
  104. +    "gio/gdbusobjectproxy.c",
  105. +    "gio/gdbusobjectskeleton.c",
  106. +    "gio/gdbusprivate.c",
  107. +    "gio/gdbusproxy.c",
  108. +    "gio/gdbusserver.c",
  109. +    "gio/gdbusutils.c",
  110. +    "gio/gtestdbus.c",
  111. +
  112. +    # portal_sources
  113. +    "gio/gdocumentportal.c",
  114. +    "gio/gmemorymonitorportal.c",
  115. +    "gio/gnetworkmonitorportal.c",
  116. +    "gio/gopenuriportal.c",
  117. +    "gio/gportalnotificationbackend.c",
  118. +    "gio/gportalsupport.c",
  119. +    "gio/gproxyresolverportal.c",
  120. +    "gio/gtrashportal.c",
  121. +
  122. +    # local_sources
  123. +    "gio/ghttpproxy.c",
  124. +    "gio/glocalfile.c",
  125. +    "gio/glocalfileenumerator.c",
  126. +    "gio/glocalfileinfo.c",
  127. +    "gio/glocalfileinputstream.c",
  128. +    "gio/glocalfileiostream.c",
  129. +    "gio/glocalfilemonitor.c",
  130. +    "gio/glocalfileoutputstream.c",
  131. +    "gio/glocalvfs.c",
  132. +    "gio/gsocks4aproxy.c",
  133. +    "gio/gsocks4proxy.c",
  134. +    "gio/gsocks5proxy.c",
  135. +    "gio/thumbnail-verify.c",
  136. +
  137. +    # unix_sources + HAVE_NETLINK
  138. +    "gio/gnetworkmonitornetlink.c",
  139. +    "gio/gnetworkmonitornm.c",
  140. +
  141. +    # unix_sources
  142. +    "gio/gfdonotificationbackend.c",
  143. +    "gio/gfiledescriptorbased.c",
  144. +    "gio/ggtknotificationbackend.c",
  145. +    "gio/giounix-private.c",
  146. +    "gio/gunixconnection.c",
  147. +    "gio/gunixcredentialsmessage.c",
  148. +    "gio/gunixfdlist.c",
  149. +    "gio/gunixfdmessage.c",
  150. +    "gio/gunixinputstream.c",
  151. +    "gio/gunixmount.c",
  152. +    "gio/gunixmounts.c",
  153. +    "gio/gunixoutputstream.c",
  154. +    "gio/gunixsocketaddress.c",
  155. +    "gio/gunixvolume.c",
  156. +    "gio/gunixvolumemonitor.c",
  157. +
  158. +    # appinfo_sources
  159. +    "gio/gdesktopappinfo.c",
  160. +
  161. +    # contenttype_sources
  162. +    "gio/gcontenttype.c",
  163. +
  164. +    # gdbus_daemon_sources
  165. +    "gio/gdbusdaemon.c",
  166. +
  167. +    # gio_sources
  168. +    "gio/gappinfo.c",
  169. +    "gio/gasynchelper.c",
  170. +    "gio/gasyncinitable.c",
  171. +    "gio/gasyncresult.c",
  172. +    "gio/gbufferedinputstream.c",
  173. +    "gio/gbufferedoutputstream.c",
  174. +    "gio/gbytesicon.c",
  175. +    "gio/gcancellable.c",
  176. +    "gio/gcharsetconverter.c",
  177. +    "gio/gcontextspecificgroup.c",
  178. +    "gio/gconverter.c",
  179. +    "gio/gconverterinputstream.c",
  180. +    "gio/gconverteroutputstream.c",
  181. +    "gio/gcredentials.c",
  182. +    "gio/gdatagrambased.c",
  183. +    "gio/gdatainputstream.c",
  184. +    "gio/gdataoutputstream.c",
  185. +    "gio/gdrive.c",
  186. +    "gio/gdtlsclientconnection.c",
  187. +    "gio/gdtlsconnection.c",
  188. +    "gio/gdtlsserverconnection.c",
  189. +    "gio/gdummyfile.c",
  190. +    "gio/gdummyproxyresolver.c",
  191. +    "gio/gdummytlsbackend.c",
  192. +    "gio/gemblem.c",
  193. +    "gio/gemblemedicon.c",
  194. +    "gio/gfile.c",
  195. +    "gio/gfileattribute.c",
  196. +    "gio/gfileenumerator.c",
  197. +    "gio/gfileicon.c",
  198. +    "gio/gfileinfo.c",
  199. +    "gio/gfileinputstream.c",
  200. +    "gio/gfileiostream.c",
  201. +    "gio/gfilemonitor.c",
  202. +    "gio/gfilenamecompleter.c",
  203. +    "gio/gfileoutputstream.c",
  204. +    "gio/gfilterinputstream.c",
  205. +    "gio/gfilteroutputstream.c",
  206. +    "gio/gicon.c",
  207. +    "gio/ginetaddress.c",
  208. +    "gio/ginetaddressmask.c",
  209. +    "gio/ginetsocketaddress.c",
  210. +    "gio/ginitable.c",
  211. +    "gio/ginputstream.c",
  212. +    "gio/gioerror.c",
  213. +    "gio/giomodule-priv.c",
  214. +    "gio/giomodule.c",
  215. +    "gio/gioscheduler.c",
  216. +    "gio/giostream.c",
  217. +    "gio/glistmodel.c",
  218. +    "gio/gliststore.c",
  219. +    "gio/gloadableicon.c",
  220. +    "gio/gmarshal-internal.c",
  221. +    "gio/gmemoryinputstream.c",
  222. +    "gio/gmemorymonitor.c",
  223. +    "gio/gmemorymonitordbus.c",
  224. +    "gio/gmemoryoutputstream.c",
  225. +    "gio/gmount.c",
  226. +    "gio/gmountoperation.c",
  227. +    "gio/gnativesocketaddress.c",
  228. +    "gio/gnativevolumemonitor.c",
  229. +    "gio/gnetworkaddress.c",
  230. +    "gio/gnetworking.c",
  231. +    "gio/gnetworkmonitor.c",
  232. +    "gio/gnetworkmonitorbase.c",
  233. +    "gio/gnetworkservice.c",
  234. +    "gio/goutputstream.c",
  235. +    "gio/gpermission.c",
  236. +    "gio/gpollableinputstream.c",
  237. +    "gio/gpollableoutputstream.c",
  238. +    "gio/gpollableutils.c",
  239. +    "gio/gpollfilemonitor.c",
  240. +    "gio/gproxy.c",
  241. +    "gio/gproxyaddress.c",
  242. +    "gio/gproxyaddressenumerator.c",
  243. +    "gio/gproxyresolver.c",
  244. +    "gio/gresolver.c",
  245. +    "gio/gresource.c",
  246. +    "gio/gresourcefile.c",
  247. +    "gio/gseekable.c",
  248. +    "gio/gsimpleasyncresult.c",
  249. +    "gio/gsimpleiostream.c",
  250. +    "gio/gsimplepermission.c",
  251. +    "gio/gsimpleproxyresolver.c",
  252. +    "gio/gsocket.c",
  253. +    "gio/gsocketaddress.c",
  254. +    "gio/gsocketaddressenumerator.c",
  255. +    "gio/gsocketclient.c",
  256. +    "gio/gsocketconnectable.c",
  257. +    "gio/gsocketconnection.c",
  258. +    "gio/gsocketcontrolmessage.c",
  259. +    "gio/gsocketinputstream.c",
  260. +    "gio/gsocketlistener.c",
  261. +    "gio/gsocketoutputstream.c",
  262. +    "gio/gsocketservice.c",
  263. +    "gio/gsrvtarget.c",
  264. +    "gio/gsubprocess.c",
  265. +    "gio/gsubprocesslauncher.c",
  266. +    "gio/gtask.c",
  267. +    "gio/gtcpconnection.c",
  268. +    "gio/gtcpwrapperconnection.c",
  269. +    "gio/gthemedicon.c",
  270. +    "gio/gthreadedresolver.c",
  271. +    "gio/gthreadedresolver.h",
  272. +    "gio/gthreadedsocketservice.c",
  273. +    "gio/gtlsbackend.c",
  274. +    "gio/gtlscertificate.c",
  275. +    "gio/gtlsclientconnection.c",
  276. +    "gio/gtlsconnection.c",
  277. +    "gio/gtlsdatabase.c",
  278. +    "gio/gtlsfiledatabase.c",
  279. +    "gio/gtlsinteraction.c",
  280. +    "gio/gtlspassword.c",
  281. +    "gio/gtlsserverconnection.c",
  282. +    "gio/gunionvolumemonitor.c",
  283. +    "gio/gvfs.c",
  284. +    "gio/gvolume.c",
  285. +    "gio/gvolumemonitor.c",
  286. +    "gio/gzlibcompressor.c",
  287. +    "gio/gzlibdecompressor.c",
  288. +
  289. +    # out
  290. +    "gio/gdbus-daemon-generated.c",
  291. +    "gio/gioenumtypes.c",
  292. +    "gio/xdp-dbus.c",
  293. +
  294. +    # g type
  295. +    "gio/gpowerprofilemonitordbus.c",
  296. +    "gio/gdebugcontrollerdbus.c",
  297. +    "gio/gpowerprofilemonitorportal.c",
  298. +    "gio/gdebugcontroller.c",
  299. +    "gio/gpowerprofilemonitor.c"
  300. +  ]
  301. +
  302. +  configs = [ ":gio_config" ]
  303. +}
  304. +
  305. +ohos_shared_library("gio") {
  306. +  deps = [
  307. +    ":ginotify",
  308. +    ":gio_source",
  309. +    ":glib",
  310. +    ":gmodule",
  311. +    ":gobject",
  312. +    ":gxdgmime",
  313. +    # "//third_party/gettext:libgettext",
  314. +    "//third_party/zlib:libz",
  315. +  ]
  316. +  part_name = "glib"
  317. +  subsystem_name = "thirdparty"
  318. +}
  319. config("g_mem_dfx_config") {
  320.    include_dirs = [
  321.      "glibmemdfx",
  322. @@ -386,3 +691,76 @@ ohos_shared_library("g_mem_dfx") {
  323.    subsystem_name = "thirdparty"
  324.    part_name = "glib"
  325. }
  326. +
  327. +config("ginotify_config") {
  328. +  visibility = [ ":*" ]
  329. +  include_dirs = [
  330. +    ".",
  331. +    "gmodule",
  332. +    "glib",
  333. +  ]
  334. +  cflags = [
  335. +    "-DXDG_PREFIX=_gio_xdg",
  336. +    "-fvisibility=hidden",
  337. +    "-Wno-shift-negative-value",
  338. +    "-Wno-sign-compare",
  339. +    "-DGIO_COMPILATION",
  340. +  ]
  341. +}
  342. +
  343. +ohos_source_set("ginotify_source") {
  344. +  sources = [
  345. +    "gio/inotify/ginotifyfilemonitor.c",
  346. +    "gio/inotify/inotify-helper.c",
  347. +    "gio/inotify/inotify-kernel.c",
  348. +    "gio/inotify/inotify-missing.c",
  349. +    "gio/inotify/inotify-path.c",
  350. +    "gio/inotify/inotify-sub.c",
  351. +  ]
  352. +
  353. +  configs = [ ":ginotify_config" ]
  354. +}
  355. +
  356. +ohos_static_library("ginotify") {
  357. +  deps = [ ":ginotify_source" ]
  358. +  part_name = "glib"
  359. +  subsystem_name = "thirdparty"
  360. +}
  361. +
  362. +
  363. +config("gxdgmime_config") {
  364. +  visibility = [ ":*" ]
  365. +  include_dirs = [
  366. +    ".",
  367. +    "gmodule",
  368. +    "glib",
  369. +  ]
  370. +  cflags = [
  371. +    "-DXDG_PREFIX=_gio_xdg",
  372. +    "-fvisibility=hidden",
  373. +    "-Wno-shift-negative-value",
  374. +    "-Wno-sign-compare",
  375. +    "-Wno-error"
  376. +  ]
  377. +}
  378. +
  379. +ohos_source_set("gxdgmime_source") {
  380. +  sources = [
  381. +    "gio/xdgmime/xdgmime.c",
  382. +    "gio/xdgmime/xdgmimealias.c",
  383. +    "gio/xdgmime/xdgmimecache.c",
  384. +    "gio/xdgmime/xdgmimeglob.c",
  385. +    "gio/xdgmime/xdgmimeicon.c",
  386. +    "gio/xdgmime/xdgmimeint.c",
  387. +    "gio/xdgmime/xdgmimemagic.c",
  388. +    "gio/xdgmime/xdgmimeparent.c",
  389. +  ]
  390. +
  391. +  configs = [ ":gxdgmime_config" ]
  392. +}
  393. +
  394. +ohos_static_library("gxdgmime") {
  395. +  deps = [ ":gxdgmime_source" ]
  396. +  part_name = "glib"
  397. +  subsystem_name = "thirdparty"
  398. +}
复制代码
itopen组织1、提供OpenHarmony优雅实用的小工具2、手把手适配riscv + qemu + linux的三方库移植3、未来计划riscv + qemu + ohos的三方库移植 + 小程序开发4、一切拥抱开源,拥抱国产化
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表