Originally committed as revision 25891 to svn://svn.ffmpeg.org/ffmpeg/trunk
| ... | ... |
@@ -27,6 +27,7 @@ |
| 27 | 27 |
#include "mpegts.h" |
| 28 | 28 |
|
| 29 | 29 |
#include <unistd.h> |
| 30 |
+#include <strings.h> |
|
| 30 | 31 |
#include "network.h" |
| 31 | 32 |
|
| 32 | 33 |
#include "rtpdec.h" |
| ... | ... |
@@ -78,6 +79,30 @@ void av_register_rtp_dynamic_payload_handlers(void) |
| 78 | 78 |
ff_register_dynamic_payload_handler(&ff_quicktime_rtp_vid_handler); |
| 79 | 79 |
} |
| 80 | 80 |
|
| 81 |
+RTPDynamicProtocolHandler *ff_rtp_handler_find_by_name(const char *name, |
|
| 82 |
+ enum AVMediaType codec_type) |
|
| 83 |
+{
|
|
| 84 |
+ RTPDynamicProtocolHandler *handler; |
|
| 85 |
+ for (handler = RTPFirstDynamicPayloadHandler; |
|
| 86 |
+ handler; handler = handler->next) |
|
| 87 |
+ if (!strcasecmp(name, handler->enc_name) && |
|
| 88 |
+ codec_type == handler->codec_type) |
|
| 89 |
+ return handler; |
|
| 90 |
+ return NULL; |
|
| 91 |
+} |
|
| 92 |
+ |
|
| 93 |
+RTPDynamicProtocolHandler *ff_rtp_handler_find_by_id(int id, |
|
| 94 |
+ enum AVMediaType codec_type) |
|
| 95 |
+{
|
|
| 96 |
+ RTPDynamicProtocolHandler *handler; |
|
| 97 |
+ for (handler = RTPFirstDynamicPayloadHandler; |
|
| 98 |
+ handler; handler = handler->next) |
|
| 99 |
+ if (handler->static_payload_id && handler->static_payload_id == id && |
|
| 100 |
+ codec_type == handler->codec_type) |
|
| 101 |
+ return handler; |
|
| 102 |
+ return NULL; |
|
| 103 |
+} |
|
| 104 |
+ |
|
| 81 | 105 |
static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf, int len) |
| 82 | 106 |
{
|
| 83 | 107 |
int payload_len; |
| ... | ... |
@@ -190,6 +190,10 @@ struct RTPDemuxContext {
|
| 190 | 190 |
|
| 191 | 191 |
extern RTPDynamicProtocolHandler *RTPFirstDynamicPayloadHandler; |
| 192 | 192 |
void ff_register_dynamic_payload_handler(RTPDynamicProtocolHandler *handler); |
| 193 |
+RTPDynamicProtocolHandler *ff_rtp_handler_find_by_name(const char *name, |
|
| 194 |
+ enum AVMediaType codec_type); |
|
| 195 |
+RTPDynamicProtocolHandler *ff_rtp_handler_find_by_id(int id, |
|
| 196 |
+ enum AVMediaType codec_type); |
|
| 193 | 197 |
|
| 194 | 198 |
int ff_rtsp_next_attr_and_value(const char **p, char *attr, int attr_size, char *value, int value_size); ///< from rtsp.c, but used by rtp dynamic protocol handlers. |
| 195 | 199 |
|