MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / rtsp_reply_header

Function rtsp_reply_header

ffserver.c:2779–2836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2777/* RTSP handling */
2778
2779static void rtsp_reply_header(HTTPContext *c, enum RTSPStatusCode error_number)
2780{
2781 const char *str;
2782 time_t ti;
2783 char *p;
2784 char buf2[32];
2785
2786 switch(error_number) {
2787 case RTSP_STATUS_OK:
2788 str = "OK";
2789 break;
2790 case RTSP_STATUS_METHOD:
2791 str = "Method Not Allowed";
2792 break;
2793 case RTSP_STATUS_BANDWIDTH:
2794 str = "Not Enough Bandwidth";
2795 break;
2796 case RTSP_STATUS_SESSION:
2797 str = "Session Not Found";
2798 break;
2799 case RTSP_STATUS_STATE:
2800 str = "Method Not Valid in This State";
2801 break;
2802 case RTSP_STATUS_AGGREGATE:
2803 str = "Aggregate operation not allowed";
2804 break;
2805 case RTSP_STATUS_ONLY_AGGREGATE:
2806 str = "Only aggregate operation allowed";
2807 break;
2808 case RTSP_STATUS_TRANSPORT:
2809 str = "Unsupported transport";
2810 break;
2811 case RTSP_STATUS_INTERNAL:
2812 str = "Internal Server Error";
2813 break;
2814 case RTSP_STATUS_SERVICE:
2815 str = "Service Unavailable";
2816 break;
2817 case RTSP_STATUS_VERSION:
2818 str = "RTSP Version not supported";
2819 break;
2820 default:
2821 str = "Unknown Error";
2822 break;
2823 }
2824
2825 url_fprintf(c->pb, "RTSP/1.0 %d %s\r\n", error_number, str);
2826 url_fprintf(c->pb, "CSeq: %d\r\n", c->seq);
2827
2828 /* output GMT time */
2829 ti = time(NULL);
2830 p = ctime(&ti);
2831 strcpy(buf2, p);
2832 p = buf2 + strlen(p) - 1;
2833 if (*p == '\n')
2834 *p = '\0';
2835 url_fprintf(c->pb, "Date: %s GMT\r\n", buf2);
2836}

Callers 6

rtsp_reply_errorFunction · 0.85
rtsp_cmd_describeFunction · 0.85
rtsp_cmd_setupFunction · 0.85
rtsp_cmd_playFunction · 0.85
rtsp_cmd_pauseFunction · 0.85
rtsp_cmd_teardownFunction · 0.85

Calls 1

url_fprintfFunction · 0.85

Tested by

no test coverage detected