History

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

Michael Niedermayer committed 10 years ago

Commit 82a33c81 parent be63ef34 files · +18 −3Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavformat/avformat.h +7 −0
  3. libavformat/utils.c +7 −2
  4. libavformat/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2015-08-28 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
18+2016-08-04 - xxxxxxx - lavf 57.46.100 - avformat.h
19+ Add av_get_frame_filename2()
20+
1821 2016-07-09 - xxxxxxx / 90f469a - lavc 57.50.100 / 57.20.0 - avcodec.h
1922 Add FF_PROFILE_H264_MULTIVIEW_HIGH and FF_PROFILE_H264_STEREO_HIGH.
2023
libavformat/avformat.h+7−0
@@ -2720,6 +2720,9 @@ void av_dump_format(AVFormatContext *ic, · 2719 unmodified lines
27202720 const char *url,
27212721 int is_output);
27222722
2723+
2724+#define AV_FRAME_FILENAME_FLAGS_MULTIPLE 1 ///< Allow multiple %d
2725+
27232726 /**
27242727 * Return in 'buf' the path with '%d' replaced by a number.
27252728 *
@@ -2730,8 +2733,12 @@ void av_dump_format(AVFormatContext *ic, · 4 unmodified lines
27302733 * @param buf_size destination buffer size
27312734 * @param path numbered sequence string
27322735 * @param number frame number
2736+ * @param flags AV_FRAME_FILENAME_FLAGS_*
27332737 * @return 0 if OK, -1 on format error
27342738 */
2739+int av_get_frame_filename2(char *buf, int buf_size,
2740+ const char *path, int number, int flags);
2741+
27352742 int av_get_frame_filename(char *buf, int buf_size,
27362743 const char *path, int number);
27372744
libavformat/utils.c+7−2
@@ -4315,7 +4315,7 @@ uint64_t ff_ntp_time(void) · 4314 unmodified lines
43154315 return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US;
43164316 }
43174317
4318−int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
4318+int av_get_frame_filename2(char *buf, int buf_size, const char *path, int number, int flags)
43194319 {
43204320 const char *p;
43214321 char *q, buf1[20], c;
@@ -4340,7 +4340,7 @@ int av_get_frame_filename(char *buf, int buf_size, const char *path, int number) · 18 unmodified lines
43404340 case '%':
43414341 goto addchar;
43424342 case 'd':
4343− if (percentd_found)
4343+ if (!(flags & AV_FRAME_FILENAME_FLAGS_MULTIPLE) && percentd_found)
43444344 goto fail;
43454345 percentd_found = 1;
43464346 if (number < 0)
@@ -4370,6 +4370,11 @@ fail: · 23 unmodified lines
43704370 return -1;
43714371 }
43724372
4373+int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
4374+{
4375+ return av_get_frame_filename2(buf, buf_size, path, number, 0);
4376+}
4377+
43734378 void av_url_split(char *proto, int proto_size,
43744379 char *authorization, int authorization_size,
43754380 char *hostname, int hostname_size,
libavformat/version.h+1−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
3333 // Also please add any ticket numbers that you belive might be affected here
3434 #define LIBAVFORMAT_VERSION_MAJOR 57
35−#define LIBAVFORMAT_VERSION_MINOR 45
35+#define LIBAVFORMAT_VERSION_MINOR 46
3636 #define LIBAVFORMAT_VERSION_MICRO 100
3737
3838 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t