google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.02k forks source link

RTSP message why not include 'accept' #10919

Closed goddoro closed 3 months ago

goddoro commented 1 year ago

When using DESCRIBE method, if the protocol message doesn't include 'Accept' data, exoplayer can't get server response. How can I add 'Accept: application/sdp​' data when using "DESCRIBE" method? or should I fix RTSP server feature?

image
claincly commented 1 year ago

Hmmm we should actually send Accept: application/sdp in there. You can quickly change the line method sendDescribeRequest in RtspClient to incorporate the Accept tag.

https://github.com/google/ExoPlayer/blob/3a654c1f54e19f261e717282fe42168b38d7e96c/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/RtspClient.java#L364

    public void sendDescribeRequest(Uri uri, @Nullable String sessionId) {
      sendRequest(
          getRequestWithCommonHeaders(
              METHOD_DESCRIBE, sessionId, /* additionalHeaders= */ ImmutableMap.of(
                  RtspHeaders.ACCEPT, "application/sdp"
              ), uri));
    }
mk868 commented 3 months ago

Hi @claincly ,

Fortunately, I found this issue, I'm currently facing a similar problem. The camera I'm using doesn't respond to a DESCRIBE request when the Accept header is missing. I applied the changes you proposed in https://github.com/google/ExoPlayer/issues/10919#issuecomment-1380439854 - and it started working.

Do you think the Accept: application/sdp header can be sent by default for a DESCRIBE request? If so what would be the next steps in fixing this problem? should I just create a PR in androidx/media repo?

claincly commented 3 months ago

Hey @mk868 we added it (as you can see from the commit), thanks for reaching out. I'll close the issue now

mk868 commented 3 months ago

Thank you!