Skip to content

Commit

Permalink
version 1.7.1
Browse files Browse the repository at this point in the history
drop appindicator
cleanup logging
  • Loading branch information
aramg committed Jan 14, 2021
1 parent 618e4ae commit 1e79120
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ JPEG_LIB ?= $(JPEG_DIR)/lib`getconf LONG_BIT`
GXX = g++
CC = -std=c++11 -x c++ -Wall -fPIC -no-pie
GTK = `pkg-config --libs --cflags gtk+-3.0` `pkg-config --libs x11`
GTK += `pkg-config --cflags --libs appindicator3-0.1`
#GTK += `pkg-config --cflags --libs appindicator3-0.1`
LIBAV = `pkg-config --libs --cflags libswscale libavutil`
LIBS = -lspeex -lasound -lpthread -lm
JPEG = -I$(JPEG_INCLUDE) $(JPEG_LIB)/libturbojpeg.a
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ libusbmuxd-dev
libplist-dev
gtk+-3.0 # Only needed for GUI client
libappindicator3-dev # Only needed for GUI client
```

Run `make`, or `make droidcam-cli` if you skipped installing GTK+, to build the droidcam binaries.
Expand Down
4 changes: 2 additions & 2 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#ifndef _COMMON_H_
#define _COMMON_H_

#define APP_VER_INT 170
#define APP_VER_STR "1.7"
#define APP_VER_INT 171
#define APP_VER_STR "1.7.1"

#define MSG_ERROR(str) ShowError("Error",str)
#define MSG_LASTERROR(str) ShowError(str,strerror(errno))
Expand Down
6 changes: 3 additions & 3 deletions src/decoder_snd.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ int snd_transfer_check(snd_pcm_t *handle, struct snd_transfer_s *transfer) {
err = snd_pcm_wait(handle, 2000);
if (err < 0) {
if ((err = xrun_recovery(handle, err)) < 0) {
printf("snd_pcm_wait error: %s\n", snd_strerror(err));
errprint("snd_pcm_wait error: %s\n", snd_strerror(err));
return err;
}
transfer->first = 1;
Expand All @@ -211,7 +211,7 @@ int snd_transfer_check(snd_pcm_t *handle, struct snd_transfer_s *transfer) {
err = snd_pcm_mmap_begin(handle, &transfer->my_areas, &transfer->offset, &transfer->frames);
if (err < 0) {
if ((err = xrun_recovery(handle, err)) < 0) {
printf("MMAP begin avail error: %s\n", snd_strerror(err));
errprint("MMAP begin avail error: %s\n", snd_strerror(err));
return err;
}
transfer->first = 1;
Expand All @@ -227,7 +227,7 @@ int snd_transfer_commit(snd_pcm_t *handle, struct snd_transfer_s *transfer) {
// dbgprint("commited %ld/%ld frames\n", commits, transfer->frames);
if (commits < 0 || (snd_pcm_uframes_t)commits != transfer->frames) {
if ((err = xrun_recovery(handle, commits >= 0 ? -EPIPE : commits)) < 0) {
printf("MMAP commit error: %s\n", snd_strerror(err));
errprint("MMAP commit error: %s\n", snd_strerror(err));
return err;
}
transfer->first = 1;
Expand Down
4 changes: 2 additions & 2 deletions src/decoder_v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int open_v4l2_device(void) {
return 0;
}

printf("Opened %s, fd:%d\n", v4l2_device, fd);
dbgprint("Opened %s, fd:%d\n", v4l2_device, fd);
return fd;
}

Expand All @@ -56,7 +56,7 @@ int find_v4l2_device(const char* bus_info) {
continue;
}

printf("Device %s is '%s' @ %s\n", v4l2_device, v4l2cap.card, v4l2cap.bus_info);
dbgprint("Device %s is '%s' @ %s\n", v4l2_device, v4l2cap.card, v4l2cap.bus_info);
if (0 == strncmp(bus_info, (const char*) v4l2cap.bus_info, bus_info_len)) {
return video_dev_fd;
}
Expand Down
9 changes: 7 additions & 2 deletions src/droidcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <sys/types.h>
#include <gtk/gtk.h>
#include <X11/Xlib.h>
#include <libappindicator/app-indicator.h>

#include "common.h"
#include "settings.h"
Expand Down Expand Up @@ -329,6 +328,10 @@ static void parse_args(int argc, char *argv[]) {
exit(1);
}

// TODO: this is broken on Debian
// Seems AppIndicator's deprecated and there is no real alternatives
// Example discussion: https://github.com/dino/dino/issues/98
#if 0
static void add_indicator(GtkWidget *window) {
AppIndicator *indicator = app_indicator_new("droidcam", APP_ICON_FILE, APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
GtkWidget *menu = gtk_menu_new();
Expand All @@ -353,6 +356,7 @@ static void add_indicator(GtkWidget *window) {
g_signal_connect(G_OBJECT(show_menu_item), "activate", G_CALLBACK(show_window), window);
g_signal_connect(G_OBJECT(exit_menu_item), "activate", G_CALLBACK(exit_window), window);
}
#endif

int main(int argc, char *argv[])
{
Expand Down Expand Up @@ -566,6 +570,7 @@ int main(int argc, char *argv[])
snprintf(info, sizeof(info), "Client v" APP_VER_STR ", Video: %s, Audio: %s",
v4l2_device, snd_device);
gtk_label_set_text(GTK_LABEL(infoText), info);
printf("Video: %s\n", v4l2_device);
printf("Audio: %s\n", snd_device);

// set the font size
Expand All @@ -576,7 +581,7 @@ int main(int argc, char *argv[])
pango_attr_list_unref(attrlist);

// add taskbar widget
add_indicator(window);
// add_indicator(window);

// main loop
gtk_main();
Expand Down

0 comments on commit 1e79120

Please sign in to comment.