summaryrefslogtreecommitdiff
path: root/gst/rtmp2/rtmp/rtmpclient.h
blob: 10a6e22deee0f41b1b8be0abd927ecc5cd2480e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/* GStreamer RTMP Library
 * Copyright (C) 2017 Make.TV, Inc. <info@make.tv>
 *   Contact: Jan Alexander Steffens (heftig) <jsteffens@make.tv>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#ifndef _GST_RTMP_CLIENT_H_
#define _GST_RTMP_CLIENT_H_

#include "rtmpconnection.h"

G_BEGIN_DECLS

#define GST_TYPE_RTMP_SCHEME (gst_rtmp_scheme_get_type ())

typedef enum
{
  GST_RTMP_SCHEME_RTMP = 0,
  GST_RTMP_SCHEME_RTMPS,
} GstRtmpScheme;

GType gst_rtmp_scheme_get_type (void);

GstRtmpScheme gst_rtmp_scheme_from_string (const gchar * string);
GstRtmpScheme gst_rtmp_scheme_from_uri (const GstUri * uri);
const gchar * gst_rtmp_scheme_to_string (GstRtmpScheme scheme);
const gchar * const * gst_rtmp_scheme_get_strings (void);
guint gst_rtmp_scheme_get_default_port (GstRtmpScheme scheme);



#define GST_TYPE_RTMP_AUTHMOD (gst_rtmp_authmod_get_type ())

typedef enum
{
  GST_RTMP_AUTHMOD_NONE = 0,
  GST_RTMP_AUTHMOD_AUTO,
  GST_RTMP_AUTHMOD_ADOBE,
} GstRtmpAuthmod;

GType gst_rtmp_authmod_get_type (void);



typedef struct _GstRtmpLocation
{
  GstRtmpScheme scheme;
  gchar *host;
  guint port;
  gchar *application;
  gchar *stream;
  gchar *username;
  gchar *password;
  gchar *secure_token;
  GstRtmpAuthmod authmod;
  gint timeout;
  GTlsCertificateFlags tls_flags;
  gchar *flash_ver;
  gboolean publish;
} GstRtmpLocation;

void gst_rtmp_location_copy (GstRtmpLocation * dest,
    const GstRtmpLocation * src);
void gst_rtmp_location_clear (GstRtmpLocation * uri);
gchar *gst_rtmp_location_get_string (const GstRtmpLocation * location,
    gboolean with_stream);



void gst_rtmp_client_connect_async (const GstRtmpLocation * location,
    GCancellable * cancellable, GAsyncReadyCallback callback,
    gpointer user_data);
GstRtmpConnection *gst_rtmp_client_connect_finish (GAsyncResult * result,
    GError ** error);
void gst_rtmp_client_start_publish_async (GstRtmpConnection * connection,
    const gchar * stream, GCancellable * cancellable,
    GAsyncReadyCallback callback, gpointer user_data);
gboolean gst_rtmp_client_start_publish_finish (GstRtmpConnection * connection,
    GAsyncResult * result, guint * stream_id, GError ** error);

void gst_rtmp_client_start_play_async (GstRtmpConnection * connection,
    const gchar * stream, GCancellable * cancellable,
    GAsyncReadyCallback callback, gpointer user_data);
gboolean gst_rtmp_client_start_play_finish (GstRtmpConnection * connection,
    GAsyncResult * result, guint * stream_id, GError ** error);

G_END_DECLS
#endif