Skip to content

Commit

Permalink
H264Packetizer now adds NALU type 7 and 8 to the stream if the encode…
Browse files Browse the repository at this point in the history
…r doesn't.
  • Loading branch information
fyhertz committed Oct 6, 2013
1 parent 407f9cb commit 791c8e0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/net/majorkernelpanic/streaming/rtp/H264Packetizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,16 @@ public void run() {
return;
}

// We read a NAL units from the input stream and we send them
try {
while (!Thread.interrupted()) {

// We measure how long it takes to receive the NAL unit from the phone
oldtime = System.nanoTime();
// We read a NAL units from the input stream and we send them
send();
// We measure how long it took to receive NAL units from the phone
duration = System.nanoTime() - oldtime;

// We regulary send RTSP Sender Report to the decoder
delta += duration/1000000;
if (intervalBetweenReports>0) {
if (delta>=intervalBetweenReports) {
Expand All @@ -108,10 +109,10 @@ public void run() {
}
}

// Every 5 secondes, we send two packets containing NALU type 7 (sps) and 8 (pps)
// Those should allow the H264 stream to be decoded even if no SDP was sent to the decoder.
delta2 += duration/1000000;
if (delta2>5000) {
// Every 5 secondes, we send two packets containing NALU type 7 (sps) and 8 (pps)
// Those should allow the H264 stream to be decoded even if no SDP was sent to the decoder.
delta2 = 0;
if (sps != null) {
buffer = socket.requestBuffer();
Expand Down

0 comments on commit 791c8e0

Please sign in to comment.