static const int packetSize[] = { 12, 8, 4, 1 };
-#define RTMP_PACKET_SIZE_LARGE 0
-#define RTMP_PACKET_SIZE_MEDIUM 1
-#define RTMP_PACKET_SIZE_SMALL 2
-#define RTMP_PACKET_SIZE_MINIMUM 3
-
bool RTMP_ctrlC;
const char RTMPProtocolStrings[][7] = {
static bool SocksNegotiate(RTMP * r);
static bool SendConnectPacket(RTMP * r, RTMPPacket *cp);
-static bool SendServerBW(RTMP * r);
static bool SendCheckBW(RTMP * r);
static bool SendCheckBWResult(RTMP * r, double txn);
-static bool SendCreateStream(RTMP * r, double dStreamId);
static bool SendDeleteStream(RTMP * r, double dStreamId);
static bool SendFCSubscribe(RTMP * r, AVal * subscribepath);
static bool SendPlay(RTMP * r);
{
RTMP_DeleteStream(r);
- SendCreateStream(r, 2.0);
+ RTMP_SendCreateStream(r, 2.0);
RTMP_SetBufferMS(r, bufferTime);
SAVC(createStream);
-static bool
-SendCreateStream(RTMP * r, double dStreamId)
+bool
+RTMP_SendCreateStream(RTMP * r, double dCmdID)
{
RTMPPacket packet;
char pbuf[256], *pend = pbuf+sizeof(pbuf);
char *enc = packet.m_body;
enc = AMF_EncodeString(enc, pend, &av_createStream);
- enc = AMF_EncodeNumber(enc, pend, dStreamId);
+ enc = AMF_EncodeNumber(enc, pend, dCmdID);
*enc++ = AMF_NULL; // NULL
packet.m_nBodySize = enc - packet.m_body;
}
#endif
-static bool
-SendServerBW(RTMP * r)
+bool
+RTMP_SendServerBW(RTMP * r)
{
RTMPPacket packet;
char pbuf[256], *pend = pbuf+sizeof(pbuf);
vals[i].av_len = 0;
}
+void
+RTMP_DropRequest(RTMP *r, int i, bool freeit)
+{
+ AV_erase(r->m_methodCalls, &r->m_numCalls, i, freeit);
+}
+
static void
AV_queue(AVal ** vals, int *num, AVal * av)
{
SendSecureTokenResponse(r, &p.p_vu.p_aval);
}
}
- SendServerBW(r);
+ RTMP_SendServerBW(r);
RTMP_SendCtrl(r, 3, 0, 300);
- SendCreateStream(r, 2.0);
+ RTMP_SendCreateStream(r, 2.0);
/* Send the FCSubscribe if live stream or if subscribepath is set */
if (r->Link.subscribepath.av_len)
#define RTMP_MAX_HEADER_SIZE 18
+#define RTMP_PACKET_SIZE_LARGE 0
+#define RTMP_PACKET_SIZE_MEDIUM 1
+#define RTMP_PACKET_SIZE_SMALL 2
+#define RTMP_PACKET_SIZE_MINIMUM 3
+
typedef unsigned char BYTE;
typedef struct RTMPChunk
bool RTMPSockBuf_Fill(RTMPSockBuf *sb);
+bool RTMP_SendCreateStream(RTMP * r, double dCmdID);
+bool RTMP_SendServerBW(RTMP * r);
+void RTMP_DropRequest(RTMP *r, int i, bool freeit);
+
#ifdef CRYPTO
/* hashswf.c */
#define HASHLEN 32