summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rmd_cache_audio.c3
-rw-r--r--src/rmd_cache_frame.c3
-rw-r--r--src/rmd_encode_image_buffer.c3
-rw-r--r--src/rmd_encode_sound_buffer.c3
-rw-r--r--src/rmd_flush_to_ogg.c3
-rw-r--r--src/rmd_get_frame.c3
-rw-r--r--src/rmd_load_cache.c3
-rw-r--r--src/rmd_threads.c5
-rw-r--r--src/rmd_threads.h1
9 files changed, 27 insertions, 0 deletions
diff --git a/src/rmd_cache_audio.c b/src/rmd_cache_audio.c
index fabcb39..8becef4 100644
--- a/src/rmd_cache_audio.c
+++ b/src/rmd_cache_audio.c
@@ -28,6 +28,7 @@
#include "rmd_cache_audio.h"
#include "rmd_jack.h"
+#include "rmd_threads.h"
#include "rmd_types.h"
#include <pthread.h>
@@ -50,6 +51,8 @@ void *rmdCacheSoundBuffer(ProgData *pdata) {
}
#endif
+ rmdThreadsSetName("rmdCacheSounds");
+
//We are simply going to throw sound on the disk.
//It's sound is tiny compared to that of image, so
//compressing would reducethe overall size by only an
diff --git a/src/rmd_cache_frame.c b/src/rmd_cache_frame.c
index 7b8a2f3..c2e37bf 100644
--- a/src/rmd_cache_frame.c
+++ b/src/rmd_cache_frame.c
@@ -29,6 +29,7 @@
#include "rmd_yuv_utils.h"
#include "rmd_cache.h"
+#include "rmd_threads.h"
#include "rmd_types.h"
#include <signal.h>
@@ -106,6 +107,8 @@ void *rmdCacheImageBuffer(ProgData *pdata) {
unsigned long long int total_received_bytes = 0;
unsigned int capture_frameno = 0;
+ rmdThreadsSetName("rmdCacheImages");
+
if (!pdata->args.zerocompression) {
fp = pdata->cache_data->ifp;
diff --git a/src/rmd_encode_image_buffer.c b/src/rmd_encode_image_buffer.c
index c234aa4..f5e8b36 100644
--- a/src/rmd_encode_image_buffer.c
+++ b/src/rmd_encode_image_buffer.c
@@ -27,6 +27,7 @@
#include "config.h"
#include "rmd_encode_image_buffer.h"
+#include "rmd_threads.h"
#include "rmd_types.h"
#include <errno.h>
@@ -35,6 +36,8 @@
void *rmdEncodeImageBuffer(ProgData *pdata) {
unsigned int encode_frameno = 0;
+ rmdThreadsSetName("rmdEncodeImages");
+
pdata->th_encoding_clean = 0;
while (pdata->running) {
diff --git a/src/rmd_encode_sound_buffer.c b/src/rmd_encode_sound_buffer.c
index 5fa1dc6..b3f8781 100644
--- a/src/rmd_encode_sound_buffer.c
+++ b/src/rmd_encode_sound_buffer.c
@@ -28,6 +28,7 @@
#include "rmd_encode_sound_buffer.h"
#include "rmd_jack.h"
+#include "rmd_threads.h"
#include "rmd_types.h"
#include <pthread.h>
@@ -45,6 +46,8 @@ void *rmdEncodeSoundBuffer(ProgData *pdata) {
jackbuf = malloc(pdata->sound_framesize * pdata->jdata->buffersize);
#endif
+ rmdThreadsSetName("rmdEncodeSounds");
+
pdata->v_encoding_clean = 0;
while (pdata->running) {
float **vorbis_buffer;
diff --git a/src/rmd_flush_to_ogg.c b/src/rmd_flush_to_ogg.c
index 87308a6..d2e7f44 100644
--- a/src/rmd_flush_to_ogg.c
+++ b/src/rmd_flush_to_ogg.c
@@ -29,6 +29,7 @@
#include "rmd_encode_image_buffer.h"
#include "rmd_encode_sound_buffer.h"
+#include "rmd_threads.h"
#include "rmd_types.h"
#include <pthread.h>
@@ -75,6 +76,8 @@ void *rmdFlushToOgg(ProgData *pdata) {
int th_st_fin = 0,
v_st_fin = (pdata->args.nosound);
+ rmdThreadsSetName("rmdFlushToOgg");
+
while (!(th_st_fin && v_st_fin)) {
int audio_or_video = 0;
diff --git a/src/rmd_get_frame.c b/src/rmd_get_frame.c
index a9e4daa..8d8b8d8 100644
--- a/src/rmd_get_frame.c
+++ b/src/rmd_get_frame.c
@@ -32,6 +32,7 @@
#include "rmd_getzpixmap.h"
#include "rmd_poll_events.h"
#include "rmd_rectinsert.h"
+#include "rmd_threads.h"
#include "rmd_update_image.h"
#include "rmd_yuv_utils.h"
#include "rmd_types.h"
@@ -268,6 +269,8 @@ void *rmdGetFrame(ProgData *pdata) {
//the current full screenshot
int init_img1 = 0, init_img2 = 0, img_sel, d_buff;
+ rmdThreadsSetName("rmdGetFrame");
+
img_sel = d_buff = pdata->args.full_shots;
if ((init_img1 = rmdFirstFrame(pdata, &image) != 0)) {
diff --git a/src/rmd_load_cache.c b/src/rmd_load_cache.c
index 8ca37f6..417b3dc 100644
--- a/src/rmd_load_cache.c
+++ b/src/rmd_load_cache.c
@@ -31,6 +31,7 @@
#include "rmd_encode_image_buffer.h"
#include "rmd_encode_sound_buffer.h"
#include "rmd_macro.h"
+#include "rmd_threads.h"
#include "rmd_types.h"
#include <pthread.h>
@@ -184,6 +185,8 @@ void *rmdLoadCache(ProgData *pdata) {
UBlocks[(yuv->uv_width * yuv->uv_height) / UV_UNIT_BYTES],
VBlocks[(yuv->uv_width * yuv->uv_height) / UV_UNIT_BYTES];
+ rmdThreadsSetName("rmdEncodeCache");
+
// We allocate the frame that we will use
frame.header = &fheader;
frame.YBlocks = YBlocks;
diff --git a/src/rmd_threads.c b/src/rmd_threads.c
index cb81f84..69b98bf 100644
--- a/src/rmd_threads.c
+++ b/src/rmd_threads.c
@@ -43,6 +43,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <sys/prctl.h>
#include <unistd.h>
void rmdThreads(ProgData *pdata) {
@@ -167,3 +168,7 @@ void rmdThreads(ProgData *pdata) {
pdata->timer_alive = 0;
pthread_join(timer_t,NULL);
}
+
+void rmdThreadsSetName(const char *name) {
+ prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0);
+}
diff --git a/src/rmd_threads.h b/src/rmd_threads.h
index e2c103a..6ca2dbd 100644
--- a/src/rmd_threads.h
+++ b/src/rmd_threads.h
@@ -38,6 +38,7 @@
* \param pdata ProgData struct containing all program data
*/
void rmdThreads(ProgData *pdata);
+void rmdThreadsSetName(const char *name);
#endif
© All Rights Reserved