On Thu, 29 Jul 2010, Martin Storsjö wrote:
> On Thu, 29 Jul 2010, Ronald S. Bultje wrote:
>
> > On Jul 29, 2010, at 7:49 AM, Martin Storsjö <[email protected]> wrote:
> > >
> > > So I think it would be worthwhile. What do you think, Luca B and
> > > Ronald?
> > > Where should we put them - rtpdec.h?
> >
> > Sounds good to me, although I'd create a fresh .h-file for all decls.
> > Maybe rtpdec_depacketizers.h?
>
> Initial patch doing this attached. The key point of the patch:
>
> 16 files changed, 47 insertions(+), 247 deletions(-)
Updated patch attached, that also removes rtpdec_asf.h and moves the
function declaration into the common header. The diffstat is now:
19 files changed, 58 insertions(+), 292 deletions(-)
Ronald and Luca, please finish the discussion on the naming of the file,
so that we can get this applied. :-)
The arguments currenly stand:
- Not in rtpdec.h, to keep it separate and not clutter the generic file
- rtpdec_depacketizers.h is quite a long name...
// Martin
From eee19df6470c88fdac862bb823a33a8275efd28a Mon Sep 17 00:00:00 2001
From: Martin Storsjo <[email protected]>
Date: Mon, 19 Jul 2010 22:14:15 +0300
Subject: [PATCH] Remove mostly unnecessary rtpdec_*.h that only declare extern structs
---
libavformat/rtpdec.c | 9 +------
libavformat/rtpdec_amr.c | 2 +-
libavformat/rtpdec_amr.h | 30 ----------------------
libavformat/rtpdec_asf.c | 2 +-
libavformat/rtpdec_asf.h | 42 -------------------------------
libavformat/rtpdec_depacketizers.h | 48 ++++++++++++++++++++++++++++++++++++
libavformat/rtpdec_h263.c | 2 +-
libavformat/rtpdec_h263.h | 30 ----------------------
libavformat/rtpdec_h264.c | 2 +-
libavformat/rtpdec_h264.h | 29 ---------------------
libavformat/rtpdec_mpeg4.c | 2 +-
libavformat/rtpdec_mpeg4.h | 39 -----------------------------
libavformat/rtpdec_qdm2.c | 2 +-
libavformat/rtpdec_qdm2.h | 32 ------------------------
libavformat/rtpdec_svq3.c | 2 +-
libavformat/rtpdec_svq3.h | 33 ------------------------
libavformat/rtpdec_xiph.c | 2 +-
libavformat/rtpdec_xiph.h | 40 ------------------------------
libavformat/rtsp.c | 2 +-
19 files changed, 58 insertions(+), 292 deletions(-)
delete mode 100644 libavformat/rtpdec_amr.h
delete mode 100644 libavformat/rtpdec_asf.h
create mode 100644 libavformat/rtpdec_depacketizers.h
delete mode 100644 libavformat/rtpdec_h263.h
delete mode 100644 libavformat/rtpdec_h264.h
delete mode 100644 libavformat/rtpdec_mpeg4.h
delete mode 100644 libavformat/rtpdec_qdm2.h
delete mode 100644 libavformat/rtpdec_svq3.h
delete mode 100644 libavformat/rtpdec_xiph.h
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 0e2aebb..c0b88ee 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -30,14 +30,7 @@
#include "network.h"
#include "rtpdec.h"
-#include "rtpdec_amr.h"
-#include "rtpdec_asf.h"
-#include "rtpdec_h263.h"
-#include "rtpdec_h264.h"
-#include "rtpdec_mpeg4.h"
-#include "rtpdec_qdm2.h"
-#include "rtpdec_svq3.h"
-#include "rtpdec_xiph.h"
+#include "rtpdec_depacketizers.h"
//#define DEBUG
diff --git a/libavformat/rtpdec_amr.c b/libavformat/rtpdec_amr.c
index 737b411..a9fcbab 100644
--- a/libavformat/rtpdec_amr.c
+++ b/libavformat/rtpdec_amr.c
@@ -20,7 +20,7 @@
*/
#include "avformat.h"
-#include "rtpdec_amr.h"
+#include "rtpdec_depacketizers.h"
#include "libavutil/avstring.h"
static const uint8_t frame_sizes_nb[16] = {
diff --git a/libavformat/rtpdec_amr.h b/libavformat/rtpdec_amr.h
deleted file mode 100644
index 3cd9dd1..0000000
--- a/libavformat/rtpdec_amr.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * RTP AMR Depacketizer, RFC 3267
- * Copyright (c) 2010 Martin Storsjo
- *
- * 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 AVFORMAT_RTPDEC_AMR_H
-#define AVFORMAT_RTPDEC_AMR_H
-
-#include "rtpdec.h"
-
-extern RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler;
-
-#endif /* AVFORMAT_RTPDEC_AMR_H */
diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c
index d77dadf..07cce4b 100644
--- a/libavformat/rtpdec_asf.c
+++ b/libavformat/rtpdec_asf.c
@@ -29,7 +29,7 @@
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "rtp.h"
-#include "rtpdec_asf.h"
+#include "rtpdec_depacketizers.h"
#include "rtsp.h"
#include "asf.h"
diff --git a/libavformat/rtpdec_asf.h b/libavformat/rtpdec_asf.h
deleted file mode 100644
index dbd85dc..0000000
--- a/libavformat/rtpdec_asf.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Microsoft RTP/ASF support.
- * Copyright (c) 2008 Ronald S. Bultje
- *
- * 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 AVFORMAT_RTPDEC_ASF_H
-#define AVFORMAT_RTPDEC_ASF_H
-
-#include "avformat.h"
-#include "rtpdec.h"
-
-/**
- * Parse a Windows Media Server-specific SDP line
- *
- * @param s RTSP demux context
- */
-int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p);
-
-/**
- * Handlers for the x-asf-pf payloads (the payload ID for RTP/ASF).
- * Defined and implemented in rtp_asf.c, registered in rtpdec.c.
- */
-extern RTPDynamicProtocolHandler ff_ms_rtp_asf_pfv_handler,
- ff_ms_rtp_asf_pfa_handler;
-
-#endif /* AVFORMAT_RTPDEC_ASF_H */
diff --git a/libavformat/rtpdec_depacketizers.h b/libavformat/rtpdec_depacketizers.h
new file mode 100644
index 0000000..282b86b
--- /dev/null
+++ b/libavformat/rtpdec_depacketizers.h
@@ -0,0 +1,48 @@
+/*
+ * RTP depacketizer declarations
+ * Copyright (c) 2010 Martin Storsjo
+ *
+ * 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 AVFORMAT_RTPDEC_DEPACKETIZERS_H
+#define AVFORMAT_RTPDEC_DEPACKETIZERS_H
+
+#include "rtpdec.h"
+
+/**
+ * Parse a Windows Media Server-specific SDP line
+ *
+ * @param s RTSP demux context
+ */
+int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p);
+
+extern RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler;
+extern RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler;
+extern RTPDynamicProtocolHandler ff_h263_1998_dynamic_handler;
+extern RTPDynamicProtocolHandler ff_h263_2000_dynamic_handler;
+extern RTPDynamicProtocolHandler ff_h264_dynamic_handler;
+extern RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler;
+extern RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler;
+extern RTPDynamicProtocolHandler ff_ms_rtp_asf_pfa_handler;
+extern RTPDynamicProtocolHandler ff_ms_rtp_asf_pfv_handler;
+extern RTPDynamicProtocolHandler ff_qdm2_dynamic_handler;
+extern RTPDynamicProtocolHandler ff_svq3_dynamic_handler;
+extern RTPDynamicProtocolHandler ff_theora_dynamic_handler;
+extern RTPDynamicProtocolHandler ff_vorbis_dynamic_handler;
+
+#endif /* AVFORMAT_RTPDEC_DEPACKETIZERS_H */
diff --git a/libavformat/rtpdec_h263.c b/libavformat/rtpdec_h263.c
index 19de6ec..251c4a1 100644
--- a/libavformat/rtpdec_h263.c
+++ b/libavformat/rtpdec_h263.c
@@ -20,7 +20,7 @@
*/
#include "avformat.h"
-#include "rtpdec_h263.h"
+#include "rtpdec_depacketizers.h"
#include "libavutil/intreadwrite.h"
static int h263_handle_packet(AVFormatContext *ctx,
diff --git a/libavformat/rtpdec_h263.h b/libavformat/rtpdec_h263.h
deleted file mode 100644
index 5b51128..0000000
--- a/libavformat/rtpdec_h263.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * RTP H.263 Depacketizer, RFC 4629
- * Copyright (c) 2010 Martin Storsjo
- *
- * 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 AVFORMAT_RTPDEC_H263_H
-#define AVFORMAT_RTPDEC_H263_H
-
-#include "rtpdec.h"
-
-extern RTPDynamicProtocolHandler ff_h263_1998_dynamic_handler;
-extern RTPDynamicProtocolHandler ff_h263_2000_dynamic_handler;
-
-#endif /* AVFORMAT_RTPDEC_H263_H */
diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c
index 3ee0788..15231a6 100644
--- a/libavformat/rtpdec_h264.c
+++ b/libavformat/rtpdec_h264.c
@@ -47,7 +47,7 @@
#include <assert.h>
#include "rtpdec.h"
-#include "rtpdec_h264.h"
+#include "rtpdec_depacketizers.h"
/**
RTP/H264 specific private data.
diff --git a/libavformat/rtpdec_h264.h b/libavformat/rtpdec_h264.h
deleted file mode 100644
index b4d54de..0000000
--- a/libavformat/rtpdec_h264.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * RTP H264 Protocol (RFC3984)
- * Copyright (c) 2006 Ryan Martell
- *
- * 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 AVFORMAT_RTPDEC_H264_H
-#define AVFORMAT_RTPDEC_H264_H
-
-#include "rtpdec.h"
-
-extern RTPDynamicProtocolHandler ff_h264_dynamic_handler;
-
-#endif /* AVFORMAT_RTPDEC_H264_H */
diff --git a/libavformat/rtpdec_mpeg4.c b/libavformat/rtpdec_mpeg4.c
index 9512752..c7d1f15 100644
--- a/libavformat/rtpdec_mpeg4.c
+++ b/libavformat/rtpdec_mpeg4.c
@@ -27,7 +27,7 @@
* @author Romain Degez
*/
-#include "rtpdec_mpeg4.h"
+#include "rtpdec_depacketizers.h"
#include "internal.h"
#include "libavutil/avstring.h"
#include "libavcodec/get_bits.h"
diff --git a/libavformat/rtpdec_mpeg4.h b/libavformat/rtpdec_mpeg4.h
deleted file mode 100644
index 06d9e57..0000000
--- a/libavformat/rtpdec_mpeg4.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Common code for the RTP depacketization of MPEG-4 formats.
- * Copyright (c) 2010 Fabrice Bellard
- * Romain Degez
- *
- * 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 AVFORMAT_RTPDEC_MPEG4_H
-#define AVFORMAT_RTPDEC_MPEG4_H
-
-#include "rtpdec.h"
-
-/**
- * MPEG-4 Video RTP callbacks. (RFC 3016)
- */
-extern RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler;
-
-/**
- * AAC RTP callbacks. (RFC 3640)
- */
-extern RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler;
-
-#endif /* AVFORMAT_RTPDEC_MPEG4_H */
-
diff --git a/libavformat/rtpdec_qdm2.c b/libavformat/rtpdec_qdm2.c
index 9c6b3ef..72f03b8 100644
--- a/libavformat/rtpdec_qdm2.c
+++ b/libavformat/rtpdec_qdm2.c
@@ -30,7 +30,7 @@
#include "libavcodec/avcodec.h"
#include "rtp.h"
#include "rtpdec.h"
-#include "rtpdec_qdm2.h"
+#include "rtpdec_depacketizers.h"
struct PayloadContext {
/** values read from the config header, used as packet headers */
diff --git a/libavformat/rtpdec_qdm2.h b/libavformat/rtpdec_qdm2.h
deleted file mode 100644
index 6fa1983..0000000
--- a/libavformat/rtpdec_qdm2.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * QDesign Music 2 (QDM2) payload for RTP
- * Copyright (c) 2010 Ronald S. Bultje
- *
- * 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 AVFORMAT_RTPDEC_QDM2_H
-#define AVFORMAT_RTPDEC_QDM2_H
-
-#include "rtpdec.h"
-
-/**
- * QMD2 RTP callbacks.
- */
-extern RTPDynamicProtocolHandler ff_qdm2_dynamic_handler;
-
-#endif /* AVFORMAT_RTPDEC_QDM2_H */
diff --git a/libavformat/rtpdec_svq3.c b/libavformat/rtpdec_svq3.c
index 441ef7a..aa32846 100644
--- a/libavformat/rtpdec_svq3.c
+++ b/libavformat/rtpdec_svq3.c
@@ -30,7 +30,7 @@
#include "libavutil/intreadwrite.h"
#include "rtp.h"
#include "rtpdec.h"
-#include "rtpdec_svq3.h"
+#include "rtpdec_depacketizers.h"
struct PayloadContext {
ByteIOContext *pktbuf;
diff --git a/libavformat/rtpdec_svq3.h b/libavformat/rtpdec_svq3.h
deleted file mode 100644
index 267d4d9..0000000
--- a/libavformat/rtpdec_svq3.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Sorenson-3 (SVQ3/SV3V) payload for RTP
- * Copyright (c) 2010 Ronald S. Bultje
- *
- * 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 AVFORMAT_RTPDEC_SVQ3_H
-#define AVFORMAT_RTPDEC_SVQ3_H
-
-#include "libavcodec/avcodec.h"
-#include "rtpdec.h"
-
-/**
- * Sorenson-3 RTP callbacks.
- */
-extern RTPDynamicProtocolHandler ff_svq3_dynamic_handler;
-
-#endif /* AVFORMAT_RTPDEC_SVQ3_H */
diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c
index 5b75529..091da67 100644
--- a/libavformat/rtpdec_xiph.c
+++ b/libavformat/rtpdec_xiph.c
@@ -34,7 +34,7 @@
#include <assert.h>
#include "rtpdec.h"
-#include "rtpdec_xiph.h"
+#include "rtpdec_depacketizers.h"
/**
* RTP/Xiph specific private data.
diff --git a/libavformat/rtpdec_xiph.h b/libavformat/rtpdec_xiph.h
deleted file mode 100644
index 50aa77f..0000000
--- a/libavformat/rtpdec_xiph.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Xiph RTP Protocols
- * Based off RFC 5215 (Vorbis RTP) and the Theora RTP draft.
- * Copyright (c) 2009 Colin McQuillian
- * Copyright (c) 2010 Josh Allmann
- *
- * 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 AVFORMAT_RTPDEC_XIPH_H
-#define AVFORMAT_RTPDEC_XIPH_H
-
-#include "libavcodec/avcodec.h"
-#include "rtpdec.h"
-
-/**
- * Theora RTP callbacks.
- */
-extern RTPDynamicProtocolHandler ff_theora_dynamic_handler;
-
-/**
- * Vorbis RTP callbacks.
- */
-extern RTPDynamicProtocolHandler ff_vorbis_dynamic_handler;
-
-#endif /* AVFORMAT_RTPDEC_XIPH_H */
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 6ad0953..8e37d05 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -38,7 +38,7 @@
#include "rtpdec.h"
#include "rdt.h"
-#include "rtpdec_asf.h"
+#include "rtpdec_depacketizers.h"
//#define DEBUG
//#define DEBUG_RTP_TCP
--
1.7.1
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc