[FFmpeg-cvslog] r19173 - trunk/libavformat/adtsenc.c

Ronald S. Bultje rsbultje
Thu Jun 25 05:11:21 CEST 2009


Howdy,

On Wed, Jun 24, 2009 at 7:54 AM, Michael Niedermayer <michaelni at gmx.at>wrote:

> On Sat, Jun 20, 2009 at 01:28:02PM -0400, Ronald S. Bultje wrote:
> > On Sat, Jun 20, 2009 at 12:34 PM, Michael Niedermayer <michaelni at gmx.at
> >wrote:
> > > > but shouldn't be used outside.
> > >
> > > why?
> >
> > I meant "in applications", e.g. in ffplay.c derivatives or so. Why? good
> > question, I suppose that's why it's in internal.h. I don't care if it is
> > used outside. :-). Maybe that' the right solution. Can I move it to
> > lavc/avcodec.h?
>
> you can but make sure theres a note in the doxy that its intended to be
> used by other libav* and not the user apps


See attached. I chose libavutil because log.h is there.

Ronald
-------------- next part --------------
Index: ffmpeg-svn/libavcodec/aac.c
===================================================================
--- ffmpeg-svn.orig/libavcodec/aac.c	2009-06-23 10:37:02.000000000 -0400
+++ ffmpeg-svn/libavcodec/aac.c	2009-06-24 22:59:01.000000000 -0400
@@ -320,7 +320,7 @@
     int extension_flag, ret;
 
     if(get_bits1(gb)) {  // frameLengthFlag
-        ff_log_missing_feature(ac->avccontext, "960/120 MDCT window is", 1);
+        av_log_missing_feature(ac->avccontext, "960/120 MDCT window is", 1);
         return -1;
     }
 
@@ -588,7 +588,7 @@
                 memset(ics, 0, sizeof(IndividualChannelStream));
                 return -1;
             } else {
-                ff_log_missing_feature(ac->avccontext, "Predictor bit set but LTP is", 1);
+                av_log_missing_feature(ac->avccontext, "Predictor bit set but LTP is", 1);
                 memset(ics, 0, sizeof(IndividualChannelStream));
                 return -1;
             }
@@ -1040,7 +1040,7 @@
         if ((tns->present = get_bits1(gb)) && decode_tns(ac, tns, gb, ics))
             return -1;
         if (get_bits1(gb)) {
-            ff_log_missing_feature(ac->avccontext, "SSR", 1);
+            av_log_missing_feature(ac->avccontext, "SSR", 1);
             return -1;
         }
     }
@@ -1245,7 +1245,7 @@
  */
 static int decode_sbr_extension(AACContext * ac, GetBitContext * gb, int crc, int cnt) {
     // TODO : sbr_extension implementation
-    ff_log_missing_feature(ac->avccontext, "SBR", 0);
+    av_log_missing_feature(ac->avccontext, "SBR", 0);
     skip_bits_long(gb, 8*cnt - 4); // -4 due to reading extension type
     return cnt;
 }
@@ -1588,7 +1588,7 @@
             if (!hdr_info.crc_absent)
                 skip_bits(gb, 16);
         } else {
-            ff_log_missing_feature(ac->avccontext, "More than one AAC RDB per ADTS frame is", 0);
+            av_log_missing_feature(ac->avccontext, "More than one AAC RDB per ADTS frame is", 0);
             return -1;
         }
     }
Index: ffmpeg-svn/libavcodec/aac_adtstoasc_bsf.c
===================================================================
--- ffmpeg-svn.orig/libavcodec/aac_adtstoasc_bsf.c	2009-06-09 16:44:34.000000000 -0400
+++ ffmpeg-svn/libavcodec/aac_adtstoasc_bsf.c	2009-06-24 22:59:01.000000000 -0400
@@ -61,7 +61,7 @@
     }
 
     if (!hdr.crc_absent && hdr.num_aac_frames > 1) {
-        ff_log_missing_feature(avctx, "Multiple RDBs per frame with CRC is", 0);
+        av_log_missing_feature(avctx, "Multiple RDBs per frame with CRC is", 0);
         return -1;
     }
 
