Browse code

lavf: rename ff_probe_input_buffer to make it public

It is useful for applications that hand input data directly to lavf via
a ByteIOContext.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>

Anssi Hannula authored on 2011/02/08 07:46:53
Showing 5 changed files
... ...
@@ -13,6 +13,10 @@ libavutil:   2009-03-08
13 13
 
14 14
 API changes, most recent first:
15 15
 
16
+2011-02-08 - xxxxxxx - lavf 52.98.0 - av_probe_input_buffer
17
+  Add av_probe_input_buffer() to avformat.h for probing format from a
18
+  ByteIOContext.
19
+
16 20
 2011-02-06 - fe174fc - lavf 52.97.0 - avio.h
17 21
   Add flag for non-blocking protocols: URL_FLAG_NONBLOCK
18 22
 
... ...
@@ -1039,6 +1039,25 @@ AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
1039 1039
 AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);
1040 1040
 
1041 1041
 /**
1042
+ * Probe a bytestream to determine the input format. Each time a probe returns
1043
+ * with a score that is too low, the probe buffer size is increased and another
1044
+ * attempt is made. When the maximum probe size is reached, the input format
1045
+ * with the highest score is returned.
1046
+ *
1047
+ * @param pb the bytestream to probe
1048
+ * @param fmt the input format is put here
1049
+ * @param filename the filename of the stream
1050
+ * @param logctx the log context
1051
+ * @param offset the offset within the bytestream to probe from
1052
+ * @param max_probe_size the maximum probe buffer size (zero for default)
1053
+ * @return 0 in case of success, a negative value corresponding to an
1054
+ * AVERROR code otherwise
1055
+ */
1056
+int av_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt,
1057
+                          const char *filename, void *logctx,
1058
+                          unsigned int offset, unsigned int max_probe_size);
1059
+
1060
+/**
1042 1061
  * Allocate all the structures needed to read an input stream.
1043 1062
  *        This does not open the needed codecs for decoding the stream[s].
1044 1063
  */
... ...
@@ -82,25 +82,6 @@ void ff_read_frame_flush(AVFormatContext *s);
82 82
 /** Get the current time since NTP epoch in microseconds. */
83 83
 uint64_t ff_ntp_time(void);
84 84
 
85
-/**
86
- * Probe a bytestream to determine the input format. Each time a probe returns
87
- * with a score that is too low, the probe buffer size is increased and another
88
- * attempt is made. When the maximum probe size is reached, the input format
89
- * with the highest score is returned.
90
- *
91
- * @param pb the bytestream to probe
92
- * @param fmt the input format is put here
93
- * @param filename the filename of the stream
94
- * @param logctx the log context
95
- * @param offset the offset within the bytestream to probe from
96
- * @param max_probe_size the maximum probe buffer size (zero for default)
97
- * @return 0 in case of success, a negative value corresponding to an
98
- * AVERROR code otherwise
99
- */
100
-int ff_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt,
101
-                          const char *filename, void *logctx,
102
-                          unsigned int offset, unsigned int max_probe_size);
103
-
104 85
 #if FF_API_URL_SPLIT
105 86
 /**
106 87
  * @deprecated use av_url_split() instead
... ...
@@ -524,7 +524,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
524 524
 #define PROBE_BUF_MIN 2048
525 525
 #define PROBE_BUF_MAX (1<<20)
526 526
 
527
-int ff_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt,
527
+int av_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt,
528 528
                           const char *filename, void *logctx,
529 529
                           unsigned int offset, unsigned int max_probe_size)
530 530
 {
... ...
@@ -622,7 +622,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
622 622
         if (buf_size > 0) {
623 623
             url_setbufsize(pb, buf_size);
624 624
         }
625
-        if (!fmt && (err = ff_probe_input_buffer(pb, &fmt, filename, logctx, 0, logctx ? (*ic_ptr)->probesize : 0)) < 0) {
625
+        if (!fmt && (err = av_probe_input_buffer(pb, &fmt, filename, logctx, 0, logctx ? (*ic_ptr)->probesize : 0)) < 0) {
626 626
             goto fail;
627 627
         }
628 628
     }
... ...
@@ -24,7 +24,7 @@
24 24
 #include "libavutil/avutil.h"
25 25
 
26 26
 #define LIBAVFORMAT_VERSION_MAJOR 52
27
-#define LIBAVFORMAT_VERSION_MINOR 97
27
+#define LIBAVFORMAT_VERSION_MINOR 98
28 28
 #define LIBAVFORMAT_VERSION_MICRO  0
29 29
 
30 30
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \