aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtpdec.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-12-05 19:39:50 +0000
committerMartin Storsjö <martin@martin.st>2010-12-05 19:39:50 +0000
commit1e515c4280acb70c615e8fe562fa6b463f1d8bed (patch)
treec3cce51026922e3dfc187dbb10262a626f67e37b /libavformat/rtpdec.c
parent2beb910d79734ef482ec1655f2ceffd7ef0375fd (diff)
downloadffmpeg-1e515c4280acb70c615e8fe562fa6b463f1d8bed.tar.gz
rtpdec: Add functions for finding depacketizers by name or payload id
Originally committed as revision 25891 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r--libavformat/rtpdec.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 25241393fc..c9cf855a59 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -27,6 +27,7 @@
#include "mpegts.h"
#include <unistd.h>
+#include <strings.h>
#include "network.h"
#include "rtpdec.h"
@@ -78,6 +79,30 @@ void av_register_rtp_dynamic_payload_handlers(void)
ff_register_dynamic_payload_handler(&ff_quicktime_rtp_vid_handler);
}
+RTPDynamicProtocolHandler *ff_rtp_handler_find_by_name(const char *name,
+ enum AVMediaType codec_type)
+{
+ RTPDynamicProtocolHandler *handler;
+ for (handler = RTPFirstDynamicPayloadHandler;
+ handler; handler = handler->next)
+ if (!strcasecmp(name, handler->enc_name) &&
+ codec_type == handler->codec_type)
+ return handler;
+ return NULL;
+}
+
+RTPDynamicProtocolHandler *ff_rtp_handler_find_by_id(int id,
+ enum AVMediaType codec_type)
+{
+ RTPDynamicProtocolHandler *handler;
+ for (handler = RTPFirstDynamicPayloadHandler;
+ handler; handler = handler->next)
+ if (handler->static_payload_id && handler->static_payload_id == id &&
+ codec_type == handler->codec_type)
+ return handler;
+ return NULL;
+}
+
static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf, int len)
{
int payload_len;