2009-07-31 06:49:36 +00:00
|
|
|
/*
|
|
|
|
* RTMP definitions
|
|
|
|
* Copyright (c) 2009 Kostya Shishkov
|
|
|
|
*
|
2011-03-18 17:35:10 +00:00
|
|
|
* This file is part of Libav.
|
2009-07-31 06:49:36 +00:00
|
|
|
*
|
2011-03-18 17:35:10 +00:00
|
|
|
* Libav is free software; you can redistribute it and/or
|
2009-07-31 06:49:36 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
2011-03-18 17:35:10 +00:00
|
|
|
* Libav is distributed in the hope that it will be useful,
|
2009-07-31 06:49:36 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2011-03-18 17:35:10 +00:00
|
|
|
* License along with Libav; if not, write to the Free Software
|
2009-07-31 06:49:36 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AVFORMAT_RTMP_H
|
|
|
|
#define AVFORMAT_RTMP_H
|
|
|
|
|
|
|
|
#include "avformat.h"
|
|
|
|
|
|
|
|
#define RTMP_DEFAULT_PORT 1935
|
2012-07-17 10:02:42 +00:00
|
|
|
#define RTMPS_DEFAULT_PORT 443
|
2009-07-31 06:49:36 +00:00
|
|
|
|
|
|
|
#define RTMP_HANDSHAKE_PACKET_SIZE 1536
|
|
|
|
|
2012-07-05 11:05:46 +00:00
|
|
|
#define HMAC_IPAD_VAL 0x36
|
|
|
|
#define HMAC_OPAD_VAL 0x5C
|
|
|
|
|
2009-07-31 06:49:36 +00:00
|
|
|
/**
|
|
|
|
* emulated Flash client version - 9.0.124.2 on Linux
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define RTMP_CLIENT_PLATFORM "LNX"
|
|
|
|
#define RTMP_CLIENT_VER1 9
|
|
|
|
#define RTMP_CLIENT_VER2 0
|
|
|
|
#define RTMP_CLIENT_VER3 124
|
|
|
|
#define RTMP_CLIENT_VER4 2
|
|
|
|
/** @} */ //version defines
|
|
|
|
|
2012-07-05 11:05:46 +00:00
|
|
|
/**
|
|
|
|
* Calculate HMAC-SHA2 digest for RTMP handshake packets.
|
|
|
|
*
|
|
|
|
* @param src input buffer
|
|
|
|
* @param len input buffer length (should be 1536)
|
|
|
|
* @param gap offset in buffer where 32 bytes should not be taken into account
|
|
|
|
* when calculating digest (since it will be used to store that digest)
|
|
|
|
* @param key digest key
|
|
|
|
* @param keylen digest key length
|
|
|
|
* @param dst buffer where calculated digest will be stored (32 bytes)
|
|
|
|
*/
|
|
|
|
int ff_rtmp_calc_digest(const uint8_t *src, int len, int gap,
|
|
|
|
const uint8_t *key, int keylen, uint8_t *dst);
|
|
|
|
|
2012-07-05 11:06:07 +00:00
|
|
|
/**
|
|
|
|
* Calculate digest position for RTMP handshake packets.
|
|
|
|
*
|
|
|
|
* @param buf input buffer (should be 1536 bytes)
|
|
|
|
* @param off offset in buffer where to start calculating digest position
|
|
|
|
* @param mod_val value used for computing modulo
|
|
|
|
* @param add_val value added at the end (after computing modulo)
|
|
|
|
*/
|
|
|
|
int ff_rtmp_calc_digest_pos(const uint8_t *buf, int off, int mod_val,
|
|
|
|
int add_val);
|
|
|
|
|
2009-07-31 06:49:36 +00:00
|
|
|
#endif /* AVFORMAT_RTMP_H */
|