summaryrefslogtreecommitdiffstats
path: root/libavformat/rtmppkt.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2017-01-31 15:47:00 +0200
committerMartin Storsjö <martin@martin.st>2017-02-03 09:26:46 +0200
commita1a143adb0fd11c474221431417cff25db7d920f (patch)
tree8381b8db9d5f72c39d2a273c84d7a72710ebed81 /libavformat/rtmppkt.c
parentbcaedef1189a3531aa4dfb020627eb0133ffa89c (diff)
downloadffmpeg-streaming-a1a143adb0fd11c474221431417cff25db7d920f.zip
ffmpeg-streaming-a1a143adb0fd11c474221431417cff25db7d920f.tar.gz
rtmp: Rename packet types to closer match the spec
Also rename comments and log messages accordingly, and add clarifying comments for some hardcoded values. The previous names were taken from older, reverse engineered references. These names match the official public rtmp specification, and matches the names used by wirecast in annotating captured streams. These names also avoid hardcoding the roles of server and client, since the handling of them is irrelevant of whether we act as server or client. The RTMP_PT_PING type maps to RTMP_PT_USER_CONTROL. The SERVER_BW and CLIENT_BW types are a bit more intertwined; RTMP_PT_SERVER_BW maps to RTMP_PT_WINDOW_ACK_SIZE and RTMP_PT_CLIENT_BW maps to RTMP_PT_SET_PEER_BW. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtmppkt.c')
-rw-r--r--libavformat/rtmppkt.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c
index 1cb3078..0bb0614 100644
--- a/libavformat/rtmppkt.c
+++ b/libavformat/rtmppkt.c
@@ -527,9 +527,9 @@ static const char* rtmp_packet_type(int type)
switch (type) {
case RTMP_PT_CHUNK_SIZE: return "chunk size";
case RTMP_PT_BYTES_READ: return "bytes read";
- case RTMP_PT_PING: return "ping";
- case RTMP_PT_SERVER_BW: return "server bandwidth";
- case RTMP_PT_CLIENT_BW: return "client bandwidth";
+ case RTMP_PT_USER_CONTROL: return "user control";
+ case RTMP_PT_WINDOW_ACK_SIZE: return "window acknowledgement size";
+ case RTMP_PT_SET_PEER_BW: return "set peer bandwidth";
case RTMP_PT_AUDIO: return "audio packet";
case RTMP_PT_VIDEO: return "video packet";
case RTMP_PT_FLEX_STREAM: return "Flex shared stream";
@@ -627,10 +627,10 @@ void ff_rtmp_packet_dump(void *ctx, RTMPPacket *p)
break;
src += sz;
}
- } else if (p->type == RTMP_PT_SERVER_BW){
- av_log(ctx, AV_LOG_DEBUG, "Server BW = %d\n", AV_RB32(p->data));
- } else if (p->type == RTMP_PT_CLIENT_BW){
- av_log(ctx, AV_LOG_DEBUG, "Client BW = %d\n", AV_RB32(p->data));
+ } else if (p->type == RTMP_PT_WINDOW_ACK_SIZE) {
+ av_log(ctx, AV_LOG_DEBUG, "Window acknowledgement size = %d\n", AV_RB32(p->data));
+ } else if (p->type == RTMP_PT_SET_PEER_BW) {
+ av_log(ctx, AV_LOG_DEBUG, "Set Peer BW = %d\n", AV_RB32(p->data));
} else if (p->type != RTMP_PT_AUDIO && p->type != RTMP_PT_VIDEO && p->type != RTMP_PT_METADATA) {
int i;
for (i = 0; i < p->size; i++)
OpenPOWER on IntegriCloud