| OLD | NEW |
| 1 /* | 1 /* |
| 2 * RTP network protocol | 2 * RTP network protocol |
| 3 * Copyright (c) 2002 Fabrice Bellard | 3 * Copyright (c) 2002 Fabrice Bellard |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 #endif | 278 #endif |
| 279 return len; | 279 return len; |
| 280 } | 280 } |
| 281 | 281 |
| 282 static int rtp_write(URLContext *h, const uint8_t *buf, int size) | 282 static int rtp_write(URLContext *h, const uint8_t *buf, int size) |
| 283 { | 283 { |
| 284 RTPContext *s = h->priv_data; | 284 RTPContext *s = h->priv_data; |
| 285 int ret; | 285 int ret; |
| 286 URLContext *hd; | 286 URLContext *hd; |
| 287 | 287 |
| 288 if (buf[1] >= 200 && buf[1] <= 204) { | 288 if (buf[1] >= RTCP_SR && buf[1] <= RTCP_APP) { |
| 289 /* RTCP payload type */ | 289 /* RTCP payload type */ |
| 290 hd = s->rtcp_hd; | 290 hd = s->rtcp_hd; |
| 291 } else { | 291 } else { |
| 292 /* RTP payload type */ | 292 /* RTP payload type */ |
| 293 hd = s->rtp_hd; | 293 hd = s->rtp_hd; |
| 294 } | 294 } |
| 295 | 295 |
| 296 ret = url_write(hd, buf, size); | 296 ret = url_write(hd, buf, size); |
| 297 #if 0 | 297 #if 0 |
| 298 { | 298 { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 *prtcp_fd = s->rtcp_fd; | 366 *prtcp_fd = s->rtcp_fd; |
| 367 } | 367 } |
| 368 #endif | 368 #endif |
| 369 | 369 |
| 370 static int rtp_get_file_handle(URLContext *h) | 370 static int rtp_get_file_handle(URLContext *h) |
| 371 { | 371 { |
| 372 RTPContext *s = h->priv_data; | 372 RTPContext *s = h->priv_data; |
| 373 return s->rtp_fd; | 373 return s->rtp_fd; |
| 374 } | 374 } |
| 375 | 375 |
| 376 int rtp_get_rtcp_file_handle(URLContext *h) { |
| 377 RTPContext *s = h->priv_data; |
| 378 return s->rtcp_fd; |
| 379 } |
| 380 |
| 376 URLProtocol rtp_protocol = { | 381 URLProtocol rtp_protocol = { |
| 377 "rtp", | 382 "rtp", |
| 378 rtp_open, | 383 rtp_open, |
| 379 rtp_read, | 384 rtp_read, |
| 380 rtp_write, | 385 rtp_write, |
| 381 NULL, /* seek */ | 386 NULL, /* seek */ |
| 382 rtp_close, | 387 rtp_close, |
| 383 .url_get_file_handle = rtp_get_file_handle, | 388 .url_get_file_handle = rtp_get_file_handle, |
| 384 }; | 389 }; |
| OLD | NEW |