@@ -22,12 +22,12 @@
#include <inttypes.h>
-#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "avformat.h"
#include "avio_internal.h"
#include "apetag.h"
#include "internal.h"
+#include "mux.h"
#define APE_TAG_FLAG_CONTAINS_HEADER (1U << 31)
#define APE_TAG_FLAG_LACKS_FOOTER (1 << 30)
@@ -29,6 +29,7 @@
#include "avlanguage.h"
#include "avio_internal.h"
#include "internal.h"
+#include "mux.h"
#include "riff.h"
#include "asf.h"
@@ -23,6 +23,7 @@
#include "caf.h"
#include "isom.h"
#include "avio_internal.h"
+#include "mux.h"
#include "libavutil/intfloat.h"
#include "libavutil/dict.h"
@@ -31,15 +31,14 @@
#include "libavutil/time_internal.h"
#include "avformat.h"
-#include "internal.h"
#include "libavcodec/dv_profile.h"
#include "libavcodec/dv.h"
#include "dv.h"
+#include "mux.h"
#include "libavutil/avassert.h"
#include "libavutil/fifo.h"
#include "libavutil/mathematics.h"
#include "libavutil/intreadwrite.h"
-#include "libavutil/opt.h"
#include "libavutil/timecode.h"
#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32-bit audio
@@ -28,6 +28,7 @@
#include "avio.h"
#include "avio_internal.h"
#include "id3v2.h"
+#include "mux.h"
static void id3v2_put_size(AVIOContext *pb, int size)
{
@@ -881,26 +881,6 @@ void ff_format_io_close_default(AVFormatContext *s, AVIOContext *pb);
*/
int ff_is_http_proto(const char *filename);
-/**
- * Parse creation_time in AVFormatContext metadata if exists and warn if the
- * parsing fails.
- *
- * @param s AVFormatContext
- * @param timestamp parsed timestamp in microseconds, only set on successful parsing
- * @param return_seconds set this to get the number of seconds in timestamp instead of microseconds
- * @return 1 if OK, 0 if the metadata was not present, AVERROR(EINVAL) on parse error
- */
-int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int return_seconds);
-
-/**
- * Standardize creation_time metadata in AVFormatContext to an ISO-8601
- * timestamp string.
- *
- * @param s AVFormatContext
- * @return <0 on error
- */
-int ff_standardize_creation_time(AVFormatContext *s);
-
struct AVBPrint;
/**
* Finalize buf into extradata and set its size appropriately.
@@ -27,6 +27,7 @@
#include "internal.h"
#include "lrc.h"
#include "metadata.h"
+#include "mux.h"
#include "version.h"
#include "libavutil/dict.h"
#include "libavutil/log.h"
@@ -103,4 +103,24 @@ enum AVWriteUncodedFrameFlags {
*/
int ff_format_shift_data(AVFormatContext *s, int64_t read_start, int shift_size);
+/**
+ * Parse creation_time in AVFormatContext metadata if exists and warn if the
+ * parsing fails.
+ *
+ * @param s AVFormatContext
+ * @param timestamp parsed timestamp in microseconds, only set on successful parsing
+ * @param return_seconds set this to get the number of seconds in timestamp instead of microseconds
+ * @return 1 if OK, 0 if the metadata was not present, AVERROR(EINVAL) on parse error
+ */
+int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int return_seconds);
+
+/**
+ * Standardize creation_time metadata in AVFormatContext to an ISO-8601
+ * timestamp string.
+ *
+ * @param s AVFormatContext
+ * @return <0 on error
+ */
+int ff_standardize_creation_time(AVFormatContext *s);
+
#endif /* AVFORMAT_MUX_H */
@@ -19,6 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/dict.h"
+#include "libavutil/internal.h"
+#include "libavutil/log.h"
+#include "libavutil/mem.h"
+#include "libavutil/parseutils.h"
#include "avformat.h"
#include "avio.h"
#include "internal.h"
@@ -79,3 +84,29 @@ end:
av_free(buf);
return ret;
}
+
+int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int return_seconds)
+{
+ AVDictionaryEntry *entry;
+ int64_t parsed_timestamp;
+ int ret;
+ if ((entry = av_dict_get(s->metadata, "creation_time", NULL, 0))) {
+ if ((ret = av_parse_time(&parsed_timestamp, entry->value, 0)) >= 0) {
+ *timestamp = return_seconds ? parsed_timestamp / 1000000 : parsed_timestamp;
+ return 1;
+ } else {
+ av_log(s, AV_LOG_WARNING, "Failed to parse creation_time %s\n", entry->value);
+ return ret;
+ }
+ }
+ return 0;
+}
+
+int ff_standardize_creation_time(AVFormatContext *s)
+{
+ int64_t timestamp;
+ int ret = ff_parse_creation_time_metadata(s, ×tamp, 0);
+ if (ret == 1)
+ return avpriv_dict_set_timestamp(&s->metadata, "creation_time", timestamp);
+ return ret;
+}
@@ -30,6 +30,7 @@
#include "libavutil/opt.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/mpegaudiodata.h"
+#include "mux.h"
#include "nut.h"
#include "internal.h"
#include "avio_internal.h"
@@ -26,6 +26,7 @@
#include "avformat.h"
#include "internal.h"
+#include "mux.h"
#include "smjpeg.h"
typedef struct SMJPEGMuxContext {
@@ -29,7 +29,6 @@
#include "libavutil/dict.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
#include "libavutil/pixfmt.h"
#include "libavutil/thread.h"
#include "libavutil/time.h"
@@ -1689,32 +1688,6 @@ int ff_is_http_proto(const char *filename) {
return proto ? (!av_strcasecmp(proto, "http") || !av_strcasecmp(proto, "https")) : 0;
}
-int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int return_seconds)
-{
- AVDictionaryEntry *entry;
- int64_t parsed_timestamp;
- int ret;
- if ((entry = av_dict_get(s->metadata, "creation_time", NULL, 0))) {
- if ((ret = av_parse_time(&parsed_timestamp, entry->value, 0)) >= 0) {
- *timestamp = return_seconds ? parsed_timestamp / 1000000 : parsed_timestamp;
- return 1;
- } else {
- av_log(s, AV_LOG_WARNING, "Failed to parse creation_time %s\n", entry->value);
- return ret;
- }
- }
- return 0;
-}
-
-int ff_standardize_creation_time(AVFormatContext *s)
-{
- int64_t timestamp;
- int ret = ff_parse_creation_time_metadata(s, ×tamp, 0);
- if (ret == 1)
- return avpriv_dict_set_timestamp(&s->metadata, "creation_time", timestamp);
- return ret;
-}
-
int ff_bprint_to_codecpar_extradata(AVCodecParameters *par, struct AVBPrint *buf)
{
int ret;
@@ -25,12 +25,12 @@
* @author Zhentan Feng <spyfeng at gmail dot com>
*/
-#include "libavutil/intreadwrite.h"
#include "libavutil/avassert.h"
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
#include "mpegts.h"
+#include "mux.h"
#include "wtv.h"
#define WTV_BIGSECTOR_SIZE (1 << WTV_BIGSECTOR_BITS)
Only used by muxers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavformat/apetag.c | 2 +- libavformat/asfenc.c | 1 + libavformat/cafenc.c | 1 + libavformat/dvenc.c | 3 +-- libavformat/id3v2enc.c | 1 + libavformat/internal.h | 20 -------------------- libavformat/lrcenc.c | 1 + libavformat/mux.h | 20 ++++++++++++++++++++ libavformat/mux_utils.c | 31 +++++++++++++++++++++++++++++++ libavformat/nutenc.c | 1 + libavformat/smjpegenc.c | 1 + libavformat/utils.c | 27 --------------------------- libavformat/wtvenc.c | 2 +- 13 files changed, 60 insertions(+), 51 deletions(-)