{"id":232,"date":"2022-01-25T02:39:58","date_gmt":"2022-01-25T02:39:58","guid":{"rendered":"https:\/\/www.hfrtc.top\/wordpress\/?p=232"},"modified":"2022-02-07T16:53:21","modified_gmt":"2022-02-07T08:53:21","slug":"janus-gateway-%e6%9e%b6%e6%9e%84%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"https:\/\/www.fanyamin.com\/wordpress\/?p=232","title":{"rendered":"Janus gateway \u67b6\u6784\u5206\u6790"},"content":{"rendered":"\n<p>It is a draft and not been done...<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"488\" src=\"https:\/\/www.hfrtc.top\/wordpress\/wp-content\/uploads\/2022\/01\/4AA1F8FB-1AFD-45E1-9B49-994A483AB984-1024x488.png\" alt=\"\" class=\"wp-image-242 img-fluid\" srcset=\"https:\/\/www.fanyamin.com\/wordpress\/wp-content\/uploads\/2022\/01\/4AA1F8FB-1AFD-45E1-9B49-994A483AB984-1024x488.png 1024w, https:\/\/www.fanyamin.com\/wordpress\/wp-content\/uploads\/2022\/01\/4AA1F8FB-1AFD-45E1-9B49-994A483AB984-300x143.png 300w, https:\/\/www.fanyamin.com\/wordpress\/wp-content\/uploads\/2022\/01\/4AA1F8FB-1AFD-45E1-9B49-994A483AB984-768x366.png 768w, https:\/\/www.fanyamin.com\/wordpress\/wp-content\/uploads\/2022\/01\/4AA1F8FB-1AFD-45E1-9B49-994A483AB984.png 1436w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u4e3b\u8981\u6d41\u7a0b\">\u4e3b\u8981\u6d41\u7a0b<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>\u542f\u52a8 Janus <ol><li>\u542f\u52a8\u7ebf\u7a0b\u6c60\uff0c\u6765\u5904\u7406\u6765\u81ea\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u548c\u6570\u636e<\/li><li>\u52a0\u8f7d\u4e8b\u4ef6\u5904\u7406\u5668<\/li><li>\u52a0\u8f7d\u6240\u6709\u63d2\u4ef6<\/li><li>\u52a0\u8f7d\u6240\u6709\u4f20\u8f93<\/li><\/ol><\/li><\/ol>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u914d\u7f6e\u6587\u4ef6\">\u914d\u7f6e\u6587\u4ef6<\/h2>\n\n\n\n<p>.jcfg \u662f\u4e00\u79cd\u4f20\u7edf\u7684 .ini \u589e\u5f3a\u7248\u7684\u683c\u5f0f libconfig format<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"plugin\">Plugin<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"440\" height=\"437\" src=\"https:\/\/www.hfrtc.top\/wordpress\/wp-content\/uploads\/2022\/01\/janus-plugin.png\" alt=\"\" class=\"wp-image-247 img-fluid\" srcset=\"https:\/\/www.fanyamin.com\/wordpress\/wp-content\/uploads\/2022\/01\/janus-plugin.png 440w, https:\/\/www.fanyamin.com\/wordpress\/wp-content\/uploads\/2022\/01\/janus-plugin-300x298.png 300w, https:\/\/www.fanyamin.com\/wordpress\/wp-content\/uploads\/2022\/01\/janus-plugin-150x150.png 150w\" sizes=\"(max-width: 440px) 100vw, 440px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>user->janus: create session\njanus-->user: session_123\nuser->janus: attach to plugin on session_123\njanus-->plugin1: new user instance\nuser->janus: attach handle xyz\njanus->plugin1: create_session()\nuser->janus: send_message\njanus->plugin1: handle_message()\nplugin1-->janus: ack\njanus-->user: ack\nplugin1->janus: push_event()\njanus->user: event<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"plugin-initiatialization\">Plugin initiatialization<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>init()<\/li><li>destroy()<\/li><li>get_name()<\/li><li>get_version()<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"plugin-session-management\">Plugin Session management<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>create_session()<\/li><li>handle_message()<\/li><li>handle_admin_message()<\/li><li>setup_media()<\/li><li>incoming_rtp()<\/li><li>incoming_rtcp()<\/li><li>incoming_data()<\/li><li>slow_link()<\/li><li>hangup_media()<\/li><li>query_session()<\/li><li>destroy_session()<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"plugin-interact-with-core\">Plugin interact with core<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>push_event()<\/li><li>relay_rtp()<\/li><li>relay_rtcp()<\/li><li>relay_data()<\/li><li>close_pc()<\/li><li>end_session()<\/li><li>event_is_enabled()<\/li><li>notify_event()<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"plugin-events-management\">Plugin events management<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>incoming_event()<\/li><li>handle_request()<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"echo-test-plugin\">Echo Test Plugin<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"request\">Request<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n        \"audio\" : true|false,\n        \"audiocodec\" : \"&lt;optional codec name; only used when creating a PeerConnection&gt;\",\n        \"video\" : true|false,\n        \"videocodec\" : \"&lt;optional codec name; only used when creating a PeerConnection&gt;\",\n        \"videoprofile\" : \"&lt;optional codec profile to force; only used when creating a PeerConnection, only valid for VP9 (0 or 2) and H.264 (e.g., 42e01f)&gt;\",\n        \"bitrate\" : &lt;numeric bitrate value&gt;,\n        \"record\" : true|false,\n        \"filename\" : &lt;base path\/filename to use for the recording&gt;,\n        \"substream\" : &lt;substream to receive (0-2), in case simulcasting is enabled&gt;,\n        \"temporal\" : &lt;temporal layers to receive (0-2), in case simulcasting is enabled&gt;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"janus-echotest-c\">janus_echotest.c<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>janus_plugin *create(void);\nint janus_echotest_init(janus_callbacks *callback, const char *config_path);\nvoid janus_echotest_destroy(void);\nint janus_echotest_get_api_compatibility(void);\nint janus_echotest_get_version(void);\nconst char *janus_echotest_get_version_string(void);\nconst char *janus_echotest_get_description(void);\nconst char *janus_echotest_get_name(void);\nconst char *janus_echotest_get_author(void);\nconst char *janus_echotest_get_package(void);\nvoid janus_echotest_create_session(janus_plugin_session *handle, int *error);\nstruct janus_plugin_result *janus_echotest_handle_message(janus_plugin_session *handle, char *transaction, json_t *message, json_t *jsep);\njson_t *janus_echotest_handle_admin_message(json_t *message);\nvoid janus_echotest_setup_media(janus_plugin_session *handle);\nvoid janus_echotest_incoming_rtp(janus_plugin_session *handle, janus_plugin_rtp *packet);\nvoid janus_echotest_incoming_rtcp(janus_plugin_session *handle, janus_plugin_rtcp *packet);\nvoid janus_echotest_incoming_data(janus_plugin_session *handle, janus_plugin_data *packet);\nvoid janus_echotest_data_ready(janus_plugin_session *handle);\nvoid janus_echotest_slow_link(janus_plugin_session *handle, int uplink, int video);\nvoid janus_echotest_hangup_media(janus_plugin_session *handle);\nvoid janus_echotest_destroy_session(janus_plugin_session *handle, int *error);\njson_t *janus_echotest_query_session(janus_plugin_session *handle);<\/code><\/pre>\n\n\n\n<p>Protocols<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/janus.conf.meetecho.com\/docs\/structjanus__ice__outgoing__traffic__coll__graph.png\" alt=\"Collaboration graph\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"dependencies\">Dependencies<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"glib\">Glib<\/h3>\n\n\n\n<p>GLib is a general-purpose, portable utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a mainloop abstraction, and so on.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is a draft and not been done&#8230; \u4e3b\u8981\u6d41\u7a0b \u542f\u52a8 Janus \u542f\u52a8\u7ebf\u7a0b\u6c60\uff0c\u6765\u5904\u7406\u6765\u81ea\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u548c\u6570\u636e \u52a0\u8f7d\u4e8b\u4ef6\u5904\u7406\u5668 \u52a0\u8f7d\u6240\u6709\u63d2\u4ef6 \u52a0\u8f7d\u6240\u6709\u4f20\u8f93 \u914d\u7f6e\u6587\u4ef6 .jcfg \u662f\u4e00\u79cd\u4f20\u7edf\u7684 .ini \u589e\u5f3a\u7248\u7684\u683c\u5f0f libconfig format Plugin Plugin initiatialization init() destroy() get_name() get_version() Plugin Session management create_session() handle_message() handle_admin_message() setup_media() incoming_rtp() incoming_rtcp() incoming_data() slow_link() hangup_media() query_session() destroy_session() Plugin interact with core push_event() relay_rtp() relay_rtcp() relay_data() close_pc() end_session() event_is_enabled() notify_event() [&hellip;] <a class=\"read-more\" href=\"https:\/\/www.fanyamin.com\/wordpress\/?p=232\" title=\"Permanent Link to: Janus gateway \u67b6\u6784\u5206\u6790\">&rarr;Read&nbsp;more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-232","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/232"}],"collection":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=232"}],"version-history":[{"count":6,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/232\/revisions"}],"predecessor-version":[{"id":305,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/232\/revisions\/305"}],"wp:attachment":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}