[FFmpeg-devel] [RFC] avformat: access AVFormatContext.filename[] filed via getter/setter.

Zhang Rui bbcallen at gmail.com
Mon Sep 14 11:54:16 CEST 2015


2015-09-14 17:48 GMT+08:00 Zhang Rui <bbcallen at gmail.com>:
> URLs longer than 1024 could be truncated by AVFormatContext.
> The field filename[1024] should be replaced with allocated string in future.

I'd like to know if this API-change could happen, since it will break
many things.

And there is one direct usage of filename left in libavformat/rtspenc.c
which I'm not quite sure how to modify

    /* We create the SDP based on the RTSP AVFormatContext where we
     * aren't allowed to change the filename field. (We create the SDP
     * based on the RTSP context since the contexts for the RTP streams
     * don't exist yet.) In order to specify a custom URL with the actual
     * peer IP instead of the originally specified hostname, we create
     * a temporary copy of the AVFormatContext, where the custom URL is set.
     *
     * FIXME: Create the SDP without copying the AVFormatContext.
     * This either requires setting up the RTP stream AVFormatContexts
     * already here (complicating things immensely) or getting a more
     * flexible SDP creation interface.
     */
    sdp_ctx = *s;
    ff_url_join(sdp_ctx.filename, sizeof(sdp_ctx.filename),
                "rtsp", NULL, addr, -1, NULL);

If the API-change could happen, I will take more investigation into this.

> ---
>  ffmpeg.c                         |  8 +++----
>  ffmpeg_opt.c                     |  8 +++----
>  ffplay.c                         | 20 +++++++++---------
>  ffprobe.c                        |  2 +-
>  ffserver.c                       | 20 +++++++++++-------
>  libavdevice/avfoundation.m       |  2 +-
>  libavdevice/lavfi.c              |  2 +-
>  libavdevice/qtkit.m              |  8 +++----
>  libavdevice/sdl.c                |  2 +-
>  libavformat/avformat.h           |  9 +++++---
>  libavformat/concatdec.c          |  4 ++--
>  libavformat/dashenc.c            | 12 +++++------
>  libavformat/gxfenc.c             |  4 ++--
>  libavformat/hdsenc.c             | 24 ++++++++++-----------
>  libavformat/hls.c                |  2 +-
>  libavformat/hlsenc.c             | 45 +++++++++++++++++++++-------------------
>  libavformat/img2dec.c            |  4 ++--
>  libavformat/img2enc.c            |  4 ++--
>  libavformat/matroskadec.c        |  4 ++--
>  libavformat/mlvdec.c             |  4 ++--
>  libavformat/mov.c                |  2 +-
>  libavformat/movenc.c             | 10 ++++-----
>  libavformat/mpeg.c               |  4 ++--
>  libavformat/mpegtsenc.c          |  2 +-
>  libavformat/mux.c                |  2 +-
>  libavformat/nsvdec.c             |  2 +-
>  libavformat/rtsp.c               | 10 ++++-----
>  libavformat/rtspdec.c            |  4 ++--
>  libavformat/sapdec.c             |  2 +-
>  libavformat/sapenc.c             |  4 ++--
>  libavformat/sdp.c                |  4 ++--
>  libavformat/segment.c            | 36 ++++++++++++++++++--------------
>  libavformat/smoothstreamingenc.c | 12 +++++------
>  libavformat/tee.c                |  6 +++---
>  libavformat/utils.c              | 17 +++++++++++++--
>  libavformat/webm_chunk.c         | 12 ++++++-----
>  36 files changed, 174 insertions(+), 143 deletions(-)


More information about the ffmpeg-devel mailing list