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

Function send_command_packet

libavformat/mmst.c:126–153  ·  view source on GitHub ↗

Send a prepared MMST command packet. */

Source from the content-addressed store, hash-verified

124
125/** Send a prepared MMST command packet. */
126static int send_command_packet(MMSTContext *mmst)
127{
128 MMSContext *mms = &mmst->mms;
129 int len= mms->write_out_ptr - mms->out_buffer;
130 int exact_length = FFALIGN(len, 8);
131 int first_length= exact_length - 16;
132 int len8= first_length/8;
133 int write_result;
134
135 // update packet length fields.
136 AV_WL32(mms->out_buffer + 8, first_length);
137 AV_WL32(mms->out_buffer + 16, len8);
138 AV_WL32(mms->out_buffer + 32, len8-2);
139 memset(mms->write_out_ptr, 0, exact_length - len);
140
141 // write it out.
142 write_result= ffurl_write(mms->mms_hd, mms->out_buffer, exact_length);
143 if(write_result != exact_length) {
144 av_log(mms->mms_hd, AV_LOG_ERROR,
145 "Failed to write data of length %d: %d (%s)\n",
146 exact_length, write_result,
147 write_result < 0 ? strerror(AVUNERROR(write_result)) :
148 "The server closed the connection");
149 return AVERROR(EIO);
150 }
151
152 return 0;
153}
154
155static int mms_put_utf16(MMSContext *mms, const uint8_t *src)
156{

Callers 9

send_time_test_dataFunction · 0.85
send_protocol_selectFunction · 0.85
send_media_file_requestFunction · 0.85
send_keepalive_packetFunction · 0.85
send_startup_packetFunction · 0.85
send_close_packetFunction · 0.85

Calls 2

ffurl_writeFunction · 0.85
av_logFunction · 0.85

Tested by

no test coverage detected