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
7e6fab4e
Commit
7e6fab4e
authored
Sep 18, 2015
by
hark
Browse files
Merge branch 'master' of gitlab.irl.020:sms/c-player
parents
099ff9fe
b69ea6ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Makefile
View file @
7e6fab4e
...
@@ -55,3 +55,6 @@ bigscreen: bigscreen.c
...
@@ -55,3 +55,6 @@ bigscreen: bigscreen.c
tcp2rtsp
:
tcp2rtsp.c
tcp2rtsp
:
tcp2rtsp.c
gcc
-g
tcp2rtsp.c
-o
tcp2rtsp
`
pkg-config
--cflags
--libs
gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0 gstreamer-rtsp-server-1.0
`
$(CFLAGS)
gcc
-g
tcp2rtsp.c
-o
tcp2rtsp
`
pkg-config
--cflags
--libs
gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0 gstreamer-rtsp-server-1.0
`
$(CFLAGS)
midicontrol
:
midicontrol.c
gcc
-g
midicontrol.c
-o
midicontrol
`
pkg-config
--cflags
--libs
alsa
`
$(CFLAGS)
src/midicontrol.c
0 → 100644
View file @
7e6fab4e
#include <alsa/asoundlib.h>
static
snd_seq_t
*
seq_handle
;
static
int
in_port
;
#define CHK(stmt, msg) if((stmt) < 0) {puts("ERROR: "#msg); exit(1);}
void
midi_open
(
void
)
{
CHK
(
snd_seq_open
(
&
seq_handle
,
"default"
,
SND_SEQ_OPEN_INPUT
,
0
),
"Could not open sequencer"
);
CHK
(
snd_seq_set_client_name
(
seq_handle
,
"Midi Listener"
),
"Could not set client name"
);
CHK
(
in_port
=
snd_seq_create_simple_port
(
seq_handle
,
"listen:in"
,
SND_SEQ_PORT_CAP_WRITE
|
SND_SEQ_PORT_CAP_SUBS_WRITE
,
SND_SEQ_PORT_TYPE_APPLICATION
),
"Could not open port"
);
}
snd_seq_event_t
*
midi_read
(
void
)
{
snd_seq_event_t
*
ev
=
NULL
;
snd_seq_event_input
(
seq_handle
,
&
ev
);
return
ev
;
}
void
midi_process
(
const
snd_seq_event_t
*
ev
)
{
if
((
ev
->
type
==
SND_SEQ_EVENT_NOTEON
)
||
(
ev
->
type
==
SND_SEQ_EVENT_NOTEOFF
))
{
const
char
*
type
=
(
ev
->
type
==
SND_SEQ_EVENT_NOTEON
)
?
"on "
:
"off"
;
printf
(
"[%d] Note %s: %2x vel(%2x)
\n
"
,
ev
->
time
.
tick
,
type
,
ev
->
data
.
note
.
note
,
ev
->
data
.
note
.
velocity
);
}
else
if
(
ev
->
type
==
SND_SEQ_EVENT_CONTROLLER
)
printf
(
"[%d] Control: %2x val(%2x)
\n
"
,
ev
->
time
.
tick
,
ev
->
data
.
control
.
param
,
ev
->
data
.
control
.
value
);
else
printf
(
"[%d] Unknown: Unhandled Event Received
\n
"
,
ev
->
time
.
tick
);
}
int
main
()
{
midi_open
();
while
(
1
)
midi_process
(
midi_read
());
return
-
1
;
}
src/tcp2rtsp.c
View file @
7e6fab4e
...
@@ -50,7 +50,7 @@ main (int argc, char *argv[])
...
@@ -50,7 +50,7 @@ main (int argc, char *argv[])
gst_rtsp_media_factory_set_shared
(
factory
,
TRUE
);
gst_rtsp_media_factory_set_shared
(
factory
,
TRUE
);
/* attach the test factory to the /test url */
/* attach the test factory to the /test url */
gst_rtsp_mount_points_add_factory
(
mounts
,
"/
test
"
,
factory
);
gst_rtsp_mount_points_add_factory
(
mounts
,
"/
020-tv
"
,
factory
);
/* don't need the ref to the mapper anymore */
/* don't need the ref to the mapper anymore */
g_object_unref
(
mounts
);
g_object_unref
(
mounts
);
...
@@ -59,7 +59,7 @@ main (int argc, char *argv[])
...
@@ -59,7 +59,7 @@ main (int argc, char *argv[])
gst_rtsp_server_attach
(
server
,
NULL
);
gst_rtsp_server_attach
(
server
,
NULL
);
/* start serving */
/* start serving */
g_print
(
"stream ready at rtsp://127.0.0.1:8554/
test
\n
"
);
g_print
(
"stream ready at rtsp://127.0.0.1:8554/
020-tv
\n
"
);
g_main_loop_run
(
loop
);
g_main_loop_run
(
loop
);
return
0
;
return
0
;
...
...
Write
Preview
Supports
Markdown
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