You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.7KB

  1. /*
  2. * Microsoft RTP/ASF support.
  3. * Copyright (c) 2008 Ronald S. Bultje
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. /**
  22. * @file libavformat/rtp_asf.c
  23. * @brief Microsoft RTP/ASF support
  24. * @author Ronald S. Bultje <rbultje@ronald.bitfreak.net>
  25. */
  26. #include <libavutil/base64.h>
  27. #include <libavutil/avstring.h>
  28. #include "rtp_asf.h"
  29. #include "rtsp.h"
  30. #include "asf.h"
  31. void ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
  32. {
  33. if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {
  34. ByteIOContext pb;
  35. RTSPState *rt = s->priv_data;
  36. int len = strlen(p) * 6 / 8;
  37. char *buf = av_mallocz(len);
  38. av_base64_decode(buf, p, len);
  39. init_put_byte(&pb, buf, len, 0, NULL, NULL, NULL, NULL);
  40. if (rt->asf_ctx) {
  41. av_close_input_stream(rt->asf_ctx);
  42. rt->asf_ctx = NULL;
  43. }
  44. av_open_input_stream(&rt->asf_ctx, &pb, "", &asf_demuxer, NULL);
  45. av_free(buf);
  46. rt->asf_ctx->pb = NULL;
  47. }
  48. }