329 |
333 |
330 gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_devsound_src_change_state); |
334 gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_devsound_src_change_state); |
331 |
335 |
332 g_object_class_install_property(gobject_class, PROP_DEVICE, |
336 g_object_class_install_property(gobject_class, PROP_DEVICE, |
333 g_param_spec_string("device", "Device", "Devsound device ", |
337 g_param_spec_string("device", "Device", "Devsound device ", |
334 DEFAULT_DEVICE, G_PARAM_READWRITE)); |
338 DEFAULT_DEVICE, (GParamFlags)G_PARAM_READWRITE)); |
335 |
339 |
336 g_object_class_install_property(gobject_class, GAIN, g_param_spec_int( |
340 g_object_class_install_property(gobject_class, GAIN, g_param_spec_int( |
337 "gain", "Gain", "Devsound src gain", -1, G_MAXINT, -1, |
341 "gain", "Gain", "Devsound src gain", -1, G_MAXINT, -1, |
338 G_PARAM_READWRITE)); |
342 (GParamFlags)G_PARAM_READWRITE)); |
339 |
343 |
340 g_object_class_install_property(gobject_class, MAXGAIN, g_param_spec_int( |
344 g_object_class_install_property(gobject_class, MAXGAIN, g_param_spec_int( |
341 "maxgain", "MaxGain", "Devsound src max gain", -1, G_MAXINT, -1, |
345 "maxgain", "MaxGain", "Devsound src max gain", -1, G_MAXINT, -1, |
342 G_PARAM_READABLE)); |
346 G_PARAM_READABLE)); |
343 |
347 |
344 g_object_class_install_property(gobject_class, LEFTBALANCE, |
348 g_object_class_install_property(gobject_class, LEFTBALANCE, |
345 g_param_spec_int("leftbalance", "Left Balance", "Left Balance", |
349 g_param_spec_int("leftbalance", "Left Balance", "Left Balance", |
346 -1, G_MAXINT, -1, G_PARAM_READWRITE)); |
350 -1, G_MAXINT, -1, (GParamFlags)G_PARAM_READWRITE)); |
347 |
351 |
348 g_object_class_install_property(gobject_class, RIGHTBALANCE, |
352 g_object_class_install_property(gobject_class, RIGHTBALANCE, |
349 g_param_spec_int("rightbalance", "Right Balance", |
353 g_param_spec_int("rightbalance", "Right Balance", |
350 "Right Balance", -1, G_MAXINT, -1, G_PARAM_READWRITE)); |
354 "Right Balance", -1, G_MAXINT, -1, (GParamFlags)G_PARAM_READWRITE)); |
351 |
355 |
352 g_object_class_install_property(gobject_class, SAMPLESRECORDED, |
356 g_object_class_install_property(gobject_class, SAMPLESRECORDED, |
353 g_param_spec_int("samplesrecorded", "Samples Recorded", |
357 g_param_spec_int("samplesrecorded", "Samples Recorded", |
354 "Samples Recorded", -1, G_MAXINT, -1, G_PARAM_READABLE)); |
358 "Samples Recorded", -1, G_MAXINT, -1, G_PARAM_READABLE)); |
355 |
359 |
356 g_object_class_install_property(gobject_class, PRIORITY, |
360 g_object_class_install_property(gobject_class, PRIORITY, |
357 g_param_spec_int("priority", "Priority", "Priority ", -1, |
361 g_param_spec_int("priority", "Priority", "Priority ", -1, |
358 G_MAXINT, -1, |
362 G_MAXINT, -1, |
359 G_PARAM_READWRITE)); |
363 (GParamFlags)G_PARAM_READWRITE)); |
360 |
364 |
361 g_object_class_install_property(gobject_class, PREFERENCE, |
365 g_object_class_install_property(gobject_class, PREFERENCE, |
362 g_param_spec_int("preference", "Preference", "Preference ", -1, |
366 g_param_spec_int("preference", "Preference", "Preference ", -1, |
363 G_MAXINT, -1, |
367 G_MAXINT, -1, |
364 G_PARAM_READWRITE)); |
368 (GParamFlags)G_PARAM_READWRITE)); |
365 |
369 |
366 g_object_class_install_property(gobject_class, RATE, |
370 g_object_class_install_property(gobject_class, RATE, |
367 g_param_spec_int("rate", "Rate", "Rate ", -1, |
371 g_param_spec_int("rate", "Rate", "Rate ", -1, |
368 G_MAXINT, -1, |
372 G_MAXINT, -1, |
369 G_PARAM_READWRITE)); |
373 (GParamFlags)G_PARAM_READWRITE)); |
370 |
374 |
371 g_object_class_install_property(gobject_class, CHANNELS, |
375 g_object_class_install_property(gobject_class, CHANNELS, |
372 g_param_spec_int("channels", "Channels", "Channels ", -1, |
376 g_param_spec_int("channels", "Channels", "Channels ", -1, |
373 G_MAXINT, -1, |
377 G_MAXINT, -1, |
374 G_PARAM_READWRITE)); |
378 (GParamFlags)G_PARAM_READWRITE)); |
375 |
379 |
376 gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_devsound_src_start); |
380 gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_devsound_src_start); |
377 gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_devsound_src_stop); |
381 gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_devsound_src_stop); |
378 gstbasesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_devsound_src_getcaps); |
382 gstbasesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_devsound_src_getcaps); |
379 gstbasesrc_class->set_caps = GST_DEBUG_FUNCPTR (gst_devsound_src_setcaps); |
383 gstbasesrc_class->set_caps = GST_DEBUG_FUNCPTR (gst_devsound_src_setcaps); |
388 //gst_debug_log(devsound_debug, GST_LEVEL_LOG, "", "", 0, (GObject *) devsoundsrc, "gst_devsound_src_init ENTER ",NULL); |
392 //gst_debug_log(devsound_debug, GST_LEVEL_LOG, "", "", 0, (GObject *) devsoundsrc, "gst_devsound_src_init ENTER ",NULL); |
389 devsoundsrc->device = g_strdup(DEFAULT_DEVICE); |
393 devsoundsrc->device = g_strdup(DEFAULT_DEVICE); |
390 devsoundsrc->handle=NULL; |
394 devsoundsrc->handle=NULL; |
391 devsoundsrc->preference = 0; //default=>EMdaPriorityPreferenceNone; |
395 devsoundsrc->preference = 0; //default=>EMdaPriorityPreferenceNone; |
392 devsoundsrc->priority = 0; //default=>EMdaPriorityNormal; |
396 devsoundsrc->priority = 0; //default=>EMdaPriorityNormal; |
393 pthread_mutex_init(&create_mutex1, NULL); |
397 devsoundsrc->firstimecreatecalled = 0; |
394 pthread_cond_init(&create_condition1, NULL); |
398 // pthread_mutex_init(&create_mutex1, NULL); |
|
399 // pthread_cond_init(&create_condition1, NULL); |
395 //gst_debug_log(devsound_debug, GST_LEVEL_LOG, "", "", 0, (GObject *) devsoundsrc, "gst_devsound_src_init EXIT ",NULL); |
400 //gst_debug_log(devsound_debug, GST_LEVEL_LOG, "", "", 0, (GObject *) devsoundsrc, "gst_devsound_src_init EXIT ",NULL); |
396 } |
401 } |
397 |
402 |
398 static void *StartDevSoundThread(void *threadarg) |
403 static void *StartDevSoundThread(void *threadarg) |
399 { |
404 { |