MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / write_begin

Function write_begin

libavformat/rtmpproto.c:1914–1938  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1912}
1913
1914static int write_begin(URLContext *s)
1915{
1916 RTMPContext *rt = s->priv_data;
1917 PutByteContext pbc;
1918 RTMPPacket spkt = { 0 };
1919 int ret;
1920
1921 // Send Stream Begin 1
1922 if ((ret = ff_rtmp_packet_create(&spkt, RTMP_NETWORK_CHANNEL,
1923 RTMP_PT_USER_CONTROL, 0, 6)) < 0) {
1924 av_log(s, AV_LOG_ERROR, "Unable to create response packet\n");
1925 return ret;
1926 }
1927
1928 bytestream2_init_writer(&pbc, spkt.data, spkt.size);
1929 bytestream2_put_be16(&pbc, 0); // 0 -> Stream Begin
1930 bytestream2_put_be32(&pbc, rt->nb_streamid);
1931
1932 ret = ff_rtmp_packet_write(rt->stream, &spkt, rt->out_chunk_size,
1933 &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
1934
1935 ff_rtmp_packet_destroy(&spkt);
1936
1937 return ret;
1938}
1939
1940static int write_status(URLContext *s, RTMPPacket *pkt,
1941 const char *status, const char *description, const char *details)

Callers 1

send_invoke_responseFunction · 0.85

Calls 5

ff_rtmp_packet_createFunction · 0.85
av_logFunction · 0.85
bytestream2_init_writerFunction · 0.85
ff_rtmp_packet_writeFunction · 0.85
ff_rtmp_packet_destroyFunction · 0.85

Tested by

no test coverage detected