@@ -74,7 +74,7 @@
         if (!hdr.chan_config) {
             init_get_bits(&gb, buf, buf_size);
             if (get_bits(&gb, 3) != 5) {
-                ff_log_missing_feature(avctx, "PCE based channel configuration, where the PCE is not the first syntax element is", 0);
+                av_log_missing_feature(avctx, "PCE based channel configuration, where the PCE is not the first syntax element is", 0);
                 return -1;
             }
             init_put_bits(&pb, pce_data, MAX_PCE_SIZE);
Index: ffmpeg-svn/libavcodec/ac3dec.c
===================================================================
--- ffmpeg-svn.orig/libavcodec/ac3dec.c	2009-06-09 16:44:32.000000000 -0400
+++ ffmpeg-svn/libavcodec/ac3dec.c	2009-06-24 22:59:01.000000000 -0400
@@ -820,7 +820,7 @@
     /* spectral extension strategy */
     if (s->eac3 && (!blk || get_bits1(gbc))) {
         if (get_bits1(gbc)) {
-            ff_log_missing_feature(s->avctx, "Spectral extension", 1);
+            av_log_missing_feature(s->avctx, "Spectral extension", 1);
             return -1;
         }
         /* TODO: parse spectral extension strategy info */
@@ -845,7 +845,7 @@
             /* check for enhanced coupling */
             if (s->eac3 && get_bits1(gbc)) {
                 /* TODO: parse enhanced coupling strategy info */
-                ff_log_missing_feature(s->avctx, "Enhanced coupling", 1);
+                av_log_missing_feature(s->avctx, "Enhanced coupling", 1);
                 return -1;
             }
 
Index: ffmpeg-svn/libavcodec/eac3dec.c
===================================================================
--- ffmpeg-svn.orig/libavcodec/eac3dec.c	2009-06-09 16:44:36.000000000 -0400
+++ ffmpeg-svn/libavcodec/eac3dec.c	2009-06-24 22:59:01.000000000 -0400
@@ -214,7 +214,7 @@
        application can select from. each independent stream can also contain
        dependent streams which are used to add or replace channels. */
     if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
-        ff_log_missing_feature(s->avctx, "Dependent substream decoding", 1);
+        av_log_missing_feature(s->avctx, "Dependent substream decoding", 1);
         return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
     } else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) {
         av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\n");
@@ -226,7 +226,7 @@
        associated to an independent stream have matching substream id's. */
     if (s->substreamid) {
         /* only decode substream with id=0. skip any additional substreams. */
-        ff_log_missing_feature(s->avctx, "Additional substreams", 1);
+        av_log_missing_feature(s->avctx, "Additional substreams", 1);
         return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
     }
 
@@ -235,7 +235,7 @@
            rates in bit allocation.  The best assumption would be that it is
            handled like AC-3 DolbyNet, but we cannot be sure until we have a
            sample which utilizes this feature. */
-        ff_log_missing_feature(s->avctx, "Reduced sampling rates", 1);
+        av_log_missing_feature(s->avctx, "Reduced sampling rates", 1);
         return -1;
     }
     skip_bits(gbc, 5); // skip bitstream id
@@ -492,7 +492,7 @@
 
     /* spectral extension attenuation data */
     if (parse_spx_atten_data) {
-        ff_log_missing_feature(s->avctx, "Spectral extension attenuation", 1);
+        av_log_missing_feature(s->avctx, "Spectral extension attenuation", 1);
         for (ch = 1; ch <= s->fbw_channels; ch++) {
             if (get_bits1(gbc)) { // channel has spx attenuation
                 skip_bits(gbc, 5); // skip spx attenuation code
@@ -508,7 +508,7 @@
            It is likely the offset of each block within the frame. */
         int block_start_bits = (s->num_blocks-1) * (4 + av_log2(s->frame_size-2));
         skip_bits_long(gbc, block_start_bits);
-        ff_log_missing_feature(s->avctx, "Block start info", 1);
+        av_log_missing_feature(s->avctx, "Block start info", 1);
     }
 
     /* syntax state initialization */
Index: ffmpeg-svn/libavcodec/flacdec.c
===================================================================
--- ffmpeg-svn.orig/libavcodec/flacdec.c	2009-04-13 16:10:11.000000000 -0400
+++ ffmpeg-svn/libavcodec/flacdec.c	2009-06-24 22:59:00.000000000 -0400
@@ -448,7 +448,7 @@
         s->curr_bps -= wasted;
     }
     if (s->curr_bps > 32) {
-        ff_log_missing_feature(s->avctx, "decorrelated bit depth > 32", 0);
+        av_log_missing_feature(s->avctx, "decorrelated bit depth > 32", 0);
         return -1;
     }
 
Index: ffmpeg-svn/libavcodec/internal.h
===================================================================
--- ffmpeg-svn.orig/libavcodec/internal.h	2009-06-24 22:54:37.000000000 -0400
+++ ffmpeg-svn/libavcodec/internal.h	2009-06-24 23:10:22.000000000 -0400
@@ -37,7 +37,7 @@
  * message which tells the user how to report samples to the development
  * mailing list.
  */
-void ff_log_missing_feature(void *avc, const char *feature, int want_sample);
+void av_log_missing_feature(void *avc, const char *feature, int want_sample);
 
 /**
  * Logs a generic warning message asking for a sample.
@@ -45,7 +45,7 @@
  * a pointer to an AVClass struct
  * @param[in] msg string containing an optional message, or NULL if no message
  */
-void ff_log_ask_for_sample(void *avc, const char *msg);
+void av_log_ask_for_sample(void *avc, const char *msg);
 
 /**
  * Determines whether pix_fmt is a hardware accelerated format.
Index: ffmpeg-svn/libavcodec/qcelpdec.c
===================================================================
--- ffmpeg-svn.orig/libavcodec/qcelpdec.c	2009-06-09 16:44:36.000000000 -0400
+++ ffmpeg-svn/libavcodec/qcelpdec.c	2009-06-24 22:59:00.000000000 -0400
@@ -432,7 +432,7 @@
     if(scalefactor)
         scalefactor = sqrt(ff_dot_productf(v_ref, v_ref, len) / scalefactor);
     else
-        ff_log_missing_feature(NULL, "Zero energy for gain control", 1);
+        av_log_missing_feature(NULL, "Zero energy for gain control", 1);
     return scalefactor;
 }
 
@@ -716,7 +716,7 @@
     if(bitrate == SILENCE)
     {
         //FIXME: Remove experimental warning when tested with samples.
-        ff_log_ask_for_sample(avctx, "'Blank frame handling is experimental.");
+        av_log_ask_for_sample(avctx, "'Blank frame handling is experimental.");
     }
     return bitrate;
 }
Index: ffmpeg-svn/libavcodec/utils.c
===================================================================
--- ffmpeg-svn.orig/libavcodec/utils.c	2009-06-24 22:54:46.000000000 -0400
+++ ffmpeg-svn/libavcodec/utils.c	2009-06-24 23:10:22.000000000 -0400
@@ -1191,19 +1191,19 @@
         return 0;
 }
 
-void ff_log_missing_feature(void *avc, const char *feature, int want_sample)
+void av_log_missing_feature(void *avc, const char *feature, int want_sample)
 {
     av_log(avc, AV_LOG_WARNING, "%s not implemented. Update your FFmpeg "
             "version to the newest one from SVN. If the problem still "
             "occurs, it means that your file has a feature which has not "
             "been implemented.", feature);
     if(want_sample)
-        ff_log_ask_for_sample(avc, NULL);
+        av_log_ask_for_sample(avc, NULL);
     else
         av_log(avc, AV_LOG_WARNING, "\n");
 }
 
-void ff_log_ask_for_sample(void *avc, const char *msg)
+void av_log_ask_for_sample(void *avc, const char *msg)
 {
     if (msg)
         av_log(avc, AV_LOG_WARNING, "%s ", msg);
-------------- next part --------------
Index: ffmpeg-svn/libavcodec/internal.h
===================================================================
--- ffmpeg-svn.orig/libavcodec/internal.h	2009-06-24 22:55:24.000000000 -0400
+++ ffmpeg-svn/libavcodec/internal.h	2009-06-24 23:00:59.000000000 -0400
@@ -28,26 +28,6 @@
 #include "avcodec.h"
 
 /**
- * Logs a generic warning message about a missing feature.
- * @param[in] avc a pointer to an arbitrary struct of which the first field is
- * a pointer to an AVClass struct
- * @param[in] feature string containing the name of the missing feature
- * @param[in] want_sample indicates if samples are wanted which exhibit this feature.
- * If want_sample is non-zero, additional verbage will be added to the log
- * message which tells the user how to report samples to the development
- * mailing list.
- */
-void av_log_missing_feature(void *avc, const char *feature, int want_sample);
-
-/**
- * Logs a generic warning message asking for a sample.
- * @param[in] avc a pointer to an arbitrary struct of which the first field is
- * a pointer to an AVClass struct
- * @param[in] msg string containing an optional message, or NULL if no message
- */
-void av_log_ask_for_sample(void *avc, const char *msg);
-
-/**
  * Determines whether pix_fmt is a hardware accelerated format.
  */
 int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt);
Index: ffmpeg-svn/libavcodec/utils.c
===================================================================
--- ffmpeg-svn.orig/libavcodec/utils.c	2009-06-24 22:55:08.000000000 -0400
+++ ffmpeg-svn/libavcodec/utils.c	2009-06-24 23:02:25.000000000 -0400
@@ -1191,27 +1191,6 @@
         return 0;
 }
 
