Commit 21ba8e0c authored by kostya's avatar kostya

Move is_input flag into RTMP protocol context.

Patch by Sergiy (gmail(piratfm))
Thread "[PATCH] rtmp-output"



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20702 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 074c63a4
...@@ -57,6 +57,7 @@ typedef struct RTMPContext { ...@@ -57,6 +57,7 @@ typedef struct RTMPContext {
URLContext* stream; ///< TCP stream used in interactions with RTMP server URLContext* stream; ///< TCP stream used in interactions with RTMP server
RTMPPacket prev_pkt[2][RTMP_CHANNELS]; ///< packet history used when reading and sending packets RTMPPacket prev_pkt[2][RTMP_CHANNELS]; ///< packet history used when reading and sending packets
int chunk_size; ///< size of the chunks RTMP packets are divided into int chunk_size; ///< size of the chunks RTMP packets are divided into
int is_input; ///< input/output flag
char playpath[256]; ///< path to filename to play (with possible "mp4:" prefix) char playpath[256]; ///< path to filename to play (with possible "mp4:" prefix)
ClientState state; ///< current state ClientState state; ///< current state
int main_channel_id; ///< an additional channel ID which is used for some invocations int main_channel_id; ///< an additional channel ID which is used for some invocations
...@@ -564,15 +565,14 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) ...@@ -564,15 +565,14 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
RTMPContext *rt; RTMPContext *rt;
char proto[8], hostname[256], path[1024], app[128], *fname; char proto[8], hostname[256], path[1024], app[128], *fname;
uint8_t buf[2048]; uint8_t buf[2048];
int port, is_input; int port;
int ret; int ret;
is_input = !(flags & URL_WRONLY);
rt = av_mallocz(sizeof(RTMPContext)); rt = av_mallocz(sizeof(RTMPContext));
if (!rt) if (!rt)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
s->priv_data = rt; s->priv_data = rt;
rt->is_input = !(flags & URL_WRONLY);
url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), &port, url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), &port,
path, sizeof(path), s->filename); path, sizeof(path), s->filename);
...@@ -586,7 +586,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) ...@@ -586,7 +586,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
goto fail; goto fail;
} }
if (!is_input) { if (!rt->is_input) {
av_log(LOG_CONTEXT, AV_LOG_ERROR, "RTMP output is not supported yet.\n"); av_log(LOG_CONTEXT, AV_LOG_ERROR, "RTMP output is not supported yet.\n");
goto fail; goto fail;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment