int main(int argc, char **argv) { GOptionContext *options; GError *error = NULL; gint success_count = 0; gint test_count = 0; options = g_option_context_new(NULL); g_option_context_add_main_entries(options, entries, NULL); if (!g_option_context_parse(options, &argc, &argv, &error)) { g_print("Failed to parse options: %s\n", error->message); return -2; } g_print("\n *** Starting data channel test ***\n\n"); owr_init(NULL); owr_run_in_background(); if (setup_transport_agents()) { success_count += run_prenegotiated_channel_test(TRUE); test_count++; success_count += run_requested_channel_test(TRUE); test_count++; success_count += run_requested_channel_test(FALSE); test_count++; success_count += run_prenegotiated_channel_test(FALSE); test_count++; g_print("\n%d / %d test were successful\n", success_count, test_count); g_print("Dumping transport agent pipelines!\n"); write_dot_file("test_data_channel-left-transport_agent", owr_transport_agent_get_dot_data(left_transport_agent), TRUE); write_dot_file("test_data_channel-right-transport_agent", owr_transport_agent_get_dot_data(right_transport_agent), TRUE); return test_count - success_count; } g_print("\n *** Failed initial setup ***\n\n"); return -1; }
void init() { owr_init(NULL); owr_run_in_background(); owr_get_capture_sources(OWR_MEDIA_TYPE_AUDIO | OWR_MEDIA_TYPE_VIDEO, (OwrCaptureSourcesCallback)got_local_sources, NULL); }