├── .circleci └── config.yml ├── .dockerignore ├── .eslintignore ├── .eslintrc ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .nvmrc ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── README.md ├── cert ├── cert.pem └── key.pem ├── doc ├── client_api.md ├── custom_theme │ ├── 404.html │ ├── base.html │ ├── content.html │ ├── css │ │ ├── architecture.css │ │ ├── base.css │ │ ├── bootstrap-custom.min.css │ │ ├── font-awesome-4.5.0.css │ │ ├── highlight.css │ │ └── style.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── img │ │ ├── 01.png │ │ ├── 02.png │ │ ├── 3.png │ │ ├── 4.png │ │ ├── 5.png │ │ ├── 6.png │ │ ├── favicon.ico │ │ ├── github-logo.png │ │ ├── grid.png │ │ └── routing.png │ ├── js │ │ ├── base.js │ │ ├── bootstrap-3.0.3.min.js │ │ ├── highlight.pack.js │ │ ├── jquery-1.10.2.min.js │ │ └── script.js │ ├── nav-sub.html │ ├── nav.html │ └── toc.html ├── docker.md ├── from_source.md ├── index.md └── server_api.md ├── erizo ├── .gitignore ├── buildProject.sh ├── cleanObjectFiles.sh ├── conanfile.txt ├── generateEclipseProject.sh ├── generateProject.sh ├── runTests.sh ├── src │ ├── CMakeLists.txt │ ├── Doxyfile.in │ ├── cmake │ │ └── Findglib.cmake │ ├── erizo │ │ ├── CMakeLists.txt │ │ ├── DefaultValues.h │ │ ├── DtlsTransport.cpp │ │ ├── DtlsTransport.h │ │ ├── IceConnection.cpp │ │ ├── IceConnection.h │ │ ├── LibNiceConnection.cpp │ │ ├── LibNiceConnection.h │ │ ├── MediaDefinitions.h │ │ ├── MediaStream.cpp │ │ ├── MediaStream.h │ │ ├── NicerConnection.cpp │ │ ├── NicerConnection.h │ │ ├── OneToManyProcessor.cpp │ │ ├── OneToManyProcessor.h │ │ ├── SdpInfo.cpp │ │ ├── SdpInfo.h │ │ ├── SrtpChannel.cpp │ │ ├── SrtpChannel.h │ │ ├── Stats.cpp │ │ ├── Stats.h │ │ ├── StringUtil.cpp │ │ ├── StringUtil.h │ │ ├── Transceiver.cpp │ │ ├── Transceiver.h │ │ ├── Transport.h │ │ ├── UnencryptedTransport.cpp │ │ ├── UnencryptedTransport.h │ │ ├── WebRtcConnection.cpp │ │ ├── WebRtcConnection.h │ │ ├── bandwidth │ │ │ ├── BandwidthDistributionAlgorithm.h │ │ │ ├── BwDistributionConfig.cpp │ │ │ ├── BwDistributionConfig.h │ │ │ ├── MaxVideoBWDistributor.cpp │ │ │ ├── MaxVideoBWDistributor.h │ │ │ ├── StreamPriorityBWDistributor.cpp │ │ │ ├── StreamPriorityBWDistributor.h │ │ │ ├── TargetVideoBWDistributor.cpp │ │ │ └── TargetVideoBWDistributor.h │ │ ├── dtls │ │ │ ├── DtlsClient.cpp │ │ │ ├── DtlsSocket.cpp │ │ │ ├── DtlsSocket.h │ │ │ ├── bf_dwrap.c │ │ │ └── bf_dwrap.h │ │ ├── handlers │ │ │ ├── HandlerImporter.cpp │ │ │ ├── HandlerImporter.h │ │ │ └── handlers │ │ │ │ ├── LoggerHandler.cpp │ │ │ │ └── LoggerHandler.h │ │ ├── lib │ │ │ ├── Base64.h │ │ │ ├── Clock.h │ │ │ ├── ClockUtils.h │ │ │ ├── LibNiceInterface.h │ │ │ ├── LibNiceInterfaceImpl.cpp │ │ │ ├── NicerInterface.cpp │ │ │ ├── NicerInterface.h │ │ │ ├── TokenBucket.cpp │ │ │ └── TokenBucket.h │ │ ├── logger.h │ │ ├── media │ │ │ ├── Depacketizer.cpp │ │ │ ├── Depacketizer.h │ │ │ ├── ExternalInput.cpp │ │ │ ├── ExternalInput.h │ │ │ ├── ExternalOutput.cpp │ │ │ ├── ExternalOutput.h │ │ │ ├── MediaProcessor.cpp │ │ │ ├── MediaProcessor.h │ │ │ ├── OneToManyTranscoder.cpp │ │ │ ├── OneToManyTranscoder.h │ │ │ ├── SyntheticInput.cpp │ │ │ ├── SyntheticInput.h │ │ │ ├── codecs │ │ │ │ ├── AudioCodec.cpp │ │ │ │ ├── AudioCodec.h │ │ │ │ ├── Codecs.h │ │ │ │ ├── VideoCodec.cpp │ │ │ │ └── VideoCodec.h │ │ │ └── mixers │ │ │ │ ├── VideoMixer.cpp │ │ │ │ ├── VideoMixer.h │ │ │ │ ├── VideoUtils.cpp │ │ │ │ └── VideoUtils.h │ │ ├── pipeline │ │ │ ├── Handler.h │ │ │ ├── HandlerContext-inl.h │ │ │ ├── HandlerContext.h │ │ │ ├── HandlerManager.h │ │ │ ├── Pipeline-inl.h │ │ │ ├── Pipeline.cpp │ │ │ ├── Pipeline.h │ │ │ ├── Service.h │ │ │ ├── ServiceContext-inl.h │ │ │ └── ServiceContext.h │ │ ├── rtp │ │ │ ├── BandwidthEstimationHandler.cpp │ │ │ ├── BandwidthEstimationHandler.h │ │ │ ├── FakeKeyframeGeneratorHandler.cpp │ │ │ ├── FakeKeyframeGeneratorHandler.h │ │ │ ├── FecReceiverHandler.cpp │ │ │ ├── FecReceiverHandler.h │ │ │ ├── LayerBitrateCalculationHandler.cpp │ │ │ ├── LayerBitrateCalculationHandler.h │ │ │ ├── LayerDetectorHandler.cpp │ │ │ ├── LayerDetectorHandler.h │ │ │ ├── PacketBufferService.cpp │ │ │ ├── PacketBufferService.h │ │ │ ├── PacketCodecParser.cpp │ │ │ ├── PacketCodecParser.h │ │ │ ├── PeriodicPliHandler.cpp │ │ │ ├── PeriodicPliHandler.h │ │ │ ├── PliPacerHandler.cpp │ │ │ ├── PliPacerHandler.h │ │ │ ├── PliPriorityHandler.cpp │ │ │ ├── PliPriorityHandler.h │ │ │ ├── QualityFilterHandler.cpp │ │ │ ├── QualityFilterHandler.h │ │ │ ├── QualityManager.cpp │ │ │ ├── QualityManager.h │ │ │ ├── RtcpAggregator.cpp │ │ │ ├── RtcpAggregator.h │ │ │ ├── RtcpFeedbackGenerationHandler.cpp │ │ │ ├── RtcpFeedbackGenerationHandler.h │ │ │ ├── RtcpForwarder.cpp │ │ │ ├── RtcpForwarder.h │ │ │ ├── RtcpNackGenerator.cpp │ │ │ ├── RtcpNackGenerator.h │ │ │ ├── RtcpProcessor.h │ │ │ ├── RtcpProcessorHandler.cpp │ │ │ ├── RtcpProcessorHandler.h │ │ │ ├── RtcpRrGenerator.cpp │ │ │ ├── RtcpRrGenerator.h │ │ │ ├── RtpExtensionProcessor.cpp │ │ │ ├── RtpExtensionProcessor.h │ │ │ ├── RtpH264Parser.cpp │ │ │ ├── RtpH264Parser.h │ │ │ ├── RtpHeaders.h │ │ │ ├── RtpPacketQueue.cpp │ │ │ ├── RtpPacketQueue.h │ │ │ ├── RtpPaddingGeneratorHandler.cpp │ │ │ ├── RtpPaddingGeneratorHandler.h │ │ │ ├── RtpPaddingManagerHandler.cpp │ │ │ ├── RtpPaddingManagerHandler.h │ │ │ ├── RtpPaddingRemovalHandler.cpp │ │ │ ├── RtpPaddingRemovalHandler.h │ │ │ ├── RtpRetransmissionHandler.cpp │ │ │ ├── RtpRetransmissionHandler.h │ │ │ ├── RtpSink.cpp │ │ │ ├── RtpSink.h │ │ │ ├── RtpSlideShowHandler.cpp │ │ │ ├── RtpSlideShowHandler.h │ │ │ ├── RtpSource.cpp │ │ │ ├── RtpSource.h │ │ │ ├── RtpTrackMuteHandler.cpp │ │ │ ├── RtpTrackMuteHandler.h │ │ │ ├── RtpUtils.cpp │ │ │ ├── RtpUtils.h │ │ │ ├── RtpVP8Fragmenter.cpp │ │ │ ├── RtpVP8Fragmenter.h │ │ │ ├── RtpVP8Parser.cpp │ │ │ ├── RtpVP8Parser.h │ │ │ ├── RtpVP9Parser.cpp │ │ │ ├── RtpVP9Parser.h │ │ │ ├── SRPacketHandler.cpp │ │ │ ├── SRPacketHandler.h │ │ │ ├── SenderBandwidthEstimantionHandler.cpp │ │ │ ├── SenderBandwidthEstimationHandler.h │ │ │ ├── SequenceNumberTranslator.cpp │ │ │ ├── SequenceNumberTranslator.h │ │ │ ├── StatsHandler.cpp │ │ │ └── StatsHandler.h │ │ ├── stats │ │ │ ├── StatNode.cpp │ │ │ └── StatNode.h │ │ └── thread │ │ │ ├── IOThreadPool.cpp │ │ │ ├── IOThreadPool.h │ │ │ ├── IOWorker.cpp │ │ │ ├── IOWorker.h │ │ │ ├── Scheduler.cpp │ │ │ ├── Scheduler.h │ │ │ ├── ThreadPool.cpp │ │ │ ├── ThreadPool.h │ │ │ ├── Worker.cpp │ │ │ └── Worker.h │ ├── examples │ │ ├── CMakeLists.txt │ │ ├── Test.cpp │ │ ├── Test.h │ │ ├── hsam.cpp │ │ └── pc │ │ │ ├── Observer.cpp │ │ │ ├── Observer.h │ │ │ ├── PCSocket.cpp │ │ │ ├── PCSocket.h │ │ │ └── SDPReceiver.h │ ├── test │ │ ├── CMakeLists.txt │ │ ├── DtlsSocketTest.cpp │ │ ├── NicerConnectionTest.cpp │ │ ├── OneToManyProcessorTest.cpp │ │ ├── PacketTest.cpp │ │ ├── WebRtcConnectionTest.cpp │ │ ├── bandwidth │ │ │ ├── MaxVideoBWDistributor.cpp │ │ │ ├── StreamPriorityBWDistributor.cpp │ │ │ └── TargetVideoBWDistributor.cpp │ │ ├── lib │ │ │ └── TokenBucketTest.cpp │ │ ├── log4cxx.properties │ │ ├── main.cpp │ │ ├── media │ │ │ ├── DepacketizerTest.cpp │ │ │ └── SyntheticInputTest.cpp │ │ ├── rtp │ │ │ ├── BandwidthEstimationHandlerTest.cpp │ │ │ ├── FakeKeyframeGeneratorHandlerTest.cpp │ │ │ ├── FecReceiverHandlerTest.cpp │ │ │ ├── LayerBitrateCalculationHandlerTest.cpp │ │ │ ├── LayerDetectorHandlerTest.cpp │ │ │ ├── PeriodicPliHandlerTest.cpp │ │ │ ├── PliPacerHandlerTest.cpp │ │ │ ├── PliPriorityHandlerTest.cpp │ │ │ ├── QualityManagerTest.cpp │ │ │ ├── RtcpFeedbackGenerationHandlerTest.cpp │ │ │ ├── RtcpNackGeneratorTest.cpp │ │ │ ├── RtcpProcessorHandlerTest.cpp │ │ │ ├── RtcpRrGeneratorTest.cpp │ │ │ ├── RtpExtensionProcessorTest.cpp │ │ │ ├── RtpPaddingGeneratorHandlerTest.cpp │ │ │ ├── RtpPaddingManagerHandlerTest.cpp │ │ │ ├── RtpRetransmissionHandlerTest.cpp │ │ │ ├── RtpSlideShowHandlerTest.cpp │ │ │ ├── RtpTrackMuteHandlerTest.cpp │ │ │ ├── SRPacketHandlerTest.cpp │ │ │ ├── SenderBandwidthEstimationTest.cpp │ │ │ ├── SequenceNumberTranslatorTest.cpp │ │ │ └── StatsHandlerTest.cpp │ │ ├── stats │ │ │ ├── MovingAverageStatTest.cpp │ │ │ ├── MovingIntervalRateStatTest.cpp │ │ │ └── StatNodeTest.cpp │ │ ├── thread │ │ │ └── SchedulerTest.cpp │ │ └── utils │ │ │ ├── Matchers.h │ │ │ ├── Mocks.h │ │ │ └── Tools.h │ └── third_party │ │ ├── nicer.cmake │ │ ├── webrtc.cmake │ │ └── webrtc │ │ └── src │ │ ├── CMakeLists.txt │ │ └── webrtc │ │ ├── api │ │ ├── array_view.h │ │ ├── audio_codecs │ │ │ ├── audio_format.cc │ │ │ └── audio_format.h │ │ ├── function_view.h │ │ ├── media_types.cc │ │ ├── media_types.h │ │ ├── network_state_predictor.h │ │ ├── priority.h │ │ ├── ref_counted_base.h │ │ ├── rtp_headers.cc │ │ ├── rtp_headers.h │ │ ├── rtp_parameters.h │ │ ├── rtp_transceiver_direction.h │ │ ├── scoped_refptr.h │ │ ├── sequence_checker.h │ │ ├── task_queue │ │ │ ├── default_task_queue_factory.h │ │ │ ├── default_task_queue_factory_stdlib.cc │ │ │ ├── queued_task.h │ │ │ ├── task_queue_base.cc │ │ │ ├── task_queue_base.h │ │ │ └── task_queue_factory.h │ │ ├── transport │ │ │ ├── OWNERS │ │ │ ├── bitrate_settings.cc │ │ │ ├── bitrate_settings.h │ │ │ ├── data_channel_transport_interface.h │ │ │ ├── enums.h │ │ │ ├── field_trial_based_config.cc │ │ │ ├── field_trial_based_config.h │ │ │ ├── network_control.h │ │ │ ├── network_types.cc │ │ │ ├── network_types.h │ │ │ ├── rtp │ │ │ │ ├── dependency_descriptor.cc │ │ │ │ ├── dependency_descriptor.h │ │ │ │ └── rtp_source.h │ │ │ ├── video │ │ │ │ └── render_resolution.h │ │ │ └── webrtc_key_value_config.h │ │ ├── units │ │ │ ├── OWNERS │ │ │ ├── data_rate.cc │ │ │ ├── data_rate.h │ │ │ ├── data_size.cc │ │ │ ├── data_size.h │ │ │ ├── frequency.cc │ │ │ ├── frequency.h │ │ │ ├── time_delta.cc │ │ │ ├── time_delta.h │ │ │ ├── timestamp.cc │ │ │ └── timestamp.h │ │ └── video │ │ │ ├── color_space.cc │ │ │ ├── color_space.h │ │ │ ├── hdr_metadata.cc │ │ │ ├── hdr_metadata.h │ │ │ ├── render_resolution.h │ │ │ ├── video_content_type.cc │ │ │ ├── video_content_type.h │ │ │ ├── video_layers_allocation.h │ │ │ ├── video_rotation.h │ │ │ ├── video_timing.cc │ │ │ └── video_timing.h │ │ ├── modules │ │ ├── congestion_controller │ │ │ ├── OWNERS │ │ │ ├── goog_cc │ │ │ │ ├── acknowledged_bitrate_estimator.cc │ │ │ │ ├── acknowledged_bitrate_estimator.h │ │ │ │ ├── acknowledged_bitrate_estimator_interface.cc │ │ │ │ ├── acknowledged_bitrate_estimator_interface.h │ │ │ │ ├── alr_detector.cc │ │ │ │ ├── alr_detector.h │ │ │ │ ├── bitrate_estimator.cc │ │ │ │ ├── bitrate_estimator.h │ │ │ │ ├── delay_based_bwe.cc │ │ │ │ ├── delay_based_bwe.h │ │ │ │ ├── delay_increase_detector_interface.h │ │ │ │ ├── inter_arrival_delta.cc │ │ │ │ ├── inter_arrival_delta.h │ │ │ │ ├── link_capacity_estimator.cc │ │ │ │ ├── link_capacity_estimator.h │ │ │ │ ├── loss_based_bandwidth_estimation.cc │ │ │ │ ├── loss_based_bandwidth_estimation.h │ │ │ │ ├── loss_based_bwe_v2.cc │ │ │ │ ├── loss_based_bwe_v2.h │ │ │ │ ├── probe_bitrate_estimator.cc │ │ │ │ ├── probe_bitrate_estimator.h │ │ │ │ ├── probe_controller.cc │ │ │ │ ├── probe_controller.h │ │ │ │ ├── robust_throughput_estimator.cc │ │ │ │ ├── robust_throughput_estimator.h │ │ │ │ ├── send_side_bandwidth_estimation.cc │ │ │ │ ├── send_side_bandwidth_estimation.h │ │ │ │ ├── trendline_estimator.cc │ │ │ │ └── trendline_estimator.h │ │ │ └── rtp │ │ │ │ ├── transport_feedback_adapter.cc │ │ │ │ └── transport_feedback_adapter.h │ │ ├── include │ │ │ ├── module.h │ │ │ ├── module_common_types.h │ │ │ ├── module_common_types_public.h │ │ │ └── module_fec_types.h │ │ ├── pacing │ │ │ ├── OWNERS │ │ │ ├── interval_budget.cc │ │ │ └── interval_budget.h │ │ ├── remote_bitrate_estimator │ │ │ ├── OWNERS │ │ │ ├── aimd_rate_control.cc │ │ │ ├── aimd_rate_control.h │ │ │ ├── bwe_defines.cc │ │ │ ├── include │ │ │ │ ├── bwe_defines.h │ │ │ │ └── remote_bitrate_estimator.h │ │ │ ├── inter_arrival.cc │ │ │ ├── inter_arrival.h │ │ │ ├── overuse_detector.cc │ │ │ ├── overuse_detector.h │ │ │ ├── overuse_estimator.cc │ │ │ ├── overuse_estimator.h │ │ │ ├── packet_arrival_map.cc │ │ │ ├── packet_arrival_map.h │ │ │ ├── remote_bitrate_estimator_abs_send_time.cc │ │ │ ├── remote_bitrate_estimator_abs_send_time.h │ │ │ ├── remote_bitrate_estimator_single_stream.cc │ │ │ ├── remote_bitrate_estimator_single_stream.h │ │ │ ├── remote_estimator_proxy.cc │ │ │ └── remote_estimator_proxy.h │ │ ├── rtp_rtcp │ │ │ ├── include │ │ │ │ ├── receive_statistics.h │ │ │ │ ├── rtp_cvo.h │ │ │ │ ├── rtp_header_extension_map.h │ │ │ │ ├── rtp_rtcp_defines.cc │ │ │ │ ├── rtp_rtcp_defines.h │ │ │ │ └── ulpfec_receiver.h │ │ │ └── source │ │ │ │ ├── byte_io.h │ │ │ │ ├── fec_private_tables_bursty.cc │ │ │ │ ├── fec_private_tables_bursty.h │ │ │ │ ├── fec_private_tables_random.cc │ │ │ │ ├── fec_private_tables_random.h │ │ │ │ ├── flexfec_header_reader_writer.cc │ │ │ │ ├── flexfec_header_reader_writer.h │ │ │ │ ├── forward_error_correction.cc │ │ │ │ ├── forward_error_correction.h │ │ │ │ ├── forward_error_correction_internal.cc │ │ │ │ ├── forward_error_correction_internal.h │ │ │ │ ├── rtcp_packet.cc │ │ │ │ ├── rtcp_packet.h │ │ │ │ ├── rtcp_packet │ │ │ │ ├── app.cc │ │ │ │ ├── app.h │ │ │ │ ├── common_header.cc │ │ │ │ ├── common_header.h │ │ │ │ ├── remote_estimate.cc │ │ │ │ ├── remote_estimate.h │ │ │ │ ├── rtpfb.cc │ │ │ │ ├── rtpfb.h │ │ │ │ ├── transport_feedback.cc │ │ │ │ └── transport_feedback.h │ │ │ │ ├── rtp_dependency_descriptor_extension.cc │ │ │ │ ├── rtp_dependency_descriptor_extension.h │ │ │ │ ├── rtp_dependency_descriptor_reader.cc │ │ │ │ ├── rtp_dependency_descriptor_reader.h │ │ │ │ ├── rtp_dependency_descriptor_writer.cc │ │ │ │ ├── rtp_dependency_descriptor_writer.h │ │ │ │ ├── rtp_generic_frame_descriptor.cc │ │ │ │ ├── rtp_generic_frame_descriptor.h │ │ │ │ ├── rtp_generic_frame_descriptor_extension.cc │ │ │ │ ├── rtp_generic_frame_descriptor_extension.h │ │ │ │ ├── rtp_header_extension_map.cc │ │ │ │ ├── rtp_header_extensions.cc │ │ │ │ ├── rtp_header_extensions.h │ │ │ │ ├── rtp_packet.cc │ │ │ │ ├── rtp_packet.h │ │ │ │ ├── rtp_packet_received.cc │ │ │ │ ├── rtp_packet_received.h │ │ │ │ ├── rtp_video_layers_allocation_extension.cc │ │ │ │ ├── rtp_video_layers_allocation_extension.h │ │ │ │ ├── ulpfec_header_reader_writer.cc │ │ │ │ ├── ulpfec_header_reader_writer.h │ │ │ │ ├── ulpfec_receiver_impl.cc │ │ │ │ └── ulpfec_receiver_impl.h │ │ └── video_coding │ │ │ └── codecs │ │ │ ├── interface │ │ │ └── common_constants.h │ │ │ └── vp9 │ │ │ └── include │ │ │ └── vp9_globals.h │ │ ├── rtc_base │ │ ├── OWNERS │ │ ├── arraysize.h │ │ ├── atomic_ops.h │ │ ├── bit_buffer.cc │ │ ├── bit_buffer.h │ │ ├── bitstream_reader.cc │ │ ├── bitstream_reader.h │ │ ├── buffer.h │ │ ├── byte_buffer.cc │ │ ├── byte_buffer.h │ │ ├── byte_order.h │ │ ├── checks.cc │ │ ├── checks.h │ │ ├── constructor_magic.h │ │ ├── copy_on_write_buffer.cc │ │ ├── copy_on_write_buffer.h │ │ ├── event.cc │ │ ├── event.h │ │ ├── event_tracer.cc │ │ ├── event_tracer.h │ │ ├── experiments │ │ │ ├── OWNERS │ │ │ ├── alr_experiment.cc │ │ │ ├── alr_experiment.h │ │ │ ├── field_trial_list.cc │ │ │ ├── field_trial_list.h │ │ │ ├── field_trial_parser.cc │ │ │ ├── field_trial_parser.h │ │ │ ├── field_trial_units.cc │ │ │ ├── field_trial_units.h │ │ │ ├── struct_parameters_parser.cc │ │ │ └── struct_parameters_parser.h │ │ ├── location.h │ │ ├── logging.cc │ │ ├── logging.h │ │ ├── network │ │ │ ├── sent_packet.cc │ │ │ └── sent_packet.h │ │ ├── network_constants.cc │ │ ├── network_constants.h │ │ ├── network_route.cc │ │ ├── network_route.h │ │ ├── numerics │ │ │ ├── divide_round.h │ │ │ ├── histogram_percentile_counter.cc │ │ │ ├── histogram_percentile_counter.h │ │ │ ├── math_utils.h │ │ │ ├── mod_ops.h │ │ │ ├── moving_median_filter.h │ │ │ ├── percentile_filter.h │ │ │ ├── running_statistics.h │ │ │ ├── safe_compare.h │ │ │ ├── safe_conversions.h │ │ │ ├── safe_conversions_impl.h │ │ │ ├── safe_minmax.h │ │ │ └── sequence_number_util.h │ │ ├── platform_thread.cc │ │ ├── platform_thread.h │ │ ├── platform_thread_types.cc │ │ ├── platform_thread_types.h │ │ ├── race_checker.cc │ │ ├── race_checker.h │ │ ├── random.cc │ │ ├── random.h │ │ ├── rate_statistics.cc │ │ ├── rate_statistics.h │ │ ├── ref_count.h │ │ ├── ref_counted_object.h │ │ ├── ref_counter.h │ │ ├── string_encode.cc │ │ ├── string_encode.h │ │ ├── string_to_number.cc │ │ ├── string_to_number.h │ │ ├── string_utils.cc │ │ ├── string_utils.h │ │ ├── strings │ │ │ ├── string_builder.cc │ │ │ └── string_builder.h │ │ ├── synchronization │ │ │ ├── mutex.cc │ │ │ ├── mutex.h │ │ │ ├── mutex_abseil.h │ │ │ ├── mutex_critical_section.h │ │ │ ├── mutex_pthread.h │ │ │ ├── sequence_checker_internal.cc │ │ │ ├── sequence_checker_internal.h │ │ │ ├── yield.cc │ │ │ ├── yield.h │ │ │ ├── yield_policy.cc │ │ │ └── yield_policy.h │ │ ├── system │ │ │ ├── arch.h │ │ │ ├── asm_defines.h │ │ │ ├── assume.h │ │ │ ├── file_wrapper.cc │ │ │ ├── file_wrapper.h │ │ │ ├── gcd_helpers.h │ │ │ ├── gcd_helpers.m │ │ │ ├── ignore_warnings.h │ │ │ ├── inline.h │ │ │ ├── no_unique_address.h │ │ │ ├── rtc_export.h │ │ │ ├── rtc_export_template.h │ │ │ ├── unused.h │ │ │ └── warn_current_thread_is_deadlocked.h │ │ ├── system_time.cc │ │ ├── system_time.h │ │ ├── task_queue.cc │ │ ├── task_queue.h │ │ ├── task_queue_for_test.cc │ │ ├── task_queue_for_test.h │ │ ├── task_queue_stdlib.cc │ │ ├── task_queue_stdlib.h │ │ ├── task_utils │ │ │ ├── pending_task_safety_flag.cc │ │ │ ├── pending_task_safety_flag.h │ │ │ ├── repeating_task.cc │ │ │ ├── repeating_task.h │ │ │ └── to_queued_task.h │ │ ├── third_party │ │ │ ├── base64 │ │ │ │ ├── LICENSE │ │ │ │ ├── README.chromium │ │ │ │ ├── base64.cc │ │ │ │ └── base64.h │ │ │ └── sigslot │ │ │ │ ├── LICENSE │ │ │ │ ├── README.chromium │ │ │ │ ├── sigslot.cc │ │ │ │ └── sigslot.h │ │ ├── thread_annotations.h │ │ ├── time_utils.cc │ │ ├── time_utils.h │ │ ├── trace_event.h │ │ ├── type_traits.h │ │ ├── units │ │ │ ├── OWNERS │ │ │ └── unit_base.h │ │ ├── zero_memory.cc │ │ └── zero_memory.h │ │ ├── system_wrappers │ │ ├── OWNERS │ │ ├── include │ │ │ ├── clock.h │ │ │ ├── field_trial.h │ │ │ ├── metrics.h │ │ │ └── ntp_time.h │ │ └── source │ │ │ ├── clock.cc │ │ │ ├── field_trial.cc │ │ │ └── metrics.cc │ │ └── test │ │ ├── explicit_key_value_config.cc │ │ └── explicit_key_value_config.h └── utils │ └── conan-include-paths │ └── conanfile.py ├── erizoAPI ├── .gitignore ├── AsyncPromiseWorker.cc ├── AsyncPromiseWorker.h ├── ConnectionDescription.cc ├── ConnectionDescription.h ├── ExternalInput.cc ├── ExternalInput.h ├── ExternalOutput.cc ├── ExternalOutput.h ├── IOThreadPool.cc ├── IOThreadPool.h ├── MediaDefinitions.h ├── MediaStream.cc ├── MediaStream.h ├── OneToManyProcessor.cc ├── OneToManyProcessor.h ├── OneToManyTranscoder.cc ├── OneToManyTranscoder.h ├── PromiseDurationDistribution.cc ├── PromiseDurationDistribution.h ├── SyntheticInput.cc ├── SyntheticInput.h ├── ThreadPool.cc ├── ThreadPool.h ├── WebRtcConnection.cc ├── WebRtcConnection.h ├── addon.cc ├── binding.gyp ├── build.sh ├── lib │ └── json.hpp ├── lint.sh ├── package-lock.json ├── package.json └── wscript ├── erizo_controller ├── .gitignore ├── ROV │ ├── inspector.js │ ├── rovClient.js │ ├── rovMetricsGatherer.js │ └── rovMetricsServer.js ├── common │ ├── PerformanceStats.js │ ├── ROV │ │ ├── rovReplManager.js │ │ └── rpcDuplexStream.js │ ├── ReliableSocket.js │ ├── amqper.js │ ├── logger.js │ └── semanticSdp │ │ ├── CandidateInfo.js │ │ ├── CodecInfo.js │ │ ├── DTLSInfo.js │ │ ├── Direction.js │ │ ├── DirectionWay.js │ │ ├── Enum.js │ │ ├── ICEInfo.js │ │ ├── MediaInfo.js │ │ ├── RIDInfo.js │ │ ├── SDPInfo.js │ │ ├── SemanticSdp.js │ │ ├── Setup.js │ │ ├── SimulcastInfo.js │ │ ├── SimulcastStreamInfo.js │ │ ├── SourceGroupInfo.js │ │ ├── SourceInfo.js │ │ ├── StreamInfo.js │ │ ├── TrackEncodingInfo.js │ │ └── TrackInfo.js ├── erizoAgent │ ├── erizoAgent.js │ ├── erizoAgentReporter.js │ ├── erizoList.js │ ├── launch.sh │ └── log4cxx.properties ├── erizoClient │ ├── dist │ │ └── assets │ │ │ ├── loader.gif │ │ │ ├── logo.svg │ │ │ ├── mute48.png │ │ │ ├── sound48.png │ │ │ └── star.svg │ ├── extras │ │ ├── chrome-extension │ │ │ ├── lynckia_icon_128.png │ │ │ ├── lynckia_icon_16.png │ │ │ ├── lynckia_icon_48.png │ │ │ ├── manifest.json │ │ │ └── script.js │ │ └── firefox-extension │ │ │ ├── README.txt │ │ │ ├── bootstrap.js │ │ │ ├── createExtension.sh │ │ │ ├── icon.png │ │ │ └── install.rdf │ ├── gulp │ │ ├── erizoFcTasks.js │ │ └── erizoTasks.js │ ├── gulpfile.js │ ├── lib │ │ ├── adapter.js │ │ └── state-machine.js │ ├── src │ │ ├── Erizo.js │ │ ├── ErizoConnectionManager.js │ │ ├── ErizoFc.js │ │ ├── Events.js │ │ ├── Room.js │ │ ├── Socket.js │ │ ├── Stream.js │ │ ├── utils │ │ │ ├── Base64.js │ │ │ ├── ConnectionHelpers.js │ │ │ ├── ErizoMap.js │ │ │ ├── FunctionQueue.js │ │ │ ├── Logger.js │ │ │ ├── Random.js │ │ │ └── SdpHelpers.js │ │ ├── views │ │ │ ├── AudioPlayer.js │ │ │ ├── Bar.js │ │ │ ├── Speaker.js │ │ │ ├── VideoPlayer.js │ │ │ └── View.js │ │ └── webrtc-stacks │ │ │ ├── BaseStack.js │ │ │ ├── ChromeStableStack.js │ │ │ ├── FcStack.js │ │ │ ├── FirefoxStack.js │ │ │ ├── PeerConnectionFsm.js │ │ │ └── SafariStack.js │ ├── webpack.config.erizo.js │ └── webpack.config.erizofc.js ├── erizoController │ ├── StreamManager.js │ ├── ch_policies │ │ └── default_policy.js │ ├── ecCloudHandler.js │ ├── erizoController.js │ ├── models │ │ ├── Channel.js │ │ ├── Client.js │ │ ├── ErizoList.js │ │ ├── Room.js │ │ └── Stream.js │ ├── nuveProxy.js │ ├── permission.js │ ├── roomController.js │ ├── rpc │ │ └── rpcPublic.js │ └── tokenAuthenticator.js ├── erizoJS │ ├── adapt_schemes │ │ ├── notify-break-recover.js │ │ ├── notify-break.js │ │ ├── notify-slideshow.js │ │ ├── notify-stop-feedback.js │ │ ├── notify.js │ │ └── schemeHelpers.js │ ├── erizoJS.js │ ├── erizoJSController.js │ └── models │ │ ├── Client.js │ │ ├── Helpers.js │ │ ├── Node.js │ │ ├── Publisher.js │ │ ├── PublisherManager.js │ │ ├── RTCPeerConnection.js │ │ ├── SessionDescription.js │ │ ├── Subscriber.js │ │ └── WebRtcConnection.js ├── initErizo_agent.sh ├── initErizo_controller.sh ├── installErizoTest.sh ├── installErizo_controller.sh ├── log4js_configuration.json ├── package-lock.json ├── package.json └── test │ ├── erizoAgent │ ├── erizoAgent.js │ └── erizoList.js │ ├── erizoClient │ ├── Room.js │ └── Stream.js │ ├── erizoController │ ├── Client.js │ ├── ecCloudHandler.js │ ├── erizoController.js │ ├── roomController.js │ └── tokenAuthenticator.js │ ├── erizoJS │ ├── FullRtcPeerConnection.js │ ├── RtcPeerConnection.js │ └── erizoJSController.js │ ├── sdps.js │ └── utils.js ├── extras ├── basic_example │ ├── basicServer.js │ ├── log4js_configuration.json │ ├── package-lock.json │ ├── package.json │ └── public │ │ ├── connection_test.html │ │ ├── connection_test.js │ │ ├── index.html │ │ ├── lib │ │ └── highcharts.js │ │ ├── quality_layers.html │ │ ├── quality_layers.js │ │ └── script.js ├── docker │ └── initDockerLicode.sh └── vagrant │ ├── Vagrantfile │ └── bootstrap.sh ├── feature-review └── single-peer-connection.md ├── mkdocs.yml ├── nuve ├── .gitignore ├── initNuve.sh ├── installNuve.sh ├── log4js_configuration.json ├── nuveAPI │ ├── .DS_Store │ ├── auth │ │ ├── mauthParser.js │ │ └── nuveAuthenticator.js │ ├── ch_policies │ │ └── default_policy.js │ ├── cloudHandler.js │ ├── logger.js │ ├── mdb │ │ ├── dataBase.js │ │ ├── erizoControllerRegistry.js │ │ ├── roomRegistry.js │ │ ├── serviceRegistry.js │ │ └── tokenRegistry.js │ ├── nuve.js │ ├── resource │ │ ├── roomResource.js │ │ ├── roomsResource.js │ │ ├── serviceResource.js │ │ ├── servicesResource.js │ │ ├── tokensResource.js │ │ ├── userResource.js │ │ └── usersResource.js │ ├── rpc │ │ ├── rpc.js │ │ └── rpcPublic.js │ ├── test │ │ ├── auth │ │ │ ├── mauthParser.js │ │ │ └── nuveAuthenticator.js │ │ ├── ch_policies │ │ │ └── default_policy.js │ │ ├── cloudHandler.js │ │ ├── mdb │ │ │ ├── dataBase.js │ │ │ ├── erizoControllerRegistry.js │ │ │ ├── roomRegistry.js │ │ │ ├── serviceRegistry.js │ │ │ └── tokenRegistry.js │ │ ├── resource │ │ │ ├── roomResource.js │ │ │ ├── roomsResource.js │ │ │ ├── serviceResource.js │ │ │ ├── servicesResource.js │ │ │ ├── tokensResource.js │ │ │ ├── userResource.js │ │ │ └── usersResource.js │ │ ├── rpc │ │ │ ├── rpc.js │ │ │ └── rpcPublic.js │ │ └── utils.js │ └── views │ │ └── test.ejs ├── nuveClient │ ├── lib │ │ └── xmlhttprequest.js │ ├── src │ │ ├── N.API.js │ │ └── N.js │ └── tools │ │ ├── compile.sh │ │ └── compileDist.sh ├── nuveClient_python │ └── nuve.py ├── nuveClient_ruby │ └── nuve.rb ├── package-lock.json └── package.json ├── package-lock.json ├── package.json ├── scripts ├── bw_distributor_config_default.js ├── checkNvm.sh ├── initBasicExample.sh ├── initLicode.sh ├── installBasicExample.sh ├── installErizo.sh ├── installMacDeps.sh ├── installNuve.sh ├── installUbuntuDeps.sh ├── libnice-014.patch0 ├── licode_default.js └── rtp_media_config_default.js ├── spine ├── Events.js ├── NativeConnectionHelpers.js ├── NativeConnectionManager.js ├── NativeStream.js ├── Spine.js ├── installSpine.sh ├── log4cxx.properties ├── log4js_configuration.json ├── logger.js ├── nativeClient.js ├── package-lock.json ├── package.json ├── runSpineClients.js ├── simpleNativeConnection.js └── spineClientsConfig.json ├── test ├── .eslintrc.json ├── karma.conf.js ├── licode_default.js ├── log4cxx.properties ├── log4js_configuration.json ├── negotiation │ ├── index.js │ ├── log4cxx.properties │ ├── log4js_configuration.json │ └── utils │ │ ├── BrowserInstaller.js │ │ ├── ClientConnection.js │ │ ├── ClientStream.js │ │ ├── ErizoConnection.js │ │ ├── NegotiationTest.js │ │ └── SdpUtils.js ├── nuve-api-spec.js ├── package-lock.json ├── package.json ├── perf-tests.js ├── rtp_media_config_default.js ├── runSpineTest.sh ├── spine-tests.js └── utils │ └── remote-spine.js └── utils └── release.sh /.dockerignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .project 3 | .cproject 4 | .git 5 | .circleci 6 | licode_config.js 7 | rtp_media_config.js 8 | utils/release.sh 9 | build/ 10 | node_modules/ 11 | erizo/build 12 | erizoAPI/build 13 | erizoAPI/.lock-wscript 14 | erizo_controller/erizoClient/dist/erizofc.js 15 | erizo_controller/erizoClient/build/erizofc.js 16 | erizo_controller/erizoClient/dist/erizo.js 17 | erizo_controller/erizoController/node_modules/ 18 | erizo_controller/test/public/erizo.js 19 | erizo_controller/erizoAgent/out.log 20 | erizo_controller/erizoAgent/erizo-*.log 21 | extras/basic_example/node_modules 22 | extras/basic_example/public/assets/ 23 | extras/basic_example/public/erizo.js 24 | extras/basic_example/nuve.js 25 | extras/vagrant/.vagrant 26 | extras/vagrant/licode/ 27 | nuve/.DS_Store 28 | nuve/nuveClient/build 29 | nuve/nuveClient/dist 30 | nuve/nuveClient/dist 31 | nuve/cloudHandler/node_modules/ 32 | nuve/nuveAPI/node_modules/ 33 | libdeps/ 34 | scripts/libdeps/ 35 | spine/erizofc.js 36 | site 37 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | nuve/nuveClient/build/**/*.js 2 | nuve/nuveClient/dist/**/*.js 3 | erizo_controller/erizoClient/**/*.js 4 | spine/**/*.js 5 | extras/basic_example/public/erizo.js 6 | extras/basic_example/nuve.js 7 | extras/basic_example/public/lib/ 8 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "airbnb", 3 | "rules": { 4 | "no-cond-assign": ["error", "except-parens"], 5 | "no-underscore-dangle": "off", 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 11 | 12 | **Description** 13 | 14 | 17 | 18 | **Steps to reproduce the issue:** 19 | 1. 20 | 2. 21 | 3. 22 | 23 | **Describe the results you received:** 24 | 25 | 26 | **Describe the results you expected:** 27 | 28 | 29 | **Additional information you deem important (e.g. issue happens only occasionally):** 30 | 31 | 32 | **Licode commit/release where the issue is happening** 33 | 34 | 35 | **Additional environment details (Local, AWS, Docker, etc.):** 36 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | **Description** 7 | 8 | 12 | 13 | [] It needs and includes Unit Tests 14 | 15 | **Changes in Client or Server public APIs** 16 | 17 | 21 | 22 | [] It includes documentation for these changes in `/doc`. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | licode_config.js 3 | bw_distributor_config.js 4 | extras/basic_example/node_modules 5 | extras/basic_example/public/erizo.js 6 | extras/basic_example/public/erizo.js.map 7 | extras/basic_example/nuve.js 8 | node_modules/ 9 | site 10 | .DS_Store 11 | scripts/libdeps/ 12 | libdeps/ 13 | extras/vagrant/.vagrant 14 | extras/vagrant/licode/ 15 | erizo_controller/erizoAgent/out.log 16 | erizo_controller/erizoAgent/erizo-*.log 17 | .project 18 | .cproject 19 | .idea 20 | spine/erizofc.js 21 | spine/testResult.json 22 | extras/basic_example/public/assets/ 23 | rtp_media_config.js 24 | bw_distribution_config.js 25 | erizo/FindIncludePathsGenerator.cmake 26 | erizo/Findboost.cmake 27 | erizo/Findbzip2.cmake 28 | erizo/Findzlib.cmake 29 | erizo/conan.lock 30 | erizo/conan_paths.cmake 31 | erizo/conanbuildinfo.args 32 | erizo/conanbuildinfo.cmake 33 | erizo/conanbuildinfo.txt 34 | erizo/conaninfo.txt 35 | erizo/graph_info.json 36 | 37 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v20.18.1 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Licode 2 | 3 | Thank you for considering contributing to Licode! 4 | We keep an up-to-date guide in the [Licode web](http://lynckia.com/licode/contribute.html). 5 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | 3 | LABEL maintainer="Lynckia" 4 | 5 | WORKDIR /opt 6 | 7 | #Configure tzdata 8 | ENV TZ=Europe/Madrid 9 | RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 10 | 11 | # Download latest version of the code and install dependencies 12 | RUN apt-get update && apt-get install -y git wget curl 13 | 14 | COPY .nvmrc package.json /opt/licode/ 15 | 16 | COPY scripts/installUbuntuDeps.sh scripts/checkNvm.sh scripts/libnice-014.patch0 /opt/licode/scripts/ 17 | 18 | WORKDIR /opt/licode/scripts 19 | 20 | RUN ./installUbuntuDeps.sh --cleanup --fast 21 | 22 | WORKDIR /opt 23 | 24 | COPY . /opt/licode 25 | 26 | RUN mkdir /opt/licode/.git 27 | 28 | # Clone and install licode 29 | WORKDIR /opt/licode/scripts 30 | 31 | RUN ./installErizo.sh -dfEAcs && \ 32 | ./../nuve/installNuve.sh && \ 33 | ./installBasicExample.sh 34 | 35 | RUN ldconfig /opt/licode/build/libdeps/build/lib 36 | 37 | WORKDIR /opt/licode 38 | 39 | ARG COMMIT 40 | 41 | RUN echo $COMMIT > RELEASE 42 | RUN date --rfc-3339='seconds' >> RELEASE 43 | RUN cat RELEASE 44 | 45 | WORKDIR /opt 46 | 47 | ENTRYPOINT ["./licode/extras/docker/initDockerLicode.sh"] 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012 Universidad Politécnica de Madrid 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cert/cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICnjCCAgegAwIBAgIJAOYd7/RgO22iMA0GCSqGSIb3DQEBBQUAMD8xCzAJBgNV 3 | BAYTAlNQMQowCAYDVQQIEwFNMQ4wDAYDVQQHEwVTcGFpbjEUMBIGA1UEAxMLbHlu 4 | Y2tpYS5jb20wHhcNMTIxMjA1MTAzODM1WhcNMTMxMjA1MTAzODM1WjA/MQswCQYD 5 | VQQGEwJTUDEKMAgGA1UECBMBTTEOMAwGA1UEBxMFU3BhaW4xFDASBgNVBAMTC2x5 6 | bmNraWEuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDWu9cfQydDBahN 7 | Hy8Xk0YLWaMmLqfjF7vvu2JzqLQY76lMIhkw7Mmdljbbdh0Mxi6RtfMhcZslpZNi 8 | 96Zb1CX543dccBzjWcCT5FWKWHRmUMbuTQHo0M4mavwQtK+HTYPpFhpc8AJDJPdr 9 | caTD1jLt1+T3548M193pKn5O86zGpQIDAQABo4GhMIGeMB0GA1UdDgQWBBSHD+cK 10 | foY1RCNJ+uR0w//K8cTjGzBvBgNVHSMEaDBmgBSHD+cKfoY1RCNJ+uR0w//K8cTj 11 | G6FDpEEwPzELMAkGA1UEBhMCU1AxCjAIBgNVBAgTAU0xDjAMBgNVBAcTBVNwYWlu 12 | MRQwEgYDVQQDEwtseW5ja2lhLmNvbYIJAOYd7/RgO22iMAwGA1UdEwQFMAMBAf8w 13 | DQYJKoZIhvcNAQEFBQADgYEAVpQ7AB/9LdDT+1qivXZdhPtYEMENkyHRkjnaJPLK 14 | H/13RdkdKJlLgD8bGUO43Z8efl8y7K0aH2cXDHQ1jR4kIgSCgNQDY+wC/RNsZPu/ 15 | DvNQBlR57zuFqCgj4FFW+RbyHCUB5AzDkEMNIWjo46vMdPUq+3s8G1ETF5ruXEYB 16 | rhU= 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /cert/key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXAIBAAKBgQDWu9cfQydDBahNHy8Xk0YLWaMmLqfjF7vvu2JzqLQY76lMIhkw 3 | 7Mmdljbbdh0Mxi6RtfMhcZslpZNi96Zb1CX543dccBzjWcCT5FWKWHRmUMbuTQHo 4 | 0M4mavwQtK+HTYPpFhpc8AJDJPdrcaTD1jLt1+T3548M193pKn5O86zGpQIDAQAB 5 | AoGAF6CFdAgkishVk17KBLMMsvUC8ZGSoXccE62vkIBQiKneG+VoliyHppI/qPgf 6 | DCfGOfwmK1jftE26oNoU8Oev4dJc5Yht09ceB+MqtkdA3VmdwJilfj6AuzVZ6TE6 7 | vbGqCKIQQvJKjsgnMX8yU+5vXkTDDm6UQiho9UFdEHtgQiECQQDvfifh9hORS+W3 8 | s90NQRsPBp+9EcbE4aELi4XoWjMXFUJypX8FukqSgatZ0SeKmYGm/LGhcYgw0hEY 9 | Dbzs5wGdAkEA5YjP05RS2xk6kzWGLCrJqPMsN+Q+cqFNz3EpctY8qS6hqjSb7yB9 10 | rUOroWaCq/mJA3Q/01m83OXMaorq+iSuqQJAMcSinxdW+6OtCh7LefykldvHiC/Q 11 | gYttvwtweVd9NHfLhi2UFumeo5FkvVZ0hB3gToZGl4kTRynwOXJpZ0WeFQJBAKaV 12 | Oxd33wYp8iviPYUSbJaUHTRXDsdMr9bsbsNsHkw+jo+jbMQIVY2Ivif96Ln8+OYr 13 | 2SJ/TyUWFdwBA/YU5zkCQGef95sS7g3gCrqe4CoLkNalIzfnovFcNtEe6h9OqH5b 14 | KK8yWZVjrffpzuD1d6d3+U7QeTlDh5/nHL1hZKA3gtY= 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /doc/custom_theme/404.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 | 5 |
6 |
7 |

404

8 |

Page not found

9 |
10 |
11 | 12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /doc/custom_theme/content.html: -------------------------------------------------------------------------------- 1 | {% if page.meta.source %} 2 | 7 | {% endif %} 8 | 9 | {{ page.content }} 10 | -------------------------------------------------------------------------------- /doc/custom_theme/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /doc/custom_theme/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /doc/custom_theme/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /doc/custom_theme/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /doc/custom_theme/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /doc/custom_theme/img/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/img/01.png -------------------------------------------------------------------------------- /doc/custom_theme/img/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/img/02.png -------------------------------------------------------------------------------- /doc/custom_theme/img/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/img/3.png -------------------------------------------------------------------------------- /doc/custom_theme/img/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/img/4.png -------------------------------------------------------------------------------- /doc/custom_theme/img/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/img/5.png -------------------------------------------------------------------------------- /doc/custom_theme/img/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/img/6.png -------------------------------------------------------------------------------- /doc/custom_theme/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/img/favicon.ico -------------------------------------------------------------------------------- /doc/custom_theme/img/github-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/img/github-logo.png -------------------------------------------------------------------------------- /doc/custom_theme/img/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/img/grid.png -------------------------------------------------------------------------------- /doc/custom_theme/img/routing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/doc/custom_theme/img/routing.png -------------------------------------------------------------------------------- /doc/custom_theme/js/base.js: -------------------------------------------------------------------------------- 1 | function getSearchTerm() 2 | { 3 | var sPageURL = window.location.search.substring(1); 4 | var sURLVariables = sPageURL.split('&'); 5 | for (var i = 0; i < sURLVariables.length; i++) 6 | { 7 | var sParameterName = sURLVariables[i].split('='); 8 | if (sParameterName[0] == 'q') 9 | { 10 | return sParameterName[1]; 11 | } 12 | } 13 | } 14 | 15 | $(document).ready(function() { 16 | 17 | var search_term = getSearchTerm(), 18 | $search_modal = $('#mkdocs_search_modal'); 19 | 20 | if(search_term){ 21 | $search_modal.modal(); 22 | } 23 | 24 | // make sure search input gets autofocus everytime modal opens. 25 | $search_modal.on('shown.bs.modal', function () { 26 | $search_modal.find('#mkdocs-search-query').focus(); 27 | }); 28 | 29 | // Highlight.js 30 | hljs.initHighlightingOnLoad(); 31 | $('table').addClass('table table-striped table-hover'); 32 | }); 33 | 34 | 35 | $('body').scrollspy({ 36 | target: '.bs-sidebar', 37 | }); 38 | 39 | /* Prevent disabled links from causing a page reload */ 40 | $("li.disabled a").click(function() { 41 | event.preventDefault(); 42 | }); 43 | -------------------------------------------------------------------------------- /doc/custom_theme/js/script.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | var $window = $(window); 4 | 5 | // side bar 6 | $('.bs-sidebar').affix({ 7 | offset: { 8 | top: function () { return $window.width() <= 980 ? 290 : 210 }, bottom: 270 9 | } 10 | }); 11 | 12 | // Binding for RTD control panel 13 | bindClick(); 14 | }); 15 | 16 | var bindClick = function () { 17 | if ($('.rst-current-version').length) { 18 | $('.rst-current-version').click(function() { 19 | $('.rst-other-versions').toggle() 20 | }); 21 | } else { 22 | // Waiting to RTD for inserting the panel 23 | setTimeout(bindClick, 500); 24 | } 25 | } -------------------------------------------------------------------------------- /doc/custom_theme/nav-sub.html: -------------------------------------------------------------------------------- 1 | {% if not nav_item.children %} 2 |
  • 3 | {{ nav_item.title }} 4 |
  • 5 | {% else %} 6 | {% for nav_item in nav_item.children %} 7 | {% include "nav-sub.html" %} 8 | {% endfor %} 9 | {% endif %} 10 | -------------------------------------------------------------------------------- /doc/custom_theme/toc.html: -------------------------------------------------------------------------------- 1 | 37 | -------------------------------------------------------------------------------- /erizo/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /erizo/buildProject.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | BIN_DIR="build" 6 | OBJ_DIR="CMakeFiles" 7 | 8 | buildAll() { 9 | if [ -d $BIN_DIR ]; then 10 | cd $BIN_DIR 11 | for d in */ ; do 12 | echo "Building $d - $*" 13 | cd $d 14 | make $* 15 | cd .. 16 | done 17 | cd .. 18 | else 19 | echo "Error, build directory does not exist, run generateProject.sh first" 20 | fi 21 | } 22 | 23 | 24 | 25 | buildAll $* 26 | -------------------------------------------------------------------------------- /erizo/cleanObjectFiles.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | BIN_DIR="build" 6 | OBJ_DIR="CMakeFiles" 7 | 8 | maybeRemoveObjDir() { 9 | if [ -d $OBJ_DIR ]; then 10 | rm -rf $OBJ_DIR 11 | fi 12 | } 13 | 14 | cleanAll() { 15 | if [ -d $BIN_DIR ]; then 16 | cd $BIN_DIR 17 | for RELEASE_DIR in */ ; do 18 | echo "cleaning $RELEASE_DIR" 19 | cd $RELEASE_DIR 20 | maybeRemoveObjDir 21 | for INTERNAL_DIR in */ ; do 22 | cd $INTERNAL_DIR 23 | maybeRemoveObjDir 24 | cd .. 25 | done 26 | cd .. 27 | done 28 | cd .. 29 | fi 30 | } 31 | 32 | cleanAll 33 | -------------------------------------------------------------------------------- /erizo/conanfile.txt: -------------------------------------------------------------------------------- 1 | [requires] 2 | libiconv/1.17 3 | boost/1.84.0 4 | apr/1.7.0 5 | apr-util/1.6.1 6 | abseil/20211102.0 7 | 8 | IncludePathsGenerator/0.1@lynckia/includes 9 | 10 | [generators] 11 | cmake 12 | cmake_find_package 13 | cmake_paths 14 | IncludePathsGenerator 15 | 16 | [options] 17 | 18 | -------------------------------------------------------------------------------- /erizo/generateEclipseProject.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | SCRIPT=`pwd`/$0 5 | FILENAME=`basename $SCRIPT` 6 | PATHNAME=`dirname $SCRIPT` 7 | BASE_BIN_DIR="build" 8 | 9 | 10 | generateVersion() { 11 | echo "generating $1" 12 | BIN_DIR="$BASE_BIN_DIR/$1" 13 | if [ -d $BIN_DIR ]; then 14 | cd $BIN_DIR 15 | else 16 | mkdir -p $BIN_DIR 17 | cd $BIN_DIR 18 | fi 19 | cmake ../../src "-DERIZO_BUILD_TYPE=$1" -G"Eclipse CDT4 - Unix Makefiles" 20 | cd $PATHNAME 21 | } 22 | 23 | 24 | generateVersion debug 25 | generateVersion release 26 | -------------------------------------------------------------------------------- /erizo/generateProject.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | SCRIPT=`pwd`/$0 5 | FILENAME=`basename $SCRIPT` 6 | PATHNAME=`dirname $SCRIPT` 7 | BASE_BIN_DIR="build" 8 | 9 | usage() 10 | { 11 | cat << EOF 12 | usage: $0 options 13 | Generate Erizo projects. It will generate all builds if no option is passed. 14 | OPTIONS: 15 | -h Show this message 16 | -d Generate debug 17 | -r Generate release 18 | EOF 19 | } 20 | 21 | 22 | generateVersion() { 23 | echo "generating $1" 24 | BIN_DIR="$BASE_BIN_DIR/$1" 25 | if [ -d $BIN_DIR ]; then 26 | cd $BIN_DIR 27 | else 28 | mkdir -p $BIN_DIR 29 | cd $BIN_DIR 30 | fi 31 | cmake ../../src "-DERIZO_BUILD_TYPE=$1" 32 | cd $PATHNAME 33 | } 34 | 35 | if [ "$#" -eq 0 ] 36 | then 37 | generateVersion debug 38 | generateVersion release 39 | else 40 | while getopts “hdr” OPTION 41 | do 42 | case $OPTION in 43 | h) 44 | usage 45 | exit 1 46 | ;; 47 | d) 48 | generateVersion debug 49 | ;; 50 | r) 51 | generateVersion release 52 | ;; 53 | ?) 54 | usage 55 | exit 56 | ;; 57 | esac 58 | done 59 | fi 60 | 61 | generateVersion release 62 | -------------------------------------------------------------------------------- /erizo/runTests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | runcmake() { 6 | cmake ../src 7 | echo "Done" 8 | } 9 | BIN_DIR="build" 10 | if [ -d $BIN_DIR ]; then 11 | cd $BIN_DIR 12 | make lint 13 | RET_LINT=`echo $?` 14 | make check 15 | RET_TEST=`echo $?` 16 | exit $(($RET_LINT + $RET_TEST)) 17 | else 18 | echo "Error, build directory does not exist, run generateProject.sh first" 19 | fi 20 | -------------------------------------------------------------------------------- /erizo/src/erizo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | project (ERIZO) 4 | 5 | set(ERIZO_VERSION_MAJOR 0) 6 | set(ERIZO_VERSION_MINOR 1) 7 | if(${ERIZO_BUILD_TYPE} STREQUAL "debug") 8 | message("Generating DEBUG project") 9 | set(CMAKE_CXX_FLAGS "-g -Wall -std=c++17 ${ERIZO_CMAKE_CXX_FLAGS}") 10 | elseif(${ERIZO_BUILD_TYPE} STREQUAL "sanitizer") 11 | message("Generating SANITIZER project") 12 | set(CMAKE_CXX_FLAGS "-g -Wall -std=c++17 ${ERIZO_CMAKE_CXX_FLAGS} -Wdeprecated-declarations -O1 -fno-omit-frame-pointer -fsanitize=address -fno-optimize-sibling-calls") 13 | else() 14 | message("Generating RELEASE project") 15 | set(CMAKE_CXX_FLAGS "-g -Wall -O3 -Wdeprecated-declarations -std=c++17 ${ERIZO_CMAKE_CXX_FLAGS}") 16 | endif() 17 | 18 | 19 | include_directories("${ERIZO_SOURCE_DIR}" "${THIRD_PARTY_INCLUDE}" "${NICER_INCLUDE}" "${LOG4CXX_BUILD}/include") 20 | 21 | file(GLOB_RECURSE ERIZO_SOURCES "${ERIZO_SOURCE_DIR}/*.h" "${ERIZO_SOURCE_DIR}/*.c" "${ERIZO_SOURCE_DIR}/*.cpp" "${ERIZO_SOURCE_DIR}/*.cc") 22 | 23 | add_library(erizo SHARED ${ERIZO_SOURCES}) 24 | 25 | 26 | target_link_libraries(erizo ${GLIB_LIBRARIES} ${Boost_LIBRARIES} ${apr_LIBRARIES} ${apr-util_LIBRARIES} ${SRTP} ${NICE} ${GTHREAD} ${SSL} ${CRYPTO} ${LIBS} webrtc nicer nrappkit log4cxx) 27 | add_dependencies(erizo log4cxxInstall) 28 | -------------------------------------------------------------------------------- /erizo/src/erizo/DefaultValues.h: -------------------------------------------------------------------------------- 1 | /* 2 | * defaultvalues.h 3 | */ 4 | #ifndef ERIZO_SRC_ERIZO_DEFAULTVALUES_H_ 5 | #define ERIZO_SRC_ERIZO_DEFAULTVALUES_H_ 6 | 7 | namespace erizo { 8 | constexpr uint32_t kDefaultMaxVideoBWInKbps = 30000; 9 | constexpr uint32_t kDefaultMaxVideoBWInBitsps = kDefaultMaxVideoBWInKbps * 1000; 10 | } // namespace erizo 11 | 12 | #endif // ERIZO_SRC_ERIZO_DEFAULTVALUES_H_ 13 | -------------------------------------------------------------------------------- /erizo/src/erizo/Stats.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Stats.cpp 3 | * 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #include "Stats.h" 10 | #include "MediaStream.h" 11 | #include "lib/ClockUtils.h" 12 | 13 | namespace erizo { 14 | 15 | DEFINE_LOGGER(Stats, "Stats"); 16 | 17 | Stats::Stats() : listener_{nullptr} { 18 | } 19 | 20 | Stats::~Stats() { 21 | } 22 | 23 | StatNode& Stats::getNode() { 24 | return root_; 25 | } 26 | 27 | std::string Stats::getStats() { 28 | return root_.toString(); 29 | } 30 | 31 | void Stats::setStatsListener(MediaStreamStatsListener* listener) { 32 | boost::mutex::scoped_lock lock(listener_mutex_); 33 | listener_ = listener; 34 | } 35 | 36 | void Stats::sendStats() { 37 | boost::mutex::scoped_lock lock(listener_mutex_); 38 | if (listener_) listener_->notifyStats(getStats()); 39 | } 40 | } // namespace erizo 41 | -------------------------------------------------------------------------------- /erizo/src/erizo/Stats.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Stats.h 3 | */ 4 | #ifndef ERIZO_SRC_ERIZO_STATS_H_ 5 | #define ERIZO_SRC_ERIZO_STATS_H_ 6 | 7 | #include 8 | #include 9 | 10 | #include "./logger.h" 11 | #include "pipeline/Service.h" 12 | #include "rtp/RtpHeaders.h" 13 | #include "lib/Clock.h" 14 | 15 | #include "stats/StatNode.h" 16 | 17 | namespace erizo { 18 | 19 | class MediaStreamStatsListener; 20 | 21 | class Stats : public Service { 22 | DECLARE_LOGGER(); 23 | 24 | public: 25 | Stats(); 26 | virtual ~Stats(); 27 | 28 | StatNode& getNode(); 29 | 30 | std::string getStats(); 31 | 32 | void setStatsListener(MediaStreamStatsListener* listener); 33 | void sendStats(); 34 | 35 | private: 36 | boost::mutex listener_mutex_; 37 | MediaStreamStatsListener* listener_; 38 | StatNode root_; 39 | }; 40 | 41 | } // namespace erizo 42 | 43 | #endif // ERIZO_SRC_ERIZO_STATS_H_ 44 | -------------------------------------------------------------------------------- /erizo/src/erizo/StringUtil.cpp: -------------------------------------------------------------------------------- 1 | #include "StringUtil.h" 2 | 3 | #include 4 | #include 5 | 6 | namespace erizo { 7 | namespace stringutil { 8 | std::vector splitOneOf(const std::string& str, 9 | const std::string& delims, 10 | const size_t maxSplits) { 11 | std::string remaining(str); 12 | std::vector result; 13 | size_t splits = 0, pos; 14 | 15 | while (((maxSplits == 0) || (splits < maxSplits)) && 16 | ((pos = remaining.find_first_of(delims)) != std::string::npos)) { 17 | result.push_back(remaining.substr(0, pos)); 18 | remaining = remaining.substr(pos + 1); 19 | splits++; 20 | } 21 | 22 | if (remaining.length() > 0) 23 | result.push_back(remaining); 24 | 25 | return result; 26 | } 27 | } // namespace stringutil 28 | } // namespace erizo 29 | -------------------------------------------------------------------------------- /erizo/src/erizo/StringUtil.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_STRINGUTIL_H_ 2 | #define ERIZO_SRC_ERIZO_STRINGUTIL_H_ 3 | 4 | #include 5 | #include 6 | 7 | namespace erizo { 8 | 9 | namespace stringutil { 10 | 11 | std::vector splitOneOf(const std::string& str, 12 | const std::string& delims, 13 | const size_t maxSplits = 0); 14 | 15 | } // namespace stringutil 16 | 17 | } // namespace erizo 18 | 19 | #endif // ERIZO_SRC_ERIZO_STRINGUTIL_H_ 20 | -------------------------------------------------------------------------------- /erizo/src/erizo/Transceiver.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ERIZO_SRC_ERIZO_TRANSCEIVER_H_ 3 | #define ERIZO_SRC_ERIZO_TRANSCEIVER_H_ 4 | 5 | #include "MediaStream.h" 6 | 7 | namespace erizo { 8 | 9 | 10 | class Transceiver { 11 | public: 12 | explicit Transceiver(std::string id, std::string kind); 13 | explicit Transceiver(uint32_t id, std::string kind); 14 | virtual ~Transceiver(); 15 | 16 | void resetSender(); 17 | bool hasSender(); 18 | bool isStopped(); 19 | void stop(); 20 | std::shared_ptr getSender(); 21 | void setSender(std::shared_ptr stream); 22 | void resetReceiver(); 23 | bool hasReceiver(); 24 | std::shared_ptr getReceiver(); 25 | void setReceiver(std::shared_ptr stream); 26 | std::string getId(); 27 | void setId(std::string id); 28 | void setId(uint32_t id); 29 | bool isInactive(); 30 | void setAsAddedToSdp(); 31 | bool hasBeenAddedToSdp(); 32 | std::string getSsrc(); 33 | std::string getKind(); 34 | std::string getSenderLabel(); 35 | std::string getReceiverLabel(); 36 | 37 | private: 38 | std::string id_; 39 | std::string sender_label_; 40 | std::string receiver_label_; 41 | std::string ssrc_; 42 | std::string kind_; 43 | bool added_to_sdp_; 44 | std::shared_ptr sender_; 45 | std::shared_ptr receiver_; 46 | bool stopped_; 47 | }; 48 | } // namespace erizo 49 | 50 | #endif // ERIZO_SRC_ERIZO_TRANSCEIVER_H_ 51 | -------------------------------------------------------------------------------- /erizo/src/erizo/bandwidth/BandwidthDistributionAlgorithm.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_BANDWIDTH_BANDWIDTHDISTRIBUTIONALGORITHM_H_ 2 | #define ERIZO_SRC_ERIZO_BANDWIDTH_BANDWIDTHDISTRIBUTIONALGORITHM_H_ 3 | 4 | #include 5 | #include 6 | 7 | namespace erizo { 8 | 9 | class MediaStream; 10 | class Transport; 11 | 12 | class BandwidthDistributionAlgorithm { 13 | public: 14 | BandwidthDistributionAlgorithm() {} 15 | virtual ~BandwidthDistributionAlgorithm() {} 16 | virtual void distribute(uint32_t remb, uint32_t ssrc, std::vector> streams, 17 | Transport *transport) = 0; 18 | virtual bool tooLowBandwidthEstimation() = 0; 19 | }; 20 | 21 | } // namespace erizo 22 | 23 | #endif // ERIZO_SRC_ERIZO_BANDWIDTH_BANDWIDTHDISTRIBUTIONALGORITHM_H_ 24 | -------------------------------------------------------------------------------- /erizo/src/erizo/bandwidth/MaxVideoBWDistributor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MaxVideoBWDistributor.cpp 3 | */ 4 | 5 | #include 6 | 7 | #include "MaxVideoBWDistributor.h" 8 | #include "MediaStream.h" 9 | #include "Transport.h" 10 | #include "rtp/RtpUtils.h" 11 | 12 | namespace erizo { 13 | 14 | void MaxVideoBWDistributor::distribute(uint32_t remb, uint32_t ssrc, 15 | std::vector> streams, Transport *transport) { 16 | std::sort(streams.begin(), streams.end(), 17 | [](const std::shared_ptr &i, const std::shared_ptr &j) { 18 | return i->getMaxVideoBW() < j->getMaxVideoBW(); 19 | }); 20 | 21 | uint8_t remaining_streams = streams.size(); 22 | uint32_t remaining_bitrate = remb; 23 | std::for_each(streams.begin(), streams.end(), 24 | [&remaining_bitrate, &remaining_streams, transport, ssrc](const std::shared_ptr &stream) { 25 | uint32_t max_bitrate = stream->getMaxVideoBW(); 26 | uint32_t remaining_avg_bitrate = remaining_bitrate / remaining_streams; 27 | uint32_t bitrate = std::min(max_bitrate, remaining_avg_bitrate); 28 | auto generated_remb = RtpUtils::createREMB(ssrc, {stream->getVideoSinkSSRC()}, bitrate); 29 | stream->onTransportData(generated_remb, transport); 30 | remaining_bitrate -= bitrate; 31 | remaining_streams--; 32 | }); 33 | } 34 | 35 | } // namespace erizo 36 | -------------------------------------------------------------------------------- /erizo/src/erizo/bandwidth/MaxVideoBWDistributor.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_BANDWIDTH_MAXVIDEOBWDISTRIBUTOR_H_ 2 | #define ERIZO_SRC_ERIZO_BANDWIDTH_MAXVIDEOBWDISTRIBUTOR_H_ 3 | 4 | #include "bandwidth/BandwidthDistributionAlgorithm.h" 5 | 6 | namespace erizo { 7 | 8 | class MaxVideoBWDistributor : public BandwidthDistributionAlgorithm { 9 | public: 10 | MaxVideoBWDistributor() {} 11 | virtual ~MaxVideoBWDistributor() {} 12 | void distribute(uint32_t remb, uint32_t ssrc, std::vector> streams, 13 | Transport *transport) override; 14 | bool tooLowBandwidthEstimation() override { return false; } 15 | }; 16 | 17 | } // namespace erizo 18 | 19 | #endif // ERIZO_SRC_ERIZO_BANDWIDTH_MAXVIDEOBWDISTRIBUTOR_H_ 20 | -------------------------------------------------------------------------------- /erizo/src/erizo/bandwidth/StreamPriorityBWDistributor.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_BANDWIDTH_STREAMPRIORITYBWDISTRIBUTOR_H_ 2 | #define ERIZO_SRC_ERIZO_BANDWIDTH_STREAMPRIORITYBWDISTRIBUTOR_H_ 3 | 4 | #include "./logger.h" 5 | #include "./Stats.h" 6 | #include "bandwidth/BwDistributionConfig.h" 7 | #include "bandwidth/BandwidthDistributionAlgorithm.h" 8 | 9 | namespace erizo { 10 | 11 | class MediaStream; 12 | 13 | class MediaStreamPriorityInfo { 14 | public: 15 | std::shared_ptr stream; 16 | uint64_t assigned_bitrate; 17 | }; 18 | 19 | class StreamPriorityBWDistributor : public BandwidthDistributionAlgorithm { 20 | DECLARE_LOGGER(); 21 | public: 22 | explicit StreamPriorityBWDistributor(StreamPriorityStrategy strategy, std::shared_ptr stats); 23 | virtual ~StreamPriorityBWDistributor() {} 24 | void distribute(uint32_t remb, uint32_t ssrc, std::vector> streams, 25 | Transport *transport) override; 26 | std::string getStrategyId(); 27 | 28 | bool tooLowBandwidthEstimation() override { return not_using_spatial_layers_; } 29 | uint32_t calulateRemainingAverageBitrate(size_t position, size_t total_size, uint32_t remaining_bitrate); 30 | 31 | private: 32 | StreamPriorityStrategy strategy_; 33 | std::shared_ptr stats_; 34 | bool not_using_spatial_layers_; 35 | }; 36 | 37 | } // namespace erizo 38 | 39 | #endif // ERIZO_SRC_ERIZO_BANDWIDTH_STREAMPRIORITYBWDISTRIBUTOR_H_ 40 | -------------------------------------------------------------------------------- /erizo/src/erizo/bandwidth/TargetVideoBWDistributor.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_BANDWIDTH_TARGETVIDEOBWDISTRIBUTOR_H_ 2 | #define ERIZO_SRC_ERIZO_BANDWIDTH_TARGETVIDEOBWDISTRIBUTOR_H_ 3 | 4 | #include "bandwidth/BandwidthDistributionAlgorithm.h" 5 | 6 | namespace erizo { 7 | 8 | class MediaStream; 9 | 10 | struct MediaStreamInfo { 11 | public: 12 | std::shared_ptr stream; 13 | bool is_simulcast; 14 | bool is_slideshow; 15 | uint32_t bitrate_sent; 16 | uint32_t max_video_bw; 17 | uint32_t bitrate_from_max_quality_layer; 18 | uint32_t target_video_bitrate; 19 | }; 20 | 21 | class TargetVideoBWDistributor : public BandwidthDistributionAlgorithm { 22 | public: 23 | TargetVideoBWDistributor() {} 24 | virtual ~TargetVideoBWDistributor() {} 25 | void distribute(uint32_t remb, uint32_t ssrc, std::vector> streams, 26 | Transport *transport) override; 27 | bool tooLowBandwidthEstimation() override { return false; } 28 | }; 29 | 30 | } // namespace erizo 31 | 32 | #endif // ERIZO_SRC_ERIZO_BANDWIDTH_TARGETVIDEOBWDISTRIBUTOR_H_ 33 | -------------------------------------------------------------------------------- /erizo/src/erizo/handlers/HandlerImporter.cpp: -------------------------------------------------------------------------------- 1 | #include "HandlerImporter.h" 2 | namespace erizo { 3 | 4 | HandlerImporter::HandlerImporter() {} 5 | 6 | void HandlerImporter::loadHandlers(std::vector> custom_handlers) { 7 | for (unsigned int i = 0; i < custom_handlers.size(); i++) { 8 | std::map parameters = custom_handlers[i]; 9 | std::string handler_name = parameters.at("name"); 10 | handler_order.push_back(handler_name); 11 | std::shared_ptr ptr; 12 | HandlersEnum handler_enum = handlers_dic[handler_name]; 13 | 14 | switch (handler_enum) { 15 | case LoggerHandlerEnum : 16 | ptr = std::make_shared(parameters); 17 | break; 18 | default: 19 | break; 20 | } 21 | handlers_pointer_dic.insert({handler_name, ptr}); 22 | } 23 | } 24 | } // namespace erizo 25 | -------------------------------------------------------------------------------- /erizo/src/erizo/handlers/HandlerImporter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by licode20 on 22/3/21. 3 | // 4 | 5 | #ifndef ERIZO_SRC_ERIZO_HANDLERS_HANDLERIMPORTER_H_ 6 | #define ERIZO_SRC_ERIZO_HANDLERS_HANDLERIMPORTER_H_ 7 | 8 | #include 9 | #include 10 | #include "../pipeline/Handler.h" 11 | #include "./logger.h" 12 | #include "handlers/LoggerHandler.h" 13 | 14 | 15 | 16 | namespace erizo { 17 | 18 | 19 | class HandlerImporterInterface { 20 | DECLARE_LOGGER(); 21 | public: 22 | void loadHandlers(std::vector> custom_handlers); 23 | std::map> handlers_pointer_dic = {}; 24 | std::vector handler_order = {}; 25 | }; 26 | 27 | 28 | class HandlerImporter: public HandlerImporterInterface { 29 | DECLARE_LOGGER(); 30 | public: 31 | HandlerImporter(); 32 | void loadHandlers(std::vector> custom_handlers); 33 | private: 34 | enum HandlersEnum {LoggerHandlerEnum}; 35 | 36 | std::map handlers_dic ={{"LoggerHandler", LoggerHandlerEnum}}; 37 | }; 38 | 39 | } // namespace erizo 40 | 41 | #endif // ERIZO_SRC_ERIZO_HANDLERS_HANDLERIMPORTER_H_ 42 | -------------------------------------------------------------------------------- /erizo/src/erizo/handlers/handlers/LoggerHandler.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_HANDLERS_HANDLERS_LOGGERHANDLER_H_ 2 | #define ERIZO_SRC_ERIZO_HANDLERS_HANDLERS_LOGGERHANDLER_H_ 3 | 4 | #include "../../pipeline/Handler.h" // Import CustomHandler interface 5 | #include "../../MediaDefinitions.h" // Imports DataPacket struct 6 | #include "./logger.h" // Include logger 7 | 8 | 9 | namespace erizo { // Handlers are include in erizo namespace 10 | class LoggerHandler : public CustomHandler { 11 | DECLARE_LOGGER(); // Declares logger for debugging and logging 12 | public: 13 | explicit LoggerHandler(std::map parameters); 14 | ~LoggerHandler(); 15 | void read(Context *ctx, std::shared_ptr packet) override; // Process packet sent by client 16 | void write(Context *ctx, std::shared_ptr packet) override; // Process packet sent to client 17 | Positions position() override; // Returns position to place handler. 18 | void enable() override; // Enable handler 19 | void disable() override; // Disable handler 20 | std::string getName() override; // Returns handler name 21 | void notifyUpdate() override; // Recieves update 22 | private: 23 | RtcpHeader* rtcp_head; 24 | RtpHeader* rtp_head; 25 | bool is_enabled = true; 26 | }; 27 | } // namespace erizo 28 | 29 | #endif // ERIZO_SRC_ERIZO_HANDLERS_HANDLERS_LOGGERHANDLER_H_" 30 | -------------------------------------------------------------------------------- /erizo/src/erizo/lib/Clock.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_LIB_CLOCK_H_ 2 | #define ERIZO_SRC_ERIZO_LIB_CLOCK_H_ 3 | 4 | #include // NOLINT 5 | 6 | namespace erizo { 7 | 8 | using clock = std::chrono::steady_clock; 9 | using time_point = std::chrono::steady_clock::time_point; 10 | using duration = std::chrono::steady_clock::duration; 11 | 12 | class Clock { 13 | public: 14 | virtual time_point now() = 0; 15 | virtual ~Clock() {} 16 | }; 17 | 18 | class SteadyClock : public Clock { 19 | public: 20 | time_point now() override { 21 | return clock::now(); 22 | } 23 | }; 24 | 25 | class SimulatedClock : public Clock { 26 | public: 27 | SimulatedClock() : now_{clock::now()} {} 28 | 29 | time_point now() override { 30 | return now_; 31 | } 32 | 33 | void advanceTime(duration duration) { 34 | now_ += duration; 35 | } 36 | private: 37 | time_point now_; 38 | }; 39 | } // namespace erizo 40 | #endif // ERIZO_SRC_ERIZO_LIB_CLOCK_H_ 41 | -------------------------------------------------------------------------------- /erizo/src/erizo/lib/ClockUtils.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_LIB_CLOCKUTILS_H_ 2 | #define ERIZO_SRC_ERIZO_LIB_CLOCKUTILS_H_ 3 | 4 | #include // NOLINT 5 | 6 | #include "Clock.h" 7 | 8 | namespace erizo { 9 | 10 | class ClockUtils { 11 | public: 12 | static inline int64_t durationToMs(erizo::duration duration) { 13 | return std::chrono::duration_cast(duration).count(); 14 | } 15 | 16 | static inline uint64_t timePointToMs(erizo::time_point time_point) { 17 | return std::chrono::duration_cast(time_point.time_since_epoch()).count(); 18 | } 19 | }; 20 | 21 | } // namespace erizo 22 | #endif // ERIZO_SRC_ERIZO_LIB_CLOCKUTILS_H_ 23 | -------------------------------------------------------------------------------- /erizo/src/erizo/media/codecs/AudioCodec.h: -------------------------------------------------------------------------------- 1 | /** 2 | * AudioCodec.h 3 | */ 4 | #ifndef ERIZO_SRC_ERIZO_MEDIA_CODECS_AUDIOCODEC_H_ 5 | #define ERIZO_SRC_ERIZO_MEDIA_CODECS_AUDIOCODEC_H_ 6 | 7 | extern "C" { 8 | #include 9 | #include 10 | } 11 | 12 | #include "./Codecs.h" 13 | #include "./logger.h" 14 | 15 | namespace erizo { 16 | 17 | class AudioEncoder { 18 | DECLARE_LOGGER(); 19 | 20 | public: 21 | AudioEncoder(); 22 | virtual ~AudioEncoder(); 23 | int initEncoder(const AudioCodecInfo& info); 24 | int encodeAudio(unsigned char* inBuffer, int nSamples, AVPacket* pkt); 25 | int closeEncoder(); 26 | 27 | private: 28 | AVCodec* aCoder_; 29 | AVCodecContext* aCoderContext_; 30 | AVFrame* aFrame_; 31 | }; 32 | 33 | class AudioDecoder { 34 | DECLARE_LOGGER(); 35 | 36 | public: 37 | AudioDecoder(); 38 | virtual ~AudioDecoder(); 39 | int initDecoder(const AudioCodecInfo& info); 40 | int initDecoder(AVCodecContext* context); 41 | int decodeAudio(unsigned char* inBuff, int inBuffLen, unsigned char* outBuff, int outBuffLen, int* gotFrame); 42 | int closeDecoder(); 43 | 44 | private: 45 | AVCodec* aDecoder_; 46 | AVCodecContext* aDecoderContext_; 47 | AVFrame* dFrame_; 48 | }; 49 | 50 | } // namespace erizo 51 | #endif // ERIZO_SRC_ERIZO_MEDIA_CODECS_AUDIOCODEC_H_ 52 | -------------------------------------------------------------------------------- /erizo/src/erizo/media/codecs/Codecs.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ERIZO_SRC_ERIZO_MEDIA_CODECS_CODECS_H_ 3 | #define ERIZO_SRC_ERIZO_MEDIA_CODECS_CODECS_H_ 4 | 5 | #include 6 | namespace erizo { 7 | enum VideoCodecID{ 8 | VIDEO_CODEC_VP8, 9 | VIDEO_CODEC_H264, 10 | VIDEO_CODEC_MPEG4 11 | }; 12 | 13 | enum AudioCodecID{ 14 | AUDIO_CODEC_PCM_U8, 15 | AUDIO_CODEC_OPUS, 16 | AUDIO_CODEC_VORBIS 17 | }; 18 | 19 | struct VideoCodecInfo { 20 | VideoCodecID codec; 21 | int payloadType; 22 | int width; 23 | int height; 24 | int bitRate; 25 | int frameRate; 26 | }; 27 | 28 | struct AudioCodecInfo { 29 | AudioCodecID codec; 30 | int bitRate; 31 | int sampleRate; 32 | }; 33 | } // namespace erizo 34 | #endif // ERIZO_SRC_ERIZO_MEDIA_CODECS_CODECS_H_ 35 | -------------------------------------------------------------------------------- /erizo/src/erizo/pipeline/HandlerManager.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_PIPELINE_HANDLERMANAGER_H_ 2 | #define ERIZO_SRC_ERIZO_PIPELINE_HANDLERMANAGER_H_ 3 | 4 | #include "pipeline/Service.h" 5 | 6 | namespace erizo { 7 | 8 | class HandlerManagerListener { 9 | public: 10 | virtual ~HandlerManagerListener() = default; 11 | 12 | virtual void notifyUpdateToHandlers() = 0; 13 | }; 14 | 15 | class HandlerManager : public Service { 16 | public: 17 | explicit HandlerManager(std::weak_ptr listener) : listener_{listener} {} 18 | virtual ~HandlerManager() = default; 19 | 20 | void notifyUpdateToHandlers() { 21 | if (auto listener = listener_.lock()) { 22 | listener->notifyUpdateToHandlers(); 23 | } 24 | } 25 | private: 26 | std::weak_ptr listener_; 27 | }; 28 | } // namespace erizo 29 | 30 | #endif // ERIZO_SRC_ERIZO_PIPELINE_HANDLERMANAGER_H_ 31 | -------------------------------------------------------------------------------- /erizo/src/erizo/pipeline/Service.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_PIPELINE_SERVICE_H_ 2 | #define ERIZO_SRC_ERIZO_PIPELINE_SERVICE_H_ 3 | 4 | #include "pipeline/Pipeline.h" 5 | 6 | namespace erizo { 7 | 8 | class PipelineBase; 9 | 10 | template 11 | class ServiceBase { 12 | public: 13 | virtual ~ServiceBase() = default; 14 | 15 | virtual void attachPipeline(Context* /*ctx*/) {} 16 | virtual void detachPipeline(Context* /*ctx*/) {} 17 | virtual void notifyEvent(MediaEventPtr event) {} 18 | 19 | 20 | Context* getContext() { 21 | if (attach_count_ != 1) { 22 | return nullptr; 23 | } 24 | assert(service_ctx_); 25 | return service_ctx_; 26 | } 27 | 28 | private: 29 | friend PipelineServiceContext; 30 | uint64_t attach_count_{0}; 31 | Context* service_ctx_{nullptr}; 32 | }; 33 | 34 | class Service : public ServiceBase { 35 | }; 36 | } // namespace erizo 37 | #endif // ERIZO_SRC_ERIZO_PIPELINE_SERVICE_H_ 38 | -------------------------------------------------------------------------------- /erizo/src/erizo/pipeline/ServiceContext.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_PIPELINE_SERVICECONTEXT_H_ 2 | #define ERIZO_SRC_ERIZO_PIPELINE_SERVICECONTEXT_H_ 3 | 4 | namespace erizo { 5 | 6 | class PipelineBase; 7 | 8 | class ServiceContext { 9 | public: 10 | virtual ~ServiceContext() = default; 11 | 12 | virtual PipelineBase* getPipeline() = 0; 13 | virtual std::shared_ptr getPipelineShared() = 0; 14 | }; 15 | 16 | } // namespace erizo 17 | 18 | #include 19 | 20 | #endif // ERIZO_SRC_ERIZO_PIPELINE_SERVICECONTEXT_H_ 21 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/FecReceiverHandler.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_RTP_FECRECEIVERHANDLER_H_ 2 | #define ERIZO_SRC_ERIZO_RTP_FECRECEIVERHANDLER_H_ 3 | 4 | #include 5 | 6 | #include "./logger.h" 7 | #include "pipeline/Handler.h" 8 | #include "webrtc/modules/rtp_rtcp/include/ulpfec_receiver.h" 9 | 10 | namespace erizo { 11 | 12 | class MediaStream; 13 | 14 | class FecReceiverHandler: public OutboundHandler, public webrtc::RecoveredPacketReceiver { 15 | DECLARE_LOGGER(); 16 | 17 | public: 18 | FecReceiverHandler(); 19 | 20 | void setFecReceiver(std::unique_ptr&& fec_receiver); // NOLINT 21 | 22 | void enable() override; 23 | void disable() override; 24 | 25 | std::string getName() override { 26 | return "fec-receiver"; 27 | } 28 | 29 | void write(Context *ctx, std::shared_ptr packet) override; 30 | void notifyUpdate() override; 31 | 32 | // webrtc::RecoveredPacketReceiver overrides. 33 | void OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override; 34 | 35 | private: 36 | bool enabled_; 37 | std::unique_ptr fec_receiver_; 38 | }; 39 | 40 | } // namespace erizo 41 | 42 | #endif // ERIZO_SRC_ERIZO_RTP_FECRECEIVERHANDLER_H_ 43 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/LayerBitrateCalculationHandler.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_RTP_LAYERBITRATECALCULATIONHANDLER_H_ 2 | #define ERIZO_SRC_ERIZO_RTP_LAYERBITRATECALCULATIONHANDLER_H_ 3 | 4 | 5 | #include "./logger.h" 6 | #include "pipeline/Handler.h" 7 | #include "./Stats.h" 8 | #include "rtp/QualityManager.h" 9 | 10 | namespace erizo { 11 | 12 | 13 | constexpr duration kLayerRateStatIntervalSize = std::chrono::milliseconds(100); 14 | constexpr uint32_t kLayerRateStatIntervals = 30; 15 | 16 | class LayerBitrateCalculationHandler: public OutboundHandler { 17 | DECLARE_LOGGER(); 18 | 19 | 20 | public: 21 | LayerBitrateCalculationHandler(); 22 | 23 | void enable() override; 24 | void disable() override; 25 | 26 | std::string getName() override { 27 | return "layer_bitrate_calculator"; 28 | } 29 | 30 | void write(Context *ctx, std::shared_ptr packet) override; 31 | void notifyUpdate() override; 32 | 33 | private: 34 | const std::string kQualityLayersStatsKey = "qualityLayers"; 35 | bool enabled_; 36 | bool initialized_; 37 | std::shared_ptr stats_; 38 | std::shared_ptr quality_manager_; 39 | }; 40 | } // namespace erizo 41 | 42 | #endif // ERIZO_SRC_ERIZO_RTP_LAYERBITRATECALCULATIONHANDLER_H_ 43 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/PacketBufferService.cpp: -------------------------------------------------------------------------------- 1 | #include "rtp/PacketBufferService.h" 2 | 3 | namespace erizo { 4 | DEFINE_LOGGER(PacketBufferService, "rtp.PacketBufferService"); 5 | 6 | PacketBufferService::PacketBufferService(): audio_{kServicePacketBufferSize}, 7 | video_{kServicePacketBufferSize} { 8 | } 9 | 10 | void PacketBufferService::insertPacket(std::shared_ptr packet) { 11 | RtpHeader *head = reinterpret_cast (packet->data); 12 | switch (packet->type) { 13 | case VIDEO_PACKET: 14 | video_[getIndexInBuffer(head->getSeqNumber())] = packet; 15 | break; 16 | case AUDIO_PACKET: 17 | audio_[getIndexInBuffer(head->getSeqNumber())] = packet; 18 | break; 19 | default: 20 | ELOG_INFO("message: Trying to store an unknown packet"); 21 | break; 22 | } 23 | } 24 | 25 | std::shared_ptr PacketBufferService::getVideoPacket(uint16_t seq_num) { 26 | return video_[getIndexInBuffer(seq_num)]; 27 | } 28 | std::shared_ptr PacketBufferService::getAudioPacket(uint16_t seq_num) { 29 | return audio_[getIndexInBuffer(seq_num)]; 30 | } 31 | uint16_t PacketBufferService::getIndexInBuffer(uint16_t seq_num) { 32 | return seq_num % kServicePacketBufferSize; 33 | } 34 | 35 | } // namespace erizo 36 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/PacketBufferService.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_RTP_PACKETBUFFERSERVICE_H_ 2 | #define ERIZO_SRC_ERIZO_RTP_PACKETBUFFERSERVICE_H_ 3 | 4 | #include "./logger.h" 5 | #include "./MediaDefinitions.h" 6 | #include "rtp/RtpHeaders.h" 7 | #include "pipeline/Service.h" 8 | 9 | static constexpr uint16_t kServicePacketBufferSize = 256; 10 | 11 | namespace erizo { 12 | class PacketBufferService: public Service { 13 | public: 14 | DECLARE_LOGGER(); 15 | 16 | PacketBufferService(); 17 | ~PacketBufferService() {} 18 | 19 | PacketBufferService(const PacketBufferService&& service); 20 | 21 | void insertPacket(std::shared_ptr packet); 22 | 23 | std::shared_ptr getVideoPacket(uint16_t seq_num); 24 | std::shared_ptr getAudioPacket(uint16_t seq_num); 25 | 26 | private: 27 | uint16_t getIndexInBuffer(uint16_t seq_num); 28 | 29 | private: 30 | std::vector> audio_; 31 | std::vector> video_; 32 | }; 33 | 34 | } // namespace erizo 35 | #endif // ERIZO_SRC_ERIZO_RTP_PACKETBUFFERSERVICE_H_ 36 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/PacketCodecParser.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_RTP_PACKETCODECPARSER_H_ 2 | #define ERIZO_SRC_ERIZO_RTP_PACKETCODECPARSER_H_ 3 | 4 | #include "./logger.h" 5 | #include "pipeline/Handler.h" 6 | 7 | namespace erizo { 8 | 9 | class MediaStream; 10 | 11 | class PacketCodecParser: public InboundHandler { 12 | DECLARE_LOGGER(); 13 | 14 | 15 | public: 16 | PacketCodecParser(); 17 | 18 | void enable() override; 19 | void disable() override; 20 | 21 | std::string getName() override { 22 | return "packet_codec_parser"; 23 | } 24 | 25 | void read(Context *ctx, std::shared_ptr packet) override; 26 | void notifyUpdate() override; 27 | 28 | private: 29 | MediaStream *stream_; 30 | bool enabled_; 31 | bool initialized_; 32 | }; 33 | } // namespace erizo 34 | 35 | #endif // ERIZO_SRC_ERIZO_RTP_PACKETCODECPARSER_H_ 36 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/PliPriorityHandler.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_RTP_PLIPRIORITYHANDLER_H_ 2 | #define ERIZO_SRC_ERIZO_RTP_PLIPRIORITYHANDLER_H_ 3 | 4 | #include 5 | 6 | #include "./logger.h" 7 | #include "pipeline/Handler.h" 8 | #include "thread/Worker.h" 9 | #include "lib/Clock.h" 10 | 11 | namespace erizo { 12 | 13 | class MediaStream; 14 | 15 | class PliPriorityHandler: public Handler, public std::enable_shared_from_this { 16 | DECLARE_LOGGER(); 17 | 18 | public: 19 | static constexpr duration kLowPriorityPliPeriod = std::chrono::seconds(3); 20 | 21 | public: 22 | explicit PliPriorityHandler(std::shared_ptr the_clock = std::make_shared()); 23 | 24 | void enable() override; 25 | void disable() override; 26 | 27 | std::string getName() override { 28 | return "pli-priority"; 29 | } 30 | 31 | void read(Context *ctx, std::shared_ptr packet) override; 32 | void write(Context *ctx, std::shared_ptr packet) override; 33 | void notifyUpdate() override; 34 | 35 | private: 36 | void schedulePeriodicPlis(); 37 | void sendPLI(); 38 | 39 | private: 40 | bool enabled_; 41 | MediaStream* stream_; 42 | std::shared_ptr clock_; 43 | uint32_t video_sink_ssrc_; 44 | uint32_t video_source_ssrc_; 45 | uint32_t plis_received_in_interval_; 46 | bool first_received_; 47 | }; 48 | 49 | } // namespace erizo 50 | 51 | #endif // ERIZO_SRC_ERIZO_RTP_PLIPRIORITYHANDLER_H_ 52 | 53 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/RtcpAggregator.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_RTP_RTCPAGGREGATOR_H_ 2 | #define ERIZO_SRC_ERIZO_RTP_RTCPAGGREGATOR_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "./logger.h" 11 | #include "./MediaDefinitions.h" 12 | #include "./SdpInfo.h" 13 | #include "rtp/RtpHeaders.h" 14 | #include "rtp/RtcpProcessor.h" 15 | 16 | namespace erizo { 17 | static const int MAP_NACK_SIZE = 50; 18 | 19 | class RtcpAggregator: public RtcpProcessor{ 20 | DECLARE_LOGGER(); 21 | 22 | public: 23 | RtcpAggregator(MediaSink* msink, MediaSource* msource, uint32_t max_video_bw = 300000); 24 | virtual ~RtcpAggregator() {} 25 | void addSourceSsrc(uint32_t ssrc); 26 | void setPublisherBW(uint32_t bandwidth); 27 | void analyzeSr(RtcpHeader* chead); 28 | int analyzeFeedback(char* buf, int len); 29 | void checkRtcpFb(); 30 | 31 | private: 32 | static const int REMB_TIMEOUT = 1000; 33 | static const uint64_t NTPTOMSCONV = 4294967296; 34 | std::map> rtcpData_; 35 | boost::mutex mapLock_; 36 | uint32_t defaultVideoBw_; 37 | uint8_t packet_[128]; 38 | int addREMB(char* buf, int len, uint32_t bitrate); 39 | int addNACK(char* buf, int len, uint16_t seqNum, uint16_t blp, uint32_t sourceSsrc, uint32_t sinkSsrc); 40 | void resetData(boost::shared_ptr data, uint32_t bandwidth); 41 | }; 42 | 43 | } // namespace erizo 44 | 45 | #endif // ERIZO_SRC_ERIZO_RTP_RTCPAGGREGATOR_H_ 46 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/RtcpForwarder.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_RTP_RTCPFORWARDER_H_ 2 | #define ERIZO_SRC_ERIZO_RTP_RTCPFORWARDER_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "./logger.h" 11 | #include "./MediaDefinitions.h" 12 | #include "./SdpInfo.h" 13 | #include "./DefaultValues.h" 14 | #include "rtp/RtpHeaders.h" 15 | #include "rtp/RtcpProcessor.h" 16 | 17 | namespace erizo { 18 | 19 | class RtcpForwarder: public RtcpProcessor{ 20 | DECLARE_LOGGER(); 21 | 22 | public: 23 | RtcpForwarder(MediaSink* msink, MediaSource* msource, uint32_t max_video_bw = kDefaultMaxVideoBWInBitsps); 24 | virtual ~RtcpForwarder() {} 25 | void addSourceSsrc(uint32_t ssrc) override; 26 | void setPublisherBW(uint32_t bandwidth) override; 27 | void analyzeSr(RtcpHeader* chead) override; 28 | int analyzeFeedback(char* buf, int len) override; 29 | void checkRtcpFb() override; 30 | 31 | private: 32 | static const int RR_AUDIO_PERIOD = 2000; 33 | static const int RR_VIDEO_BASE = 800; 34 | static const int REMB_TIMEOUT = 1000; 35 | std::map> rtcpData_; 36 | boost::mutex mapLock_; 37 | int addREMB(char* buf, int len, uint32_t bitrate); 38 | int addNACK(char* buf, int len, uint16_t seqNum, uint16_t blp, uint32_t sourceSsrc, uint32_t sinkSsrc); 39 | }; 40 | 41 | } // namespace erizo 42 | 43 | #endif // ERIZO_SRC_ERIZO_RTP_RTCPFORWARDER_H_ 44 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/RtcpNackGenerator.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_RTP_RTCPNACKGENERATOR_H_ 2 | #define ERIZO_SRC_ERIZO_RTP_RTCPNACKGENERATOR_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "./logger.h" 9 | #include "pipeline/Handler.h" 10 | #include "lib/ClockUtils.h" 11 | 12 | #define MAX_DELAY 450000 13 | 14 | namespace erizo { 15 | 16 | class NackInfo { 17 | public: 18 | NackInfo(): seq_num{0}, retransmits{0}, sent_time{0} {} 19 | explicit NackInfo(uint16_t seq_num): seq_num{seq_num}, retransmits{0}, sent_time{0} {} 20 | uint16_t seq_num; 21 | uint16_t retransmits; 22 | uint64_t sent_time; 23 | }; 24 | 25 | class RtcpNackGenerator{ 26 | DECLARE_LOGGER(); 27 | 28 | public: 29 | explicit RtcpNackGenerator(uint32_t ssrc_, 30 | std::shared_ptr the_clock = std::make_shared()); 31 | bool handleRtpPacket(std::shared_ptr packet); 32 | bool addNackPacketToRr(std::shared_ptr rr_packet); 33 | 34 | private: 35 | bool addNacks(uint16_t seq_num); 36 | bool isTimeToRetransmit(const NackInfo& nack_info, uint64_t current_time_ms); 37 | 38 | private: 39 | bool initialized_; 40 | uint16_t highest_seq_num_; 41 | uint32_t ssrc_; 42 | NackInfo nack_info_; 43 | std::vector nack_info_list_; 44 | std::shared_ptr clock_; 45 | }; 46 | } // namespace erizo 47 | 48 | #endif // ERIZO_SRC_ERIZO_RTP_RTCPNACKGENERATOR_H_ 49 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/RtcpProcessorHandler.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_RTP_RTCPPROCESSORHANDLER_H_ 2 | #define ERIZO_SRC_ERIZO_RTP_RTCPPROCESSORHANDLER_H_ 3 | 4 | #include 5 | 6 | #include "./logger.h" 7 | #include "./Stats.h" 8 | #include "pipeline/Handler.h" 9 | #include "rtp/RtcpProcessor.h" 10 | 11 | namespace erizo { 12 | 13 | class MediaStream; 14 | 15 | class RtcpProcessorHandler: public Handler { 16 | DECLARE_LOGGER(); 17 | 18 | public: 19 | RtcpProcessorHandler(); 20 | 21 | void enable() override; 22 | void disable() override; 23 | 24 | std::string getName() override { 25 | return "rtcp-processor"; 26 | } 27 | 28 | void read(Context *ctx, std::shared_ptr packet) override; 29 | void write(Context *ctx, std::shared_ptr packet) override; 30 | void notifyUpdate() override; 31 | 32 | private: 33 | MediaStream* stream_; 34 | std::shared_ptr processor_; 35 | std::shared_ptr stats_; 36 | }; 37 | 38 | } // namespace erizo 39 | 40 | #endif // ERIZO_SRC_ERIZO_RTP_RTCPPROCESSORHANDLER_H_ 41 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/RtpH264Parser.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_RTP_RTPH264PARSER_H_ 2 | #define ERIZO_SRC_ERIZO_RTP_RTPH264PARSER_H_ 3 | 4 | #include "./logger.h" 5 | #include 6 | 7 | namespace erizo { 8 | 9 | enum H264FrameTypes { 10 | kH264IFrame, // key frame 11 | kH264PFrame // Delta frame 12 | }; 13 | 14 | enum NALTypes { 15 | single, 16 | fragmented, 17 | aggregated, 18 | }; 19 | 20 | struct RTPPayloadH264 { 21 | static constexpr unsigned char start_sequence[] = { 0, 0, 0, 1 }; 22 | H264FrameTypes frameType = kH264PFrame; 23 | NALTypes nal_type = single; 24 | const unsigned char* data; 25 | unsigned int dataLength = 0; 26 | unsigned char fragment_nal_header; 27 | int fragment_nal_header_len = 0; 28 | unsigned char start_bit = 0; 29 | unsigned char end_bit = 0; 30 | std::unique_ptr unpacked_data; 31 | unsigned unpacked_data_len = 0; 32 | }; 33 | 34 | class RtpH264Parser { 35 | DECLARE_LOGGER(); 36 | public: 37 | RtpH264Parser(); 38 | virtual ~RtpH264Parser(); 39 | erizo::RTPPayloadH264* parseH264(unsigned char* data, int datalength); 40 | private: 41 | int parse_packet_fu_a(RTPPayloadH264* h264, unsigned char* buf, int len) const; 42 | int parse_aggregated_packet(RTPPayloadH264* h264, unsigned char* buf, int len) const; 43 | }; 44 | } // namespace erizo 45 | #endif // ERIZO_SRC_ERIZO_RTP_RTPH264PARSER_H_ 46 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/RtpPaddingRemovalHandler.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ERIZO_SRC_ERIZO_RTP_RTPPADDINGREMOVALHANDLER_H_ 3 | #define ERIZO_SRC_ERIZO_RTP_RTPPADDINGREMOVALHANDLER_H_ 4 | 5 | #include 6 | 7 | #include "./logger.h" 8 | #include "pipeline/Handler.h" 9 | #include "rtp/SequenceNumberTranslator.h" 10 | 11 | namespace erizo { 12 | 13 | class MediaStream; 14 | 15 | class RtpPaddingRemovalHandler: public Handler, public std::enable_shared_from_this { 16 | DECLARE_LOGGER(); 17 | 18 | 19 | public: 20 | RtpPaddingRemovalHandler(); 21 | 22 | void enable() override; 23 | void disable() override; 24 | 25 | std::string getName() override { 26 | return "padding_removal"; 27 | } 28 | 29 | void read(Context *ctx, std::shared_ptr packet) override; 30 | void write(Context *ctx, std::shared_ptr packet) override; 31 | void notifyUpdate() override; 32 | 33 | private: 34 | bool removePaddingBytes(std::shared_ptr packet, 35 | std::shared_ptr translator); 36 | std::shared_ptr getTranslatorForSsrc(uint32_t ssrc, 37 | bool should_create); 38 | 39 | private: 40 | bool enabled_; 41 | bool initialized_; 42 | std::map> translator_map_; 43 | MediaStream* stream_; 44 | }; 45 | } // namespace erizo 46 | 47 | #endif // ERIZO_SRC_ERIZO_RTP_RTPPADDINGREMOVALHANDLER_H_ 48 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/RtpSource.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * RtpSource.h 4 | * 5 | * Created on: Aug 2, 2012 6 | * Author: pedro 7 | */ 8 | #ifndef ERIZO_SRC_ERIZO_RTP_RTPSOURCE_H_ 9 | #define ERIZO_SRC_ERIZO_RTP_RTPSOURCE_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | #include "./MediaDefinitions.h" 18 | #include "./logger.h" 19 | 20 | namespace erizo { 21 | 22 | class RtpSource: public MediaSource, public FeedbackSink { 23 | DECLARE_LOGGER(); 24 | 25 | public: 26 | RtpSource(const int mediaPort, const std::string& feedbackDir, const std::string& feedbackPort); 27 | virtual ~RtpSource(); 28 | 29 | private: 30 | static const int LENGTH = 1500; 31 | boost::scoped_ptr socket_, fbSocket_; 32 | boost::scoped_ptr resolver_; 33 | boost::scoped_ptr query_; 34 | boost::asio::ip::udp::resolver::iterator iterator_; 35 | boost::asio::io_service io_service_; 36 | boost::thread rtpSource_thread_; 37 | char* buffer_[LENGTH]; 38 | void handleReceive(const::boost::system::error_code& error, size_t bytes_recvd); // NOLINT 39 | void eventLoop(); 40 | int deliverFeedback_(std::shared_ptr fb_packet) override; 41 | }; 42 | 43 | 44 | } // namespace erizo 45 | #endif // ERIZO_SRC_ERIZO_RTP_RTPSOURCE_H_ 46 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/RtpVP8Fragmenter.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_RTP_RTPVP8FRAGMENTER_H_ 2 | #define ERIZO_SRC_ERIZO_RTP_RTPVP8FRAGMENTER_H_ 3 | 4 | #include 5 | #include "./logger.h" 6 | 7 | namespace erizo { 8 | 9 | class RtpVP8Fragmenter { 10 | DECLARE_LOGGER(); 11 | 12 | public: 13 | RtpVP8Fragmenter(unsigned char* data, unsigned int length); 14 | virtual ~RtpVP8Fragmenter(); 15 | 16 | int getPacket(unsigned char* data, unsigned int* length, bool* lastPacket); 17 | 18 | private: 19 | struct Fragment { 20 | unsigned int position; 21 | unsigned int size; 22 | bool first; 23 | }; 24 | void calculatePackets(); 25 | unsigned int writeFragment(const Fragment& fragment, unsigned char* buffer, unsigned int* length); 26 | unsigned char* totalData_; 27 | unsigned int totalLenth_; 28 | std::queue fragmentQueue_; 29 | }; 30 | } // namespace erizo 31 | #endif // ERIZO_SRC_ERIZO_RTP_RTPVP8FRAGMENTER_H_ 32 | -------------------------------------------------------------------------------- /erizo/src/erizo/rtp/SRPacketHandler.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_RTP_SRPACKETHANDLER_H_ 2 | #define ERIZO_SRC_ERIZO_RTP_SRPACKETHANDLER_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "./logger.h" 8 | #include "pipeline/Handler.h" 9 | 10 | #define MAX_DELAY 450000 11 | 12 | namespace erizo { 13 | 14 | class MediaStream; 15 | 16 | class SRPacketHandler: public Handler { 17 | DECLARE_LOGGER(); 18 | 19 | 20 | public: 21 | SRPacketHandler(); 22 | 23 | void enable() override; 24 | void disable() override; 25 | 26 | std::string getName() override { 27 | return "sr_handler"; 28 | } 29 | 30 | void read(Context *ctx, std::shared_ptr packet) override; 31 | void write(Context *ctx, std::shared_ptr packet) override; 32 | void notifyUpdate() override; 33 | 34 | private: 35 | struct SRInfo { 36 | SRInfo() : ssrc{0}, sent_octets{0}, sent_packets{0} {} 37 | uint32_t ssrc; 38 | uint32_t sent_octets; 39 | uint32_t sent_packets; 40 | }; 41 | 42 | bool enabled_, initialized_; 43 | MediaStream* stream_; 44 | std::map> sr_info_map_; 45 | 46 | void handleRtpPacket(std::shared_ptr packet); 47 | void handleSR(std::shared_ptr packet); 48 | }; 49 | } // namespace erizo 50 | 51 | #endif // ERIZO_SRC_ERIZO_RTP_SRPACKETHANDLER_H_ 52 | -------------------------------------------------------------------------------- /erizo/src/erizo/thread/IOThreadPool.cpp: -------------------------------------------------------------------------------- 1 | #include "thread/IOThreadPool.h" 2 | 3 | #include 4 | #include // NOLINT 5 | 6 | using erizo::IOThreadPool; 7 | using erizo::IOWorker; 8 | 9 | IOThreadPool::IOThreadPool(unsigned int num_io_workers, bool enable_glib_loop) 10 | : io_workers_{} { 11 | for (unsigned int index = 0; index < num_io_workers; index++) { 12 | io_workers_.push_back(std::make_shared(enable_glib_loop)); 13 | } 14 | } 15 | 16 | IOThreadPool::~IOThreadPool() { 17 | close(); 18 | } 19 | 20 | std::shared_ptr IOThreadPool::getLessUsedIOWorker() { 21 | std::shared_ptr chosen_io_worker = io_workers_.front(); 22 | for (auto io_worker : io_workers_) { 23 | if (chosen_io_worker.use_count() > io_worker.use_count()) { 24 | chosen_io_worker = io_worker; 25 | } 26 | } 27 | return chosen_io_worker; 28 | } 29 | 30 | void IOThreadPool::start() { 31 | std::vector>> promises(io_workers_.size()); 32 | int index = 0; 33 | for (auto io_worker : io_workers_) { 34 | promises[index] = std::make_shared>(); 35 | io_worker->start(promises[index++]); 36 | } 37 | for (auto promise : promises) { 38 | promise->get_future().wait(); 39 | } 40 | } 41 | 42 | void IOThreadPool::close() { 43 | for (auto io_worker : io_workers_) { 44 | io_worker->close(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /erizo/src/erizo/thread/IOThreadPool.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_THREAD_IOTHREADPOOL_H_ 2 | #define ERIZO_SRC_ERIZO_THREAD_IOTHREADPOOL_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "thread/IOWorker.h" 8 | #include "thread/Scheduler.h" 9 | 10 | namespace erizo { 11 | 12 | class IOThreadPool { 13 | public: 14 | explicit IOThreadPool(unsigned int num_workers, bool enable_glib_loop = false); 15 | ~IOThreadPool(); 16 | 17 | std::shared_ptr getLessUsedIOWorker(); 18 | void start(); 19 | void close(); 20 | 21 | private: 22 | std::vector> io_workers_; 23 | }; 24 | } // namespace erizo 25 | 26 | #endif // ERIZO_SRC_ERIZO_THREAD_IOTHREADPOOL_H_ 27 | -------------------------------------------------------------------------------- /erizo/src/erizo/thread/IOWorker.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_THREAD_IOWORKER_H_ 2 | #define ERIZO_SRC_ERIZO_THREAD_IOWORKER_H_ 3 | 4 | #include 5 | #include 6 | #include // NOLINT 7 | #include // NOLINT 8 | #include // NOLINT 9 | #include 10 | 11 | #include "./logger.h" 12 | #include "lib/LibNiceInterface.h" 13 | 14 | 15 | namespace erizo { 16 | 17 | class IOWorker : public std::enable_shared_from_this { 18 | DECLARE_LOGGER(); 19 | 20 | public: 21 | typedef std::function Task; 22 | explicit IOWorker(bool enable_glib_loop = false); 23 | virtual ~IOWorker(); 24 | 25 | virtual void start(); 26 | virtual void start(std::shared_ptr> start_promise); 27 | virtual void close(); 28 | 29 | virtual void task(Task f); 30 | 31 | GMainContext* getGlibContext(); 32 | 33 | private: 34 | void mainGlibLoop(); 35 | 36 | private: 37 | std::atomic started_; 38 | std::atomic closed_; 39 | bool enable_glib_loop_; 40 | std::unique_ptr thread_; 41 | std::unique_ptr glib_thread_; 42 | std::vector tasks_; 43 | std::unique_ptr> glib_promise_; 44 | mutable std::mutex task_mutex_; 45 | GMainContext* glib_context_; 46 | GMainLoop* glib_loop_; 47 | }; 48 | } // namespace erizo 49 | 50 | #endif // ERIZO_SRC_ERIZO_THREAD_IOWORKER_H_ 51 | -------------------------------------------------------------------------------- /erizo/src/erizo/thread/ThreadPool.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZO_SRC_ERIZO_THREAD_THREADPOOL_H_ 2 | #define ERIZO_SRC_ERIZO_THREAD_THREADPOOL_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "thread/Worker.h" 8 | #include "thread/Scheduler.h" 9 | 10 | namespace erizo { 11 | 12 | class ThreadPool { 13 | public: 14 | explicit ThreadPool(unsigned int num_workers); 15 | ~ThreadPool(); 16 | 17 | std::shared_ptr getLessUsedWorker(); 18 | void start(); 19 | void close(); 20 | 21 | void resetStats(); 22 | DurationDistribution getDurationDistribution(); 23 | DurationDistribution getDelayDistribution(); 24 | 25 | private: 26 | std::vector> workers_; 27 | std::shared_ptr scheduler_; 28 | }; 29 | } // namespace erizo 30 | 31 | #endif // ERIZO_SRC_ERIZO_THREAD_THREADPOOL_H_ 32 | -------------------------------------------------------------------------------- /erizo/src/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | #functions 3 | function(test_lib LIB_NAME) 4 | if (${LIB_NAME} MATCHES "^.*-NOTFOUND") 5 | message(FATAL_ERROR "lib not found: " ${LIB_NAME} " check README") 6 | return() 7 | endif(${LIB_NAME} MATCHES "^.*-NOTFOUND") 8 | endfunction(test_lib) 9 | 10 | project (ERIZO_EXAMPLES) 11 | file(GLOB_RECURSE ERIZO_EXAMPLES_SOURCES ${ERIZO_EXAMPLES_SOURCE_DIR}/*.cpp ${ERIZO_EXAMPLES_SOURCE_DIR}/*.h) 12 | add_executable(hsam ${ERIZO_EXAMPLES_SOURCES}) 13 | include_directories(${ERIZO_EXAMPLES_SOURCE_DIR}/../erizo) 14 | link_directories(${ERIZO_EXAMPLES_SOURCE_DIR}/../../build) 15 | 16 | set (BOOST_LIBS thread regex system) 17 | find_package(Boost COMPONENTS ${BOOST_LIBS} REQUIRED) 18 | target_link_libraries(hsam ${Boost_LIBRARIES}) 19 | target_link_libraries(hsam ${EXTRA_LIBS}) 20 | -------------------------------------------------------------------------------- /erizo/src/examples/Test.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifndef TEST_H_ 6 | #define TEST_H_ 7 | namespace erizo { 8 | class Test: public RawDataReceiver { 9 | public: 10 | Test(); 11 | virtual ~Test(); 12 | void receiveRawData(unsigned char*data, int len); 13 | 14 | void rec(); 15 | void send(char *buff, int buffSize); 16 | private: 17 | 18 | boost::asio::ip::udp::socket* socket_; 19 | boost::asio::ip::udp::resolver* resolver_; 20 | 21 | boost::asio::ip::udp::resolver::query* query_; 22 | boost::asio::io_service* ioservice_; 23 | InputProcessor* ip; 24 | erizo::RtpParser pars; 25 | 26 | }; 27 | 28 | } 29 | #endif /* TEST_H_ */ 30 | -------------------------------------------------------------------------------- /erizo/src/examples/pc/Observer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Observer.h 3 | */ 4 | 5 | #ifndef OBSERVER_H_ 6 | #define OBSERVER_H_ 7 | 8 | #include 9 | #include 10 | 11 | #include "SDPReceiver.h" 12 | #include "PCSocket.h" 13 | 14 | class Observer: PCClientObserver { 15 | public: 16 | Observer(std::string name, SDPReceiver *receiver); 17 | ~Observer(); 18 | void OnSignedIn(); // Called when we're logged on. 19 | void OnDisconnected(); 20 | void OnPeerConnected(int id, const std::string& name); 21 | void OnPeerDisconnected(int peer_id); 22 | void OnMessageFromPeer(int peer_id, const std::string& message); 23 | void OnMessageSent(int err); 24 | void wait(); 25 | 26 | static void Replace(std::string& text, const std::string& pattern, 27 | const std::string& replace); 28 | static std::string Match(const std::string& text, 29 | const std::string& pattern); 30 | 31 | private: 32 | void init(); 33 | void start(); 34 | void processMessage(int peerid, const std::string& message); 35 | 36 | PC *pc_; 37 | boost::thread m_Thread_; 38 | std::string name_; 39 | SDPReceiver *receiver_; 40 | }; 41 | 42 | #endif /* OBSERVER_H_ */ 43 | 44 | -------------------------------------------------------------------------------- /erizo/src/examples/pc/SDPReceiver.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class SDPReceiver { 4 | 5 | public: 6 | 7 | SDPReceiver(); 8 | virtual ~SDPReceiver(){}; 9 | bool createPublisher(int peer_id); 10 | bool createSubscriber(int peer_id); 11 | void setRemoteSDP(int peer_id, const std::string &sdp); 12 | std::string getLocalSDP(int peer_id); 13 | void peerDisconnected(int peer_id); 14 | 15 | private: 16 | 17 | erizo::OneToManyProcessor* muxer; 18 | }; 19 | -------------------------------------------------------------------------------- /erizo/src/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | project (ERIZO_TEST) 4 | 5 | if(${ERIZO_BUILD_TYPE} STREQUAL "sanitizer") 6 | set(SANITIZER_OPTION "-fsanitize=address") 7 | else() 8 | set(SANITIZER_OPTION "") 9 | endif() 10 | 11 | set(CMAKE_CXX_FLAGS "-g -Wall -std=c++17 ${ERIZO_CMAKE_CXX_FLAGS} ${SANITIZER_OPTION}") 12 | 13 | file(GLOB_RECURSE ERIZO_TEST_SDPS ${ERIZO_TEST_SOURCE_DIR}/*.sdp) 14 | file(COPY ${ERIZO_TEST_SDPS} DESTINATION ${ERIZO_TEST_BINARY_DIR}) 15 | file(COPY ${ERIZO_TEST_SOURCE_DIR}/log4cxx.properties DESTINATION ${ERIZO_TEST_BINARY_DIR}) 16 | file(GLOB_RECURSE ERIZO_TEST_SOURCES ${ERIZO_TEST_SOURCE_DIR}/*.cpp ${ERIZO_TEST_SOURCE_DIR}/*.h) 17 | 18 | link_directories("${GMOCK_BUILD}/lib") 19 | 20 | add_executable(tests ${ERIZO_TEST_SOURCES}) 21 | 22 | include_directories("${ERIZO_SOURCE_DIR}" "${THIRD_PARTY_INCLUDE}" "${GMOCK_BUILD}/include" "${NICER_INCLUDE}") 23 | target_link_libraries(tests erizo gtest_main gmock_main) 24 | 25 | add_test(NAME all 26 | WORKING_DIRECTORY "${ERIZO_TEST_BINARY_DIR}" 27 | COMMAND tests) 28 | 29 | add_custom_target(check 30 | tests 31 | WORKING_DIRECTORY "${ERIZO_TEST_BINARY_DIR}" 32 | COMMENT "Running tests" 33 | ) 34 | -------------------------------------------------------------------------------- /erizo/src/test/DtlsSocketTest.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include // NOLINT 7 | 8 | using testing::_; 9 | using testing::Return; 10 | using testing::Eq; 11 | 12 | void createDtlsClient() { 13 | std::unique_ptr dtls_rtp; 14 | dtls_rtp.reset(new dtls::DtlsSocketContext()); 15 | dtls_rtp->createClient(); 16 | } 17 | 18 | class DtlsSocketTest : public ::testing::Test { 19 | protected: 20 | virtual void SetUp() { 21 | dtls::DtlsSocketContext::Init(); 22 | } 23 | 24 | virtual void TearDown() { 25 | dtls::DtlsSocketContext::Destroy(); 26 | } 27 | 28 | void runTest(int number_of_clients) { 29 | std::thread threads[number_of_clients]; // NOLINT 30 | for (int j = 0; j < number_of_clients; j++) { 31 | threads[j] = std::thread(createDtlsClient); 32 | } 33 | for (int j = 0; j < number_of_clients; j++) { 34 | threads[j].join(); 35 | } 36 | } 37 | }; 38 | 39 | TEST_F(DtlsSocketTest, create_1000_DtlsClient) { 40 | runTest(1000); 41 | EXPECT_THAT(true, Eq(true)); 42 | } 43 | -------------------------------------------------------------------------------- /erizo/src/test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char **argv) { 5 | ::testing::InitGoogleTest(&argc, argv); 6 | return RUN_ALL_TESTS(); 7 | } 8 | -------------------------------------------------------------------------------- /erizo/src/test/rtp/LayerBitrateCalculationHandlerTest.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | #include 6 | 7 | #include "../utils/Mocks.h" 8 | #include "../utils/Tools.h" 9 | #include "../utils/Matchers.h" 10 | 11 | using ::testing::_; 12 | using ::testing::IsNull; 13 | using ::testing::Args; 14 | using ::testing::Return; 15 | using erizo::AUDIO_PACKET; 16 | using erizo::VIDEO_PACKET; 17 | using erizo::Pipeline; 18 | using erizo::LayerBitrateCalculationHandler; 19 | 20 | 21 | class LayerBitrateCalculationHandlerTest : public erizo::HandlerTest { 22 | public: 23 | LayerBitrateCalculationHandlerTest() {} 24 | 25 | protected: 26 | void setHandler() { 27 | layer_bitrate_handler = std::make_shared(); 28 | pipeline->addBack(layer_bitrate_handler); 29 | } 30 | 31 | std::shared_ptr layer_bitrate_handler; 32 | }; 33 | 34 | TEST_F(LayerBitrateCalculationHandlerTest, basicBehaviourShouldWritePackets) { 35 | auto packet = erizo::PacketTools::createDataPacket(erizo::kArbitrarySeqNumber, AUDIO_PACKET); 36 | 37 | EXPECT_CALL(*writer.get(), write(_, _)). 38 | With(Args<1>(erizo::RtpHasSequenceNumber(erizo::kArbitrarySeqNumber))).Times(1); 39 | pipeline->write(packet); 40 | } 41 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc.cmake: -------------------------------------------------------------------------------- 1 | add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/third_party/webrtc/src/") 2 | 3 | set(ERIZO_CMAKE_CXX_FLAGS "${ERIZO_CMAKE_CXX_FLAGS} -DWEBRTC_POSIX") 4 | 5 | IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 6 | set(ERIZO_CMAKE_CXX_FLAGS "${ERIZO_CMAKE_CXX_FLAGS} -fno-stack-protector -DWEBRTC_MAC") 7 | ELSE() 8 | set(ERIZO_CMAKE_CXX_FLAGS "${ERIZO_CMAKE_CXX_FLAGS} -fPIC -DWEBRTC_LINUX") 9 | ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 10 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | find_package(PkgConfig) 3 | #functions 4 | function(test_lib LIB_NAME) 5 | if (${LIB_NAME} MATCHES "^.*-NOTFOUND") 6 | message(FATAL_ERROR "lib not found: " ${LIB_NAME} " check README") 7 | return() 8 | endif(${LIB_NAME} MATCHES "^.*-NOTFOUND") 9 | endfunction(test_lib) 10 | project (WEBRTC) 11 | 12 | set (WEBRTC_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}) 13 | 14 | set(CMAKE_CXX_FLAGS "-g -Wall -std=c++17 -DWEBRTC_POSIX") 15 | 16 | IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 17 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-stack-protector -DWEBRTC_MAC") 18 | ELSE() 19 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DWEBRTC_LINUX") 20 | ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 21 | 22 | include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../conan_paths.cmake) 23 | 24 | # ABSEIL 25 | find_package(absl) 26 | include_directories("${WEBRTC_SOURCE_DIR}" "${absl_INCLUDE_DIRS}") 27 | 28 | file(GLOB_RECURSE WEBRTC_SOURCES "${WEBRTC_SOURCE_DIR}/*.c" "${WEBRTC_SOURCE_DIR}/*.cpp" "${WEBRTC_SOURCE_DIR}/*.cc") 29 | file(GLOB_RECURSE WEBRTC_HEADERS "${WEBRTC_SOURCE_DIR}/*.h") 30 | 31 | add_library(webrtc STATIC ${WEBRTC_SOURCES} ) 32 | 33 | target_include_directories(webrtc PUBLIC ${WEBRTC_SOURCE_DIR}) 34 | 35 | target_link_libraries(webrtc ${absl_LIBRARIES}) 36 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/media_types.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/api/media_types.h" 12 | 13 | #include "webrtc/rtc_base/checks.h" 14 | 15 | namespace cricket { 16 | 17 | const char kMediaTypeVideo[] = "video"; 18 | const char kMediaTypeAudio[] = "audio"; 19 | const char kMediaTypeData[] = "data"; 20 | 21 | std::string MediaTypeToString(MediaType type) { 22 | switch (type) { 23 | case MEDIA_TYPE_AUDIO: 24 | return kMediaTypeAudio; 25 | case MEDIA_TYPE_VIDEO: 26 | return kMediaTypeVideo; 27 | case MEDIA_TYPE_DATA: 28 | return kMediaTypeData; 29 | case MEDIA_TYPE_UNSUPPORTED: 30 | // Unsupported media stores the m= differently. 31 | RTC_DCHECK_NOTREACHED(); 32 | return ""; 33 | } 34 | RTC_CHECK_NOTREACHED(); 35 | } 36 | 37 | } // namespace cricket 38 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/media_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef API_MEDIA_TYPES_H_ 12 | #define API_MEDIA_TYPES_H_ 13 | 14 | #include 15 | 16 | #include "webrtc/rtc_base/system/rtc_export.h" 17 | 18 | // The cricket and webrtc have separate definitions for what a media type is. 19 | // They're not compatible. Watch out for this. 20 | 21 | namespace cricket { 22 | 23 | enum MediaType { 24 | MEDIA_TYPE_AUDIO, 25 | MEDIA_TYPE_VIDEO, 26 | MEDIA_TYPE_DATA, 27 | MEDIA_TYPE_UNSUPPORTED 28 | }; 29 | 30 | extern const char kMediaTypeAudio[]; 31 | extern const char kMediaTypeVideo[]; 32 | extern const char kMediaTypeData[]; 33 | 34 | RTC_EXPORT std::string MediaTypeToString(MediaType type); 35 | 36 | } // namespace cricket 37 | 38 | namespace webrtc { 39 | 40 | enum class MediaType { ANY, AUDIO, VIDEO, DATA }; 41 | 42 | } // namespace webrtc 43 | 44 | #endif // API_MEDIA_TYPES_H_ 45 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/priority.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef API_PRIORITY_H_ 12 | #define API_PRIORITY_H_ 13 | 14 | namespace webrtc { 15 | 16 | // GENERATED_JAVA_ENUM_PACKAGE: org.webrtc 17 | enum class Priority { 18 | kVeryLow, 19 | kLow, 20 | kMedium, 21 | kHigh, 22 | }; 23 | 24 | } // namespace webrtc 25 | 26 | #endif // API_PRIORITY_H_ 27 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/rtp_transceiver_direction.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef API_RTP_TRANSCEIVER_DIRECTION_H_ 12 | #define API_RTP_TRANSCEIVER_DIRECTION_H_ 13 | 14 | namespace webrtc { 15 | 16 | // https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiverdirection 17 | enum class RtpTransceiverDirection { 18 | kSendRecv, 19 | kSendOnly, 20 | kRecvOnly, 21 | kInactive, 22 | kStopped, 23 | }; 24 | 25 | } // namespace webrtc 26 | 27 | #endif // API_RTP_TRANSCEIVER_DIRECTION_H_ 28 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/task_queue/default_task_queue_factory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | #ifndef API_TASK_QUEUE_DEFAULT_TASK_QUEUE_FACTORY_H_ 11 | #define API_TASK_QUEUE_DEFAULT_TASK_QUEUE_FACTORY_H_ 12 | 13 | #include 14 | 15 | #include "webrtc/api/task_queue/task_queue_factory.h" 16 | 17 | namespace webrtc { 18 | 19 | std::unique_ptr CreateDefaultTaskQueueFactory(); 20 | 21 | } // namespace webrtc 22 | 23 | #endif // API_TASK_QUEUE_DEFAULT_TASK_QUEUE_FACTORY_H_ 24 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/task_queue/default_task_queue_factory_stdlib.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | #include 11 | 12 | #include "webrtc/api/task_queue/task_queue_factory.h" 13 | #include "webrtc/rtc_base/task_queue_stdlib.h" 14 | 15 | namespace webrtc { 16 | 17 | std::unique_ptr CreateDefaultTaskQueueFactory() { 18 | return CreateTaskQueueStdlibFactory(); 19 | } 20 | 21 | } // namespace webrtc 22 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/task_queue/queued_task.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | #ifndef API_TASK_QUEUE_QUEUED_TASK_H_ 11 | #define API_TASK_QUEUE_QUEUED_TASK_H_ 12 | 13 | namespace webrtc { 14 | 15 | // Base interface for asynchronously executed tasks. 16 | // The interface basically consists of a single function, Run(), that executes 17 | // on the target queue. For more details see the Run() method and TaskQueue. 18 | class QueuedTask { 19 | public: 20 | virtual ~QueuedTask() = default; 21 | 22 | // Main routine that will run when the task is executed on the desired queue. 23 | // The task should return `true` to indicate that it should be deleted or 24 | // `false` to indicate that the queue should consider ownership of the task 25 | // having been transferred. Returning `false` can be useful if a task has 26 | // re-posted itself to a different queue or is otherwise being re-used. 27 | virtual bool Run() = 0; 28 | }; 29 | 30 | } // namespace webrtc 31 | 32 | #endif // API_TASK_QUEUE_QUEUED_TASK_H_ 33 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/task_queue/task_queue_factory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | #ifndef API_TASK_QUEUE_TASK_QUEUE_FACTORY_H_ 11 | #define API_TASK_QUEUE_TASK_QUEUE_FACTORY_H_ 12 | 13 | #include 14 | 15 | #include "absl/strings/string_view.h" 16 | #include "webrtc/api/task_queue/task_queue_base.h" 17 | 18 | namespace webrtc { 19 | 20 | // The implementation of this interface must be thread-safe. 21 | class TaskQueueFactory { 22 | public: 23 | // TaskQueue priority levels. On some platforms these will map to thread 24 | // priorities, on others such as Mac and iOS, GCD queue priorities. 25 | enum class Priority { NORMAL = 0, HIGH, LOW }; 26 | 27 | virtual ~TaskQueueFactory() = default; 28 | virtual std::unique_ptr CreateTaskQueue( 29 | absl::string_view name, 30 | Priority priority) const = 0; 31 | }; 32 | 33 | } // namespace webrtc 34 | 35 | #endif // API_TASK_QUEUE_TASK_QUEUE_FACTORY_H_ 36 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/transport/OWNERS: -------------------------------------------------------------------------------- 1 | srte@webrtc.org 2 | terelius@webrtc.org 3 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/transport/bitrate_settings.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/api/transport/bitrate_settings.h" 12 | 13 | namespace webrtc { 14 | 15 | BitrateSettings::BitrateSettings() = default; 16 | BitrateSettings::~BitrateSettings() = default; 17 | BitrateSettings::BitrateSettings(const BitrateSettings&) = default; 18 | 19 | } // namespace webrtc 20 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/transport/field_trial_based_config.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | #include "webrtc/api/transport/field_trial_based_config.h" 11 | 12 | #include "webrtc/system_wrappers/include/field_trial.h" 13 | 14 | namespace webrtc { 15 | std::string FieldTrialBasedConfig::Lookup(absl::string_view key) const { 16 | return webrtc::field_trial::FindFullName(std::string(key)); 17 | } 18 | } // namespace webrtc 19 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/transport/field_trial_based_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | #ifndef API_TRANSPORT_FIELD_TRIAL_BASED_CONFIG_H_ 11 | #define API_TRANSPORT_FIELD_TRIAL_BASED_CONFIG_H_ 12 | 13 | #include 14 | 15 | #include "absl/strings/string_view.h" 16 | #include "webrtc/api/transport/webrtc_key_value_config.h" 17 | 18 | namespace webrtc { 19 | // Implementation using the field trial API fo the key value lookup. 20 | class FieldTrialBasedConfig : public WebRtcKeyValueConfig { 21 | public: 22 | std::string Lookup(absl::string_view key) const override; 23 | }; 24 | } // namespace webrtc 25 | 26 | #endif // API_TRANSPORT_FIELD_TRIAL_BASED_CONFIG_H_ 27 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/transport/webrtc_key_value_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | #ifndef API_TRANSPORT_WEBRTC_KEY_VALUE_CONFIG_H_ 11 | #define API_TRANSPORT_WEBRTC_KEY_VALUE_CONFIG_H_ 12 | 13 | #include 14 | 15 | #include "absl/strings/string_view.h" 16 | #include "webrtc/rtc_base/system/rtc_export.h" 17 | 18 | namespace webrtc { 19 | 20 | // An interface that provides a key-value mapping for configuring internal 21 | // details of WebRTC. Note that there's no guarantess that the meaning of a 22 | // particular key value mapping will be preserved over time and no announcements 23 | // will be made if they are changed. It's up to the library user to ensure that 24 | // the behavior does not break. 25 | class RTC_EXPORT WebRtcKeyValueConfig { 26 | public: 27 | virtual ~WebRtcKeyValueConfig() = default; 28 | // The configured value for the given key. Defaults to an empty string. 29 | virtual std::string Lookup(absl::string_view key) const = 0; 30 | }; 31 | } // namespace webrtc 32 | 33 | #endif // API_TRANSPORT_WEBRTC_KEY_VALUE_CONFIG_H_ 34 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/units/OWNERS: -------------------------------------------------------------------------------- 1 | srte@webrtc.org 2 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/units/data_rate.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/api/units/data_rate.h" 12 | 13 | #include "webrtc/api/array_view.h" 14 | #include "webrtc/rtc_base/strings/string_builder.h" 15 | 16 | namespace webrtc { 17 | 18 | std::string ToString(DataRate value) { 19 | char buf[64]; 20 | rtc::SimpleStringBuilder sb(buf); 21 | if (value.IsPlusInfinity()) { 22 | sb << "+inf bps"; 23 | } else if (value.IsMinusInfinity()) { 24 | sb << "-inf bps"; 25 | } else { 26 | if (value.bps() == 0 || value.bps() % 1000 != 0) { 27 | sb << value.bps() << " bps"; 28 | } else { 29 | sb << value.kbps() << " kbps"; 30 | } 31 | } 32 | return sb.str(); 33 | } 34 | } // namespace webrtc 35 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/units/data_size.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/api/units/data_size.h" 12 | 13 | #include "webrtc/api/array_view.h" 14 | #include "webrtc/rtc_base/strings/string_builder.h" 15 | 16 | namespace webrtc { 17 | 18 | std::string ToString(DataSize value) { 19 | char buf[64]; 20 | rtc::SimpleStringBuilder sb(buf); 21 | if (value.IsPlusInfinity()) { 22 | sb << "+inf bytes"; 23 | } else if (value.IsMinusInfinity()) { 24 | sb << "-inf bytes"; 25 | } else { 26 | sb << value.bytes() << " bytes"; 27 | } 28 | return sb.str(); 29 | } 30 | } // namespace webrtc 31 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/units/frequency.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | #include "webrtc/api/units/frequency.h" 11 | 12 | #include "webrtc/rtc_base/strings/string_builder.h" 13 | 14 | namespace webrtc { 15 | std::string ToString(Frequency value) { 16 | char buf[64]; 17 | rtc::SimpleStringBuilder sb(buf); 18 | if (value.IsPlusInfinity()) { 19 | sb << "+inf Hz"; 20 | } else if (value.IsMinusInfinity()) { 21 | sb << "-inf Hz"; 22 | } else if (value.millihertz() % 1000 != 0) { 23 | sb.AppendFormat("%.3f Hz", value.hertz()); 24 | } else { 25 | sb << value.hertz() << " Hz"; 26 | } 27 | return sb.str(); 28 | } 29 | } // namespace webrtc 30 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/units/time_delta.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/api/units/time_delta.h" 12 | 13 | #include "webrtc/api/array_view.h" 14 | #include "webrtc/rtc_base/strings/string_builder.h" 15 | 16 | namespace webrtc { 17 | 18 | std::string ToString(TimeDelta value) { 19 | char buf[64]; 20 | rtc::SimpleStringBuilder sb(buf); 21 | if (value.IsPlusInfinity()) { 22 | sb << "+inf ms"; 23 | } else if (value.IsMinusInfinity()) { 24 | sb << "-inf ms"; 25 | } else { 26 | if (value.us() == 0 || (value.us() % 1000) != 0) 27 | sb << value.us() << " us"; 28 | else if (value.ms() % 1000 != 0) 29 | sb << value.ms() << " ms"; 30 | else 31 | sb << value.seconds() << " s"; 32 | } 33 | return sb.str(); 34 | } 35 | 36 | } // namespace webrtc 37 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/units/timestamp.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/api/units/timestamp.h" 12 | 13 | #include "webrtc/api/array_view.h" 14 | #include "webrtc/rtc_base/strings/string_builder.h" 15 | 16 | namespace webrtc { 17 | std::string ToString(Timestamp value) { 18 | char buf[64]; 19 | rtc::SimpleStringBuilder sb(buf); 20 | if (value.IsPlusInfinity()) { 21 | sb << "+inf ms"; 22 | } else if (value.IsMinusInfinity()) { 23 | sb << "-inf ms"; 24 | } else { 25 | if (value.us() == 0 || (value.us() % 1000) != 0) 26 | sb << value.us() << " us"; 27 | else if (value.ms() % 1000 != 0) 28 | sb << value.ms() << " ms"; 29 | else 30 | sb << value.seconds() << " s"; 31 | } 32 | return sb.str(); 33 | } 34 | } // namespace webrtc 35 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/video/hdr_metadata.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/api/video/hdr_metadata.h" 12 | 13 | namespace webrtc { 14 | 15 | HdrMasteringMetadata::Chromaticity::Chromaticity() = default; 16 | 17 | HdrMasteringMetadata::HdrMasteringMetadata() = default; 18 | 19 | HdrMetadata::HdrMetadata() = default; 20 | 21 | } // namespace webrtc 22 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/video/video_content_type.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef API_VIDEO_VIDEO_CONTENT_TYPE_H_ 12 | #define API_VIDEO_VIDEO_CONTENT_TYPE_H_ 13 | 14 | #include 15 | 16 | namespace webrtc { 17 | 18 | enum class VideoContentType : uint8_t { 19 | UNSPECIFIED = 0, 20 | SCREENSHARE = 1, 21 | }; 22 | 23 | namespace videocontenttypehelpers { 24 | bool SetExperimentId(VideoContentType* content_type, uint8_t experiment_id); 25 | bool SetSimulcastId(VideoContentType* content_type, uint8_t simulcast_id); 26 | 27 | uint8_t GetExperimentId(const VideoContentType& content_type); 28 | uint8_t GetSimulcastId(const VideoContentType& content_type); 29 | 30 | bool IsScreenshare(const VideoContentType& content_type); 31 | 32 | bool IsValidContentType(uint8_t value); 33 | 34 | const char* ToString(const VideoContentType& content_type); 35 | } // namespace videocontenttypehelpers 36 | 37 | } // namespace webrtc 38 | 39 | #endif // API_VIDEO_VIDEO_CONTENT_TYPE_H_ 40 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/api/video/video_rotation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef API_VIDEO_VIDEO_ROTATION_H_ 12 | #define API_VIDEO_VIDEO_ROTATION_H_ 13 | 14 | namespace webrtc { 15 | 16 | // enum for clockwise rotation. 17 | enum VideoRotation { 18 | kVideoRotation_0 = 0, 19 | kVideoRotation_90 = 90, 20 | kVideoRotation_180 = 180, 21 | kVideoRotation_270 = 270 22 | }; 23 | 24 | } // namespace webrtc 25 | 26 | #endif // API_VIDEO_VIDEO_ROTATION_H_ 27 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/modules/congestion_controller/OWNERS: -------------------------------------------------------------------------------- 1 | srte@webrtc.org 2 | stefan@webrtc.org 3 | terelius@webrtc.org 4 | crodbro@webrtc.org 5 | philipel@webrtc.org 6 | mflodman@webrtc.org 7 | yinwa@webrtc.org 8 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/modules/include/module_fec_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef MODULES_INCLUDE_MODULE_FEC_TYPES_H_ 12 | #define MODULES_INCLUDE_MODULE_FEC_TYPES_H_ 13 | 14 | namespace webrtc { 15 | 16 | // Types for the FEC packet masks. The type `kFecMaskRandom` is based on a 17 | // random loss model. The type `kFecMaskBursty` is based on a bursty/consecutive 18 | // loss model. The packet masks are defined in 19 | // modules/rtp_rtcp/fec_private_tables_random(bursty).h 20 | enum FecMaskType { 21 | kFecMaskRandom, 22 | kFecMaskBursty, 23 | }; 24 | 25 | // Struct containing forward error correction settings. 26 | struct FecProtectionParams { 27 | int fec_rate = 0; 28 | int max_fec_frames = 0; 29 | FecMaskType fec_mask_type = FecMaskType::kFecMaskRandom; 30 | }; 31 | 32 | } // namespace webrtc 33 | 34 | #endif // MODULES_INCLUDE_MODULE_FEC_TYPES_H_ 35 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/modules/pacing/OWNERS: -------------------------------------------------------------------------------- 1 | stefan@webrtc.org 2 | mflodman@webrtc.org 3 | asapersson@webrtc.org 4 | philipel@webrtc.org 5 | srte@webrtc.org 6 | sprang@webrtc.org 7 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/modules/remote_bitrate_estimator/OWNERS: -------------------------------------------------------------------------------- 1 | stefan@webrtc.org 2 | terelius@webrtc.org 3 | asapersson@webrtc.org 4 | mflodman@webrtc.org 5 | philipel@webrtc.org 6 | srte@webrtc.org 7 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/modules/remote_bitrate_estimator/bwe_defines.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" 12 | 13 | #include "webrtc/system_wrappers/include/field_trial.h" 14 | 15 | namespace webrtc { 16 | 17 | const char kBweTypeHistogram[] = "WebRTC.BWE.Types"; 18 | 19 | namespace congestion_controller { 20 | int GetMinBitrateBps() { 21 | constexpr int kMinBitrateBps = 5000; 22 | return kMinBitrateBps; 23 | } 24 | 25 | DataRate GetMinBitrate() { 26 | return DataRate::BitsPerSec(GetMinBitrateBps()); 27 | } 28 | 29 | } // namespace congestion_controller 30 | 31 | RateControlInput::RateControlInput( 32 | BandwidthUsage bw_state, 33 | const absl::optional& estimated_throughput) 34 | : bw_state(bw_state), estimated_throughput(estimated_throughput) {} 35 | 36 | RateControlInput::~RateControlInput() = default; 37 | 38 | } // namespace webrtc 39 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/modules/rtp_rtcp/source/fec_private_tables_random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef MODULES_RTP_RTCP_SOURCE_FEC_PRIVATE_TABLES_RANDOM_H_ 12 | #define MODULES_RTP_RTCP_SOURCE_FEC_PRIVATE_TABLES_RANDOM_H_ 13 | 14 | // This file contains a set of packets masks for the FEC code. The masks in 15 | // this table are specifically designed to favor recovery to random loss. 16 | // These packet masks are defined to protect up to maximum of 48 media packets. 17 | 18 | #include 19 | 20 | namespace webrtc { 21 | namespace fec_private_tables { 22 | 23 | extern const uint8_t kPacketMaskRandomTbl[]; 24 | 25 | } // namespace fec_private_tables 26 | } // namespace webrtc 27 | #endif // MODULES_RTP_RTCP_SOURCE_FEC_PRIVATE_TABLES_RANDOM_H_ 28 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/modules/video_coding/codecs/interface/common_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | // This file contains constants that are used by multiple global 12 | // codec definitions (modules/video_coding/codecs/*/include/*_globals.h) 13 | 14 | #ifndef MODULES_VIDEO_CODING_CODECS_INTERFACE_COMMON_CONSTANTS_H_ 15 | #define MODULES_VIDEO_CODING_CODECS_INTERFACE_COMMON_CONSTANTS_H_ 16 | 17 | #include 18 | 19 | namespace webrtc { 20 | 21 | const int16_t kNoPictureId = -1; 22 | const int16_t kNoTl0PicIdx = -1; 23 | const uint8_t kNoTemporalIdx = 0xFF; 24 | const int kNoKeyIdx = -1; 25 | 26 | } // namespace webrtc 27 | 28 | #endif // MODULES_VIDEO_CODING_CODECS_INTERFACE_COMMON_CONSTANTS_H_ 29 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/OWNERS: -------------------------------------------------------------------------------- 1 | hta@webrtc.org 2 | mflodman@webrtc.org 3 | tommi@webrtc.org 4 | mbonadei@webrtc.org 5 | 6 | per-file rate_statistics*=sprang@webrtc.org 7 | per-file rate_statistics*=stefan@webrtc.org 8 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/arraysize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef RTC_BASE_ARRAYSIZE_H_ 12 | #define RTC_BASE_ARRAYSIZE_H_ 13 | 14 | #include 15 | 16 | // This file defines the arraysize() macro and is derived from Chromium's 17 | // base/macros.h. 18 | 19 | // The arraysize(arr) macro returns the # of elements in an array arr. 20 | // The expression is a compile-time constant, and therefore can be 21 | // used in defining new arrays, for example. If you use arraysize on 22 | // a pointer by mistake, you will get a compile-time error. 23 | 24 | // This template function declaration is used in defining arraysize. 25 | // Note that the function doesn't need an implementation, as we only 26 | // use its type. 27 | template 28 | char (&ArraySizeHelper(T (&array)[N]))[N]; 29 | 30 | #define arraysize(array) (sizeof(ArraySizeHelper(array))) 31 | 32 | #endif // RTC_BASE_ARRAYSIZE_H_ 33 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/constructor_magic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef RTC_BASE_CONSTRUCTOR_MAGIC_H_ 12 | #define RTC_BASE_CONSTRUCTOR_MAGIC_H_ 13 | 14 | // A macro to disallow the copy constructor and operator= functions. This should 15 | // be used in the declarations for a class. 16 | #define RTC_DISALLOW_COPY_AND_ASSIGN(TypeName) \ 17 | TypeName(const TypeName&) = delete; \ 18 | TypeName& operator=(const TypeName&) = delete 19 | 20 | #endif // RTC_BASE_CONSTRUCTOR_MAGIC_H_ 21 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/experiments/OWNERS: -------------------------------------------------------------------------------- 1 | asapersson@webrtc.org 2 | sprang@webrtc.org 3 | srte@webrtc.org 4 | 5 | per-file alr_experiment*=sprang@webrtc.org 6 | per-file audio_allocation_settings*=srte@webrtc.org 7 | per-file congestion_controller_experiment*=srte@webrtc.org 8 | per-file cpu_speed_experiment*=asapersson@webrtc.org 9 | per-file field_trial*=srte@webrtc.org 10 | per-file jitter_upper_bound_experiment*=sprang@webrtc.org 11 | per-file keyframe_interval_settings*=brandtr@webrtc.org 12 | per-file normalize_simulcast_size_experiment*=asapersson@webrtc.org 13 | per-file quality_scaling_experiment*=asapersson@webrtc.org 14 | per-file rtt_mult_experiment*=mhoro@webrtc.org 15 | per-file rate_control_settings*=sprang@webrtc.org 16 | per-file rate_control_settings*=srte@webrtc.org 17 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/network/sent_packet.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/rtc_base/network/sent_packet.h" 12 | 13 | namespace rtc { 14 | 15 | PacketInfo::PacketInfo() = default; 16 | PacketInfo::PacketInfo(const PacketInfo& info) = default; 17 | PacketInfo::~PacketInfo() = default; 18 | 19 | SentPacket::SentPacket() = default; 20 | SentPacket::SentPacket(int64_t packet_id, int64_t send_time_ms) 21 | : packet_id(packet_id), send_time_ms(send_time_ms) {} 22 | SentPacket::SentPacket(int64_t packet_id, 23 | int64_t send_time_ms, 24 | const rtc::PacketInfo& info) 25 | : packet_id(packet_id), send_time_ms(send_time_ms), info(info) {} 26 | 27 | } // namespace rtc 28 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/network_route.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/rtc_base/network_route.h" 12 | 13 | namespace rtc { 14 | 15 | bool RouteEndpoint::operator==(const RouteEndpoint& other) const { 16 | return adapter_type_ == other.adapter_type_ && 17 | adapter_id_ == other.adapter_id_ && network_id_ == other.network_id_ && 18 | uses_turn_ == other.uses_turn_; 19 | } 20 | 21 | bool NetworkRoute::operator==(const NetworkRoute& other) const { 22 | return connected == other.connected && local == other.local && 23 | remote == other.remote && packet_overhead == other.packet_overhead && 24 | last_sent_packet_id == other.last_sent_packet_id; 25 | } 26 | 27 | } // namespace rtc 28 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/synchronization/mutex.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/rtc_base/synchronization/mutex.h" 12 | 13 | #include "webrtc/rtc_base/checks.h" 14 | #include "webrtc/rtc_base/synchronization/yield.h" 15 | 16 | namespace webrtc { 17 | 18 | #if !defined(WEBRTC_ABSL_MUTEX) 19 | void GlobalMutex::Lock() { 20 | while (mutex_locked_.exchange(1)) { 21 | YieldCurrentThread(); 22 | } 23 | } 24 | 25 | void GlobalMutex::Unlock() { 26 | int old = mutex_locked_.exchange(0); 27 | RTC_DCHECK_EQ(old, 1) << "Unlock called without calling Lock first"; 28 | } 29 | 30 | GlobalMutexLock::GlobalMutexLock(GlobalMutex* mutex) : mutex_(mutex) { 31 | mutex_->Lock(); 32 | } 33 | 34 | GlobalMutexLock::~GlobalMutexLock() { 35 | mutex_->Unlock(); 36 | } 37 | #endif // #if !defined(WEBRTC_ABSL_MUTEX) 38 | 39 | } // namespace webrtc 40 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/synchronization/yield.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/rtc_base/synchronization/yield.h" 12 | 13 | #if defined(WEBRTC_WIN) 14 | #include 15 | #else 16 | #include 17 | #include 18 | #endif 19 | 20 | namespace webrtc { 21 | 22 | void YieldCurrentThread() { 23 | // TODO(bugs.webrtc.org/11634): use dedicated OS functionality instead of 24 | // sleep for yielding. 25 | #if defined(WEBRTC_WIN) 26 | ::Sleep(0); 27 | #elif defined(WEBRTC_MAC) && defined(RTC_USE_NATIVE_MUTEX_ON_MAC) && \ 28 | !RTC_USE_NATIVE_MUTEX_ON_MAC 29 | sched_yield(); 30 | #else 31 | static const struct timespec ts_null = {0}; 32 | nanosleep(&ts_null, nullptr); 33 | #endif 34 | } 35 | 36 | } // namespace webrtc 37 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/synchronization/yield.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | #ifndef RTC_BASE_SYNCHRONIZATION_YIELD_H_ 11 | #define RTC_BASE_SYNCHRONIZATION_YIELD_H_ 12 | 13 | namespace webrtc { 14 | 15 | // Request rescheduling of threads. 16 | void YieldCurrentThread(); 17 | 18 | } // namespace webrtc 19 | 20 | #endif // RTC_BASE_SYNCHRONIZATION_YIELD_H_ 21 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/synchronization/yield_policy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | #ifndef RTC_BASE_SYNCHRONIZATION_YIELD_POLICY_H_ 11 | #define RTC_BASE_SYNCHRONIZATION_YIELD_POLICY_H_ 12 | 13 | namespace rtc { 14 | class YieldInterface { 15 | public: 16 | virtual ~YieldInterface() = default; 17 | virtual void YieldExecution() = 0; 18 | }; 19 | 20 | // Sets the current thread-local yield policy while it's in scope and reverts 21 | // to the previous policy when it leaves the scope. 22 | class ScopedYieldPolicy final { 23 | public: 24 | explicit ScopedYieldPolicy(YieldInterface* policy); 25 | ScopedYieldPolicy(const ScopedYieldPolicy&) = delete; 26 | ScopedYieldPolicy& operator=(const ScopedYieldPolicy&) = delete; 27 | ~ScopedYieldPolicy(); 28 | // Will yield as specified by the currently active thread-local yield policy 29 | // (which by default is a no-op). 30 | static void YieldExecution(); 31 | 32 | private: 33 | YieldInterface* const previous_; 34 | }; 35 | 36 | } // namespace rtc 37 | 38 | #endif // RTC_BASE_SYNCHRONIZATION_YIELD_POLICY_H_ 39 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/system/gcd_helpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef RTC_BASE_SYSTEM_GCD_HELPERS_H_ 12 | #define RTC_BASE_SYSTEM_GCD_HELPERS_H_ 13 | 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT DISPATCH_NOTHROW dispatch_queue_t 21 | RTCDispatchQueueCreateWithTarget(const char* label, 22 | dispatch_queue_attr_t attr, 23 | dispatch_queue_t target); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif // RTC_BASE_SYSTEM_GCD_HELPERS_H_ 30 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/system/gcd_helpers.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/rtc_base/system/gcd_helpers.h" 12 | 13 | dispatch_queue_t RTCDispatchQueueCreateWithTarget(const char *label, 14 | dispatch_queue_attr_t attr, 15 | dispatch_queue_t target) { 16 | if (@available(iOS 10, macOS 10.12, tvOS 10, watchOS 3, *)) { 17 | return dispatch_queue_create_with_target(label, attr, target); 18 | } 19 | dispatch_queue_t queue = dispatch_queue_create(label, attr); 20 | dispatch_set_target_queue(queue, target); 21 | return queue; 22 | } 23 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/system/ignore_warnings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef RTC_BASE_SYSTEM_IGNORE_WARNINGS_H_ 12 | #define RTC_BASE_SYSTEM_IGNORE_WARNINGS_H_ 13 | 14 | #ifdef __clang__ 15 | #define RTC_PUSH_IGNORING_WFRAME_LARGER_THAN() \ 16 | _Pragma("clang diagnostic push") \ 17 | _Pragma("clang diagnostic ignored \"-Wframe-larger-than=\"") 18 | #define RTC_POP_IGNORING_WFRAME_LARGER_THAN() _Pragma("clang diagnostic pop") 19 | #elif __GNUC__ 20 | #define RTC_PUSH_IGNORING_WFRAME_LARGER_THAN() \ 21 | _Pragma("GCC diagnostic push") \ 22 | _Pragma("GCC diagnostic ignored \"-Wframe-larger-than=\"") 23 | #define RTC_POP_IGNORING_WFRAME_LARGER_THAN() _Pragma("GCC diagnostic pop") 24 | #else 25 | #define RTC_PUSH_IGNORING_WFRAME_LARGER_THAN() 26 | #define RTC_POP_IGNORING_WFRAME_LARGER_THAN() 27 | #endif 28 | 29 | #endif // RTC_BASE_SYSTEM_IGNORE_WARNINGS_H_ 30 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/system/inline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef RTC_BASE_SYSTEM_INLINE_H_ 12 | #define RTC_BASE_SYSTEM_INLINE_H_ 13 | 14 | #if defined(_MSC_VER) 15 | 16 | #define RTC_FORCE_INLINE __forceinline 17 | #define RTC_NO_INLINE __declspec(noinline) 18 | 19 | #elif defined(__GNUC__) 20 | 21 | #define RTC_FORCE_INLINE __attribute__((__always_inline__)) 22 | #define RTC_NO_INLINE __attribute__((__noinline__)) 23 | 24 | #else 25 | 26 | #define RTC_FORCE_INLINE 27 | #define RTC_NO_INLINE 28 | 29 | #endif 30 | 31 | #endif // RTC_BASE_SYSTEM_INLINE_H_ 32 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/system/rtc_export.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef RTC_BASE_SYSTEM_RTC_EXPORT_H_ 12 | #define RTC_BASE_SYSTEM_RTC_EXPORT_H_ 13 | 14 | // RTC_EXPORT is used to mark symbols as exported or imported when WebRTC is 15 | // built or used as a shared library. 16 | // When WebRTC is built as a static library the RTC_EXPORT macro expands to 17 | // nothing. 18 | 19 | #ifdef WEBRTC_ENABLE_SYMBOL_EXPORT 20 | 21 | #ifdef WEBRTC_WIN 22 | 23 | #ifdef WEBRTC_LIBRARY_IMPL 24 | #define RTC_EXPORT __declspec(dllexport) 25 | #else 26 | #define RTC_EXPORT __declspec(dllimport) 27 | #endif 28 | 29 | #else // WEBRTC_WIN 30 | 31 | #if __has_attribute(visibility) && defined(WEBRTC_LIBRARY_IMPL) 32 | #define RTC_EXPORT __attribute__((visibility("default"))) 33 | #endif 34 | 35 | #endif // WEBRTC_WIN 36 | 37 | #endif // WEBRTC_ENABLE_SYMBOL_EXPORT 38 | 39 | #ifndef RTC_EXPORT 40 | #define RTC_EXPORT 41 | #endif 42 | 43 | #endif // RTC_BASE_SYSTEM_RTC_EXPORT_H_ 44 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/system/unused.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef RTC_BASE_SYSTEM_UNUSED_H_ 12 | #define RTC_BASE_SYSTEM_UNUSED_H_ 13 | 14 | // Prevent the compiler from warning about an unused variable. For example: 15 | // int result = DoSomething(); 16 | // RTC_DCHECK(result == 17); 17 | // RTC_UNUSED(result); 18 | // Note: In most cases it is better to remove the unused variable rather than 19 | // suppressing the compiler warning. 20 | #ifndef RTC_UNUSED 21 | #ifdef __cplusplus 22 | #define RTC_UNUSED(x) static_cast(x) 23 | #else 24 | #define RTC_UNUSED(x) (void)(x) 25 | #endif 26 | #endif // RTC_UNUSED 27 | 28 | #endif // RTC_BASE_SYSTEM_UNUSED_H_ 29 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/system/warn_current_thread_is_deadlocked.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef RTC_BASE_SYSTEM_WARN_CURRENT_THREAD_IS_DEADLOCKED_H_ 12 | #define RTC_BASE_SYSTEM_WARN_CURRENT_THREAD_IS_DEADLOCKED_H_ 13 | 14 | namespace webrtc { 15 | 16 | inline void WarnThatTheCurrentThreadIsProbablyDeadlocked() {} 17 | 18 | } // namespace webrtc 19 | 20 | #endif // RTC_BASE_SYSTEM_WARN_CURRENT_THREAD_IS_DEADLOCKED_H_ 21 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/system_time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef RTC_BASE_SYSTEM_TIME_H_ 12 | #define RTC_BASE_SYSTEM_TIME_H_ 13 | 14 | namespace rtc { 15 | 16 | // Returns the actual system time, even if a clock is set for testing. 17 | // Useful for timeouts while using a test clock, or for logging. 18 | int64_t SystemTimeNanos(); 19 | 20 | } // namespace rtc 21 | 22 | #endif // RTC_BASE_SYSTEM_TIME_H_ 23 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/task_queue_for_test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #include "webrtc/rtc_base/task_queue_for_test.h" 12 | 13 | #include "webrtc/api/task_queue/default_task_queue_factory.h" 14 | 15 | namespace webrtc { 16 | 17 | TaskQueueForTest::TaskQueueForTest(absl::string_view name, Priority priority) 18 | : TaskQueue( 19 | CreateDefaultTaskQueueFactory()->CreateTaskQueue(name, priority)) {} 20 | 21 | } // namespace webrtc 22 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/task_queue_stdlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef RTC_BASE_TASK_QUEUE_STDLIB_H_ 12 | #define RTC_BASE_TASK_QUEUE_STDLIB_H_ 13 | 14 | #include 15 | 16 | #include "webrtc/api/task_queue/task_queue_factory.h" 17 | 18 | namespace webrtc { 19 | 20 | std::unique_ptr CreateTaskQueueStdlibFactory(); 21 | 22 | } // namespace webrtc 23 | 24 | #endif // RTC_BASE_TASK_QUEUE_STDLIB_H_ 25 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/third_party/base64/LICENSE: -------------------------------------------------------------------------------- 1 | //********************************************************************* 2 | //* Base64 - a simple base64 encoder and decoder. 3 | //* 4 | //* Copyright (c) 1999, Bob Withers - bwit@pobox.com 5 | //* 6 | //* This code may be freely used for any purpose, either personal 7 | //* or commercial, provided the authors copyright notice remains 8 | //* intact. 9 | //* 10 | //* Enhancements by Stanley Yamane: 11 | //* o reverse lookup table for the decode function 12 | //* o reserve string buffer space in advance 13 | //* 14 | //********************************************************************* 15 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/third_party/base64/README.chromium: -------------------------------------------------------------------------------- 1 | Name: A simple base64 encoder and decoder 2 | Short Name: base64 3 | URL: 4 | Version: 0 5 | Date: 2018-06-20 6 | License: Custom license 7 | License File: LICENSE 8 | Security Critical: yes 9 | 10 | Description: 11 | A simple base64 encoder and decoder 12 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/third_party/sigslot/LICENSE: -------------------------------------------------------------------------------- 1 | // sigslot.h: Signal/Slot classes 2 | // 3 | // Written by Sarah Thompson (sarah@telergy.com) 2002. 4 | // 5 | // License: Public domain. You are free to use this code however you like, with 6 | // the proviso that the author takes on no responsibility or liability for any 7 | // use. 8 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/third_party/sigslot/README.chromium: -------------------------------------------------------------------------------- 1 | Name: C++ Signal/Slot Library 2 | Short Name: sigslot 3 | URL: http://sigslot.sourceforge.net/ 4 | Version: 0 5 | Date: 2018-07-09 6 | License: Custom license 7 | License File: LICENSE 8 | Security Critical: yes 9 | 10 | Description: 11 | C++ Signal/Slot Library 12 | 13 | This file has been modified such that has_slots and signalx do not have to be 14 | using the same threading requirements. E.g. it is possible to connect a 15 | has_slots and signal0 or 16 | has_slots and signal0. 17 | If has_slots is single threaded the user must ensure that it is not trying 18 | to connect or disconnect to signalx concurrently or data race may occur. 19 | If signalx is single threaded the user must ensure that disconnect, connect 20 | or signal is not happening concurrently or data race may occur. 21 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/third_party/sigslot/sigslot.cc: -------------------------------------------------------------------------------- 1 | // sigslot.h: Signal/Slot classes 2 | // 3 | // Written by Sarah Thompson (sarah@telergy.com) 2002. 4 | // 5 | // License: Public domain. You are free to use this code however you like, with 6 | // the proviso that the author takes on no responsibility or liability for any 7 | // use. 8 | 9 | #include "webrtc/rtc_base/third_party/sigslot/sigslot.h" 10 | 11 | namespace sigslot { 12 | 13 | #ifdef _SIGSLOT_HAS_POSIX_THREADS 14 | 15 | pthread_mutex_t* multi_threaded_global::get_mutex() { 16 | static pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER; 17 | return &g_mutex; 18 | } 19 | 20 | #endif // _SIGSLOT_HAS_POSIX_THREADS 21 | 22 | } // namespace sigslot 23 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/units/OWNERS: -------------------------------------------------------------------------------- 1 | srte@webrtc.org 2 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/zero_memory.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #if defined(WEBRTC_WIN) 12 | #include 13 | #else 14 | #include 15 | #endif 16 | 17 | #include "webrtc/rtc_base/checks.h" 18 | #include "webrtc/rtc_base/zero_memory.h" 19 | 20 | namespace rtc { 21 | 22 | // Code and comment taken from "OPENSSL_cleanse" of BoringSSL. 23 | void ExplicitZeroMemory(void* ptr, size_t len) { 24 | RTC_DCHECK(ptr || !len); 25 | #if defined(WEBRTC_WIN) 26 | SecureZeroMemory(ptr, len); 27 | #else 28 | memset(ptr, 0, len); 29 | #if !defined(__pnacl__) 30 | /* As best as we can tell, this is sufficient to break any optimisations that 31 | might try to eliminate "superfluous" memsets. If there's an easy way to 32 | detect memset_s, it would be better to use that. */ 33 | __asm__ __volatile__("" : : "r"(ptr) : "memory"); // NOLINT 34 | #endif 35 | #endif // !WEBRTC_WIN 36 | } 37 | 38 | } // namespace rtc 39 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/rtc_base/zero_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The WebRTC Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef RTC_BASE_ZERO_MEMORY_H_ 12 | #define RTC_BASE_ZERO_MEMORY_H_ 13 | 14 | #include 15 | 16 | #include 17 | 18 | #include "webrtc/api/array_view.h" 19 | 20 | namespace rtc { 21 | 22 | // Fill memory with zeros in a way that the compiler doesn't optimize it away 23 | // even if the pointer is not used afterwards. 24 | void ExplicitZeroMemory(void* ptr, size_t len); 25 | 26 | template ::value && 28 | std::is_trivial::value>::type* = nullptr> 29 | void ExplicitZeroMemory(rtc::ArrayView a) { 30 | ExplicitZeroMemory(a.data(), a.size()); 31 | } 32 | 33 | } // namespace rtc 34 | 35 | #endif // RTC_BASE_ZERO_MEMORY_H_ 36 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/system_wrappers/OWNERS: -------------------------------------------------------------------------------- 1 | henrika@webrtc.org 2 | mflodman@webrtc.org 3 | nisse@webrtc.org 4 | -------------------------------------------------------------------------------- /erizo/src/third_party/webrtc/src/webrtc/test/explicit_key_value_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef TEST_EXPLICIT_KEY_VALUE_CONFIG_H_ 12 | #define TEST_EXPLICIT_KEY_VALUE_CONFIG_H_ 13 | 14 | #include 15 | #include 16 | 17 | #include "absl/strings/string_view.h" 18 | #include "webrtc/api/transport/webrtc_key_value_config.h" 19 | 20 | namespace webrtc { 21 | namespace test { 22 | 23 | class ExplicitKeyValueConfig : public WebRtcKeyValueConfig { 24 | public: 25 | explicit ExplicitKeyValueConfig(const std::string& s); 26 | std::string Lookup(absl::string_view key) const override; 27 | 28 | private: 29 | std::map key_value_map_; 30 | }; 31 | 32 | } // namespace test 33 | } // namespace webrtc 34 | 35 | #endif // TEST_EXPLICIT_KEY_VALUE_CONFIG_H_ 36 | -------------------------------------------------------------------------------- /erizoAPI/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | .lock-wscript 3 | -------------------------------------------------------------------------------- /erizoAPI/AsyncPromiseWorker.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "AsyncPromiseWorker.h" 3 | 4 | AsyncPromiseWorker::AsyncPromiseWorker(Nan::Persistent *persistent) 5 | : AsyncWorker(nullptr) { 6 | _persistent = persistent; 7 | } 8 | 9 | AsyncPromiseWorker::~AsyncPromiseWorker() {} 10 | 11 | void AsyncPromiseWorker::Execute() { 12 | } 13 | 14 | void AsyncPromiseWorker::HandleOKCallback() { 15 | Nan::HandleScope scope; 16 | auto resolver = Nan::New(*_persistent); 17 | resolver->Resolve(Nan::GetCurrentContext(), Nan::New("").ToLocalChecked()).IsNothing(); 18 | } 19 | 20 | void AsyncPromiseWorker::HandleErrorCallback() { 21 | Nan::HandleScope scope; 22 | auto resolver = Nan::New(*_persistent); 23 | resolver->Reject(Nan::GetCurrentContext(), Nan::New("").ToLocalChecked()).IsNothing(); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /erizoAPI/AsyncPromiseWorker.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZOAPI_ASYNCPROMISEWORKER_H_ 2 | #define ERIZOAPI_ASYNCPROMISEWORKER_H_ 3 | 4 | #include 5 | 6 | class AsyncPromiseWorker : public Nan::AsyncWorker { 7 | public: 8 | explicit AsyncPromiseWorker(Nan::Persistent *persistent); 9 | ~AsyncPromiseWorker(); 10 | void Execute() override; 11 | void HandleOKCallback() override; 12 | void HandleErrorCallback() override; 13 | 14 | private: 15 | Nan::Persistent *_persistent; 16 | }; 17 | 18 | #endif // ERIZOAPI_ASYNCPROMISEWORKER_H_ 19 | 20 | -------------------------------------------------------------------------------- /erizoAPI/ExternalOutput.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZOAPI_EXTERNALOUTPUT_H_ 2 | #define ERIZOAPI_EXTERNALOUTPUT_H_ 3 | 4 | #include 5 | #include 6 | #include "MediaDefinitions.h" 7 | #include "WebRtcConnection.h" 8 | 9 | 10 | /* 11 | * Wrapper class of erizo::ExternalOutput 12 | * 13 | * Represents a OneToMany connection. 14 | * Receives media from one publisher and retransmits it to every subscriber. 15 | */ 16 | class ExternalOutput: public MediaSink { 17 | public: 18 | static NAN_MODULE_INIT(Init); 19 | std::shared_ptr me; 20 | 21 | private: 22 | ExternalOutput(); 23 | ~ExternalOutput(); 24 | 25 | /* 26 | * Constructor. 27 | * Constructs a ExternalOutput 28 | */ 29 | static NAN_METHOD(New); 30 | /* 31 | * Closes the ExternalOutput. 32 | * The object cannot be used after this call 33 | */ 34 | static NAN_METHOD(close); 35 | /* 36 | * Inits the ExternalOutput 37 | * Returns true ready 38 | */ 39 | static NAN_METHOD(init); 40 | 41 | static Nan::Persistent constructor; 42 | }; 43 | 44 | #endif // ERIZOAPI_EXTERNALOUTPUT_H_ 45 | -------------------------------------------------------------------------------- /erizoAPI/IOThreadPool.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZOAPI_IOTHREADPOOL_H_ 2 | #define ERIZOAPI_IOTHREADPOOL_H_ 3 | 4 | #include 5 | #include 6 | 7 | 8 | /* 9 | * Wrapper class of erizo::IOThreadPool 10 | * 11 | * Represents a OneToMany connection. 12 | * Receives media from one publisher and retransmits it to every subscriber. 13 | */ 14 | class IOThreadPool : public Nan::ObjectWrap { 15 | public: 16 | static NAN_MODULE_INIT(Init); 17 | std::unique_ptr me; 18 | 19 | private: 20 | IOThreadPool(); 21 | ~IOThreadPool(); 22 | 23 | /* 24 | * Constructor. 25 | * Constructs a IOThreadPool 26 | */ 27 | static NAN_METHOD(New); 28 | /* 29 | * Closes the IOThreadPool. 30 | * The object cannot be used after this call 31 | */ 32 | static NAN_METHOD(close); 33 | /* 34 | * Starts all workers in the IOThreadPool 35 | */ 36 | static NAN_METHOD(start); 37 | 38 | static Nan::Persistent constructor; 39 | }; 40 | 41 | #endif // ERIZOAPI_IOTHREADPOOL_H_ 42 | -------------------------------------------------------------------------------- /erizoAPI/MediaDefinitions.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZOAPI_MEDIADEFINITIONS_H_ 2 | #define ERIZOAPI_MEDIADEFINITIONS_H_ 3 | 4 | #include 5 | #include 6 | 7 | 8 | /* 9 | * Wrapper class of erizo::MediaSink 10 | */ 11 | class MediaSink : public Nan::ObjectWrap { 12 | public: 13 | std::weak_ptr msink; 14 | }; 15 | 16 | 17 | /* 18 | * Wrapper class of erizo::MediaSource 19 | */ 20 | class MediaSource : public Nan::ObjectWrap { 21 | public: 22 | std::weak_ptr msource; 23 | }; 24 | 25 | #endif // ERIZOAPI_MEDIADEFINITIONS_H_ 26 | -------------------------------------------------------------------------------- /erizoAPI/PromiseDurationDistribution.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZOAPI_PROMISEDURATIONDISTRIBUTION_H_ 2 | #define ERIZOAPI_PROMISEDURATIONDISTRIBUTION_H_ 3 | 4 | #include 5 | 6 | typedef unsigned int uint; 7 | 8 | using erizo::duration; 9 | 10 | class PromiseDurationDistribution { 11 | public: 12 | PromiseDurationDistribution(); 13 | ~PromiseDurationDistribution() {} 14 | void reset(); 15 | void add(duration promise_duration); 16 | PromiseDurationDistribution& operator+=(const PromiseDurationDistribution& buf); 17 | 18 | public: 19 | uint duration_0_10_ms; 20 | uint duration_10_50_ms; 21 | uint duration_50_100_ms; 22 | uint duration_100_1000_ms; 23 | uint duration_1000_ms; 24 | }; 25 | 26 | #endif // ERIZOAPI_PROMISEDURATIONDISTRIBUTION_H_ 27 | -------------------------------------------------------------------------------- /erizoAPI/SyntheticInput.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZOAPI_SYNTHETICINPUT_H_ 2 | #define ERIZOAPI_SYNTHETICINPUT_H_ 3 | 4 | #include 5 | #include 6 | #include "MediaDefinitions.h" 7 | #include "MediaStream.h" 8 | 9 | 10 | /* 11 | * Wrapper class of erizo::SyntheticInput 12 | * 13 | * Represents a SyntheticInput connection. 14 | */ 15 | class SyntheticInput : public Nan::ObjectWrap { 16 | public: 17 | static NAN_MODULE_INIT(Init); 18 | std::shared_ptr me; 19 | 20 | private: 21 | SyntheticInput(); 22 | ~SyntheticInput(); 23 | 24 | /* 25 | * Constructor. 26 | * Constructs a SyntheticInput 27 | */ 28 | static NAN_METHOD(New); 29 | /* 30 | * Closes the SyntheticInput. 31 | * The object cannot be used after this call 32 | */ 33 | static NAN_METHOD(close); 34 | /* 35 | * Inits the SyntheticInput 36 | * Returns true ready 37 | */ 38 | static NAN_METHOD(init); 39 | /* 40 | * Sets a MediaSink that is going to receive Audio Data 41 | * Param: the MediaSink to send audio to. 42 | */ 43 | static NAN_METHOD(setAudioReceiver); 44 | /* 45 | * Sets a MediaSink that is going to receive Video Data 46 | * Param: the MediaSink 47 | */ 48 | static NAN_METHOD(setVideoReceiver); 49 | 50 | static NAN_METHOD(setFeedbackSource); 51 | 52 | static Nan::Persistent constructor; 53 | }; 54 | 55 | #endif // ERIZOAPI_SYNTHETICINPUT_H_ 56 | -------------------------------------------------------------------------------- /erizoAPI/ThreadPool.h: -------------------------------------------------------------------------------- 1 | #ifndef ERIZOAPI_THREADPOOL_H_ 2 | #define ERIZOAPI_THREADPOOL_H_ 3 | 4 | #include 5 | #include 6 | 7 | 8 | /* 9 | * Wrapper class of erizo::ThreadPool 10 | * 11 | * Represents a OneToMany connection. 12 | * Receives media from one publisher and retransmits it to every subscriber. 13 | */ 14 | class ThreadPool : public Nan::ObjectWrap { 15 | public: 16 | static NAN_MODULE_INIT(Init); 17 | std::unique_ptr me; 18 | 19 | private: 20 | ThreadPool(); 21 | ~ThreadPool(); 22 | 23 | /* 24 | * Constructor. 25 | * Constructs a ThreadPool 26 | */ 27 | static NAN_METHOD(New); 28 | /* 29 | * Closes the ThreadPool. 30 | * The object cannot be used after this call 31 | */ 32 | static NAN_METHOD(close); 33 | /* 34 | * Starts all workers in the ThreadPool 35 | */ 36 | static NAN_METHOD(start); 37 | 38 | static NAN_METHOD(getDurationDistribution); 39 | static NAN_METHOD(getDelayDistribution); 40 | static NAN_METHOD(resetStats); 41 | 42 | static Nan::Persistent constructor; 43 | }; 44 | 45 | #endif // ERIZOAPI_THREADPOOL_H_ 46 | -------------------------------------------------------------------------------- /erizoAPI/addon.cc: -------------------------------------------------------------------------------- 1 | #ifndef BUILDING_NODE_EXTENSION 2 | #define BUILDING_NODE_EXTENSION 3 | #endif 4 | #include 5 | #include 6 | #include "WebRtcConnection.h" 7 | #include "MediaStream.h" 8 | #include "OneToManyProcessor.h" 9 | #include "OneToManyTranscoder.h" 10 | #include "SyntheticInput.h" 11 | #include "ExternalInput.h" 12 | #include "ExternalOutput.h" 13 | #include "ConnectionDescription.h" 14 | #include "ThreadPool.h" 15 | #include "IOThreadPool.h" 16 | 17 | NAN_MODULE_INIT(InitAll) { 18 | dtls::DtlsSocketContext::Init(); 19 | WebRtcConnection::Init(target); 20 | MediaStream::Init(target); 21 | OneToManyProcessor::Init(target); 22 | ExternalInput::Init(target); 23 | ExternalOutput::Init(target); 24 | SyntheticInput::Init(target); 25 | ThreadPool::Init(target); 26 | IOThreadPool::Init(target); 27 | ConnectionDescription::Init(target); 28 | } 29 | 30 | NODE_MODULE(addon, InitAll) 31 | -------------------------------------------------------------------------------- /erizoAPI/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | SCRIPT=`pwd`/$0 6 | FILENAME=`basename $SCRIPT` 7 | PATHNAME=`dirname $SCRIPT` 8 | ROOT=$PATHNAME/.. 9 | CURRENT_DIR=`pwd` 10 | NVM_CHECK="$ROOT"/scripts/checkNvm.sh 11 | 12 | . $NVM_CHECK 13 | nvm use 14 | 15 | echo 'linting with cpplint' 16 | ./lint.sh 17 | 18 | if hash node-waf 2>/dev/null; then 19 | echo 'building with node-waf' 20 | rm -rf build 21 | node-waf configure build 22 | else 23 | echo 'building with node-gyp' 24 | node-gyp rebuild 25 | fi 26 | -------------------------------------------------------------------------------- /erizoAPI/lint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cpplint --filter=-legal/copyright,-build/include --linelength=120 *.cc *.h 4 | -------------------------------------------------------------------------------- /erizoAPI/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "licode-erizo-api", 3 | "version": "0.1.0", 4 | "description": "Open Source Communication Provider - Erizo API", 5 | "license": "MIT", 6 | "private": true, 7 | "devDependencies": {}, 8 | "dependencies": { 9 | "nan": "^2.20", 10 | "node-gyp": "^9.4.0" 11 | }, 12 | "contributors": [ 13 | { 14 | "name": "Alvaro Alonso", 15 | "email": "aalonsog@dit.upm.es" 16 | }, 17 | { 18 | "name": "Pedro Rodriguez", 19 | "email": "prodriguez@dit.upm.es" 20 | }, 21 | { 22 | "name": "Javier Cerviño", 23 | "email": "jcervino@dit.upm.es" 24 | } 25 | ], 26 | "scripts": { 27 | "install": "node-gyp rebuild", 28 | "preinstall": "./lint.sh" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /erizoAPI/wscript: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | srcdir = '.' 4 | blddir = 'build' 5 | VERSION = '0.5' 6 | 7 | def set_options(opt): 8 | opt.tool_options('compiler_cxx') 9 | 10 | def configure(conf): 11 | conf.check_tool('compiler_cxx') 12 | conf.check_tool('node_addon') 13 | conf.env.append_unique('CXXFLAGS', ['-Wall', '-O3']) 14 | conf.env['ERIZO_HOME'] = os.environ['ERIZO_HOME'] 15 | 16 | def build(bld): 17 | obj = bld.new_task_gen('cxx', 'shlib', 'node_addon') 18 | obj.cxxflags = ["-I"+bld.env['ERIZO_HOME']+"/src/erizo", "-I"+bld.env['ERIZO_HOME']+"/../build/libdeps/build/include", "-g", "-Wall"] 19 | obj.target = 'addon' 20 | obj.source = ['addon.cc', 'WebRtcConnection.cc', 'OneToManyProcessor.cc', 'OneToManyTranscoder.cc', 'ExternalInput.cc'] 21 | bld.env.append_value('LINKFLAGS',('-L'+bld.env['ERIZO_HOME'] + "/build/erizo/ -lerizo").split()) 22 | -------------------------------------------------------------------------------- /erizo_controller/.gitignore: -------------------------------------------------------------------------------- 1 | erizoClient/dist/production/ 2 | erizoClient/dist/debug/ 3 | erizoController/node_modules/ 4 | test/public/erizo.js 5 | erizoController/ch_policies/ 6 | -------------------------------------------------------------------------------- /erizo_controller/common/ROV/rpcDuplexStream.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable class-methods-use-this */ 2 | 3 | const Duplex = require('stream').Duplex; 4 | 5 | class RpcDuplexStream extends Duplex { 6 | constructor(options) { 7 | super(options); 8 | this.rpcCallbacks = []; 9 | this.resultString = ''; 10 | this.requestTimeout = undefined; 11 | } 12 | 13 | _write(chunk, encoding, callback) { 14 | // The underlying source only deals with strings 15 | let resultString = ''; 16 | if (Buffer.isBuffer(chunk)) { 17 | resultString = chunk.toString(); 18 | } 19 | this._flush(resultString); 20 | callback(); 21 | } 22 | 23 | _flush(resultString) { 24 | this.resultString += resultString; 25 | if (this.requestTimeout) { 26 | clearTimeout(this.requestTimeout); 27 | } 28 | this.requestTimeout = setTimeout(() => { 29 | const rpcCallback = this.rpcCallbacks.pop(); 30 | if (rpcCallback) { 31 | rpcCallback('callback', this.resultString); 32 | } 33 | this.resultString = ''; 34 | }, 10); 35 | } 36 | 37 | onData(message, rpcCallback) { 38 | this.rpcCallbacks.push(rpcCallback); 39 | this.push(Buffer.from(`${message}\n`, 'utf8')); 40 | } 41 | 42 | _read() { // We need this to be an InputStream 43 | } 44 | } 45 | 46 | exports.RpcDuplexStream = RpcDuplexStream; 47 | -------------------------------------------------------------------------------- /erizo_controller/common/semanticSdp/DTLSInfo.js: -------------------------------------------------------------------------------- 1 | const Setup = require('./Setup'); 2 | 3 | class DTLSInfo { 4 | constructor(setup, hash, fingerprint) { 5 | this.setup = setup; 6 | this.hash = hash; 7 | this.fingerprint = fingerprint; 8 | } 9 | 10 | clone() { 11 | return new DTLSInfo(this.setup, this.hash, this.fingerprint); 12 | } 13 | 14 | plain() { 15 | return { 16 | setup: Setup.toString(this.setup), 17 | hash: this.hash, 18 | fingerprint: this.fingerprint, 19 | }; 20 | } 21 | 22 | getFingerprint() { 23 | return this.fingerprint; 24 | } 25 | 26 | getHash() { 27 | return this.hash; 28 | } 29 | 30 | getSetup() { 31 | return this.setup; 32 | } 33 | 34 | setSetup(setup) { 35 | this.setup = setup; 36 | } 37 | } 38 | 39 | module.exports = DTLSInfo; 40 | -------------------------------------------------------------------------------- /erizo_controller/common/semanticSdp/Direction.js: -------------------------------------------------------------------------------- 1 | const Enum = require('./Enum'); 2 | 3 | const Direction = Enum('SENDRECV', 'SENDONLY', 'RECVONLY', 'INACTIVE'); 4 | 5 | Direction.byValue = direction => Direction[direction.toUpperCase()]; 6 | 7 | /** 8 | * Get Direction name 9 | * @memberOf Direction 10 | * @param {Direction} direction 11 | * @returns {String} 12 | */ 13 | Direction.toString = (direction) => { 14 | switch (direction) { 15 | case Direction.SENDRECV: 16 | return 'sendrecv'; 17 | case Direction.SENDONLY: 18 | return 'sendonly'; 19 | case Direction.RECVONLY: 20 | return 'recvonly'; 21 | case Direction.INACTIVE: 22 | return 'inactive'; 23 | default: 24 | return 'unknown'; 25 | } 26 | }; 27 | 28 | Direction.reverse = (direction) => { 29 | switch (direction) { 30 | case Direction.SENDRECV: 31 | return Direction.SENDRECV; 32 | case Direction.SENDONLY: 33 | return Direction.RECVONLY; 34 | case Direction.RECVONLY: 35 | return Direction.SENDONLY; 36 | case Direction.INACTIVE: 37 | return Direction.INACTIVE; 38 | default: 39 | return Direction.SENDRECV; 40 | } 41 | }; 42 | 43 | module.exports = Direction; 44 | -------------------------------------------------------------------------------- /erizo_controller/common/semanticSdp/DirectionWay.js: -------------------------------------------------------------------------------- 1 | const Enum = require('./Enum'); 2 | 3 | const DirectionWay = Enum('SEND', 'RECV'); 4 | 5 | DirectionWay.byValue = direction => DirectionWay[direction.toUpperCase()]; 6 | 7 | DirectionWay.toString = (direction) => { 8 | switch (direction) { 9 | case DirectionWay.SEND: 10 | return 'send'; 11 | case DirectionWay.RECV: 12 | return 'recv'; 13 | default: 14 | return 'unknown'; 15 | } 16 | }; 17 | 18 | DirectionWay.reverse = (direction) => { 19 | switch (direction) { 20 | case DirectionWay.SEND: 21 | return DirectionWay.RECV; 22 | case DirectionWay.RECV: 23 | return DirectionWay.SEND; 24 | default: 25 | return DirectionWay.SEND; 26 | } 27 | }; 28 | 29 | module.exports = DirectionWay; 30 | -------------------------------------------------------------------------------- /erizo_controller/common/semanticSdp/Enum.js: -------------------------------------------------------------------------------- 1 | 2 | function Enum(...args) { 3 | if (!(this instanceof Enum)) { 4 | return new (Function.prototype.bind.apply(Enum, 5 | [null].concat(Array.prototype.slice.call(args))))(); 6 | } 7 | Array.from(args).forEach((arg) => { 8 | this[arg] = Symbol.for(`LICODE_SEMANTIC_SDP_${arg}`); 9 | }); 10 | } 11 | 12 | module.exports = Enum; 13 | -------------------------------------------------------------------------------- /erizo_controller/common/semanticSdp/RIDInfo.js: -------------------------------------------------------------------------------- 1 | const DirectionWay = require('./DirectionWay'); 2 | 3 | class RIDInfo { 4 | constructor(id, direction) { 5 | this.id = id; 6 | this.direction = direction; 7 | this.formats = []; 8 | this.params = new Map(); 9 | } 10 | 11 | clone() { 12 | const cloned = new RIDInfo(this.id, this.direction); 13 | cloned.setFormats(this.formats); 14 | cloned.setParams(this.params); 15 | return cloned; 16 | } 17 | 18 | plain() { 19 | const plain = { 20 | id: this.id, 21 | direction: DirectionWay.toString(this.direction), 22 | formats: this.formats, 23 | params: {}, 24 | }; 25 | this.params.forEach((param, id) => { 26 | plain.params[id] = param; 27 | }); 28 | return plain; 29 | } 30 | 31 | getId() { 32 | return this.id; 33 | } 34 | 35 | getDirection() { 36 | return this.direction; 37 | } 38 | 39 | setDirection(direction) { 40 | this.direction = direction; 41 | } 42 | 43 | getFormats() { 44 | return this.formats; 45 | } 46 | 47 | setFormats(formats) { 48 | this.formats = []; 49 | formats.forEach((format) => { 50 | this.formats.push(parseInt(format, 10)); 51 | }); 52 | } 53 | 54 | getParams() { 55 | return this.params; 56 | } 57 | 58 | setParams(params) { 59 | this.params = new Map(params); 60 | } 61 | } 62 | 63 | module.exports = RIDInfo; 64 | -------------------------------------------------------------------------------- /erizo_controller/common/semanticSdp/SemanticSdp.js: -------------------------------------------------------------------------------- 1 | const SDPInfo = require('./SDPInfo'); 2 | const CandidateInfo = require('./CandidateInfo'); 3 | const CodecInfo = require('./CodecInfo'); 4 | const DTLSInfo = require('./DTLSInfo'); 5 | const ICEInfo = require('./ICEInfo'); 6 | const MediaInfo = require('./MediaInfo'); 7 | const Setup = require('./Setup'); 8 | const SourceGroupInfo = require('./SourceGroupInfo'); 9 | const SourceInfo = require('./SourceInfo'); 10 | const StreamInfo = require('./StreamInfo'); 11 | const TrackInfo = require('./TrackInfo'); 12 | const Direction = require('./Direction'); 13 | 14 | module.exports = { 15 | SDPInfo, 16 | CandidateInfo, 17 | CodecInfo, 18 | DTLSInfo, 19 | ICEInfo, 20 | MediaInfo, 21 | Setup, 22 | SourceGroupInfo, 23 | SourceInfo, 24 | StreamInfo, 25 | TrackInfo, 26 | Direction, 27 | }; 28 | -------------------------------------------------------------------------------- /erizo_controller/common/semanticSdp/Setup.js: -------------------------------------------------------------------------------- 1 | const Enum = require('./Enum'); 2 | 3 | const Setup = Enum('ACTIVE', 'PASSIVE', 'ACTPASS', 'INACTIVE'); 4 | 5 | Setup.byValue = setup => Setup[setup.toUpperCase()]; 6 | 7 | Setup.toString = (setup) => { 8 | switch (setup) { 9 | case Setup.ACTIVE: 10 | return 'active'; 11 | case Setup.PASSIVE: 12 | return 'passive'; 13 | case Setup.ACTPASS: 14 | return 'actpass'; 15 | case Setup.INACTIVE: 16 | return 'inactive'; 17 | default: 18 | return null; 19 | } 20 | }; 21 | 22 | Setup.reverse = (setup) => { 23 | switch (setup) { 24 | case Setup.ACTIVE: 25 | return Setup.PASSIVE; 26 | case Setup.PASSIVE: 27 | return Setup.ACTIVE; 28 | case Setup.ACTPASS: 29 | return Setup.PASSIVE; 30 | case Setup.INACTIVE: 31 | return Setup.INACTIVE; 32 | default: 33 | return Setup.ACTIVE; 34 | } 35 | }; 36 | 37 | module.exports = Setup; 38 | -------------------------------------------------------------------------------- /erizo_controller/common/semanticSdp/SimulcastStreamInfo.js: -------------------------------------------------------------------------------- 1 | class SimulcastStreamInfo { 2 | constructor(id, paused) { 3 | this.paused = paused; 4 | this.id = id; 5 | } 6 | 7 | clone() { 8 | return new SimulcastStreamInfo(this.id, this.paused); 9 | } 10 | 11 | plain() { 12 | return { 13 | id: this.id, 14 | paused: this.paused, 15 | }; 16 | } 17 | 18 | isPaused() { 19 | return this.paused; 20 | } 21 | 22 | getId() { 23 | return this.id; 24 | } 25 | } 26 | 27 | module.exports = SimulcastStreamInfo; 28 | -------------------------------------------------------------------------------- /erizo_controller/common/semanticSdp/SourceGroupInfo.js: -------------------------------------------------------------------------------- 1 | class SourceGroupInfo { 2 | constructor(semantics, ssrcs) { 3 | this.semantics = semantics; 4 | this.ssrcs = []; 5 | ssrcs.forEach((ssrc) => { 6 | this.ssrcs.push(parseInt(ssrc, 10)); 7 | }); 8 | } 9 | 10 | clone() { 11 | return new SourceGroupInfo(this.semantics, this.ssrcs); 12 | } 13 | 14 | plain() { 15 | const plain = { 16 | semantics: this.semantics, 17 | ssrcs: [], 18 | }; 19 | plain.ssrcs = this.ssrcs; 20 | return plain; 21 | } 22 | 23 | getSemantics() { 24 | return this.semantics; 25 | } 26 | 27 | getSSRCs() { 28 | return this.ssrcs; 29 | } 30 | } 31 | 32 | module.exports = SourceGroupInfo; 33 | -------------------------------------------------------------------------------- /erizo_controller/common/semanticSdp/SourceInfo.js: -------------------------------------------------------------------------------- 1 | class SourceInfo { 2 | constructor(ssrc) { 3 | this.ssrc = ssrc; 4 | } 5 | 6 | clone() { 7 | const clone = new SourceInfo(this.ssrc); 8 | clone.setCName(this.cname); 9 | clone.setStreamId(this.streamId); 10 | this.setTrackId(this.trackId); 11 | } 12 | 13 | 14 | plain() { 15 | const plain = { 16 | ssrc: this.ssrc, 17 | }; 18 | if (this.cname) plain.cname = this.cname; 19 | if (this.label) plain.label = this.label; 20 | if (this.mslabel) plain.mslabel = this.mslabel; 21 | if (this.streamId) plain.streamId = this.streamId; 22 | if (this.trackId) plain.trackid = this.trackId; 23 | return plain; 24 | } 25 | 26 | getCName() { 27 | return this.cname; 28 | } 29 | 30 | setCName(cname) { 31 | this.cname = cname; 32 | } 33 | 34 | getStreamId() { 35 | return this.streamId; 36 | } 37 | 38 | setStreamId(streamId) { 39 | this.streamId = streamId; 40 | } 41 | 42 | getTrackId() { 43 | return this.trackId; 44 | } 45 | 46 | setTrackId(trackId) { 47 | this.trackId = trackId; 48 | } 49 | 50 | getMSLabel() { 51 | return this.mslabel; 52 | } 53 | 54 | setMSLabel(mslabel) { 55 | this.mslabel = mslabel; 56 | } 57 | 58 | getLabel() { 59 | return this.label; 60 | } 61 | 62 | setLabel(label) { 63 | this.label = label; 64 | } 65 | 66 | getSSRC() { 67 | return this.ssrc; 68 | } 69 | } 70 | 71 | module.exports = SourceInfo; 72 | -------------------------------------------------------------------------------- /erizo_controller/common/semanticSdp/StreamInfo.js: -------------------------------------------------------------------------------- 1 | class StreamInfo { 2 | constructor(id) { 3 | this.id = id; 4 | this.tracks = new Map(); 5 | } 6 | 7 | clone() { 8 | const cloned = new StreamInfo(this.id); 9 | this.tracks.forEach((track) => { 10 | cloned.addTrack(track.clone()); 11 | }); 12 | return cloned; 13 | } 14 | 15 | plain() { 16 | const plain = { 17 | id: this.id, 18 | tracks: [], 19 | }; 20 | this.tracks.forEach((track) => { 21 | plain.tracks.push(track.plain()); 22 | }); 23 | return plain; 24 | } 25 | 26 | getId() { 27 | return this.id; 28 | } 29 | 30 | addTrack(track) { 31 | this.tracks.set(track.getId(), track); 32 | } 33 | 34 | getFirstTrack(media) { 35 | let result; 36 | this.tracks.forEach((track) => { 37 | if (track.getMedia().toLowerCase() === media.toLowerCase()) { 38 | result = track; 39 | } 40 | }); 41 | return result; 42 | } 43 | 44 | getTracks() { 45 | return this.tracks; 46 | } 47 | 48 | removeAllTracks() { 49 | this.tracks.clear(); 50 | } 51 | 52 | getTrack(trackId) { 53 | return this.tracks.get(trackId); 54 | } 55 | } 56 | 57 | module.exports = StreamInfo; 58 | -------------------------------------------------------------------------------- /erizo_controller/common/semanticSdp/TrackEncodingInfo.js: -------------------------------------------------------------------------------- 1 | class TrackEncodingInfo { 2 | constructor(id, paused) { 3 | this.id = id; 4 | this.paused = paused; 5 | this.codecs = new Map(); 6 | this.params = new Map(); 7 | } 8 | 9 | clone() { 10 | const cloned = new TrackEncodingInfo(this.id, this.paused); 11 | this.codecs.forEach((codec) => { 12 | cloned.addCodec(codec.cloned()); 13 | }); 14 | cloned.setParams(this.params); 15 | return cloned; 16 | } 17 | 18 | plain() { 19 | const plain = { 20 | id: this.id, 21 | paused: this.paused, 22 | codecs: {}, 23 | params: {}, 24 | }; 25 | this.codecs.keys().forEach((id) => { 26 | plain.codecs[id] = this.codecs.get(id).plain(); 27 | }); 28 | this.params.keys().forEach((id) => { 29 | plain.params[id] = this.params.get(id).param; 30 | }); 31 | return plain; 32 | } 33 | 34 | getId() { 35 | return this.id; 36 | } 37 | 38 | getCodecs() { 39 | return this.codecs; 40 | } 41 | 42 | addCodec(codec) { 43 | this.codecs.set(codec.getType(), codec); 44 | } 45 | 46 | getParams() { 47 | return this.params; 48 | } 49 | 50 | setParams(params) { 51 | this.params = new Map(params); 52 | } 53 | 54 | isPaused() { 55 | return this.paused; 56 | } 57 | } 58 | 59 | module.exports = TrackEncodingInfo; 60 | -------------------------------------------------------------------------------- /erizo_controller/erizoAgent/erizoAgentReporter.js: -------------------------------------------------------------------------------- 1 | /* global require, exports */ 2 | 3 | 4 | const os = require('os'); 5 | 6 | exports.Reporter = (spec) => { 7 | const that = {}; 8 | 9 | 10 | const myId = spec.id; 11 | 12 | 13 | const myMeta = spec.metadata || {}; 14 | 15 | let lastTotal = 0; 16 | let lastIdle = 0; 17 | 18 | const getStats = () => { 19 | const cpus = os.cpus(); 20 | 21 | let user = 0; 22 | let nice = 0; 23 | let sys = 0; 24 | let idle = 0; 25 | let irq = 0; 26 | let total = 0; 27 | let cpu = 0; 28 | 29 | cpus.forEach((singleCpuInfo) => { 30 | user += singleCpuInfo.times.user; 31 | nice += singleCpuInfo.times.nice; 32 | sys += singleCpuInfo.times.sys; 33 | irq += singleCpuInfo.times.irq; 34 | idle += singleCpuInfo.times.idle; 35 | }); 36 | total = user + nice + sys + idle + irq; 37 | 38 | cpu = 1 - ((idle - lastIdle) / (total - lastTotal)); 39 | const mem = 1 - (os.freemem() / os.totalmem()); 40 | 41 | lastTotal = total; 42 | lastIdle = idle; 43 | 44 | const data = { 45 | perc_cpu: cpu, 46 | perc_mem: mem, 47 | }; 48 | return data; 49 | }; 50 | 51 | that.getErizoAgent = (callback) => { 52 | const data = { 53 | info: { 54 | id: myId, 55 | rpc_id: `ErizoAgent_${myId}`, 56 | }, 57 | metadata: myMeta, 58 | stats: getStats(), 59 | }; 60 | callback(data); 61 | }; 62 | 63 | return that; 64 | }; 65 | -------------------------------------------------------------------------------- /erizo_controller/erizoAgent/launch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ulimit -c unlimited 3 | exec node $ERIZOJS_NODE_OPTIONS $* 4 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/dist/assets/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/erizo_controller/erizoClient/dist/assets/loader.gif -------------------------------------------------------------------------------- /erizo_controller/erizoClient/dist/assets/mute48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/erizo_controller/erizoClient/dist/assets/mute48.png -------------------------------------------------------------------------------- /erizo_controller/erizoClient/dist/assets/sound48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/erizo_controller/erizoClient/dist/assets/sound48.png -------------------------------------------------------------------------------- /erizo_controller/erizoClient/extras/chrome-extension/lynckia_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/erizo_controller/erizoClient/extras/chrome-extension/lynckia_icon_128.png -------------------------------------------------------------------------------- /erizo_controller/erizoClient/extras/chrome-extension/lynckia_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/erizo_controller/erizoClient/extras/chrome-extension/lynckia_icon_16.png -------------------------------------------------------------------------------- /erizo_controller/erizoClient/extras/chrome-extension/lynckia_icon_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/erizo_controller/erizoClient/extras/chrome-extension/lynckia_icon_48.png -------------------------------------------------------------------------------- /erizo_controller/erizoClient/extras/chrome-extension/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "minimum_chrome_version": "34", 4 | "name": "Lynckia Screensharing", 5 | "permissions": [ "desktopCapture" ], 6 | "short_name": "Screen sharing for lynckia", 7 | "update_url": "https://clients2.google.com/service/update2/crx", 8 | "version": "0.0.0.1", 9 | 10 | "background": { 11 | "persistent": true, 12 | "scripts": [ "script.js" ] 13 | }, 14 | "description": "Extension to allow screen sharing in Licode applications.", 15 | "externally_connectable": { 16 | "matches": [ "*://*.dit.upm.es/*"] 17 | }, 18 | "icons": { 19 | "128": "lynckia_icon_128.png", 20 | "16": "lynckia_icon_16.png", 21 | "48": "lynckia_icon_48.png" 22 | }, 23 | "browser_action":{ 24 | "default_icon": "lynckia_icon_16.png" 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/extras/chrome-extension/script.js: -------------------------------------------------------------------------------- 1 | /* global chrome */ 2 | 'use strict'; 3 | // Listens for external messages coming from pages that match url pattern defined in manifest.json 4 | chrome.runtime.onMessageExternal.addListener( 5 | function(request, sender, sendResponse) { 6 | console.log('Got request', request, sender); 7 | if(request.getVersion) { 8 | sendResponse({ version: chrome.runtime.getManifest().version}); 9 | return false; // Dispose of sendResponse 10 | } else if(request.getStream) { 11 | // Gets chrome media stream token and returns it in the response. 12 | chrome.desktopCapture.chooseDesktopMedia( 13 | ['screen', 'window'], sender.tab, 14 | function(streamId) { 15 | sendResponse({ streamId: streamId}); 16 | }); 17 | return true; // Preserve sendResponse for future use 18 | } else { 19 | console.error('Unknown request'); 20 | sendResponse({ error : 'Unknown request' }); 21 | return false; 22 | } 23 | } 24 | ); 25 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/extras/firefox-extension/README.txt: -------------------------------------------------------------------------------- 1 | Instructions to create your own Firefox Screensharing Extension: 2 | 3 | 1. Modify bootstrap.js file, updating the variable domainsUsed with your own domains. 4 | 5 | 2. Modify install.rdf with your own extension information 6 | 7 | 3. Choose your icon (48x48) and name it icon.png 8 | 9 | 4. Run createExtension.sh script to create your .xpi containing the three files. 10 | 11 | 5. Install the .xpi file in Firefox 12 | 13 | 6. Enjoy Firefox Screensharing with Licode! -------------------------------------------------------------------------------- /erizo_controller/erizoClient/extras/firefox-extension/createExtension.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "Creating FirefoxExtension.xpi..." 4 | 5 | zip ./FirefoxExtension.xpi icon.png bootstrap.js install.rdf 6 | 7 | echo "FirefoxExtension.xpi ready!" 8 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/extras/firefox-extension/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/erizo_controller/erizoClient/extras/firefox-extension/icon.png -------------------------------------------------------------------------------- /erizo_controller/erizoClient/extras/firefox-extension/install.rdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | lynckia@lynckia.com 5 | 2 6 | Lynckia Screensharing 7 | Extension to allow screen sharing in Licode applications. 8 | 1.0 9 | true 10 | Lynckia 11 | lynckia.com/licode 12 | 13 | 14 | 15 | {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 16 | 33.0 17 | 100000.* 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/gulp/erizoFcTasks.js: -------------------------------------------------------------------------------- 1 | const webpackConfig = require('../webpack.config.erizofc.js'); 2 | 3 | const erizoFcTasks = (gulp, plugins, config) => { 4 | const that = {}; 5 | if (!config.paths) { 6 | return {}; 7 | } 8 | const erizoFcConfig = { 9 | entry: `${config.paths.entry}ErizoFc.js`, 10 | webpackConfig, 11 | debug: `${config.paths.debug}/erizofc`, 12 | production: `${config.paths.production}/erizofc`, 13 | }; 14 | that.bundle = () => 15 | gulp.src(erizoFcConfig.entry) 16 | .pipe(plugins.webpackGulp(erizoFcConfig.webpackConfig, plugins.webpack)) 17 | .on('error', anError => plugins.exitOnError(anError)) 18 | .pipe(gulp.dest(erizoFcConfig.debug)) 19 | .on('error', anError => plugins.exitOnError(anError)); 20 | 21 | that.compile = () => gulp.src(`${erizoFcConfig.debug}/**/*.js`) 22 | .pipe(gulp.dest(erizoFcConfig.production)); 23 | 24 | that.dist = () => 25 | gulp.src(`${erizoFcConfig.production}/**/*.js`) 26 | .pipe(gulp.dest(config.paths.spine)); 27 | 28 | that.distDebug = () => 29 | gulp.src(`${erizoFcConfig.debug}/**/*.js`) 30 | .pipe(gulp.dest(config.paths.spine)); 31 | 32 | that.clean = () => 33 | plugins.del([`${erizoFcConfig.debug}/**/*.js*`, `${erizoFcConfig.production}/**/*.js*`], 34 | { force: true }); 35 | 36 | return that; 37 | }; 38 | 39 | module.exports = erizoFcTasks; 40 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/src/Erizo.js: -------------------------------------------------------------------------------- 1 | import Room from './Room'; 2 | import Base64 from './utils/Base64'; 3 | import ErizoConnectionManager from './ErizoConnectionManager'; 4 | import { LicodeEvent, RoomEvent, StreamEvent, ConnectionEvent } from './Events'; 5 | import Stream from './Stream'; 6 | import Logger from './utils/Logger'; 7 | 8 | // eslint-disable-next-line 9 | require('expose-loader?adapter!../lib/adapter.js'); 10 | 11 | const Erizo = { 12 | Room: Room.bind(null, undefined, undefined, undefined), 13 | LicodeEvent, 14 | RoomEvent, 15 | StreamEvent, 16 | ConnectionEvent, 17 | Stream: Stream.bind(null, undefined), 18 | Logger, 19 | _: { 20 | ErizoConnectionManager, 21 | Room, 22 | Base64, 23 | }, 24 | }; 25 | 26 | export default Erizo; 27 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/src/ErizoFc.js: -------------------------------------------------------------------------------- 1 | import Room from './Room'; 2 | import { LicodeEvent, RoomEvent, StreamEvent } from './Events'; 3 | import Stream from './Stream'; 4 | import Logger from './utils/Logger'; 5 | // Using script-loader to load global variables 6 | 7 | const Erizo = { 8 | Room, 9 | LicodeEvent, 10 | RoomEvent, 11 | StreamEvent, 12 | Stream, 13 | Logger, 14 | }; 15 | 16 | export default Erizo; 17 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/src/utils/ErizoMap.js: -------------------------------------------------------------------------------- 1 | const ErizoMap = () => { 2 | const that = {}; 3 | let values = {}; 4 | 5 | that.add = (id, value) => { 6 | values[id] = value; 7 | }; 8 | 9 | that.get = id => values[id]; 10 | 11 | that.has = id => values[id] !== undefined; 12 | 13 | that.size = () => Object.keys(values).length; 14 | 15 | that.forEach = (func) => { 16 | const keys = Object.keys(values); 17 | for (let index = 0; index < keys.length; index += 1) { 18 | const key = keys[index]; 19 | const value = values[key]; 20 | func(value, key); 21 | } 22 | }; 23 | 24 | that.keys = () => Object.keys(values); 25 | 26 | that.remove = (id) => { 27 | delete values[id]; 28 | }; 29 | 30 | that.clear = () => { 31 | values = {}; 32 | }; 33 | 34 | return that; 35 | }; 36 | 37 | export default ErizoMap; 38 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/src/utils/Random.js: -------------------------------------------------------------------------------- 1 | /* global window */ 2 | 3 | const Random = (() => { 4 | const getRandomValue = () => { 5 | const array = new Uint16Array(1); 6 | window.crypto.getRandomValues(array); 7 | return array[0]; 8 | }; 9 | 10 | return { 11 | getRandomValue, 12 | }; 13 | })(); 14 | 15 | export default Random; 16 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/src/views/View.js: -------------------------------------------------------------------------------- 1 | /* 2 | * View class represents a HTML component 3 | * Every view is an EventDispatcher. 4 | */ 5 | 6 | import { EventDispatcher } from '../Events'; 7 | 8 | const View = () => { 9 | const that = EventDispatcher({}); 10 | 11 | // Variables 12 | 13 | // URL where it will look for icons and assets 14 | that.url = ''; 15 | return that; 16 | }; 17 | 18 | export default View; 19 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/src/webrtc-stacks/ChromeStableStack.js: -------------------------------------------------------------------------------- 1 | import BaseStack from './BaseStack'; 2 | import SdpHelpers from './../utils/SdpHelpers'; 3 | import Logger from '../utils/Logger'; 4 | 5 | const log = Logger.module('ChromeStableStack'); 6 | 7 | const ChromeStableStack = (specInput) => { 8 | log.debug(`message: Starting Chrome stable stack, spec: ${JSON.stringify(specInput)}`); 9 | const spec = specInput; 10 | const that = BaseStack(specInput); 11 | that.mediaConstraints = { 12 | offerToReceiveVideo: true, 13 | offerToReceiveAudio: true, 14 | }; 15 | 16 | that.prepareCreateOffer = () => Promise.resolve(); 17 | 18 | that.setStartVideoBW = (sdpInfo) => { 19 | if (that.video && spec.startVideoBW) { 20 | log.debug(`message: startVideoBW, requested: ${spec.startVideoBW}`); 21 | SdpHelpers.setParamForCodecs(sdpInfo, 'video', 'x-google-start-bitrate', spec.startVideoBW); 22 | } 23 | }; 24 | 25 | that.setHardMinVideoBW = (sdpInfo) => { 26 | if (that.video && spec.hardMinVideoBW) { 27 | log.debug(`message: hardMinVideoBW, requested: ${spec.hardMinVideoBW}`); 28 | SdpHelpers.setParamForCodecs(sdpInfo, 'video', 'x-google-min-bitrate', spec.hardMinVideoBW); 29 | } 30 | }; 31 | 32 | return that; 33 | }; 34 | 35 | export default ChromeStableStack; 36 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/src/webrtc-stacks/FcStack.js: -------------------------------------------------------------------------------- 1 | import Logger from '../utils/Logger'; 2 | 3 | const log = Logger.module('FcStack'); 4 | const FcStack = (spec) => { 5 | /* 6 | spec.callback({ 7 | type: sessionDescription.type, 8 | sdp: sessionDescription.sdp 9 | }); 10 | */ 11 | const that = {}; 12 | 13 | that.pcConfig = {}; 14 | 15 | that.peerConnection = {}; 16 | that.desc = {}; 17 | that.signalCallback = undefined; 18 | 19 | that.close = () => { 20 | log.debug('message: Close FcStack'); 21 | }; 22 | 23 | that.createOffer = () => { 24 | log.debug('message: CreateOffer'); 25 | }; 26 | 27 | that.addStream = (stream) => { 28 | log.debug(`message: addStream, ${stream.toLog()}`); 29 | }; 30 | 31 | that.processSignalingMessage = (msg) => { 32 | log.debug(`message: processSignaling, message: ${msg}`); 33 | if (that.signalCallback !== undefined) { that.signalCallback(msg); } 34 | }; 35 | 36 | that.sendSignalingMessage = (msg) => { 37 | log.debug(`message: Sending signaling Message, message: ${msg}`); 38 | spec.callback(msg); 39 | }; 40 | 41 | that.setSignalingCallback = (callback = () => {}) => { 42 | log.debug('message: Setting signalling callback'); 43 | that.signalCallback = callback; 44 | }; 45 | return that; 46 | }; 47 | 48 | export default FcStack; 49 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/src/webrtc-stacks/FirefoxStack.js: -------------------------------------------------------------------------------- 1 | import Logger from '../utils/Logger'; 2 | import BaseStack from './BaseStack'; 3 | 4 | const log = Logger.module('FirefoxStack'); 5 | 6 | 7 | const FirefoxStack = (specInput) => { 8 | log.debug('message: Starting Firefox stack'); 9 | const that = BaseStack(specInput); 10 | 11 | that.addStream = (streamInput) => { 12 | const nativeStream = streamInput.stream; 13 | nativeStream.transceivers = []; 14 | nativeStream.getTracks().forEach(async (track) => { 15 | let options = {}; 16 | if (track.kind === 'video' && streamInput.simulcast) { 17 | options = { 18 | sendEncodings: [], 19 | }; 20 | } 21 | options.streams = [nativeStream]; 22 | const transceiver = that.peerConnection.addTransceiver(track, options); 23 | nativeStream.transceivers.push(transceiver); 24 | const parameters = transceiver.sender.getParameters() || {}; 25 | parameters.encodings = streamInput.generateEncoderParameters(); 26 | return transceiver.sender.setParameters(parameters); 27 | }); 28 | }; 29 | 30 | that.prepareCreateOffer = () => Promise.resolve(); 31 | 32 | return that; 33 | }; 34 | 35 | export default FirefoxStack; 36 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/src/webrtc-stacks/SafariStack.js: -------------------------------------------------------------------------------- 1 | import Logger from '../utils/Logger'; 2 | import ChromeStableStack from './ChromeStableStack'; 3 | 4 | const log = Logger.module('SafariStack'); 5 | const SafariStack = (specInput) => { 6 | log.debug('message: Starting Safari stack'); 7 | const that = ChromeStableStack(specInput); 8 | 9 | that._updateTracksToBeNegotiatedFromStream = () => { 10 | that.tracksToBeNegotiated += 1; 11 | }; 12 | 13 | return that; 14 | }; 15 | 16 | export default SafariStack; 17 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/webpack.config.erizo.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | entry: './src/Erizo.js', 5 | mode: 'production', 6 | output: { 7 | filename: 'erizo.js', 8 | path: path.resolve(__dirname, 'dist'), 9 | libraryExport: 'default', 10 | library: 'Erizo', 11 | libraryTarget: 'var', 12 | }, 13 | devtool: 'source-map', // Default development sourcemap 14 | }; 15 | -------------------------------------------------------------------------------- /erizo_controller/erizoClient/webpack.config.erizofc.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | mode: 'production', 5 | entry: './src/ErizoFc.js', 6 | output: { 7 | filename: 'erizofc.js', 8 | path: path.resolve(__dirname, 'dist'), 9 | libraryExport: 'default', 10 | library: 'Erizo', 11 | libraryTarget: 'umd', 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /erizo_controller/erizoController/ch_policies/default_policy.js: -------------------------------------------------------------------------------- 1 | /* 2 | Params 3 | 4 | agents: object with the available agents 5 | agent_id : { 6 | info: { 7 | id: String, 8 | rpc_id: String 9 | }, 10 | metadata: Object, 11 | stats: { 12 | perc_cpu: Int 13 | }, 14 | timeout: Int // number of periods during the agent has not respond 15 | } 16 | 17 | Returns 18 | 19 | rpc_id: agent.info.rpc_id field of the selected agent. 20 | *default value: "ErizoAgent" - select the agent in round-robin mode 21 | 22 | */ 23 | exports.getErizoAgent = (agents, agentId) => { 24 | if (agentId) { 25 | return `ErizoAgent_${agentId}`; 26 | } 27 | return 'ErizoAgent'; 28 | }; 29 | -------------------------------------------------------------------------------- /erizo_controller/erizoController/nuveProxy.js: -------------------------------------------------------------------------------- 1 | /* global require, exports */ 2 | 3 | 4 | const logger = require('./../common/logger').logger; 5 | 6 | // Logger 7 | const log = logger.getLogger('NuveProxy'); 8 | 9 | exports.NuveProxy = (spec) => { 10 | const that = {}; 11 | 12 | const callNuve = (method, additionalErrors, args) => new Promise((resolve, reject) => { 13 | try { 14 | spec.amqper.callRpc('nuve', method, args, { callback(response) { 15 | const errors = ['timeout', 'error'].concat(additionalErrors); 16 | if (errors.indexOf(response) !== -1) { 17 | reject(response); 18 | return; 19 | } 20 | resolve(response); 21 | } }); 22 | } catch (err) { 23 | log.error('message: Error calling RPC', err); 24 | } 25 | }); 26 | 27 | that.killMe = publicIP => callNuve('killMe', [], publicIP); 28 | that.keepAlive = myId => callNuve('keepAlive', ['whoareyou'], myId); 29 | that.addNewErizoController = controller => callNuve('addNewErizoController', [], controller); 30 | that.setInfo = info => callNuve('setInfo', [], info); 31 | that.deleteToken = token => callNuve('deleteToken', [], token); 32 | 33 | return that; 34 | }; 35 | -------------------------------------------------------------------------------- /erizo_controller/erizoController/permission.js: -------------------------------------------------------------------------------- 1 | const permission = {}; 2 | permission.PUBLISH = 'publish'; 3 | permission.SUBSCRIBE = 'subscribe'; 4 | permission.RECORD = 'record'; 5 | 6 | /* Not used, but still there just in case */ 7 | permission.DATA = 'data'; 8 | permission.AUDIO = 'audio'; 9 | permission.VIDEO = 'video'; 10 | permission.SCREEN = 'screen'; 11 | permission.STATS = 'stats'; 12 | 13 | module.exports = permission; 14 | -------------------------------------------------------------------------------- /erizo_controller/erizoController/rpc/rpcPublic.js: -------------------------------------------------------------------------------- 1 | 2 | const erizoController = require('./../erizoController'); 3 | const RovReplManager = require('./../../common/ROV/rovReplManager').RovReplManager; 4 | 5 | let replManager = false; 6 | /* 7 | * This function is called remotely from nuve to get a list of the users in a determined room. 8 | */ 9 | exports.getUsersInRoom = (id, callback) => { 10 | erizoController.getUsersInRoom(id, (users) => { 11 | if (users === undefined) { 12 | callback('callback', 'error'); 13 | } else { 14 | callback('callback', users); 15 | } 16 | }); 17 | }; 18 | 19 | exports.deleteRoom = (roomId, callback) => { 20 | erizoController.deleteRoom(roomId, (result) => { 21 | callback('callback', result); 22 | }); 23 | }; 24 | 25 | exports.deleteUser = (args, callback) => { 26 | const user = args.user; 27 | const roomId = args.roomId; 28 | erizoController.deleteUser(user, roomId, (result) => { 29 | callback('callback', result); 30 | }); 31 | }; 32 | 33 | exports.connectionStatusEvent = (clientId, connectionId, info, evt) => { 34 | erizoController.connectionStatusEvent(clientId, connectionId, info, evt); 35 | }; 36 | 37 | exports.rovMessage = (args, callback) => { 38 | if (!replManager) { 39 | replManager = new RovReplManager(erizoController.getContext()); 40 | } 41 | replManager.processRpcMessage(args, callback); 42 | }; 43 | -------------------------------------------------------------------------------- /erizo_controller/erizoJS/adapt_schemes/schemeHelpers.js: -------------------------------------------------------------------------------- 1 | 2 | const schemeHelpers = {}; 3 | 4 | schemeHelpers.getBandwidthStat = mediaStream => new Promise((resolve, reject) => { 5 | mediaStream.getStats((statsString) => { 6 | if (!statsString) { 7 | reject('no stats'); 8 | } 9 | const newStats = JSON.parse(statsString); 10 | if (Object.prototype.hasOwnProperty.call(newStats, 'total')) { 11 | resolve(newStats.total.senderBitrateEstimation); 12 | } 13 | resolve(false); 14 | }); 15 | }); 16 | 17 | exports.schemeHelpers = schemeHelpers; 18 | -------------------------------------------------------------------------------- /erizo_controller/erizoJS/models/PublisherManager.js: -------------------------------------------------------------------------------- 1 | class PublisherManager { 2 | constructor() { 3 | // streamId: Publisher 4 | this.publisherNodes = new Map(); 5 | } 6 | 7 | add(streamId, publisherNode) { 8 | this.publisherNodes.set(streamId, publisherNode); 9 | } 10 | 11 | remove(id) { 12 | return this.publisherNodes.delete(id); 13 | } 14 | 15 | forEach(doSomething) { 16 | this.publisherNodes.forEach((publisherNode) => { 17 | doSomething(publisherNode); 18 | }); 19 | } 20 | 21 | getPublisherById(id) { 22 | return this.publisherNodes.get(id); 23 | } 24 | 25 | getPublishersByClientId(clientId) { 26 | const nodes = this.publisherNodes.values(); 27 | const publisherNodes = Array.from(nodes).filter(node => node.clientId === clientId); 28 | return publisherNodes; 29 | } 30 | 31 | has(id) { 32 | return this.publisherNodes.has(id); 33 | } 34 | 35 | getPublisherCount() { 36 | return this.publisherNodes.size; 37 | } 38 | } 39 | 40 | exports.PublisherManager = PublisherManager; 41 | 42 | -------------------------------------------------------------------------------- /erizo_controller/initErizo_agent.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | SCRIPT=`pwd`/$0 5 | FILENAME=`basename $SCRIPT` 6 | ROOT=`dirname $SCRIPT` 7 | LICODE_ROOT="$ROOT"/.. 8 | CURRENT_DIR=`pwd` 9 | NVM_CHECK="$LICODE_ROOT"/scripts/checkNvm.sh 10 | 11 | export LD_LIBRARY_PATH="$LICODE_ROOT/build/libdeps/build/lib" 12 | 13 | . $NVM_CHECK 14 | 15 | cd $ROOT/erizoAgent 16 | nvm use 17 | node erizoAgent.js $* & 18 | 19 | cd $CURRENT_DIR 20 | -------------------------------------------------------------------------------- /erizo_controller/initErizo_controller.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | SCRIPT=`pwd`/$0 6 | FILENAME=`basename $SCRIPT` 7 | ROOT=`dirname $SCRIPT` 8 | LICODE_ROOT="$ROOT"/.. 9 | CURRENT_DIR=`pwd` 10 | NVM_CHECK="$LICODE_ROOT"/scripts/checkNvm.sh 11 | 12 | . $NVM_CHECK 13 | 14 | cd $ROOT/erizoController 15 | nvm use 16 | node erizoController.js & 17 | 18 | cd $CURRENT_DIR 19 | -------------------------------------------------------------------------------- /erizo_controller/installErizoTest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo [erizo_controller] Installing erizoTest 4 | 5 | cd erizoClient/tools 6 | 7 | ./compileDebug.sh 8 | 9 | cp ../dist/erizo.js ../../test/public 10 | 11 | echo [erizo_controller] Done -------------------------------------------------------------------------------- /erizo_controller/installErizo_controller.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | SCRIPT=`pwd`/$0 5 | FILENAME=`basename $SCRIPT` 6 | ROOT=`dirname $SCRIPT` 7 | LICODE_ROOT="$ROOT"/.. 8 | CURRENT_DIR=`pwd` 9 | NVM_CHECK="$LICODE_ROOT"/scripts/checkNvm.sh 10 | 11 | . $NVM_CHECK 12 | 13 | check_result() { 14 | if [ "$1" -ne 0 ] 15 | then 16 | echo "ERROR: Failed building ErizoClient" 17 | exit $1 18 | fi 19 | } 20 | 21 | echo [erizo_controller] Installing node_modules for erizo_controller 22 | 23 | nvm use 24 | npm install --loglevel error 25 | 26 | echo [erizo_controller] Done, node_modules installed 27 | 28 | cd ./erizoClient/ 29 | 30 | $LICODE_ROOT/node_modules/.bin/gulp erizo 31 | 32 | check_result $? 33 | 34 | echo [erizo_controller] Done, erizo.js compiled 35 | -------------------------------------------------------------------------------- /erizo_controller/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "licode-erizo-controller", 3 | "version": "0.1.0", 4 | "description": "Open Source Communication Provider - Erizo Controller", 5 | "license": "MIT", 6 | "private": true, 7 | "devDependencies": {}, 8 | "dependencies": { 9 | "amqp": "~0.2.7", 10 | "aws-sdk": "~2.1626.0", 11 | "express": "~4.21.2", 12 | "fancy-log": "^1.3.3", 13 | "fast-stats": "0.0.6", 14 | "log4js": "^6.4.0", 15 | "node-getopt": "~0.3.2", 16 | "prom-client": "~11.2.1", 17 | "sdp-transform": "~2.14.0", 18 | "socket.io": "~4.8.1", 19 | "socket.io-client": "~4.7.5", 20 | "uuid": "~3.1.0" 21 | }, 22 | "contributors": [ 23 | { 24 | "name": "Alvaro Alonso", 25 | "email": "aalonsog@dit.upm.es" 26 | }, 27 | { 28 | "name": "Pedro Rodriguez", 29 | "email": "prodriguez@dit.upm.es" 30 | }, 31 | { 32 | "name": "Javier Cerviño", 33 | "email": "jcervino@dit.upm.es" 34 | } 35 | ], 36 | "scripts": {} 37 | } 38 | -------------------------------------------------------------------------------- /extras/basic_example/log4js_configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "appenders": { 3 | "out": { 4 | "type": "stdout", 5 | "layout": { 6 | "type": "pattern", 7 | "pattern": "%d - %p: %c - %m" 8 | } 9 | } 10 | }, 11 | "categories": { 12 | "default": { "appenders": ["out"], "level": "ERROR" }, 13 | "BasicExample": { "appenders": ["out"], "level": "ERROR" } 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /extras/basic_example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "licode-basic-example", 3 | "version": "0.1.0", 4 | "description": "Open Source Communication Provider - Basic Example", 5 | "license": "MIT", 6 | "private": true, 7 | "devDependencies": {}, 8 | "dependencies": { 9 | "body-parser": "~1.20.3", 10 | "errorhandler": "~1.5.1", 11 | "express": "~4.21.2", 12 | "log4js": "^6.4.0", 13 | "morgan": "~1.9.1" 14 | }, 15 | "contributors": [ 16 | { 17 | "name": "Alvaro Alonso", 18 | "email": "aalonsog@dit.upm.es" 19 | }, 20 | { 21 | "name": "Pedro Rodriguez", 22 | "email": "prodriguez@dit.upm.es" 23 | }, 24 | { 25 | "name": "Javier Cerviño", 26 | "email": "jcervino@dit.upm.es" 27 | } 28 | ], 29 | "scripts": {} 30 | } 31 | -------------------------------------------------------------------------------- /extras/basic_example/public/connection_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Licode Basic Example 4 | 5 | 6 | 7 | 8 | 9 |
    10 |

    This page tests your connectivity to Licode server

    11 | 12 |
    13 |
    14 |

    Local video (got from your local camera)

    15 |
    16 |

    Subscribed video (how other participant will see you once your local video is published)

    17 |
    18 |
    19 | 20 | 21 | -------------------------------------------------------------------------------- /extras/vagrant/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | sudo apt-get update 3 | sudo apt-get install -y git 4 | cd /vagrant 5 | git clone https://github.com/ging/licode.git 6 | cd licode 7 | git checkout async_events 8 | cd .. 9 | ./licode/scripts/installUbuntuDeps.sh --cleanup 10 | ./licode/scripts/installErizo.sh 11 | ./licode/scripts/installNuve.sh 12 | ./licode/scripts/installBasicExample.sh 13 | echo "config.erizoController.publicIP = '$1';" >> ./licode/licode_config.js 14 | echo "config.erizo.minport = 30000;" >> ./licode/licode_config.js 15 | echo "config.erizo.maxport = 31000;" >> ./licode/licode_config.js 16 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: Documentation 2 | site_url: http://licode.readthedocs.org 3 | repo_url: https://github.com/lynckia/licode 4 | site_description: Open Source WebRTC Communications Platform 5 | docs_dir: doc 6 | theme: 7 | name: mkdocs 8 | custom_dir: doc/custom_theme 9 | extra_css: ['css/style.css', 'css/architecture.css'] 10 | extra_javascript: ['js/script.js'] 11 | pages: 12 | - API Documentation: 13 | - Architecture: index.md 14 | - Client API: client_api.md 15 | - Server API: server_api.md 16 | - Installation: 17 | - Docker: docker.md 18 | - From Source: from_source.md 19 | -------------------------------------------------------------------------------- /nuve/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | nuveClient/build 3 | nuveClient/dist 4 | nuveClient/dist 5 | cloudHandler/node_modules/ 6 | nuveAPI/node_modules/ -------------------------------------------------------------------------------- /nuve/initNuve.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | SCRIPT=`pwd`/$0 6 | FILENAME=`basename $SCRIPT` 7 | PATHNAME=`dirname $SCRIPT` 8 | ROOT=$PATHNAME/.. 9 | NVM_CHECK="$ROOT"/scripts/checkNvm.sh 10 | CURRENT_DIR=`pwd` 11 | 12 | . $NVM_CHECK 13 | 14 | cd $PATHNAME/nuveAPI 15 | 16 | node nuve.js & 17 | 18 | cd $CURRENT_DIR 19 | -------------------------------------------------------------------------------- /nuve/installNuve.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | SCRIPT=`pwd`/$0 6 | FILENAME=`basename $SCRIPT` 7 | PATHNAME=`dirname $SCRIPT` 8 | ROOT=$PATHNAME/.. 9 | NVM_CHECK="$ROOT"/scripts/checkNvm.sh 10 | BUILD_DIR=$ROOT/build 11 | CURRENT_DIR=`pwd` 12 | DB_DIR="$BUILD_DIR"/db 13 | 14 | . $NVM_CHECK 15 | 16 | cd $PATHNAME 17 | 18 | cd nuveAPI 19 | 20 | echo [nuve] Installing node_modules for nuve 21 | 22 | nvm use 23 | npm install --loglevel error 24 | echo [nuve] Done, node_modules installed 25 | 26 | cd ../nuveClient/tools 27 | 28 | ./compile.sh 29 | 30 | echo [nuve] Done, nuve.js compiled 31 | 32 | cd $CURRENT_DIR 33 | -------------------------------------------------------------------------------- /nuve/log4js_configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "appenders": { 3 | "out": { 4 | "type": "stdout", 5 | "layout": { 6 | "type": "pattern", 7 | "pattern": "%d - %p: %c - %m" 8 | } 9 | } 10 | }, 11 | "categories": { 12 | "default": { "appenders": ["out"], "level": "ERROR" }, 13 | "AMQPER": { "appenders": ["out"], "level": "ERROR" }, 14 | "MAuthParser": { "appenders": ["out"], "level": "ERROR" }, 15 | "NuveAuthenticator": { "appenders": ["out"], "level": "ERROR" }, 16 | "CloudHandler": { "appenders": ["out"], "level": "INFO" }, 17 | "DataBase": { "appenders": ["out"], "level": "ERROR" }, 18 | "RoomRegistry": { "appenders": ["out"], "level": "ERROR" }, 19 | "ServiceRegistry": { "appenders": ["out"], "level": "ERROR" }, 20 | "TokenRegistry": { "appenders": ["out"], "level": "ERROR" }, 21 | "RoomResource": { "appenders": ["out"], "level": "ERROR" }, 22 | "RoomsResource": { "appenders": ["out"], "level": "ERROR" }, 23 | "ServiceResource": { "appenders": ["out"], "level": "ERROR" }, 24 | "ServicesResource": { "appenders": ["out"], "level": "ERROR" }, 25 | "TokenResource": { "appenders": ["out"], "level": "ERROR" }, 26 | "TokensResource": { "appenders": ["out"], "level": "ERROR" }, 27 | "Nuve": { "appenders": ["out"], "level": "INFO" }, 28 | "RPC": { "appenders": ["out"], "level": "ERROR" }, 29 | "RPCPublic": { "appenders": ["out"], "level": "INFO" } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /nuve/nuveAPI/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lynckia/licode/97938a0f98f8fbda0136a6bac0fd8e63dd790282/nuve/nuveAPI/.DS_Store -------------------------------------------------------------------------------- /nuve/nuveAPI/ch_policies/default_policy.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Params 4 | 5 | room: room to which we need to assing a erizoController. 6 | { 7 | name: String, 8 | [p2p: bool], 9 | [data: Object], 10 | _id: ObjectId 11 | } 12 | 13 | ec_queue: available erizo controllers ordered by priority 14 | { erizoControllerId: { 15 | ip: String, 16 | state: Int, 17 | keepAlive: Int, 18 | hostname: String, 19 | port: Int, 20 | ssl: bool 21 | }, ...} 22 | 23 | Returns 24 | 25 | erizoControler: the erizo controller selected from ecQueue 26 | 27 | */ 28 | exports.getErizoController = (room, ecQueue) => { 29 | const erizoController = ecQueue[0]; 30 | return erizoController; 31 | }; 32 | -------------------------------------------------------------------------------- /nuve/nuveAPI/logger.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line import/no-extraneous-dependencies 2 | const log4js = require('log4js'); 3 | // eslint-disable-next-line import/no-unresolved 4 | const config = require('./../../licode_config'); 5 | 6 | let logFile = config.logger.configFile || '../log4js_configuration.json'; 7 | 8 | const logJsonReplacer = (key, value) => { 9 | if (key) { 10 | if (typeof (value) === 'object') { 11 | return '[Object]'; 12 | } 13 | return value; 14 | } 15 | return value; 16 | }; 17 | 18 | if (logFile === true) { 19 | logFile = { 20 | appenders: { 21 | out: { 22 | type: 'stdout', 23 | layout: { 24 | type: 'pattern', 25 | pattern: '%d - %p: %c - %m', 26 | }, 27 | }, 28 | }, 29 | categories: { 30 | default: { 31 | appenders: ['out'], 32 | level: 'OFF', 33 | }, 34 | }, 35 | }; 36 | } 37 | 38 | log4js.configure(logFile); 39 | 40 | exports.logger = log4js; 41 | 42 | exports.logger.objectToLog = (jsonInput) => { 43 | if (jsonInput === undefined) { 44 | return ''; 45 | } 46 | if (typeof (jsonInput) !== 'object') { 47 | return jsonInput; 48 | } else if (jsonInput.constructor === Array) { 49 | return '[Object]'; 50 | } 51 | const jsonString = JSON.stringify(jsonInput, logJsonReplacer); 52 | return jsonString.replace(/['"]+/g, '') 53 | .replace(/[:]+/g, ': ') 54 | .replace(/[,]+/g, ', ') 55 | .slice(1, -1); 56 | }; 57 | -------------------------------------------------------------------------------- /nuve/nuveAPI/test/ch_policies/default_policy.js: -------------------------------------------------------------------------------- 1 | /* global require, describe, it */ 2 | 3 | 4 | const policy = require('../../ch_policies/default_policy'); 5 | // eslint-disable-next-line import/no-extraneous-dependencies 6 | const expect = require('chai').expect; 7 | 8 | const kArbitraryErizoController1 = 'erizoController1'; 9 | const kArbitraryErizoController2 = 'erizoController1'; 10 | 11 | describe('Default Policy', () => { 12 | it('should return the first Erizo Controller in the queue', () => { 13 | const result = policy.getErizoController( 14 | {}, // room 15 | [kArbitraryErizoController2, kArbitraryErizoController1]); 16 | expect(result).to.deep.equal(kArbitraryErizoController2); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /nuve/nuveAPI/test/mdb/dataBase.js: -------------------------------------------------------------------------------- 1 | /* global require, describe, it, before */ 2 | 3 | // eslint-disable-next-line import/no-extraneous-dependencies 4 | const expect = require('chai').expect; 5 | 6 | describe('DataBase', () => { 7 | let db; 8 | 9 | before(() => { 10 | // eslint-disable-next-line global-require 11 | db = require('../../mdb/dataBase'); 12 | }); 13 | 14 | it('should contain a client', () => { 15 | expect(db).to.have.property('client'); 16 | }); 17 | 18 | it('should contain a superService', () => { 19 | expect(db).to.have.property('superService'); 20 | }); 21 | 22 | it('should contain a nuveKey', () => { 23 | expect(db).to.have.property('nuveKey'); 24 | }); 25 | 26 | it('should contain a testErizoController', () => { 27 | expect(db).to.have.property('testErizoController'); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /nuve/nuveClient/src/N.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line 2 | var N = N || {}; 3 | 4 | N.authors = ['aalonsog@dit.upm.es', 'prodriguez@dit.upm.es', 'jcervino@dit.upm.es']; 5 | 6 | N.version = 0.1; 7 | -------------------------------------------------------------------------------- /nuve/nuveClient/tools/compile.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | mkdir ../dist || true 6 | mkdir ../build || true 7 | 8 | ../../node_modules/google-closure-compiler-js/cmd.js ../src/N.js ../src/N.API.js > ../build/nuve.js 9 | 10 | ./compileDist.sh 11 | -------------------------------------------------------------------------------- /nuve/nuveClient/tools/compileDist.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | mkdir ../dist || true 6 | mkdir ../build || true 7 | 8 | ../../node_modules/google-closure-compiler-js/cmd.js ../lib/xmlhttprequest.js > ../dist/xmlhttprequest.js 9 | 10 | TARGET=../dist/nuve.js 11 | 12 | current_dir=`pwd` 13 | 14 | # License 15 | echo '/*' > $TARGET 16 | echo '*/' >> $TARGET 17 | 18 | # Body 19 | cat ../dist/xmlhttprequest.js >> $TARGET 20 | cat ../build/nuve.js >> $TARGET 21 | echo 'module.exports = N;' >> $TARGET 22 | 23 | #cd ../npm/ 24 | 25 | #tar -czvf package.tgz package/ 26 | 27 | #cd $current_dir 28 | -------------------------------------------------------------------------------- /nuve/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "licode-nuve", 3 | "version": "0.1.0", 4 | "description": "Open Source Communication Provider - Nuve", 5 | "license": "MIT", 6 | "private": true, 7 | "devDependencies": { 8 | "google-closure-compiler-js": "~20180204.0.0" 9 | }, 10 | "dependencies": { 11 | "amqp": "~0.2.7", 12 | "aws-sdk": "~2.1626.0", 13 | "body-parser": "~1.20.3", 14 | "express": "~4.21.2", 15 | "log4js": "^6.4.0", 16 | "mongodb": "^3.6.10", 17 | "node-getopt": "~0.3.2" 18 | }, 19 | "contributors": [ 20 | { 21 | "name": "Alvaro Alonso", 22 | "email": "aalonsog@dit.upm.es" 23 | }, 24 | { 25 | "name": "Pedro Rodriguez", 26 | "email": "prodriguez@dit.upm.es" 27 | }, 28 | { 29 | "name": "Javier Cerviño", 30 | "email": "jcervino@dit.upm.es" 31 | } 32 | ], 33 | "scripts": {} 34 | } 35 | -------------------------------------------------------------------------------- /scripts/checkNvm.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | oldstate="$(set +o); set -$-" # POSIXly store all set options. 4 | 5 | set +e 6 | 7 | check_readlink() { 8 | if [ "$(uname)" == "Darwin" ]; then 9 | # Do something under Mac OS X platform 10 | READLINK="greadlink" 11 | elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then 12 | # Do something under GNU/Linux platform 13 | READLINK="readlink" 14 | else 15 | echo "Unsupported OS" 16 | exit 1 17 | fi 18 | 19 | } 20 | command -v nvm | grep 'nvm' &> /dev/null 21 | if [ ! $? == 0 ]; then 22 | check_readlink 23 | CHECK_SCRIPT=$($READLINK -f "$0") 24 | CHECK_SCRIPT_PATH=$(dirname "$CHECK_SCRIPT") 25 | LINKED_DIR=$CHECK_SCRIPT_PATH/../build/libdeps/nvm 26 | export NVM_DIR=$($READLINK -f "$LINKED_DIR") 27 | echo "Checking dir $NVM_DIR" 28 | if [ -s "$NVM_DIR/nvm.sh" ]; then 29 | echo "Running nvm" 30 | . "$NVM_DIR/nvm.sh" # This loads nvm 31 | else 32 | echo "ERROR: Missing NVM" 33 | exit 1 34 | fi 35 | fi 36 | 37 | eval "$oldstate" # restore all options stored. -------------------------------------------------------------------------------- /scripts/initBasicExample.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SCRIPT=`pwd`/$0 4 | FILENAME=`basename $SCRIPT` 5 | PATHNAME=`dirname $SCRIPT` 6 | ROOT=$PATHNAME/.. 7 | BUILD_DIR=$ROOT/build 8 | CURRENT_DIR=`pwd` 9 | NVM_CHECK="$PATHNAME"/checkNvm.sh 10 | EXTRAS=$ROOT/extras 11 | 12 | cp $ROOT/nuve/nuveClient/dist/nuve.js $EXTRAS/basic_example/ 13 | 14 | . $NVM_CHECK 15 | 16 | nvm use 17 | cd $EXTRAS/basic_example 18 | node basicServer.js & 19 | -------------------------------------------------------------------------------- /scripts/initLicode.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SCRIPT=`pwd`/$0 4 | FILENAME=`basename $SCRIPT` 5 | PATHNAME=`dirname $SCRIPT` 6 | ROOT=$PATHNAME/.. 7 | BUILD_DIR=$ROOT/build 8 | CURRENT_DIR=`pwd` 9 | EXTRAS=$ROOT/extras 10 | 11 | export PATH=$PATH:/usr/local/sbin 12 | 13 | if ! pgrep -f rabbitmq; then 14 | sudo echo 15 | sudo rabbitmq-server > $BUILD_DIR/rabbit.log & 16 | sleep 5 17 | fi 18 | 19 | cd $ROOT/nuve 20 | ./initNuve.sh 21 | 22 | sleep 5 23 | 24 | export ERIZO_HOME=$ROOT/erizo/ 25 | 26 | cd $ROOT/erizo_controller 27 | ./initErizo_controller.sh 28 | ./initErizo_agent.sh 29 | 30 | echo [licode] Done, run ./scripts/initBasicExample.sh 31 | -------------------------------------------------------------------------------- /scripts/installBasicExample.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | SCRIPT=`pwd`/$0 6 | FILENAME=`basename $SCRIPT` 7 | PATHNAME=`dirname $SCRIPT` 8 | ROOT=$PATHNAME/.. 9 | BUILD_DIR=$ROOT/build 10 | CURRENT_DIR=`pwd` 11 | NVM_CHECK="$PATHNAME"/checkNvm.sh 12 | 13 | DB_DIR="$BUILD_DIR"/db 14 | EXTRAS=$ROOT/extras 15 | 16 | . $NVM_CHECK 17 | 18 | cd $EXTRAS/basic_example 19 | 20 | cp -r ${ROOT}/erizo_controller/erizoClient/dist/assets public/ 21 | 22 | 23 | nvm use 24 | npm install --loglevel error 25 | cd $CURRENT_DIR 26 | -------------------------------------------------------------------------------- /scripts/libnice-014.patch0: -------------------------------------------------------------------------------- 1 | --- conncheck.c 2014-01-20 08:51:48.535625502 +0100 2 | +++ agent/conncheck.c 2013-01-09 22:35:25.000000000 +0100 3 | @@ -2824,7 +2824,6 @@ 4 | 5 | if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE || 6 | agent->compatibility == NICE_COMPATIBILITY_MSN || 7 | - agent->compatibility == NICE_COMPATIBILITY_RFC5245 || 8 | agent->compatibility == NICE_COMPATIBILITY_OC2007) { 9 | /* We need to find which local candidate was used */ 10 | for (i = component->remote_candidates; 11 | -------------------------------------------------------------------------------- /spine/NativeConnectionHelpers.js: -------------------------------------------------------------------------------- 1 | /* global */ 2 | const logger = require('./logger').logger; 3 | 4 | const log = logger.getLogger('NativeConnectionHelpers'); 5 | 6 | exports.getBrowser = () => 'fake'; 7 | 8 | exports.GetUserMedia = (opt, callback) => { 9 | log.info('Fake getUserMedia to use with files', opt); 10 | // if (that.peerConnection && opt.video.file){ 11 | // that.peerConnection.prepareVideo(opt.video.file); 12 | // } 13 | callback(''); 14 | }; 15 | -------------------------------------------------------------------------------- /spine/NativeStream.js: -------------------------------------------------------------------------------- 1 | const Erizo = require('./erizofc'); 2 | 3 | exports.Stream = (altConnectionHelpers, specInput) => { 4 | const spec = specInput; 5 | spec.videoInfo = spec.video; 6 | spec.audioInfo = spec.audio; 7 | spec.dataInfo = spec.data; 8 | const that = Erizo.Stream(altConnectionHelpers, spec); 9 | 10 | that.hasVideo = () => spec.videoInfo; 11 | that.hasAudio = () => spec.audioInfo; 12 | that.hasData = () => spec.dataInfo; 13 | 14 | return that; 15 | }; 16 | -------------------------------------------------------------------------------- /spine/installSpine.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | SCRIPT=`pwd`/$0 6 | FILENAME=`basename $SCRIPT` 7 | ROOT=`dirname $SCRIPT` 8 | LICODE_ROOT="$ROOT"/.. 9 | CURRENT_DIR=`pwd` 10 | NVM_CHECK="$LICODE_ROOT"/scripts/checkNvm.sh 11 | 12 | . $NVM_CHECK 13 | 14 | nvm use 15 | 16 | echo [spine] Installing node_modules for Spine 17 | 18 | npm install --loglevel error 19 | 20 | echo [spine] Done, node_modules installed 21 | 22 | cd ../erizo_controller/erizoClient/ 23 | 24 | $LICODE_ROOT/node_modules/.bin/gulp erizofc 25 | 26 | echo [spine] Done, erizofc.js compiled 27 | -------------------------------------------------------------------------------- /spine/log4js_configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "appenders": { 3 | "out": { 4 | "type": "stdout", 5 | "layout": { 6 | "type": "pattern", 7 | "pattern": "%d - %p: %c - %m", 8 | } 9 | } 10 | }, 11 | "categories": { 12 | "NativeStack": { "appenders": ["out"], "level": "ERROR" }, 13 | "NativeClient": { "appenders": ["out"], "level": "ERROR" }, 14 | "ErizoSimpleNativeConnection": { "appenders": ["out"], "level": "INFO" } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spine/logger.js: -------------------------------------------------------------------------------- 1 | const log4js = require('log4js'); // eslint-disable-line import/no-extraneous-dependencies 2 | 3 | const logFile = './log4js_configuration.json'; 4 | 5 | log4js.configure(logFile); 6 | 7 | exports.logger = log4js; 8 | -------------------------------------------------------------------------------- /spine/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "licode-spine", 3 | "version": "0.1.0", 4 | "description": "Open Source Communication Provider - Spine", 5 | "license": "MIT", 6 | "private": true, 7 | "devDependencies": {}, 8 | "dependencies": { 9 | "log4js": "~6.4.0", 10 | "node-getopt": "~0.3.2", 11 | "socket.io-client": "~2.5.0", 12 | "xmlhttprequest": "~1.7.0" 13 | }, 14 | "contributors": [ 15 | { 16 | "name": "Alvaro Alonso", 17 | "email": "aalonsog@dit.upm.es" 18 | }, 19 | { 20 | "name": "Pedro Rodriguez", 21 | "email": "prodriguez@dit.upm.es" 22 | }, 23 | { 24 | "name": "Javier Cerviño", 25 | "email": "jcervino@dit.upm.es" 26 | } 27 | ], 28 | "scripts": {} 29 | } 30 | -------------------------------------------------------------------------------- /spine/spineClientsConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "basicExampleUrl": "https://localhost/", 3 | "publishConfig" : { 4 | "_video":{"file":"file:///YOUR_LICODE_COMPATIBLE_TEST_FILE"}, 5 | "video":{"synthetic":{"audioBitrate": 30000, 6 | "minVideoBitrate": 10000, 7 | "maxVideoBitrate": 300000}}, 8 | "audio":true, 9 | "data":true 10 | }, 11 | "subscribeConfig" : { 12 | "video":{ 13 | "recording":"file///YOUR_DESTINATION_FOR_RECORDING" 14 | }, 15 | "video": true, 16 | "audio": true, 17 | "data": true 18 | }, 19 | "numPublishers": 0, 20 | "numSubscribers" : 1, 21 | "publishersAreSubscribers" : false, 22 | "connectionCreationInterval" : 500, 23 | "stats" : [ 24 | "packetsLost", 25 | "bitrateCalculated" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /test/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "mocha/test" 3 | } 4 | -------------------------------------------------------------------------------- /test/log4js_configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "appenders": { 3 | "out": { 4 | "type": "stdout", 5 | "layout": { 6 | "type": "pattern", 7 | "pattern": "%d - %p: %c - %m", 8 | "replaceConsole": true 9 | } 10 | } 11 | }, 12 | "categories": { 13 | "default": { "appenders": ["out"], "level": "ERROR" }, 14 | "NativeStack": { "appenders": ["out"], "level": "ERROR" }, 15 | "NativeClient": { "appenders": ["out"], "level": "ERROR" }, 16 | "ErizoSimpleNativeConnection": { "appenders": ["out"], "level": "INFO" } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "erizo-tests", 3 | "version": "0.0.1", 4 | "private": true, 5 | "dependencies": { 6 | "aws-sdk": "^2.1406.0", 7 | "axios": "^1.8.2", 8 | "chai": "^3.5.0", 9 | "cli-progress": "^3.8.2", 10 | "node-getopt": "0.2.3", 11 | "node-ssh": "^4.2.3", 12 | "puppeteer-core": "^5.2.1" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/runSpineTest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | SCRIPT=`pwd`/$0 3 | 4 | FILENAME=`basename $SCRIPT` 5 | PATHNAME=`dirname $SCRIPT` 6 | NVM_CHECK="$PATHNAME"/checkNvm.sh 7 | ROOT=$PATHNAME/.. 8 | NVM_CHECK="$ROOT"/scripts/checkNvm.sh 9 | 10 | . $NVM_CHECK 11 | 12 | cd $ROOT/spine 13 | node runSpineClients -s ../results/config_${TESTPREFIX}_${TESTID}.json -t $DURATION -i 10 -o $ROOT/results/output_${TESTPREFIX}_${TESTID}.json > /dev/null 2>&1 14 | exit 0 15 | --------------------------------------------------------------------------------