aboutsummaryrefslogtreecommitdiff
path: root/libavformat/rtpenc_h264.c
diff options
context:
space:
mode:
authorMartin Storsjö2012-05-28 12:11:26 +0300
committerMartin Storsjö2012-06-18 12:27:56 +0300
commitd77f4afa9814b0433be6fdbfd7d8a113592ba680 (patch)
tree8a0df73a17bf709996f686453f0784dcb20eaa30 /libavformat/rtpenc_h264.c
parentbecc3c629b6d2be3171a26587f7ca999ef7a9d86 (diff)
rtpenc: Allow requesting H264 RTP packetization mode 0
This requires all NAL units to fit within single RTP packets. It doesn't change the actual packetization for packets that fit, but errors out and gives a helpful hint if the NAL units would have to be split, and signals the right packetization mode in the SDP. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpenc_h264.c')
-rw-r--r--libavformat/rtpenc_h264.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/rtpenc_h264.c b/libavformat/rtpenc_h264.c
index 776da83a62..ac74074307 100644
--- a/libavformat/rtpenc_h264.c
+++ b/libavformat/rtpenc_h264.c
@@ -55,6 +55,12 @@ static void nal_send(AVFormatContext *s1, const uint8_t *buf, int size, int last
uint8_t type = buf[0] & 0x1F;
uint8_t nri = buf[0] & 0x60;
+ if (s->flags & FF_RTP_FLAG_H264_MODE0) {
+ av_log(s1, AV_LOG_ERROR,
+ "NAL size %d > %d, try -slice-max-size %d\n", size,
+ s->max_payload_size, s->max_payload_size);
+ return;
+ }
av_log(s1, AV_LOG_DEBUG, "NAL size %d > %d\n", size, s->max_payload_size);
s->buf[0] = 28; /* FU Indicator; Type = 28 ---> FU-A */
s->buf[0] |= nri;