static void opt_show_formats(void)
{
- AVInputFormat *ifmt;
- AVOutputFormat *ofmt;
- URLProtocol *up;
+ AVInputFormat *ifmt=NULL;
+ AVOutputFormat *ofmt=NULL;
+ URLProtocol *up=NULL;
AVCodec *p=NULL, *p2;
AVBitStreamFilter *bsf=NULL;
const char *last_name;
const char *name=NULL;
const char *long_name=NULL;
- for(ofmt = first_oformat; ofmt != NULL; ofmt = ofmt->next) {
+ while(ofmt= av_oformat_next(ofmt)) {
if((name == NULL || strcmp(ofmt->name, name)<0) &&
strcmp(ofmt->name, last_name)>0){
name= ofmt->name;
encode=1;
}
}
- for(ifmt = first_iformat; ifmt != NULL; ifmt = ifmt->next) {
+ while(ifmt= av_iformat_next(ifmt)) {
if((name == NULL || strcmp(ifmt->name, name)<0) &&
strcmp(ifmt->name, last_name)>0){
name= ifmt->name;
printf("\n");
printf("Supported file protocols:\n");
- for(up = first_protocol; up != NULL; up = up->next)
+ while(up = av_protocol_next(up))
printf(" %s:", up->name);
printf("\n");
#ifndef FFMPEG_AVFORMAT_H
#define FFMPEG_AVFORMAT_H
-#define LIBAVFORMAT_VERSION_INT ((52<<16)+(1<<8)+0)
-#define LIBAVFORMAT_VERSION 52.1.0
+#define LIBAVFORMAT_VERSION_INT ((52<<16)+(2<<8)+0)
+#define LIBAVFORMAT_VERSION 52.2.0
#define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT
#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
struct AVPacketList *next;
} AVPacketList;
+#if LIBAVFORMAT_VERSION_INT < (53<<16)
extern AVInputFormat *first_iformat;
extern AVOutputFormat *first_oformat;
+#endif
+
+AVInputFormat *av_iformat_next(AVInputFormat *f);
+AVOutputFormat *av_oformat_next(AVOutputFormat *f);
enum CodecID av_guess_image2_codec(const char *filename);
URLProtocol *first_protocol = NULL;
URLInterruptCB *url_interrupt_cb = default_interrupt_cb;
+URLProtocol *av_protocol_next(URLProtocol *p)
+{
+ if(p) return p->next;
+ else return first_protocol;
+}
+
int register_protocol(URLProtocol *protocol)
{
URLProtocol **p;
extern URLProtocol *first_protocol;
extern URLInterruptCB *url_interrupt_cb;
+URLProtocol *av_protocol_next(URLProtocol *p);
+
int register_protocol(URLProtocol *protocol);
typedef struct {
/** head of registered output format linked list. */
AVOutputFormat *first_oformat = NULL;
+AVInputFormat *av_iformat_next(AVInputFormat *f)
+{
+ if(f) return f->next;
+ else return first_iformat;
+}
+
+AVOutputFormat *av_oformat_next(AVOutputFormat *f)
+{
+ if(f) return f->next;
+ else return first_oformat;
+}
+
void av_register_input_format(AVInputFormat *format)
{
AVInputFormat **p;