-void av_log_missing_feature(void *avc, const char *feature, int want_sample)
-{
-    av_log(avc, AV_LOG_WARNING, "%s not implemented. Update your FFmpeg "
-            "version to the newest one from SVN. If the problem still "
-            "occurs, it means that your file has a feature which has not "
-            "been implemented.", feature);
-    if(want_sample)
-        av_log_ask_for_sample(avc, NULL);
-    else
-        av_log(avc, AV_LOG_WARNING, "\n");
-}
-
-void av_log_ask_for_sample(void *avc, const char *msg)
-{
-    if (msg)
-        av_log(avc, AV_LOG_WARNING, "%s ", msg);
-    av_log(avc, AV_LOG_WARNING, "If you want to help, upload a sample "
-            "of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ "
-            "and contact the ffmpeg-devel mailing list.\n");
-}
-
 static AVHWAccel *first_hwaccel = NULL;
 
 void av_register_hwaccel(AVHWAccel *hwaccel)
Index: ffmpeg-svn/libavutil/log.c
===================================================================
--- ffmpeg-svn.orig/libavutil/log.c	2009-02-26 08:54:04.000000000 -0500
+++ ffmpeg-svn/libavutil/log.c	2009-06-24 23:02:45.000000000 -0400
@@ -87,3 +87,24 @@
 {
     av_log_callback = callback;
 }
+
+void av_log_missing_feature(void *avc, const char *feature, int want_sample)
+{
+    av_log(avc, AV_LOG_WARNING, "%s not implemented. Update your FFmpeg "
+            "version to the newest one from SVN. If the problem still "
+            "occurs, it means that your file has a feature which has not "
+            "been implemented.", feature);
+    if(want_sample)
+        av_log_ask_for_sample(avc, NULL);
+    else
+        av_log(avc, AV_LOG_WARNING, "\n");
+}
+
+void av_log_ask_for_sample(void *avc, const char *msg)
+{
+    if (msg)
+        av_log(avc, AV_LOG_WARNING, "%s ", msg);
+    av_log(avc, AV_LOG_WARNING, "If you want to help, upload a sample "
+            "of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ "
+            "and contact the ffmpeg-devel mailing list.\n");
+}
Index: ffmpeg-svn/libavutil/log.h
===================================================================
--- ffmpeg-svn.orig/libavutil/log.h	2009-06-09 16:44:26.000000000 -0400
+++ ffmpeg-svn/libavutil/log.h	2009-06-24 23:01:49.000000000 -0400
@@ -113,4 +113,24 @@
 void av_log_set_callback(void (*)(void*, int, const char*, va_list));
 void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
 
+/**
+ * Logs a generic warning message about a missing feature.
+ * @param[in] avc a pointer to an arbitrary struct of which the first field is
+ * a pointer to an AVClass struct
+ * @param[in] feature string containing the name of the missing feature
+ * @param[in] want_sample indicates if samples are wanted which exhibit this feature.
+ * If want_sample is non-zero, additional verbage will be added to the log
+ * message which tells the user how to report samples to the development
+ * mailing list.
+ */
+void av_log_missing_feature(void *avc, const char *feature, int want_sample);
+
+/**
+ * Logs a generic warning message asking for a sample.
+ * @param[in] avc a pointer to an arbitrary struct of which the first field is
+ * a pointer to an AVClass struct
+ * @param[in] msg string containing an optional message, or NULL if no message
+ */
+void av_log_ask_for_sample(void *avc, const char *msg);
+
 #endif /* AVUTIL_LOG_H */
-------------- next part --------------
Index: ffmpeg-svn/libavutil/log.h
===================================================================
--- ffmpeg-svn.orig/libavutil/log.h	2009-06-24 23:01:49.000000000 -0400
+++ ffmpeg-svn/libavutil/log.h	2009-06-24 23:09:22.000000000 -0400
@@ -114,7 +114,9 @@
 void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
 
 /**
- * Logs a generic warning message about a missing feature.
+ * Logs a generic warning message about a missing feature. This function is
+ * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
+ * only, and would normally not be used by applications.
  * @param[in] avc a pointer to an arbitrary struct of which the first field is
  * a pointer to an AVClass struct
  * @param[in] feature string containing the name of the missing feature
@@ -126,7 +128,9 @@
 void av_log_missing_feature(void *avc, const char *feature, int want_sample);
 
 /**
- * Logs a generic warning message asking for a sample.
+ * Logs a generic warning message asking for a sample. This function is
+ * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
+ * only, and would normally not be used by applications.
  * @param[in] avc a pointer to an arbitrary struct of which the first field is
  * a pointer to an AVClass struct
  * @param[in] msg string containing an optional message, or NULL if no message



More information about the ffmpeg-cvslog mailing list