Commit 82a33c8d authored by Michael Niedermayer's avatar Michael Niedermayer

avformat: Add av_get_frame_filename2() and AV_FRAME_FILENAME_FLAGS_MULTIPLE

This will be used to allow writing file sequences using the tee output onto
multiple places in parallel
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent be63ef3c
...@@ -15,6 +15,9 @@ libavutil: 2015-08-28 ...@@ -15,6 +15,9 @@ libavutil: 2015-08-28
API changes, most recent first: API changes, most recent first:
2016-08-04 - xxxxxxx - lavf 57.46.100 - avformat.h
Add av_get_frame_filename2()
2016-07-09 - xxxxxxx / 90f469a - lavc 57.50.100 / 57.20.0 - avcodec.h 2016-07-09 - xxxxxxx / 90f469a - lavc 57.50.100 / 57.20.0 - avcodec.h
Add FF_PROFILE_H264_MULTIVIEW_HIGH and FF_PROFILE_H264_STEREO_HIGH. Add FF_PROFILE_H264_MULTIVIEW_HIGH and FF_PROFILE_H264_STEREO_HIGH.
......
...@@ -2720,6 +2720,9 @@ void av_dump_format(AVFormatContext *ic, ...@@ -2720,6 +2720,9 @@ void av_dump_format(AVFormatContext *ic,
const char *url, const char *url,
int is_output); int is_output);
#define AV_FRAME_FILENAME_FLAGS_MULTIPLE 1 ///< Allow multiple %d
/** /**
* Return in 'buf' the path with '%d' replaced by a number. * Return in 'buf' the path with '%d' replaced by a number.
* *
...@@ -2730,8 +2733,12 @@ void av_dump_format(AVFormatContext *ic, ...@@ -2730,8 +2733,12 @@ void av_dump_format(AVFormatContext *ic,
* @param buf_size destination buffer size * @param buf_size destination buffer size
* @param path numbered sequence string * @param path numbered sequence string
* @param number frame number * @param number frame number
* @param flags AV_FRAME_FILENAME_FLAGS_*
* @return 0 if OK, -1 on format error * @return 0 if OK, -1 on format error
*/ */
int av_get_frame_filename2(char *buf, int buf_size,
const char *path, int number, int flags);
int av_get_frame_filename(char *buf, int buf_size, int av_get_frame_filename(char *buf, int buf_size,
const char *path, int number); const char *path, int number);
......
...@@ -4315,7 +4315,7 @@ uint64_t ff_ntp_time(void) ...@@ -4315,7 +4315,7 @@ uint64_t ff_ntp_time(void)
return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US; return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US;
} }
int av_get_frame_filename(char *buf, int buf_size, const char *path, int number) int av_get_frame_filename2(char *buf, int buf_size, const char *path, int number, int flags)
{ {
const char *p; const char *p;
char *q, buf1[20], c; char *q, buf1[20], c;
...@@ -4340,7 +4340,7 @@ int av_get_frame_filename(char *buf, int buf_size, const char *path, int number) ...@@ -4340,7 +4340,7 @@ int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
case '%': case '%':
goto addchar; goto addchar;
case 'd': case 'd':
if (percentd_found) if (!(flags & AV_FRAME_FILENAME_FLAGS_MULTIPLE) && percentd_found)
goto fail; goto fail;
percentd_found = 1; percentd_found = 1;
if (number < 0) if (number < 0)
...@@ -4370,6 +4370,11 @@ fail: ...@@ -4370,6 +4370,11 @@ fail:
return -1; return -1;
} }
int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
{
return av_get_frame_filename2(buf, buf_size, path, number, 0);
}
void av_url_split(char *proto, int proto_size, void av_url_split(char *proto, int proto_size,
char *authorization, int authorization_size, char *authorization, int authorization_size,
char *hostname, int hostname_size, char *hostname, int hostname_size,
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium) // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you belive might be affected here // Also please add any ticket numbers that you belive might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 57 #define LIBAVFORMAT_VERSION_MAJOR 57
#define LIBAVFORMAT_VERSION_MINOR 45 #define LIBAVFORMAT_VERSION_MINOR 46
#define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment