WebrtcNode, publish-sdp offer 流程(1)

2024-01-17 19:50

本文主要是介绍WebrtcNode, publish-sdp offer 流程(1),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1. AmqpClient - New message received

sdp offer 的消息

AmqpClient - RpcServer New message received {method: 'onTransportSignaling',args: ['aa230ce0863e42baa8bae5c14e91e809',{sdp: 'v=0\r\n' +'o=- 2367615733001925388 2 IN IP4 127.0.0.1\r\n' +'s=-\r\n' +'t=0 0\r\n' +'a=group:BUNDLE 0 1\r\n' +'a=msid-semantic: WMS MediaStream-0176f9fc-a754-4838-b002-0bdda6d4deaa\r\n' +'m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126\r\n' +'c=IN IP4 0.0.0.0\r\n' +'a=rtcp:9 IN IP4 0.0.0.0\r\n' +'a=ice-ufrag:YH25\r\n' +'a=ice-pwd:l47tWnjyoR1kn3nR0JWjuotU\r\n' +'a=ice-options:trickle\r\n' +'a=fingerprint:sha-256 65:8A:AE:75:0E:6B:50:51:A4:93:A4:01:76:43:3D:83:26:31:E7:75:B8:8A:DC:D4:13:78:14:4E:4D:0B:93:3E\r\n' +'a=setup:actpass\r\n' +'a=mid:0\r\n' +'a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\n' +'a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\n' +'a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\n' +'a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\n' +'a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\n' +'a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\n' +'a=sendonly\r\n' +'a=msid:MediaStream-0176f9fc-a754-4838-b002-0bdda6d4deaa AudioTrack-abd86f8a-1f74-4c73-b6fa-c20f5b175a1d\r\n' +'a=rtcp-mux\r\n' +'a=rtpmap:111 opus/48000/2\r\n' +'a=rtcp-fb:111 transport-cc\r\n' +'a=fmtp:111 minptime=10;useinbandfec=1\r\n' +'a=rtpmap:103 ISAC/16000\r\n' +'a=rtpmap:104 ISAC/32000\r\n' +'a=rtpmap:9 G722/8000\r\n' +'a=rtpmap:102 ILBC/8000\r\n' +'a=rtpmap:0 PCMU/8000\r\n' +'a=rtpmap:8 PCMA/8000\r\n' +'a=rtpmap:106 CN/32000\r\n' +'a=rtpmap:105 CN/16000\r\n' +'a=rtpmap:13 CN/8000\r\n' +'a=rtpmap:110 telephone-event/48000\r\n' +'a=rtpmap:112 telephone-event/32000\r\n' +'a=rtpmap:113 telephone-event/16000\r\n' +'a=rtpmap:126 telephone-event/8000\r\n' +'a=ssrc:3582341671 cname:JTBK6RkjYuislL5i\r\n' +'a=ssrc:3582341671 msid:MediaStream-0176f9fc-a754-4838-b002-0bdda6d4deaa AudioTrack-abd86f8a-1f74-4c73-b6fa-c20f5b175a1d\r\n' +'a=ssrc:3582341671 mslabel:MediaStream-0176f9fc-a754-4838-b002-0bdda6d4deaa\r\n' +'a=ssrc:3582341671 label:AudioTrack-abd86f8a-1f74-4c73-b6fa-c20f5b175a1d\r\n' +'m=video 9 UDP/TLS/RTP/SAVPF 123 114 115 116 119\r\n' +'c=IN IP4 0.0.0.0\r\n' +'a=rtcp:9 IN IP4 0.0.0.0\r\n' +'a=ice-ufrag:YH25\r\n' +'a=ice-pwd:l47tWnjyoR1kn3nR0JWjuotU\r\n' +'a=ice-options:trickle\r\n' +'a=fingerprint:sha-256 65:8A:AE:75:0E:6B:50:51:A4:93:A4:01:76:43:3D:83:26:31:E7:75:B8:8A:DC:D4:13:78:14:4E:4D:0B:93:3E\r\n' +'a=setup:actpass\r\n' +'a=mid:1\r\n' +'a=extmap:14 urn:ietf:params:rtp-hdrext:toffset\r\n' +'a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\n' +'a=extmap:13 urn:3gpp:video-orientation\r\n' +'a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\n' +'a=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\n' +'a=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\n' +'a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\n' +'a=extmap:8 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07\r\n' +'a=extmap:9 http://www.webrtc.org/experiments/rtp-hdrext/color-space\r\n' +'a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\n' +'a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\n' +'a=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\n' +'a=sendonly\r\n' +'a=msid:MediaStream-0176f9fc-a754-4838-b002-0bdda6d4deaa VideoTrack-3e9cd783-7906-49e1-8887-99736156a1d2\r\n' +'a=rtcp-mux\r\n' +'a=rtcp-rsize\r\n' +'a=rtpmap:123 AV1/90000\r\n' +'a=rtcp-fb:123 goog-remb\r\n' +'a=rtcp-fb:123 transport-cc\r\n' +'a=rtcp-fb:123 ccm fir\r\n' +'a=rtcp-fb:123 nack\r\n' +'a=rtcp-fb:123 nack pli\r\n' +'a=rtpmap:114 red/90000\r\n' +'a=rtpmap:115 rtx/90000\r\n' +'a=fmtp:115 apt=114\r\n' +'a=rtpmap:116 ulpfec/90000\r\n' +'a=rtpmap:119 rtx/90000\r\n' +'a=fmtp:119 apt=123\r\n' +'a=ssrc-group:FID 4143402920 1935417042\r\n' +'a=ssrc:4143402920 cname:JTBK6RkjYuislL5i\r\n' +'a=ssrc:4143402920 msid:MediaStream-0176f9fc-a754-4838-b002-0bdda6d4deaa VideoTrack-3e9cd783-7906-49e1-8887-99736156a1d2\r\n' +'a=ssrc:4143402920 mslabel:MediaStream-0176f9fc-a754-4838-b002-0bdda6d4deaa\r\n' +'a=ssrc:4143402920 label:VideoTrack-3e9cd783-7906-49e1-8887-99736156a1d2\r\n' +'a=ssrc:1935417042 cname:JTBK6RkjYuislL5i\r\n' +'a=ssrc:1935417042 msid:MediaStream-0176f9fc-a754-4838-b002-0bdda6d4deaa VideoTrack-3e9cd783-7906-49e1-8887-99736156a1d2\r\n' +'a=ssrc:1935417042 mslabel:MediaStream-0176f9fc-a754-4838-b002-0bdda6d4deaa\r\n' +'a=ssrc:1935417042 label:VideoTrack-3e9cd783-7906-49e1-8887-99736156a1d2\r\n',type: 'offer'}],corrID: 14,replyTo: 'amq.gen-pj6CYWZ4AOsOkYmlAePDEA'
}

2. WebrtcNode - onTransportSignaling

dist/webrtc_agent/webrtc/index.js

// connectionId 应该就是operationId
that.onTransportSignaling = function (connectionId, msg, callback) {log.debug('onTransportSignaling, connection id:', connectionId, 'msg:', msg);// 通过 operationId 从mappingTransports 获取 transportId,// 接着通过transportId从peerConnections 获取WrtcConnection// 参考小结 2.1var conn = getWebRTCConnection(connectionId);// WrtcConnection connif (conn) {// 参考小结 2.2conn.onSignalling(msg, connectionId);callback('callback', 'ok');} else {callback('callback', 'error', 'Connection does NOT exist:' + connectionId);}};

2.1 WebrtcNode - getWebRTCConnection——返回WrtcConnection

dist/webrtc_agent/webrtc/index.js

    // 返回的是WrtcConnectionvar getWebRTCConnection = function (operationId) {// 在WebrtcNode-createWebRTCConnection 创建var transportId = mappingTransports.get(operationId);if (peerConnections.has(transportId)) {return peerConnections.get(transportId);}return null;};

2.2 WrtcConnection.onSignalling

dist/webrtc_agent/webrtc/wrtcConnection.js

处理 offer sdp。

  that.onSignalling = function (msg, operationId) {var processSignalling = function () {// 这里type=’offer‘if (msg.type === 'offer') {log.debug('on offer:', msg.sdp);processOffer(msg.sdp);} else if (msg.type === 'candidate') {...} else if (msg.type === 'removed-candidates') {...}};// wrtc 是 Connectionif (wrtc) {processSignalling();} else {// should not reach herelog.error('wrtc is not ready');}};

2.3 ==========WrtcConnection.processOffer

dist/webrtc_agent/webrtc/wrtcConnection.js

这里的 remoteSdp 是null,

 const processOffer = function (sdp) {// 第一进来,remoteSdp 是nullif (!remoteSdp) {// First offerremoteSdp = new SdpInfo(sdp);// Check mid, 获取到mid 数组const mids = remoteSdp.mids();for (const mid of mids) {// 设置finalformatprocessOfferMedia(mid);}// 创建answer sdplocalSdp = remoteSdp.answer();// Setup transportlet opId = null;for (const mid of mids) {if (remoteSdp.getMediaPort(mid) !== 0) {opId = setupTransport(mid);}}if (opId) {on_track({type: 'tracks-complete',operationId: opId});}} else {...}};
  var remoteSdp = null;var localSdp = null;
2.3.1 SdpInfo.SdpInfo

dist/webrtc_agent/webrtc/sdpInfo.js

2.3.2 WrtcConnection.processOfferMedia——设置finalformat

WrtcConnection.addTrackOperation, 创建了元素operationMap

设置finalFormat

 const processOfferMedia = function (mid) {...// Determine media format in offerif (remoteSdp.mediaType(mid) === 'audio') {const audioPreference = operationMap.get(mid).formatPreference;const audioFormat = remoteSdp.filterAudioPayload(mid, audioPreference);operationMap.get(mid).finalFormat = audioFormat;} else if (remoteSdp.mediaType(mid) === 'video') {const videoPreference = operationMap.get(mid).formatPreference;const videoFormat = remoteSdp.filterVideoPayload(mid, videoPreference);operationMap.get(mid).finalFormat = videoFormat;}};

operationMap 的元素就是WrtcConnection.addTrackOperation中添加的,这里是给finalFormat赋值

// mid => { operationId, sdpDirection, type, formatPreference, rids, enabled, finalFormat }var operationMap = new Map();

dist/webrtc_agent/webrtc/wrtcConnection.js,在WebrtcNode-publish流程.md 的addTrackOperation 小节 有详细说明。

2.3.3 SdpInfo.answer——localSdp

通过offer到sdp,进行对应的修改,作为answer的sdp。赋值给localSdp中,在WrtcConnection.setupTransport用到。

 answer() {const answer = new SdpInfo(this.toString());answer.obj.origin = {username: '-',sessionId: '0',sessionVersion: 0,netType: 'IN',ipVer: 4,address: '127.0.0.1'};answer.obj.media.forEach(mediaInfo => {mediaInfo.port = 1;mediaInfo.rtcp = {port: 1,netType: 'IN',ipVer: 4,address: '0.0.0.0'};if (mediaInfo.setup === 'active') {mediaInfo.setup = 'passive';} else {mediaInfo.setup = 'active';}delete mediaInfo.iceOptions;  delete mediaInfo.rtcpRsize;if (mediaInfo.direction === 'recvonly') {mediaInfo.direction = 'sendonly';} else if (mediaInfo.direction === 'sendonly') {delete mediaInfo.msid;delete mediaInfo.ssrcGroups;delete mediaInfo.ssrcs;mediaInfo.direction = 'recvonly';}if (mediaInfo.ext && Array.isArray(mediaInfo.ext)) {const extMappings = ['urn:ietf:params:rtp-hdrext:ssrc-audio-level',// 'http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01','urn:ietf:params:rtp-hdrext:sdes:mid','urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id','urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id','urn:ietf:params:rtp-hdrext:toffset','http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time',// 'urn:3gpp:video-orientation',// 'http://www.webrtc.org/experiments/rtp-hdrext/playout-delay',];if (mediaInfo.type === 'video') {extMappings.push('http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01');}mediaInfo.ext = mediaInfo.ext.filter((e) => {return extMappings.includes(e.uri);});}if (mediaInfo.rids && Array.isArray(mediaInfo.rids)) {// Reverse rids directionmediaInfo.rids.forEach(r => {r.direction = (r.direction === 'send') ? 'recv' : 'send';});}if (mediaInfo.simulcast) {// Reverse simulcast directionif (mediaInfo.simulcast.dir1 === 'send') {mediaInfo.simulcast.dir1 = 'recv';} else {mediaInfo.simulcast.dir1 = 'send';}}});return answer;}
SdpInfo.getMediaPort
SdpInfo.mediaType
operationMap——存放的是track相关的内容

dist/webrtc_agent/webrtc/wrtcConnection.js

WebrtcNode-publish流程.md 的addTrackOperation 小节 有详细说明

  // mid => { operationId, sdpDirection, type, formatPreference, rids, enabled, finalFormat }var operationMap = new Map();
2.3.4 WrtcConnection.setupTransport——创建WrtcStream

dist/webrtc_agent/webrtc/wrtcConnection.js

小节 3

2.3.5 on_track——这是创建WrtcConnection 传入的callback,tracks-complete

WebrtcNode-publish流程.md3.WebrtcNode - createWebRTCConnection——返回WrtcConnection 中传入了

function onTrack(trackInfo) {handleTrackInfo(transportId, trackInfo, controller);}

调用的代码

        on_track({type: 'tracks-complete',operationId: opId});

详细的看3.3, 3.4 小节

3. WrtcConnection.setupTransport——创建WrtcStream

主要是创建MediaStream。

dist/webrtc_agent/webrtc/wrtcConnection.js

const setupTransport = function (mid) {let rids = remoteSdp.rids(mid);const opSettings = operationMap.get(mid);const direction = (opSettings.sdpDirection === 'sendonly') ? 'in' : 'out';const simSsrcs = remoteSdp.getLegacySimulcast(mid);const trackSettings = remoteSdp.getMediaSettings(mid);const mediaType = remoteSdp.mediaType(mid);trackSettings.owner = owner;trackSettings.enableBWE = that.enableBWE;if (opSettings.finalFormat) {trackSettings[mediaType].format = opSettings.finalFormat;if (opSettings.finalFormat.codec === 'vp9' && simSsrcs) {// Legacy simulcast for VP9 SVCrids = null;trackSettings['video'].scalabilityMode = opSettings.scalabilityMode;}}if (rids) {...} else {// 走这里的代码// No simulcastif (!trackMap.has(mid)) {// 1. Connection wrtctrackMap.set(mid, new WrtcStream(mid, wrtc, direction, trackSettings));// Set ssrc in local sdp for out direction// direct 是inif (direction === 'out') {...}// 2. Connection wrtc// remoteSdp 是在processOffer 创建的对象wrtc.setRemoteSdp(remoteSdp.singleMediaSdp(mid).toString(), mid);// 3. Notify new track, 详细见小节 3.3, 3.4on_track({type: 'track-added',track: trackMap.get(mid),operationId: opSettings.operationId,mid: mid});} else {log.warn(`Conflict trackId ${mid} for ${wrtcId}`);}}return opSettings.operationId;};

SdpInfo.rids

trackMap 属性——存放了WrtcStream

  // composedId => WrtcStreamvar trackMap = new Map();

composeId

  const composeId = function (mid, rid) {return mid + ':' + rid;};

3.1 new WrtcStream

小节 4
创建了MediaStream

3.2 Connection.setRemoteSdp

// streamId = mid
setRemoteSdp(sdp, streamId) {// webRtcConnection wrtcthis.wrtc.setRemoteSdp(sdp, streamId || this.id);}
3.2.1 NAN_METHOD(WebRtcConnection::setRemoteSdp)
NAN_METHOD(WebRtcConnection::setRemoteSdp) {WebRtcConnection* obj = Nan::ObjectWrap::Unwrap<WebRtcConnection>(info.Holder());std::shared_ptr<erizo::WebRtcConnection> me = obj->me;if (!me) {return;}std::string sdp = getString(info[0]);std::string stream_id = getString(info[1]);bool r = me->setRemoteSdp(sdp, stream_id);info.GetReturnValue().Set(Nan::New(r));
}
3.2.2 WebRtcConnection::setRemoteSdp
bool WebRtcConnection::setRemoteSdpInfo(std::shared_ptr<SdpInfo> sdp, std::string stream_id) {asyncTask([sdp, stream_id] (std::shared_ptr<WebRtcConnection> connection) {ELOG_DEBUG("%s message: setting remote SDPInfo", connection->toLog());if (!connection->sending_) {return;}connection->remote_sdp_ = sdp;// mid connection->processRemoteSdp(stream_id);});return true;
}
??? WebRtcConnection::processRemoteSdp

source/agent/webrtc/rtcConn/erizo/src/erizo/WebRtcConnection.cpp

SdpInfo.singleMediaSdp

dist-debug/webrtc_agent/webrtc/sdpInfo.js

  singleMediaSdp(mid) {const sdp = new SdpInfo(this.toString());sdp.obj.media = sdp.obj.media.filter(m => m.mid.toString() === mid);sdp.setBundleMids([mid]);return sdp;}

3.3 on__track——track add

dist/webrtc_agent/webrtc/wrtcConnection.js

通知到WebrtcNode(/dist/webrtc_agent/webrtc/index.js)的createWebRTCConnection 中注册的callback, 回调一个对象,

        // Notify new trackon_track({type: 'track-added',track: trackMap.get(mid), // WrtcStreamoperationId: opSettings.operationId,mid: mid})

3.4 ======WebrtcNode.handleTrackInfo

dist/webrtc_agent/webrtc/index.js

var connection = new WrtcConnection({connectionId: transportId,threadPool: threadPool,ioThreadPool: ioThreadPool,network_interfaces: global.config.webrtc.network_interfaces,owner,}, function onTransportStatus(status) {notifyTransportStatus(controller, transportId, status);}, function onTrack(trackInfo) {handleTrackInfo(transportId, trackInfo, controller);});
// trackInfo 就是on__track 回调回来
var handleTrackInfo = function (transportId, trackInfo, controller) {var publicTrackId;var updateInfo;if (trackInfo.type === 'track-added') {// Generate public track IDconst track = trackInfo.track; // WrtcStreampublicTrackId = transportId + '-' + track.id;if (mediaTracks.has(publicTrackId)) {log.error('Conflict public track id:', publicTrackId, transportId, track.id);return;}mediaTracks.set(publicTrackId, track);mappingPublicId.get(transportId).set(track.id, publicTrackId);if (track.direction === 'in') {const trackSource = track.sender();router.addLocalSource(publicTrackId, 'webrtc', trackSource).catch(e => log.warn('Unexpected error during track add:', e));} else {router.addLocalDestination(publicTrackId, 'webrtc', track).catch(e => log.warn('Unexpected error during track add:', e));}// Bind media-update handlertrack.on('media-update', (jsonUpdate) => {log.debug('notifyMediaUpdate:', publicTrackId, jsonUpdate);notifyMediaUpdate(controller, publicTrackId, track.direction, JSON.parse(jsonUpdate));});// Notify controllerconst mediaType = track.format('audio') ? 'audio' : 'video';updateInfo = {type: 'track-added',trackId: publicTrackId,mediaType: track.format('audio') ? 'audio' : 'video',mediaFormat: track.format(mediaType),direction: track.direction,operationId: trackInfo.operationId,mid: trackInfo.mid,rid: trackInfo.rid,active: true,};log.debug('notifyTrackUpdate', controller, publicTrackId, updateInfo);notifyTrackUpdate(controller, transportId, updateInfo);} else if (trackInfo.type === 'track-removed') {publicTrackId = mappingPublicId.get(transportId).get(trackInfo.trackId);if (!mediaTracks.has(publicTrackId)) {log.error('Non-exist public track id:', publicTrackId, transportId, trackInfo.trackId);return;}log.debug('track removed:', publicTrackId);router.removeConnection(publicTrackId).then(ok => {mediaTracks.get(publicTrackId).close();mediaTracks.delete(publicTrackId);mappingPublicId.get(transportId).delete(trackInfo.trackId);}).catch(e => log.warn('Unexpected error during track remove:', e));// Notify controllerupdateInfo = {type: 'track-removed',trackId: publicTrackId,};notifyTrackUpdate(controller, transportId, updateInfo);} else if (trackInfo.type === 'tracks-complete') {updateInfo = {type: 'tracks-complete',operationId: trackInfo.operationId};notifyTrackUpdate(controller, transportId, updateInfo);}};

时序图

在这里插入图片描述

这篇关于WebrtcNode, publish-sdp offer 流程(1)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/617030

相关文章

Security OAuth2 单点登录流程

单点登录(英语:Single sign-on,缩写为 SSO),又译为单一签入,一种对于许多相互关连,但是又是各自独立的软件系统,提供访问控制的属性。当拥有这项属性时,当用户登录时,就可以获取所有系统的访问权限,不用对每个单一系统都逐一登录。这项功能通常是以轻型目录访问协议(LDAP)来实现,在服务器上会将用户信息存储到LDAP数据库中。相同的,单一注销(single sign-off)就是指

Spring Security基于数据库验证流程详解

Spring Security 校验流程图 相关解释说明(认真看哦) AbstractAuthenticationProcessingFilter 抽象类 /*** 调用 #requiresAuthentication(HttpServletRequest, HttpServletResponse) 决定是否需要进行验证操作。* 如果需要验证,则会调用 #attemptAuthentica

kubelet组件的启动流程源码分析

概述 摘要: 本文将总结kubelet的作用以及原理,在有一定基础认识的前提下,通过阅读kubelet源码,对kubelet组件的启动流程进行分析。 正文 kubelet的作用 这里对kubelet的作用做一个简单总结。 节点管理 节点的注册 节点状态更新 容器管理(pod生命周期管理) 监听apiserver的容器事件 容器的创建、删除(CRI) 容器的网络的创建与删除

火语言RPA流程组件介绍--浏览网页

🚩【组件功能】:浏览器打开指定网址或本地html文件 配置预览 配置说明 网址URL 支持T或# 默认FLOW输入项 输入需要打开的网址URL 超时时间 支持T或# 打开网页超时时间 执行后后等待时间(ms) 支持T或# 当前组件执行完成后继续等待的时间 UserAgent 支持T或# User Agent中文名为用户代理,简称 UA,它是一个特殊字符串头,使得服务器

UMI复现代码运行逻辑全流程(一)——eval_real.py(尚在更新)

一、文件夹功能解析 全文件夹如下 其中,核心文件作用为: diffusion_policy:扩散策略核心文件夹,包含了众多模型及基础库 example:标定及配置文件 scripts/scripts_real:测试脚本文件,区别在于前者倾向于单体运行,后者为整体运行 scripts_slam_pipeline:orb_slam3运行全部文件 umi:核心交互文件夹,作用在于构建真

C++/《C/C++程序编译流程》

程序的基本流程如图:   1.预处理        预处理相当于根据预处理指令组装新的C/C++程序。经过预处理,会产生一个没有宏定义,没有条件编译指令,没有特殊符号的输出文件,这个文件的含义同原本的文件无异,只是内容上有所不同。 读取C/C++源程序,对其中的伪指令(以#开头的指令)进行处理将所有的“#define”删除,并且展开所有的宏定义处理所有的条件编译指令,如:“#if”、“

笔记本电脑的具体选购步骤流程

2.1 笔记本电脑的具体选购步骤流程   关于笔记本电脑的选购,一直是热点话题。不管是新手还是老前辈,选购前,总是要先上网查一查,汇总一些信息或经验。因为选购一台笔记本电脑,从它的配置、外观到做工等很多方面都需要考量,所以挑一台自己喜欢的、适合自己的笔记本电脑也是一件很费脑筋的事情。本节将一些选购笔记本电脑的经验进行了总结,供广大读者选购笔记本电脑时参考。   笔记本电脑选购流程如下

基于微信小程序与嵌入式系统的智能小车开发(详细流程)

一、项目概述 本项目旨在开发一款智能小车,结合微信小程序与嵌入式系统,提供实时图像处理与控制功能。用户可以通过微信小程序远程操控小车,并实时接收摄像头采集的图像。该项目解决了传统遥控小车在图像反馈和控制延迟方面的问题,提升了小车的智能化水平,适用于教育、科研和娱乐等多个领域。 二、系统架构 1. 系统架构设计 本项目的系统架构主要分为以下几个部分: 微信小程序:负责用户界面、控制指令的

MySQL B+树查询数据全流程

MySQL B+树查询数据全流程 一、引言 在 MySQL 数据库中,B+树是一种常用的数据结构,用于高效地存储和查询数据。了解 B+树中查询数据的全过程,对于深入理解 MySQL 的工作原理和优化查询性能至关重要。 二、B+树的结构特点 B+树是一种平衡的多路查找树,具有以下结构特点: 每个节点可以存储多个关键字和对应的指针。非叶子节点的关键字起到索引的作用,用于引导查询到相应的子节点