[FFmpeg-devel] Libavnet
Michael Niedermayer
michaelni
Fri Nov 23 14:29:37 CET 2007
On Fri, Nov 23, 2007 at 11:01:53AM +0100, Luca Abeni wrote:
> Hi all,
>
> I attach the latest version of the patch for creating libavnet.
> This is slightly more complex than the last version I posted,
> because I had to split os_support.h in two parts (os_support.h
> provides seek functionalities on some systems, so it cannot be
> entirely removed from libavformat.
>
> So, I split a net_support.h file, which is copied in libavnet.
> As a result, I also renamed os_support.c in net_support.c.
> This seems to work well on Linux.
>
> I also re-introduced the EXTRALIBS in the makefile, because they
> seem to be needed on windows.
>
>
> Thanks,
> Luca
[Makefile / configure]
not maintained nor reviewed by me
[...]
[...]
> Index: ffmpeg/ffserver.c
> ===================================================================
> --- ffmpeg.orig/ffserver.c 2007-11-23 09:13:58.000000000 +0100
> +++ ffmpeg/ffserver.c 2007-11-23 09:47:42.000000000 +0100
> @@ -26,6 +26,7 @@
> #include <string.h>
> #include <stdlib.h>
> #include "avformat.h"
> +#include "avnet.h"
> #include "rtsp.h"
> #include "rtp.h"
>
> @@ -4358,6 +4359,7 @@
> struct sigaction sigact;
>
> av_register_all();
> + avnet_register_all();
>
> show_banner(program_name, program_birth_year);
isnt a avdevice_register_all() missing here?
[...]
> Index: ffmpeg/libavnet/avnet.h
> ===================================================================
> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ ffmpeg/libavnet/avnet.h 2007-11-23 09:47:42.000000000 +0100
> @@ -0,0 +1,49 @@
> +/*
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#ifndef FFMPEG_AVNET_H
> +#define FFMPEG_AVNET_H
> +
> +#define LIBAVNET_VERSION_INT ((52<<16)+(0<<8)+0)
> +#define LIBAVNET_VERSION 52.0.0
> +#define LIBAVNET_BUILD LIBAVNET_VERSION_INT
> +
> +/**
> + * Generate an SDP for an RTP session.
> + *
> + * @param ac array of AVFormatContexts describing the RTP streams. If the
> + * array is composed by only one context, such context can contain
> + * multiple AVStreams (one AVStream per RTP stream). Otherwise,
> + * all the contexts in the array (an AVCodecContext per RTP stream)
> + * must contain only one AVStream
> + * @param n_files number of AVCodecContexts contained in ac
> + * @param buff buffer where the SDP will be stored (must be allocated by
> + * the caller
> + * @param size the size of the buffer
> + * @return 0 if OK. AVERROR_xxx if error.
> + */
> +int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size);
> +
> +/**
> + * Initialize libavnet and register all the (de)muxers and protocols.
> + * @warning This function is not thread safe.
> + */
> +void avnet_register_all(void);
> +
> +#endif /* FFMPEG_AVNET_H */
> +
> Index: ffmpeg/libavnet/allprotocols.c
> ===================================================================
> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ ffmpeg/libavnet/allprotocols.c 2007-11-23 09:47:42.000000000 +0100
> @@ -0,0 +1,58 @@
> +/*
> + * Register all the network formats and protocols.
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +#include "avformat.h"
> +#include "rtp_internal.h"
> +
> +#define REGISTER_MUXER(X,x) { \
> + extern AVOutputFormat x##_muxer; \
> + if(ENABLE_##X##_MUXER) av_register_output_format(&x##_muxer); }
> +#define REGISTER_DEMUXER(X,x) { \
> + extern AVInputFormat x##_demuxer; \
> + if(ENABLE_##X##_DEMUXER) av_register_input_format(&x##_demuxer); }
> +#define REGISTER_MUXDEMUX(X,x) REGISTER_MUXER(X,x); REGISTER_DEMUXER(X,x)
> +#define REGISTER_PROTOCOL(X,x) { \
> + extern URLProtocol x##_protocol; \
> + if(ENABLE_##X##_PROTOCOL) register_protocol(&x##_protocol); }
> +
> +void avnet_register_all(void)
> +{
> + static int inited;
> +
> + if (inited)
> + return;
> + inited = 1;
> +
> + av_register_all();
> +
> + /* (de)muxers */
> + REGISTER_DEMUXER (REDIR, redir);
> + REGISTER_MUXER (RTP, rtp);
> + REGISTER_DEMUXER (RTSP, rtsp);
> + REGISTER_DEMUXER (SDP, sdp);
> +#ifdef CONFIG_RTP_MUXER
> + av_register_rtp_dynamic_payload_handlers();
> +#endif
> +
> + /* protocols */
> + REGISTER_PROTOCOL (HTTP, http);
> + REGISTER_PROTOCOL (RTP, rtp);
> + REGISTER_PROTOCOL (TCP, tcp);
> + REGISTER_PROTOCOL (UDP, udp);
> +}
cant review as these have not been diffed against their ancestors
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071123/281a93b6/attachment.pgp>
More information about the ffmpeg-devel
mailing list