]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/internal.h
Merge commit 'eccc03c8fbc603a0a3257df66f0705f74fe2581a'
[ffmpeg] / libavformat / internal.h
index 36a57214cede9960130e5004be64cb6c0cf646e0..0d08576c299ae03c3342f1f3891aa3ecddae62a6 100644 (file)
@@ -541,8 +541,11 @@ static inline int ff_rename(const char *oldpath, const char *newpath, void *logc
     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;
 }
@@ -618,6 +621,14 @@ int ff_format_output_open(AVFormatContext *s, const char *url, AVDictionary **op
  */
 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.
@@ -681,4 +692,22 @@ int ff_bprint_to_codecpar_extradata(AVCodecParameters *par, struct AVBPrint *buf
 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 */