Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sms
c-player
Commits
05bd5f39
Commit
05bd5f39
authored
Sep 15, 2015
by
hark
Browse files
fix makefile
parent
1dda1426
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/.c-player.c.swp
View file @
05bd5f39
No preview for this file type
src/.gitignore
View file @
05bd5f39
vartest
bigscreen
c-player
s2s
...
...
src/.playlist.c.swp
deleted
100644 → 0
View file @
1dda1426
File deleted
src/Makefile
View file @
05bd5f39
...
...
@@ -8,8 +8,12 @@ CFLAGS= -O0 -march=native -Wall -Wextra -Wno-unused-parameter -Wno-unused-variab
#-std=c99
# -Werror -Wconversion -Wsign-conversion
all
:
c-player snowControl s2s s2s-cli
all
:
c-player
c-player-0.10 c-player-debug vartest
snowControl s2s s2s-cli
vartest
:
vartest.c
gcc
-DTESTING
-DGTK
-g
vartest.c
-o
vartest
`
pkg-config
--cflags
--libs
gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gtk+-2.0 gstreamer-0.10
`
$(CFLAGS)
c-player-0.10
:
c-player.c
gcc
-DTESTING
-DGTK
-g
c-player.c wraps.c playlist.c snowbin.c teebin.c
-o
c-player-0.10
`
pkg-config
--cflags
--libs
gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gtk+-2.0 gstreamer-0.10
`
$(CFLAGS)
...
...
@@ -17,7 +21,7 @@ c-player-0.10 : c-player.c
c-player-debug
:
c-player.c
gcc
-D
TT
-DTESTING
-DGTK
-DGST1
-g
c-player.c wraps.c playlist.c snowbin.c teebin.c
-o
c-player-debug
`
pkg-config
--cflags
--libs
gtk+-2.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0
`
$(CFLAGS)
c-player
-1.0
:
c-player.c
c-player
:
c-player.c
gcc
-DGTK
-DGST1
-g
c-player.c wraps.c playlist.c snowbin.c teebin.c
-o
c-player
`
pkg-config
--cflags
--libs
gtk+-2.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0
`
$(CFLAGS)
c-player-cli
:
c-player.c
...
...
src/common.h
View file @
05bd5f39
...
...
@@ -37,6 +37,7 @@
//#include <glib-2.0/glib/gprintf.h>
//gtk stuff
#ifdef GTK
#ifndef CLI
#include <gtk/gtk.h>
#include <gdk/gdk.h>
...
...
@@ -48,6 +49,7 @@
#include <gdk/gdkquartz.h>
#endif
#endif
#endif
//gstreamer stuff
#define GST_DISABLE_DEPRECATED
...
...
src/getvars.sh
0 → 100755
View file @
05bd5f39
#!/bin/bash
# Deliver mixer1 output to dummy.
set
-e
SM
=
/crypthome/hark/src/Snowmix-0.4.5/
# IMPORTANT >>>>>You need to get port, ip and feed_id right<<<<<
port
=
9999
ip
=
127.0.0.1
# Set video feed
feed_id
=
1
audio_feed_id
=
1
# Check for SM variable and the snowmix and gstreamer settings
if
[
X
$SM
=
X
-o
!
-f
$SM
/scripts/gstreamer-settings
-o
!
-f
$SM
/scripts/snowmix-settings
]
;
then
#echo "You need to se the environment variable SM to the base of the Snowmix directory"
exit
1
fi
# Load the Snowmix and GStreamer settings
.
$SM
/scripts/gstreamer-settings
.
$SM
/scripts/snowmix-settings
# This will set
# a) feed_rate
# b) feed_channels
# c) feed_control_pipe
# d) feed_width
# e) feed_height
# f) ctrsocket
# g) system_width
# h) system_height
# i) ratefraction
# j) snowmix
# k) channels
# l) rate
if
[
X
$ctrsocket
=
X
-o
X
$system_width
=
X
-o
X
$system_height
=
X
]
;
then
# echo Failed to get control pipe or width or height from running snowmix
exit
2
fi
VIDEOFORMAT
=
$VIDEOBGRA
', width=(int)'
$system_width
', height=(int)'
$system_height
', framerate=(fraction)'
$ratefraction
echo
feed_rate:
$feed_rate
echo
feed_channels:
$feed_channels
echo
feed_control_pipe:
$feed_control_pipe
echo
feed_width:
$feed_width
echo
feed_height:
$feed_height
echo
ctrsocket:
$ctrsocket
echo
system_width:
$system_width
echo
system_height:
$system_height
echo
ratefraction:
$ratefraction
echo
snowmix:
$snowmix
echo
channels:
$channels
echo
rate:
$rate
echo
videoformat:
$VIDEOFORMAT
#make vartest
#./vartest
#env
src/vartest.c
0 → 100644
View file @
05bd5f39
/* get vars from snowmix */
#include "common.h"
#include <regex.h>
/*
ctrsocket: /tmp/mixer1
system_width: 1280
system_height: 720
ratefraction: 25/1
snowmix: running
channels: 2
rate: 48000
*/
struct
snowmixer
{
int
width
;
int
height
;
char
*
ctrlsocket
;
int
audio_rate
;
int
audio_channels
;
char
*
state
;
char
*
ratefraction
;
};
/*
feed_rate: 48000
feed_channels: 1
feed_control_pipe: /tmp/feed1-control-pipe
feed_width: 1280
feed_height: 720
*/
struct
feed
{
int
id
;
int
rate
;
char
*
control_pipe
;
int
width
;
int
height
;
};
struct
snowmixer
mm
;
struct
feed
mf
;
int
get_vars
()
{
FILE
*
fp
;
char
line
[
1035
];
regex_t
regex
;
int
reti
;
char
msgbuf
[
100
];
/* Compile regular expression */
reti
=
regcomp
(
&
regex
,
"^a[[:alnum:]]"
,
0
);
if
(
reti
)
{
fprintf
(
stderr
,
"Could not compile regex
\n
"
);
exit
(
1
);
}
/* Open the command for reading. */
fp
=
popen
(
"./getvars.sh 1"
,
"r"
);
if
(
fp
==
NULL
)
{
printf
(
"Failed to run command
\n
"
);
exit
(
1
);
}
/* Read the output a line at a time - output it. */
while
(
fgets
(
line
,
sizeof
(
line
)
-
1
,
fp
)
!=
NULL
)
{
printf
(
"%s"
,
line
);
/* Execute regular expression */
reti
=
regexec
(
&
regex
,
line
,
0
,
NULL
,
0
);
if
(
!
reti
)
{
puts
(
"Match"
);
}
else
if
(
reti
==
REG_NOMATCH
)
{
puts
(
"No match"
);
}
else
{
regerror
(
reti
,
&
regex
,
msgbuf
,
sizeof
(
msgbuf
));
fprintf
(
stderr
,
"Regex match failed: %s
\n
"
,
msgbuf
);
exit
(
1
);
}
}
/* Free compiled regular expression if you want to use the regex_t again */
regfree
(
&
regex
);
/* close */
pclose
(
fp
);
return
0
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
/*
feed_rate: 48000
feed_channels: 1
feed_control_pipe: /tmp/feed1-control-pipe
feed_width: 1280
feed_height: 720
ctrsocket: /tmp/mixer1
system_width: 1280
system_height: 720
ratefraction: 25/1
snowmix: running
channels: 2
rate: 48000
*/
// exec script that sets env.
get_vars
();
// system("./vartest.sh");
char
*
feed_rate
;
feed_rate
=
getenv
(
"feed_rate"
);
printf
(
"feed_rate: %s
\n
"
,
feed_rate
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment