1cabdff1aSopenharmony_ci/*
2cabdff1aSopenharmony_ci * RTMP definitions
3cabdff1aSopenharmony_ci * Copyright (c) 2009 Konstantin Shishkov
4cabdff1aSopenharmony_ci *
5cabdff1aSopenharmony_ci * This file is part of FFmpeg.
6cabdff1aSopenharmony_ci *
7cabdff1aSopenharmony_ci * FFmpeg is free software; you can redistribute it and/or
8cabdff1aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public
9cabdff1aSopenharmony_ci * License as published by the Free Software Foundation; either
10cabdff1aSopenharmony_ci * version 2.1 of the License, or (at your option) any later version.
11cabdff1aSopenharmony_ci *
12cabdff1aSopenharmony_ci * FFmpeg is distributed in the hope that it will be useful,
13cabdff1aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of
14cabdff1aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15cabdff1aSopenharmony_ci * Lesser General Public License for more details.
16cabdff1aSopenharmony_ci *
17cabdff1aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public
18cabdff1aSopenharmony_ci * License along with FFmpeg; if not, write to the Free Software
19cabdff1aSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20cabdff1aSopenharmony_ci */
21cabdff1aSopenharmony_ci
22cabdff1aSopenharmony_ci#ifndef AVFORMAT_RTMP_H
23cabdff1aSopenharmony_ci#define AVFORMAT_RTMP_H
24cabdff1aSopenharmony_ci
25cabdff1aSopenharmony_ci#include "avformat.h"
26cabdff1aSopenharmony_ci
27cabdff1aSopenharmony_ci#define RTMP_DEFAULT_PORT 1935
28cabdff1aSopenharmony_ci#define RTMPS_DEFAULT_PORT 443
29cabdff1aSopenharmony_ci
30cabdff1aSopenharmony_ci#define RTMP_HANDSHAKE_PACKET_SIZE 1536
31cabdff1aSopenharmony_ci
32cabdff1aSopenharmony_ci/**
33cabdff1aSopenharmony_ci * emulated Flash client version - 9.0.124.2 on Linux
34cabdff1aSopenharmony_ci * @{
35cabdff1aSopenharmony_ci */
36cabdff1aSopenharmony_ci#define RTMP_CLIENT_PLATFORM "LNX"
37cabdff1aSopenharmony_ci#define RTMP_CLIENT_VER1    9
38cabdff1aSopenharmony_ci#define RTMP_CLIENT_VER2    0
39cabdff1aSopenharmony_ci#define RTMP_CLIENT_VER3  124
40cabdff1aSopenharmony_ci#define RTMP_CLIENT_VER4    2
41cabdff1aSopenharmony_ci/** @} */ //version defines
42cabdff1aSopenharmony_ci
43cabdff1aSopenharmony_ci/**
44cabdff1aSopenharmony_ci * Calculate HMAC-SHA2 digest for RTMP handshake packets.
45cabdff1aSopenharmony_ci *
46cabdff1aSopenharmony_ci * @param src    input buffer
47cabdff1aSopenharmony_ci * @param len    input buffer length (should be 1536)
48cabdff1aSopenharmony_ci * @param gap    offset in buffer where 32 bytes should not be taken into account
49cabdff1aSopenharmony_ci *               when calculating digest (since it will be used to store that digest)
50cabdff1aSopenharmony_ci * @param key    digest key
51cabdff1aSopenharmony_ci * @param keylen digest key length
52cabdff1aSopenharmony_ci * @param dst    buffer where calculated digest will be stored (32 bytes)
53cabdff1aSopenharmony_ci */
54cabdff1aSopenharmony_ciint ff_rtmp_calc_digest(const uint8_t *src, int len, int gap,
55cabdff1aSopenharmony_ci                        const uint8_t *key, int keylen, uint8_t *dst);
56cabdff1aSopenharmony_ci
57cabdff1aSopenharmony_ci/**
58cabdff1aSopenharmony_ci * Calculate digest position for RTMP handshake packets.
59cabdff1aSopenharmony_ci *
60cabdff1aSopenharmony_ci * @param buf input buffer (should be 1536 bytes)
61cabdff1aSopenharmony_ci * @param off offset in buffer where to start calculating digest position
62cabdff1aSopenharmony_ci * @param mod_val value used for computing modulo
63cabdff1aSopenharmony_ci * @param add_val value added at the end (after computing modulo)
64cabdff1aSopenharmony_ci */
65cabdff1aSopenharmony_ciint ff_rtmp_calc_digest_pos(const uint8_t *buf, int off, int mod_val,
66cabdff1aSopenharmony_ci                            int add_val);
67cabdff1aSopenharmony_ci
68cabdff1aSopenharmony_ci#endif /* AVFORMAT_RTMP_H */
69