Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Paul Orlyk <paul.orlyk@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avformat/rtsp: Fix server compatibility issues with rtspclientsink GStreamer plugin
Date: Wed, 3 Jan 2024 14:51:36 +0200
Message-ID: <b7af2f51-78eb-4e21-bf46-1ba85f405dac@gmail.com> (raw)
In-Reply-To: <20231228193329.GV6420@pb2>

[-- Attachment #1: Type: text/plain, Size: 1629 bytes --]

On 12/28/23 21:33, Michael Niedermayer wrote:
> On Wed, Dec 27, 2023 at 03:44:09PM +0200, Paul Orlyk wrote:
>> mode field in Transport header can be sent in upper case so make string
>> comparison case insensitive.
>> Also, GStreamer expects to see mode=record instead of mode=receive in
>> Transport header in response.
>>
>> Signed-off-by: Paul Orlyk<paul.orlyk@gmail.com>
>> ---
>>   libavformat/rtsp.c    | 4 ++--
>>   libavformat/rtspdec.c | 4 ++--
>>   2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
>> index 583f5338e8..61e24a5c7a 100644
>> --- a/libavformat/rtsp.c
>> +++ b/libavformat/rtsp.c
>> @@ -1012,8 +1012,8 @@ static void rtsp_parse_transport(AVFormatContext *s,
>>                   if (*p == '=') {
>>                       p++;
>>                       get_word_sep(buf, sizeof(buf), ";, ", &p);
>> -                    if (!strcmp(buf, "record") ||
>> -                        !strcmp(buf, "receive"))
>> +                    if (!av_strcasecmp(buf, "record") ||
>> +                        !av_strcasecmp(buf, "receive"))
>>                           th->mode_record = 1;
>>                   }
>>               }
>> diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
>> index 39fd92fb66..d6a223cbc6 100644
>> --- a/libavformat/rtspdec.c
>> +++ b/libavformat/rtspdec.c
>> @@ -303,7 +303,7 @@ static int rtsp_read_setup(AVFormatContext*s, char*
>> host, char *controlurl)
>>           rtsp_st->interleaved_min = request.transports[0].interleaved_min;
> patch is damaged by linebreaks
> 
> 
> [...]


Sorry for that. Please find it attached.

[-- Attachment #2: 0001-avformat-rtsp-Fix-server-compatibility-issues-with-r.patch --]
[-- Type: text/x-patch, Size: 2579 bytes --]

From 156ceeded6cd076b781205adc034144186a9a7ea Mon Sep 17 00:00:00 2001
From: Paul Orlyk <paul.orlyk@gmail.com>
Date: Wed, 27 Dec 2023 15:30:20 +0200
Subject: [PATCH] avformat/rtsp: Fix server compatibility issues with
 rtspclientsink GStreamer plugin

mode field in Transport header can be sent in upper case so make string comparison case insensitive.
Also, GStreamer expects to see mode=record instead of mode=receive in Transport header in response.

Signed-off-by: Paul Orlyk <paul.orlyk@gmail.com>
---
 libavformat/rtsp.c    | 4 ++--
 libavformat/rtspdec.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 583f5338e8..61e24a5c7a 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1012,8 +1012,8 @@ static void rtsp_parse_transport(AVFormatContext *s,
                 if (*p == '=') {
                     p++;
                     get_word_sep(buf, sizeof(buf), ";, ", &p);
-                    if (!strcmp(buf, "record") ||
-                        !strcmp(buf, "receive"))
+                    if (!av_strcasecmp(buf, "record") ||
+                        !av_strcasecmp(buf, "receive"))
                         th->mode_record = 1;
                 }
             }
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 39fd92fb66..d6a223cbc6 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -303,7 +303,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, char *controlurl)
         rtsp_st->interleaved_min = request.transports[0].interleaved_min;
         rtsp_st->interleaved_max = request.transports[0].interleaved_max;
         snprintf(responseheaders, sizeof(responseheaders), "Transport: "
-                 "RTP/AVP/TCP;unicast;mode=receive;interleaved=%d-%d"
+                 "RTP/AVP/TCP;unicast;mode=record;interleaved=%d-%d"
                  "\r\n", request.transports[0].interleaved_min,
                  request.transports[0].interleaved_max);
     } else {
@@ -333,7 +333,7 @@ static int rtsp_read_setup(AVFormatContext *s, char* host, char *controlurl)
 
         localport = ff_rtp_get_local_rtp_port(rtsp_st->rtp_handle);
         snprintf(responseheaders, sizeof(responseheaders), "Transport: "
-                 "RTP/AVP/UDP;unicast;mode=receive;source=%s;"
+                 "RTP/AVP/UDP;unicast;mode=record;source=%s;"
                  "client_port=%d-%d;server_port=%d-%d\r\n",
                  host, request.transports[0].client_port_min,
                  request.transports[0].client_port_max, localport,
-- 
2.39.2


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2024-01-03 12:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-27 13:44 Paul Orlyk
2023-12-28 19:33 ` Michael Niedermayer
2024-01-03 12:51   ` Paul Orlyk [this message]
2024-01-10 17:57     ` Paul Orlyk
2024-01-12 19:07     ` Michael Niedermayer
2024-01-12 20:46       ` Paul Orlyk
2024-01-13 18:22         ` Michael Niedermayer
2024-01-15 20:37           ` [FFmpeg-devel] [PATCH v2 1/2] avformat/rtsp: Support mode field of Transport header being sent in upper case Paul Orlyk
2024-01-16  0:05             ` Michael Niedermayer
2024-01-15 20:37           ` [FFmpeg-devel] [PATCH v2 2/2] avformat/rtsp: Send mode=record instead of mode=receive in Transport header Paul Orlyk
2024-01-16  0:20             ` Michael Niedermayer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7af2f51-78eb-4e21-bf46-1ba85f405dac@gmail.com \
    --to=paul.orlyk@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git