int avoid_negative_ts_use_pts;
- /**
- * Whether or not a header has already been written
- */
- int header_written;
- int write_header_ret;
-
/**
* Timestamp of the end of the shortest stream.
*/
*/
int ff_get_line(AVIOContext *s, char *buf, int maxlen);
+/**
+ * Read a whole line of text from AVIOContext to an AVBPrint buffer. Stop
+ * reading after reaching a \\r, a \\n, a \\r\\n, a \\0 or EOF. The line
+ * ending characters are NOT included in the buffer, but they are skipped on
+ * the input.
+ *
+ * @param s the read-only AVIOContext
+ * @param bp the AVBPrint buffer
+ * @return the length of the read line, not including the line endings,
+ * negative on error.
+ */
+int64_t ff_read_line_to_bprint(AVIOContext *s, AVBPrint *bp);
+
+/**
+ * Read a whole line of text from AVIOContext to an AVBPrint buffer overwriting
+ * its contents. Stop reading after reaching a \\r, a \\n, a \\r\\n, a \\0 or
+ * EOF. The line ending characters are NOT included in the buffer, but they
+ * are skipped on the input.
+ *
+ * @param s the read-only AVIOContext
+ * @param bp the AVBPrint buffer
+ * @return the length of the read line not including the line endings,
+ * negative on error, or if the buffer becomes truncated.
+ */
+int64_t ff_read_line_to_bprint_overwrite(AVIOContext *s, AVBPrint *bp);
+
#define SPACE_CHARS " \t\r\n"
/**
int ret = 0;
if (rename(oldpath, newpath) == -1) {
ret = AVERROR(errno);
- if (logctx)
- av_log(logctx, AV_LOG_ERROR, "failed to rename file %s to %s\n", oldpath, newpath);
+ if (logctx) {
+ char err[AV_ERROR_MAX_STRING_SIZE] = {0};
+ av_make_error_string(err, AV_ERROR_MAX_STRING_SIZE, ret);
+ av_log(logctx, AV_LOG_ERROR, "failed to rename file %s to %s: %s\n", oldpath, newpath, err);
+ }
}
return ret;
}
* Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end
* which is always set to 0.
*
+ * Previously allocated extradata in par will be freed.
+ *
* @param size size of extradata
* @return 0 if OK, AVERROR_xxx on error
*/
*/
void ff_format_io_close(AVFormatContext *s, AVIOContext **pb);
+/**
+ * Utility function to check if the file uses http or https protocol
+ *
+ * @param s AVFormatContext
+ * @param filename URL or file name to open for writing
+ */
+int ff_is_http_proto(char *filename);
+
/**
* Parse creation_time in AVFormatContext metadata if exists and warn if the
* parsing fails.
int ff_interleaved_peek(AVFormatContext *s, int stream,
AVPacket *pkt, int add_offset);
+
+int ff_lock_avformat(void);
+int ff_unlock_avformat(void);
+
+/**
+ * Set AVFormatContext url field to the provided pointer. The pointer must
+ * point to a valid string. The existing url field is freed if necessary. Also
+ * set the legacy filename field to the same string which was provided in url.
+ */
+void ff_format_set_url(AVFormatContext *s, char *url);
+
+#if FF_API_NEXT
+/**
+ * Register devices in deprecated format linked list.
+ */
+void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[]);
+#endif
+
#endif /* AVFORMAT_INTERNAL_H */