Skip to content

Commit

Permalink
#23 Wired RTP input and output to the RTP mixer component.
Browse files Browse the repository at this point in the history
Created class diagram for new architecture.
  • Loading branch information
hrosa committed Jul 7, 2015
1 parent 60c0d2b commit d49124a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
Binary file added architecture_diagrams/classes.dia
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void addOOBInput(OOBInput input) {
this.ooBComponent.addInput(input);
}

public void addAudioOutput(OOBOutput output) {
public void addOOBOutput(OOBOutput output) {
this.ooBComponent.addOutput(output);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class RtpMixerComponent extends MixerComponent {
// RTP statistics
private volatile int rxPackets;

public RtpMixerComponent(int connectionId, RtpClock rtpClock, RtpClock oobClock, Scheduler scheduler, RTPFormats formats) {
public RtpMixerComponent(int connectionId, RtpClock rtpClock, RtpClock oobClock, Scheduler scheduler) {
super(connectionId);

// RTP receiver
Expand All @@ -65,6 +65,12 @@ public RtpMixerComponent(int connectionId, RtpClock rtpClock, RtpClock oobClock,
this.rtpSink = new RtpSink(scheduler, dsp);
this.dtmfSink = new DtmfSink(scheduler, rtpChannel, oobClock);

// Register mixer components
super.addAudioInput(this.rtpSource.getAudioInput());
super.addAudioOutput(this.rtpSink.getAudioOutput());
super.addOOBInput(this.dtmfSource.getOoBinput());
super.addOOBOutput(this.dtmfSink.getOobOutput());

// RTP statistics
this.rxPackets = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class RtpSink extends AbstractSink {

// Media Mixer components
private static final AudioFormat LINEAR_FORMAT = FormatFactory.createAudioFormat("LINEAR", 8000, 16, 1);
private final AudioOutput output;
private final AudioOutput audioOutput;
private Processor dsp;

// RTP processing components
Expand All @@ -67,14 +67,18 @@ public RtpSink(Scheduler scheduler, RtpClock rtpClock, Processor dsp) {
super("output");

// Media mixer components
this.output = new AudioOutput(scheduler, 1);
this.output.join(this);
this.audioOutput = new AudioOutput(scheduler, 1);
this.audioOutput.join(this);
this.dsp = dsp;

// RTP processing components
this.rtpClock = rtpClock;
}

public AudioOutput getAudioOutput() {
return audioOutput;
}

public void setFormats(Formats formats) {
this.formats = formats;
}
Expand Down Expand Up @@ -134,12 +138,12 @@ private boolean evolveFrame(Frame frame) {

@Override
public void activate() {
this.output.start();
this.audioOutput.start();
}

@Override
public void deactivate() {
this.output.stop();
this.audioOutput.stop();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public RtpSource(Scheduler scheduler, JitterBuffer jitterBuffer, Processor dsp)

// Media mixing components
this.jitterBuffer = jitterBuffer;
this.jitterBuffer.setListener(this);
this.dsp = dsp;
this.audioInput = new AudioInput(1, PACKET_SIZE);
super.connect(audioInput);
Expand Down

0 comments on commit d49124a

Please sign in to comment.