Commit 22860285 authored by hark's avatar hark
Browse files

audio feed selection

parent e7b003b2
......@@ -87,6 +87,11 @@
#define gst_element_factory_make(element, name) gst_element_factory_make_debug (element, name);
enum {
JACK,
SNOWMIX,
FAKE
};
typedef struct snowMixer snowMixer;
struct snowMixer {
......@@ -123,6 +128,7 @@ typedef struct snowData snowData;
struct snowData {
snowFeed *currentFeed;
snowMixer *mixer;
int audiosink;
};
......
......@@ -442,6 +442,8 @@ snowbin_init_snowData (PlayerData *s)
get_vars(mixer, feed);
// set audiosink
sd->audiosink = SNOWMIX;
// print_snowMixer(snow->mixer);
// print_snowFeed(snow->currentFeed);
......@@ -462,12 +464,22 @@ get_snowaudiobin (snowData *sd)
asprintf (&feedname, "feed%u", sd->currentFeed->id);
snowaudiobin = gst_bin_new ("snowaudiobin");
audioconvert = gst_element_factory_make ("audioconvert", "audioconvert");
//common
if (sd->audiosink == JACK)
{
//jack
audiosink = get_jacksink(sd->currentFeed->id);
gst_bin_add_many (GST_BIN (snowaudiobin), audioconvert, audiosink,
NULL);
gst_element_link_many (audioconvert, audiosink, NULL);
// audiosink = get_jacksink(sd->currentFeed->id);
} else if (sd->audiosink == SNOWMIX)
{
// snow
audiosink = get_snowaudiosink(sd->currentFeed->id);
//AUDIOFORMAT='audio/x-raw,format=S16LE,rate='$feed_rate',channels='$feed_channels
GstCaps *caps = gst_caps_new_simple ("audio/x-raw",
"rate", G_TYPE_INT, 4800,
......@@ -479,14 +491,11 @@ get_snowaudiobin (snowData *sd)
g_object_set (G_OBJECT (capsfilter), "caps", caps, NULL);
audioconvert = gst_element_factory_make ("audioconvert", "audioconvert");
gst_bin_add_many (GST_BIN (snowaudiobin), audioconvert, capsfilter, audiosink,
NULL);
gst_element_link_many (audioconvert, capsfilter, audiosink, NULL);
}
// common
apad = gst_element_get_static_pad (audioconvert, "sink");
aghostpad = gst_ghost_pad_new ("sink", apad);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment