Browse Source

add FF_API_URL_CLASS define to enable usage of URLContext as a AVClass

Originally committed as revision 24835 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/n0.8
Aurelien Jacobs 15 years ago
parent
commit
404eba44b1
3 changed files with 6 additions and 3 deletions
  1. +3
    -0
      libavformat/avformat.h
  2. +2
    -2
      libavformat/avio.c
  3. +1
    -1
      libavformat/avio.h

+ 3
- 0
libavformat/avformat.h View File

@@ -45,6 +45,9 @@
#ifndef FF_API_OLD_METADATA #ifndef FF_API_OLD_METADATA
#define FF_API_OLD_METADATA (LIBAVFORMAT_VERSION_MAJOR < 53) #define FF_API_OLD_METADATA (LIBAVFORMAT_VERSION_MAJOR < 53)
#endif #endif
#ifndef FF_API_URL_CLASS
#define FF_API_URL_CLASS (LIBAVFORMAT_VERSION_MAJOR >= 53)
#endif


/** /**
* I return the LIBAVFORMAT_VERSION_INT constant. You got * I return the LIBAVFORMAT_VERSION_INT constant. You got


+ 2
- 2
libavformat/avio.c View File

@@ -30,7 +30,7 @@
#include "network.h" #include "network.h"
#endif #endif


#if LIBAVFORMAT_VERSION_MAJOR >= 53
#if FF_API_URL_CLASS
/** @name Logging context. */ /** @name Logging context. */
/*@{*/ /*@{*/
static const char *urlcontext_to_name(void *ptr) static const char *urlcontext_to_name(void *ptr)
@@ -109,7 +109,7 @@ static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up,
err = AVERROR(ENOMEM); err = AVERROR(ENOMEM);
goto fail; goto fail;
} }
#if LIBAVFORMAT_VERSION_MAJOR >= 53
#if FF_API_URL_CLASS
uc->av_class = &urlcontext_class; uc->av_class = &urlcontext_class;
#endif #endif
uc->filename = (char *) &uc[1]; uc->filename = (char *) &uc[1];


+ 1
- 1
libavformat/avio.h View File

@@ -43,7 +43,7 @@
* sizeof(URLContext) must not be used outside libav*. * sizeof(URLContext) must not be used outside libav*.
*/ */
typedef struct URLContext { typedef struct URLContext {
#if LIBAVFORMAT_VERSION_MAJOR >= 53
#if FF_API_URL_CLASS
const AVClass *av_class; ///< information for av_log(). Set by url_open(). const AVClass *av_class; ///< information for av_log(). Set by url_open().
#endif #endif
struct URLProtocol *prot; struct URLProtocol *prot;


Loading…
Cancel
Save