Name Java threads
Give a user-friendly name to Java threads created by the server.
This commit is contained in:
parent
a3cdf1a6b8
commit
fdbc9397a7
6 changed files with 9 additions and 9 deletions
|
@ -134,7 +134,7 @@ public final class AudioEncoder implements AsyncProcessor {
|
|||
Ln.d("Audio encoder stopped");
|
||||
listener.onTerminated(fatalError);
|
||||
}
|
||||
});
|
||||
}, "audio-encoder");
|
||||
thread.start();
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ public final class AudioEncoder implements AsyncProcessor {
|
|||
Codec codec = streamer.getCodec();
|
||||
mediaCodec = createMediaCodec(codec, encoderName);
|
||||
|
||||
mediaCodecThread = new HandlerThread("AudioEncoder");
|
||||
mediaCodecThread = new HandlerThread("media-codec");
|
||||
mediaCodecThread.start();
|
||||
|
||||
MediaFormat format = createFormat(codec.getMimeType(), bitRate, codecOptions);
|
||||
|
@ -201,7 +201,7 @@ public final class AudioEncoder implements AsyncProcessor {
|
|||
} finally {
|
||||
end();
|
||||
}
|
||||
});
|
||||
}, "audio-in");
|
||||
|
||||
outputThread = new Thread(() -> {
|
||||
try {
|
||||
|
@ -216,7 +216,7 @@ public final class AudioEncoder implements AsyncProcessor {
|
|||
} finally {
|
||||
end();
|
||||
}
|
||||
});
|
||||
}, "audio-out");
|
||||
|
||||
mediaCodec.start();
|
||||
mediaCodecStarted = true;
|
||||
|
|
|
@ -69,7 +69,7 @@ public final class AudioRawRecorder implements AsyncProcessor {
|
|||
Ln.d("Audio recorder stopped");
|
||||
listener.onTerminated(fatalError);
|
||||
}
|
||||
});
|
||||
}, "audio-raw");
|
||||
thread.start();
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ public class Controller implements AsyncProcessor {
|
|||
Ln.d("Controller stopped");
|
||||
listener.onTerminated(true);
|
||||
}
|
||||
});
|
||||
}, "control-recv");
|
||||
thread.start();
|
||||
sender.start();
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public final class DeviceMessageSender {
|
|||
} finally {
|
||||
Ln.d("Device message sender stopped");
|
||||
}
|
||||
});
|
||||
}, "control-send");
|
||||
thread.start();
|
||||
}
|
||||
|
||||
|
|
|
@ -299,7 +299,7 @@ public class ScreenEncoder implements Device.RotationListener, Device.FoldListen
|
|||
Ln.d("Screen streaming stopped");
|
||||
listener.onTerminated(true);
|
||||
}
|
||||
});
|
||||
}, "video");
|
||||
thread.start();
|
||||
}
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ public final class Server {
|
|||
}
|
||||
|
||||
private static Thread startInitThread(final Options options) {
|
||||
Thread thread = new Thread(() -> initAndCleanUp(options));
|
||||
Thread thread = new Thread(() -> initAndCleanUp(options), "init-cleanup");
|
||||
thread.start();
|
||||
return thread;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue