[FFmpeg-cvslog] r12411 - in trunk/libavformat: avio.c avio.h

superdump subversion
Mon Mar 10 20:03:39 CET 2008


Author: superdump
Date: Mon Mar 10 20:03:39 2008
New Revision: 12411

Log:
Add AVClass to URLContext at next major version bump

Patch by Bj?rn Axelsson (bjorn axelsson intinor se)


Modified:
   trunk/libavformat/avio.c
   trunk/libavformat/avio.h

Modified: trunk/libavformat/avio.c
==============================================================================
--- trunk/libavformat/avio.c	(original)
+++ trunk/libavformat/avio.c	Mon Mar 10 20:03:39 2008
@@ -20,6 +20,22 @@
  */
 #include "avformat.h"
 #include "avstring.h"
+#include "opt.h"
+
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
+/** @name Logging context. */
+/*@{*/
+static const char *urlcontext_to_name(void *ptr)
+{
+    URLContext *h = (URLContext *)ptr;
+    if(h->prot) return h->prot->name;
+    else        return "NULL";
+}
+static const AVOption options[] = {{NULL}};
+static const AVClass urlcontext_class =
+        { "URLContext", urlcontext_to_name, options };
+/*@}*/
+#endif
 
 static int default_interrupt_cb(void);
 
@@ -82,6 +98,9 @@ int url_open(URLContext **puc, const cha
         err = AVERROR(ENOMEM);
         goto fail;
     }
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
+    uc->av_class = &urlcontext_class;
+#endif
     uc->filename = (char *) &uc[1];
     strcpy(uc->filename, filename);
     uc->prot = up;

Modified: trunk/libavformat/avio.h
==============================================================================
--- trunk/libavformat/avio.h	(original)
+++ trunk/libavformat/avio.h	Mon Mar 10 20:03:39 2008
@@ -37,6 +37,9 @@ typedef int64_t offset_t;
  * sizeof(URLContext) must not be used outside libav*.
  */
 struct URLContext {
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
+    const AVClass *av_class; ///< information for av_log(). Set by url_open().
+#endif
     struct URLProtocol *prot;
     int flags;
     int is_streamed;  /**< true if streamed (no seek possible), default = false */




More information about the ffmpeg-cvslog mailing list