• Home
  • Raw
  • Download

Lines Matching refs:stream

313 	struct avdtp_stream *stream; /* Set if the request targeted a stream */  member
324 struct avdtp_stream *stream; member
337 struct avdtp_stream *stream; member
436 struct avdtp_stream *stream, uint8_t signal_id,
439 struct avdtp_stream *stream,
443 struct avdtp_stream *stream,
603 static void close_stream(struct avdtp_stream *stream) in close_stream() argument
607 if (stream->io == NULL) in close_stream()
610 sock = g_io_channel_unix_get_fd(stream->io); in close_stream()
614 g_io_channel_shutdown(stream->io, FALSE, NULL); in close_stream()
616 g_io_channel_unref(stream->io); in close_stream()
617 stream->io = NULL; in close_stream()
622 struct avdtp_stream *stream = user_data; in stream_close_timeout() local
626 stream->timer = 0; in stream_close_timeout()
628 close_stream(stream); in stream_close_timeout()
635 struct avdtp_stream *stream = user_data; in stream_open_timeout() local
639 stream->timer = 0; in stream_open_timeout()
641 stream->session->pending_open = NULL; in stream_open_timeout()
643 avdtp_abort(stream->session, stream); in stream_open_timeout()
723 struct avdtp_stream *stream = l->data; in find_stream_by_rseid() local
725 if (stream->rseid == rseid) in find_stream_by_rseid()
726 return stream; in find_stream_by_rseid()
769 static void stream_free(struct avdtp_stream *stream) in stream_free() argument
773 stream->lsep->info.inuse = 0; in stream_free()
774 stream->lsep->stream = NULL; in stream_free()
776 rsep = find_remote_sep(stream->session->seps, stream->rseid); in stream_free()
778 rsep->stream = NULL; in stream_free()
780 if (stream->timer) in stream_free()
781 g_source_remove(stream->timer); in stream_free()
783 if (stream->io) in stream_free()
784 g_io_channel_unref(stream->io); in stream_free()
786 if (stream->io_id) in stream_free()
787 g_source_remove(stream->io_id); in stream_free()
789 g_slist_foreach(stream->callbacks, (GFunc) g_free, NULL); in stream_free()
790 g_slist_free(stream->callbacks); in stream_free()
792 g_slist_foreach(stream->caps, (GFunc) g_free, NULL); in stream_free()
793 g_slist_free(stream->caps); in stream_free()
795 g_free(stream); in stream_free()
800 struct avdtp_stream *stream = user_data; in stream_timeout() local
801 struct avdtp *session = stream->session; in stream_timeout()
803 if (avdtp_close(session, stream, FALSE) < 0) in stream_timeout()
806 stream->idle_timer = 0; in stream_timeout()
814 struct avdtp_stream *stream = data; in transport_cb() local
815 struct avdtp_local_sep *sep = stream->lsep; in transport_cb()
817 if (stream->close_int && sep->cfm && sep->cfm->close) in transport_cb()
818 sep->cfm->close(stream->session, sep, stream, NULL, in transport_cb()
822 close_stream(stream); in transport_cb()
824 stream->io_id = 0; in transport_cb()
826 if (!stream->abort_int) in transport_cb()
827 avdtp_sep_set_state(stream->session, sep, AVDTP_STATE_IDLE); in transport_cb()
835 struct avdtp_stream *stream = session->pending_open; in handle_transport_connect() local
836 struct avdtp_local_sep *sep = stream->lsep; in handle_transport_connect()
840 if (stream->timer) { in handle_transport_connect()
841 g_source_remove(stream->timer); in handle_transport_connect()
842 stream->timer = 0; in handle_transport_connect()
846 if (!stream->open_acp && sep->cfm && sep->cfm->open) { in handle_transport_connect()
855 stream->io = g_io_channel_ref(io); in handle_transport_connect()
856 stream->omtu = omtu; in handle_transport_connect()
857 stream->imtu = imtu; in handle_transport_connect()
859 if (!stream->open_acp && sep->cfm && sep->cfm->open) in handle_transport_connect()
860 sep->cfm->open(session, sep, stream, NULL, sep->user_data); in handle_transport_connect()
864 stream->io_id = g_io_add_watch(io, G_IO_ERR | G_IO_HUP | G_IO_NVAL, in handle_transport_connect()
865 (GIOFunc) transport_cb, stream); in handle_transport_connect()
871 const struct avdtp_stream *stream = b; in pending_req_cmp() local
873 if (req->stream == stream) in pending_req_cmp()
879 static void cleanup_queue(struct avdtp *session, struct avdtp_stream *stream) in cleanup_queue() argument
884 while ((l = g_slist_find_custom(session->prio_queue, stream, in cleanup_queue()
891 while ((l = g_slist_find_custom(session->req_queue, stream, in cleanup_queue()
900 struct avdtp_stream *stream) in handle_unanswered_req() argument
909 session->req->stream = NULL; in handle_unanswered_req()
918 lsep = stream->lsep; in handle_unanswered_req()
924 lsep->cfm->reconfigure(session, lsep, stream, &err, in handle_unanswered_req()
930 lsep->cfm->open(session, lsep, stream, &err, in handle_unanswered_req()
936 lsep->cfm->start(session, lsep, stream, &err, in handle_unanswered_req()
942 lsep->cfm->suspend(session, lsep, stream, &err, in handle_unanswered_req()
948 lsep->cfm->close(session, lsep, stream, &err, in handle_unanswered_req()
954 lsep->cfm->set_configuration(session, lsep, stream, in handle_unanswered_req()
965 struct avdtp_stream *stream = sep->stream; in avdtp_sep_set_state() local
970 if (!stream) { in avdtp_sep_set_state()
989 for (l = stream->callbacks; l != NULL; l = g_slist_next(l)) { in avdtp_sep_set_state()
991 cb->cb(stream, old_state, state, err_ptr, cb->user_data); in avdtp_sep_set_state()
997 avdtp_delay_report(session, stream, stream->delay); in avdtp_sep_set_state()
1001 stream->idle_timer = g_timeout_add_seconds(STREAM_TIMEOUT, in avdtp_sep_set_state()
1003 stream); in avdtp_sep_set_state()
1008 if (stream->idle_timer) { in avdtp_sep_set_state()
1009 g_source_remove(stream->idle_timer); in avdtp_sep_set_state()
1010 stream->idle_timer = 0; in avdtp_sep_set_state()
1014 if (stream->idle_timer) { in avdtp_sep_set_state()
1015 g_source_remove(stream->idle_timer); in avdtp_sep_set_state()
1016 stream->idle_timer = 0; in avdtp_sep_set_state()
1018 session->streams = g_slist_remove(session->streams, stream); in avdtp_sep_set_state()
1019 if (session->pending_open == stream) in avdtp_sep_set_state()
1021 if (session->req && session->req->stream == stream) in avdtp_sep_set_state()
1022 handle_unanswered_req(session, stream); in avdtp_sep_set_state()
1024 cleanup_queue(session, stream); in avdtp_sep_set_state()
1025 stream_free(stream); in avdtp_sep_set_state()
1051 static void release_stream(struct avdtp_stream *stream, struct avdtp *session) in release_stream() argument
1053 struct avdtp_local_sep *sep = stream->lsep; in release_stream()
1057 stream->abort_int)) in release_stream()
1058 sep->cfm->abort(session, sep, stream, NULL, sep->user_data); in release_stream()
1350 struct avdtp_stream *stream; in avdtp_setconf_cmd() local
1367 if (sep->stream) { in avdtp_setconf_cmd()
1396 stream = g_new0(struct avdtp_stream, 1); in avdtp_setconf_cmd()
1397 stream->session = session; in avdtp_setconf_cmd()
1398 stream->lsep = sep; in avdtp_setconf_cmd()
1399 stream->rseid = req->int_seid; in avdtp_setconf_cmd()
1400 stream->caps = caps_to_list(req->caps, in avdtp_setconf_cmd()
1402 &stream->codec, in avdtp_setconf_cmd()
1403 &stream->delay_reporting); in avdtp_setconf_cmd()
1406 for (l = stream->caps; l != NULL; l = g_slist_next(l)) { in avdtp_setconf_cmd()
1415 if (stream->delay_reporting && session->version < 0x0103) in avdtp_setconf_cmd()
1419 if (!sep->ind->set_configuration(session, sep, stream, in avdtp_setconf_cmd()
1420 stream->caps, &err, in avdtp_setconf_cmd()
1428 stream_free(stream); in avdtp_setconf_cmd()
1432 sep->stream = stream; in avdtp_setconf_cmd()
1434 session->streams = g_slist_append(session->streams, stream); in avdtp_setconf_cmd()
1441 stream_free(stream); in avdtp_setconf_cmd()
1471 if (!sep->stream || !sep->stream->caps) { in avdtp_getconf_cmd()
1476 for (l = sep->stream->caps, rsp_size = 0; l != NULL; l = g_slist_next(l)) { in avdtp_getconf_cmd()
1505 struct avdtp_stream *stream; in avdtp_open_cmd() local
1524 stream = sep->stream; in avdtp_open_cmd()
1527 if (!sep->ind->open(session, sep, stream, &err, in avdtp_open_cmd()
1536 stream->open_acp = TRUE; in avdtp_open_cmd()
1537 session->pending_open = stream; in avdtp_open_cmd()
1538 stream->timer = g_timeout_add_seconds(REQ_TIMEOUT, in avdtp_open_cmd()
1540 stream); in avdtp_open_cmd()
1553 struct avdtp_stream *stream; in avdtp_start_cmd() local
1573 if (!sep || !sep->stream) { in avdtp_start_cmd()
1578 stream = sep->stream; in avdtp_start_cmd()
1586 if (!sep->ind->start(session, sep, stream, &err, in avdtp_start_cmd()
1609 struct avdtp_stream *stream; in avdtp_close_cmd() local
1618 if (!sep || !sep->stream) { in avdtp_close_cmd()
1629 stream = sep->stream; in avdtp_close_cmd()
1632 if (!sep->ind->close(session, sep, stream, &err, in avdtp_close_cmd()
1643 stream->timer = g_timeout_add_seconds(REQ_TIMEOUT, in avdtp_close_cmd()
1645 stream); in avdtp_close_cmd()
1658 struct avdtp_stream *stream; in avdtp_suspend_cmd() local
1678 if (!sep || !sep->stream) { in avdtp_suspend_cmd()
1683 stream = sep->stream; in avdtp_suspend_cmd()
1691 if (!sep->ind->suspend(session, sep, stream, &err, in avdtp_suspend_cmd()
1723 if (!sep || !sep->stream) { in avdtp_abort_cmd()
1729 if (!sep->ind->abort(session, sep, sep->stream, &err, in avdtp_abort_cmd()
1758 struct avdtp_stream *stream; in avdtp_delayreport_cmd() local
1767 if (!sep || !sep->stream) { in avdtp_delayreport_cmd()
1772 stream = sep->stream; in avdtp_delayreport_cmd()
1780 stream->delay = ntohs(req->delay); in avdtp_delayreport_cmd()
1783 if (!sep->ind->delayreport(session, sep, stream->rseid, in avdtp_delayreport_cmd()
1784 stream->delay, &err, in avdtp_delayreport_cmd()
2047 if (!avdtp_parse_resp(session, session->req->stream, in session_cb()
2057 if (!avdtp_parse_rej(session, session->req->stream, in session_cb()
2260 struct avdtp_stream *stream = session->pending_open; in avdtp_connect_cb() local
2264 if (avdtp_abort(session, stream) < 0) in avdtp_connect_cb()
2265 avdtp_sep_set_state(session, stream->lsep, in avdtp_connect_cb()
2419 struct avdtp_stream *stream; in cancel_request() local
2430 stream = find_stream_by_rseid(session, seid); in cancel_request()
2432 stream = NULL; in cancel_request()
2434 if (stream) { in cancel_request()
2435 stream->abort_int = TRUE; in cancel_request()
2436 lsep = stream->lsep; in cancel_request()
2444 lsep->cfm->reconfigure(session, lsep, stream, &averr, in cancel_request()
2450 lsep->cfm->open(session, lsep, stream, &averr, in cancel_request()
2456 lsep->cfm->start(session, lsep, stream, &averr, in cancel_request()
2462 lsep->cfm->suspend(session, lsep, stream, &averr, in cancel_request()
2468 lsep->cfm->close(session, lsep, stream, &averr, in cancel_request()
2470 if (stream) in cancel_request()
2471 stream->close_int = FALSE; in cancel_request()
2477 lsep->cfm->set_configuration(session, lsep, stream, in cancel_request()
2491 if (!stream) in cancel_request()
2497 err = send_request(session, TRUE, stream, AVDTP_ABORT, &sreq, in cancel_request()
2568 struct avdtp_stream *stream, uint8_t signal_id, in send_request() argument
2573 if (stream && stream->abort_int && signal_id != AVDTP_ABORT) in send_request()
2581 req->stream = stream; in send_request()
2601 struct avdtp_stream *stream; in avdtp_discover_resp() local
2609 stream = find_stream_by_rseid(session, resp->seps[i].seid); in avdtp_discover_resp()
2613 if (resp->seps[i].inuse && !stream) in avdtp_discover_resp()
2619 sep->stream = stream; in avdtp_discover_resp()
2679 struct avdtp_stream *stream, in avdtp_set_configuration_resp() argument
2683 struct avdtp_local_sep *sep = stream->lsep; in avdtp_set_configuration_resp()
2686 sep->cfm->set_configuration(session, sep, stream, NULL, in avdtp_set_configuration_resp()
2695 struct avdtp_stream *stream, in avdtp_reconfigure_resp() argument
2701 static gboolean avdtp_open_resp(struct avdtp *session, struct avdtp_stream *stream, in avdtp_open_resp() argument
2704 struct avdtp_local_sep *sep = stream->lsep; in avdtp_open_resp()
2711 session->pending_open = stream; in avdtp_open_resp()
2717 struct avdtp_stream *stream, in avdtp_start_resp() argument
2720 struct avdtp_local_sep *sep = stream->lsep; in avdtp_start_resp()
2723 sep->cfm->start(session, sep, stream, NULL, sep->user_data); in avdtp_start_resp()
2734 struct avdtp_stream *stream, in avdtp_close_resp() argument
2737 struct avdtp_local_sep *sep = stream->lsep; in avdtp_close_resp()
2741 close_stream(stream); in avdtp_close_resp()
2747 struct avdtp_stream *stream, in avdtp_suspend_resp() argument
2750 struct avdtp_local_sep *sep = stream->lsep; in avdtp_suspend_resp()
2755 sep->cfm->suspend(session, sep, stream, NULL, sep->user_data); in avdtp_suspend_resp()
2761 struct avdtp_stream *stream, in avdtp_abort_resp() argument
2764 struct avdtp_local_sep *sep = stream->lsep; in avdtp_abort_resp()
2769 sep->cfm->abort(session, sep, stream, NULL, sep->user_data); in avdtp_abort_resp()
2777 struct avdtp_stream *stream, in avdtp_delay_report_resp() argument
2780 struct avdtp_local_sep *sep = stream->lsep; in avdtp_delay_report_resp()
2783 sep->cfm->delay_report(session, sep, stream, NULL, sep->user_data); in avdtp_delay_report_resp()
2789 struct avdtp_stream *stream, in avdtp_parse_resp() argument
2821 if (!stream) { in avdtp_parse_resp()
2829 return avdtp_set_configuration_resp(session, stream, in avdtp_parse_resp()
2833 return avdtp_reconfigure_resp(session, stream, buf, size); in avdtp_parse_resp()
2836 return avdtp_open_resp(session, stream, buf, size); in avdtp_parse_resp()
2839 return avdtp_suspend_resp(session, stream, buf, size); in avdtp_parse_resp()
2842 return avdtp_start_resp(session, stream, buf, size); in avdtp_parse_resp()
2845 return avdtp_close_resp(session, stream, buf, size); in avdtp_parse_resp()
2848 return avdtp_abort_resp(session, stream, buf, size); in avdtp_parse_resp()
2851 return avdtp_delay_report_resp(session, stream, buf, size); in avdtp_parse_resp()
2905 struct avdtp_stream *stream, in avdtp_parse_rej() argument
2911 struct avdtp_local_sep *sep = stream ? stream->lsep : NULL; in avdtp_parse_rej()
2933 sep->cfm->open(session, sep, stream, &err, in avdtp_parse_rej()
2942 sep->cfm->set_configuration(session, sep, stream, in avdtp_parse_rej()
2951 sep->cfm->reconfigure(session, sep, stream, &err, in avdtp_parse_rej()
2960 sep->cfm->start(session, sep, stream, &err, in avdtp_parse_rej()
2969 sep->cfm->suspend(session, sep, stream, &err, in avdtp_parse_rej()
2978 sep->cfm->close(session, sep, stream, &err, in avdtp_parse_rej()
2980 stream->close_int = FALSE; in avdtp_parse_rej()
2989 sep->cfm->abort(session, sep, stream, &err, in avdtp_parse_rej()
2998 sep->cfm->delay_report(session, sep, stream, &err, in avdtp_parse_rej()
3027 struct avdtp_stream *stream) in avdtp_stream_get_codec() argument
3031 for (l = stream->caps; l; l = l->next) { in avdtp_stream_get_codec()
3041 gboolean avdtp_stream_has_capability(struct avdtp_stream *stream, in avdtp_stream_has_capability() argument
3047 for (l = stream->caps; l; l = g_slist_next(l)) { in avdtp_stream_has_capability()
3061 gboolean avdtp_stream_has_capabilities(struct avdtp_stream *stream, in avdtp_stream_has_capabilities() argument
3069 if (!avdtp_stream_has_capability(stream, cap)) in avdtp_stream_has_capabilities()
3076 gboolean avdtp_stream_get_transport(struct avdtp_stream *stream, int *sock, in avdtp_stream_get_transport() argument
3080 if (stream->io == NULL) in avdtp_stream_get_transport()
3084 *sock = g_io_channel_unix_get_fd(stream->io); in avdtp_stream_get_transport()
3087 *omtu = stream->omtu; in avdtp_stream_get_transport()
3090 *imtu = stream->imtu; in avdtp_stream_get_transport()
3093 *caps = stream->caps; in avdtp_stream_get_transport()
3159 return sep->stream; in avdtp_get_stream()
3245 if (!sep->stream) { in avdtp_get_seps()
3255 struct avdtp_stream *stream, in avdtp_stream_remove_cb() argument
3261 if (!stream) in avdtp_stream_remove_cb()
3264 for (cb = NULL, l = stream->callbacks; l != NULL; l = l->next) { in avdtp_stream_remove_cb()
3275 stream->callbacks = g_slist_remove(stream->callbacks, cb); in avdtp_stream_remove_cb()
3282 struct avdtp_stream *stream, in avdtp_stream_add_cb() argument
3293 stream->callbacks = g_slist_append(stream->callbacks, stream_cb);; in avdtp_stream_add_cb()
3298 int avdtp_get_configuration(struct avdtp *session, struct avdtp_stream *stream) in avdtp_get_configuration() argument
3306 req.acp_seid = stream->rseid; in avdtp_get_configuration()
3308 return send_request(session, FALSE, stream, AVDTP_GET_CONFIGURATION, in avdtp_get_configuration()
3328 struct avdtp_stream **stream) in avdtp_set_configuration() argument
3381 lsep->stream = new_stream; in avdtp_set_configuration()
3382 rsep->stream = new_stream; in avdtp_set_configuration()
3384 if (stream) in avdtp_set_configuration()
3385 *stream = new_stream; in avdtp_set_configuration()
3394 struct avdtp_stream *stream) in avdtp_reconfigure() argument
3402 if (!g_slist_find(session->streams, stream)) in avdtp_reconfigure()
3405 if (stream->lsep->state != AVDTP_STATE_OPEN) in avdtp_reconfigure()
3416 req->acp_seid = stream->rseid; in avdtp_reconfigure()
3425 err = send_request(session, FALSE, stream, AVDTP_RECONFIGURE, req, in avdtp_reconfigure()
3432 int avdtp_open(struct avdtp *session, struct avdtp_stream *stream) in avdtp_open() argument
3436 if (!g_slist_find(session->streams, stream)) in avdtp_open()
3439 if (stream->lsep->state > AVDTP_STATE_CONFIGURED) in avdtp_open()
3443 req.acp_seid = stream->rseid; in avdtp_open()
3445 return send_request(session, FALSE, stream, AVDTP_OPEN, in avdtp_open()
3449 int avdtp_start(struct avdtp *session, struct avdtp_stream *stream) in avdtp_start() argument
3453 if (!g_slist_find(session->streams, stream)) in avdtp_start()
3456 if (stream->lsep->state != AVDTP_STATE_OPEN) in avdtp_start()
3459 if (stream->close_int == TRUE) { in avdtp_start()
3465 req.first_seid.seid = stream->rseid; in avdtp_start()
3467 return send_request(session, FALSE, stream, AVDTP_START, in avdtp_start()
3471 int avdtp_close(struct avdtp *session, struct avdtp_stream *stream, in avdtp_close() argument
3477 if (!g_slist_find(session->streams, stream)) in avdtp_close()
3480 if (stream->lsep->state < AVDTP_STATE_OPEN) in avdtp_close()
3483 if (stream->close_int == TRUE) { in avdtp_close()
3488 if (immediate && session->req && stream == session->req->stream) in avdtp_close()
3489 return avdtp_abort(session, stream); in avdtp_close()
3492 req.acp_seid = stream->rseid; in avdtp_close()
3494 ret = send_request(session, FALSE, stream, AVDTP_CLOSE, in avdtp_close()
3497 stream->close_int = TRUE; in avdtp_close()
3502 int avdtp_suspend(struct avdtp *session, struct avdtp_stream *stream) in avdtp_suspend() argument
3506 if (!g_slist_find(session->streams, stream)) in avdtp_suspend()
3509 if (stream->lsep->state <= AVDTP_STATE_OPEN || stream->close_int) in avdtp_suspend()
3513 req.acp_seid = stream->rseid; in avdtp_suspend()
3515 return send_request(session, FALSE, stream, AVDTP_SUSPEND, in avdtp_suspend()
3519 int avdtp_abort(struct avdtp *session, struct avdtp_stream *stream) in avdtp_abort() argument
3524 if (!g_slist_find(session->streams, stream)) in avdtp_abort()
3527 if (stream->lsep->state == AVDTP_STATE_IDLE || in avdtp_abort()
3528 stream->lsep->state == AVDTP_STATE_ABORTING) in avdtp_abort()
3531 if (session->req && stream == session->req->stream) in avdtp_abort()
3535 req.acp_seid = stream->rseid; in avdtp_abort()
3537 ret = send_request(session, TRUE, stream, AVDTP_ABORT, in avdtp_abort()
3540 stream->abort_int = TRUE; in avdtp_abort()
3545 int avdtp_delay_report(struct avdtp *session, struct avdtp_stream *stream, in avdtp_delay_report() argument
3550 if (!g_slist_find(session->streams, stream)) in avdtp_delay_report()
3553 if (stream->lsep->state != AVDTP_STATE_CONFIGURED && in avdtp_delay_report()
3554 stream->lsep->state != AVDTP_STATE_STREAMING) in avdtp_delay_report()
3557 if (!stream->delay_reporting || session->version < 0x0103 || in avdtp_delay_report()
3561 stream->delay = delay; in avdtp_delay_report()
3564 req.acp_seid = stream->rseid; in avdtp_delay_report()
3567 return send_request(session, TRUE, stream, AVDTP_DELAY_REPORT, in avdtp_delay_report()
3619 if (sep->stream) in avdtp_unregister_sep()
3620 release_stream(sep->stream, sep->stream->session); in avdtp_unregister_sep()
3778 gboolean avdtp_has_stream(struct avdtp *session, struct avdtp_stream *stream) in avdtp_has_stream() argument
3780 return g_slist_find(session->streams, stream) ? TRUE : FALSE; in avdtp_has_stream()