summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-06 16:45:00 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-10 07:31:47 +0200
commit437484a66a3c1d002ab6683eab6eba90d517a35a (patch)
tree1d5e7cce43be171f84abf02a543046971a96b085 /libavformat
parentd78838414b8362a7aa7c27abacee1f6ca036199c (diff)
avformat/utils: Move ff_format_output_open() to mux_utils.c
It is obviously a muxing-only function. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/fifo.c1
-rw-r--r--libavformat/internal.h10
-rw-r--r--libavformat/mux.h10
-rw-r--r--libavformat/mux_utils.c10
-rw-r--r--libavformat/tee.c2
-rw-r--r--libavformat/utils.c10
6 files changed, 22 insertions, 21 deletions
diff --git a/libavformat/fifo.c b/libavformat/fifo.c
index 86e5d369b5..ead2bdc5cf 100644
--- a/libavformat/fifo.c
+++ b/libavformat/fifo.c
@@ -28,6 +28,7 @@
#include "libavutil/threadmessage.h"
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#define FIFO_DEFAULT_QUEUE_SIZE 60
#define FIFO_DEFAULT_MAX_RECOVERY_ATTEMPTS 0
diff --git a/libavformat/internal.h b/libavformat/internal.h
index 03b9bb8e37..51deb1c49f 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -849,16 +849,6 @@ int ff_copy_whiteblacklists(AVFormatContext *dst, const AVFormatContext *src);
*/
#define FFERROR_REDO FFERRTAG('R','E','D','O')
-/**
- * Utility function to open IO stream of output format.
- *
- * @param s AVFormatContext
- * @param url URL or file name to open for writing
- * @options optional options which will be passed to io_open callback
- * @return >=0 on success, negative AVERROR in case of failure
- */
-int ff_format_output_open(AVFormatContext *s, const char *url, AVDictionary **options);
-
/*
* A wrapper around AVFormatContext.io_close that should be used
* instead of calling the pointer directly.
diff --git a/libavformat/mux.h b/libavformat/mux.h
index 246101f0c8..1bfcaf795f 100644
--- a/libavformat/mux.h
+++ b/libavformat/mux.h
@@ -104,6 +104,16 @@ enum AVWriteUncodedFrameFlags {
int ff_format_shift_data(AVFormatContext *s, int64_t read_start, int shift_size);
/**
+ * Utility function to open IO stream of output format.
+ *
+ * @param s AVFormatContext
+ * @param url URL or file name to open for writing
+ * @options optional options which will be passed to io_open callback
+ * @return >=0 on success, negative AVERROR in case of failure
+ */
+int ff_format_output_open(AVFormatContext *s, const char *url, AVDictionary **options);
+
+/**
* Parse creation_time in AVFormatContext metadata if exists and warn if the
* parsing fails.
*
diff --git a/libavformat/mux_utils.c b/libavformat/mux_utils.c
index df264fc6a0..83c1482540 100644
--- a/libavformat/mux_utils.c
+++ b/libavformat/mux_utils.c
@@ -85,6 +85,16 @@ end:
return ret;
}
+int ff_format_output_open(AVFormatContext *s, const char *url, AVDictionary **options)
+{
+ if (!s->oformat)
+ return AVERROR(EINVAL);
+
+ if (!(s->oformat->flags & AVFMT_NOFILE))
+ return s->io_open(s, &s->pb, url, AVIO_FLAG_WRITE, options);
+ return 0;
+}
+
int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int return_seconds)
{
AVDictionaryEntry *entry;
diff --git a/libavformat/tee.c b/libavformat/tee.c
index b3bcd70b9f..f1f2a9d2a5 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -26,7 +26,7 @@
#include "libavcodec/bsf.h"
#include "internal.h"
#include "avformat.h"
-#include "avio_internal.h"
+#include "mux.h"
#include "tee_common.h"
typedef enum {
diff --git a/libavformat/utils.c b/libavformat/utils.c
index a695f19b03..58d2524457 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1655,16 +1655,6 @@ uint8_t *av_stream_new_side_data(AVStream *st, enum AVPacketSideDataType type,
return data;
}
-int ff_format_output_open(AVFormatContext *s, const char *url, AVDictionary **options)
-{
- if (!s->oformat)
- return AVERROR(EINVAL);
-
- if (!(s->oformat->flags & AVFMT_NOFILE))
- return s->io_open(s, &s->pb, url, AVIO_FLAG_WRITE, options);
- return 0;
-}
-
void ff_format_io_close_default(AVFormatContext *s, AVIOContext *pb)
{
avio_close(pb);