[FFmpeg-devel] [PATCH] Re: Reworking the codec lookup system

Nicolas George nicolas.george
Mon Jun 11 10:52:38 CEST 2007


Le tridi 23 prairial, an CCXV, Michael Niedermayer a ?crit?:
> its hard to define precissely, but something like

Of course. But the real problem is not to properly define it: anyone working
with audio-video encoding would understand it. The question is to _decide_
that it must be so, and that must be done with the full authority of a major
ffmpeg developer.

Here is a patch that explicitly documents it in the header.

Regards,

-- 
  Nicolas George


Index: libavcodec/avcodec.h
===================================================================
--- libavcodec/avcodec.h	(revision 9281)
+++ libavcodec/avcodec.h	(working copy)
@@ -44,6 +44,11 @@
 #define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
 
 /**
+ * Identifiers of codec families.
+ * Two decoders with the same ID can decode the same streams.
+ * Two encoders with the same ID can encode compatible streams.
+ * For example, encoder_vorbis and encoder_libvorbis both use
+ * CODEC_ID_VORBIS.
  *
  * If you add a codec ID to this list, add it so that
  * 1. no value of a existing codec ID changes (that would break ABI),
@@ -2119,8 +2124,22 @@
  * AVCodec.
  */
 typedef struct AVCodec {
+    /**
+     * Name of the codec
+     * The name is globally unique among encoders and among decoders (but an
+     * encoder and a decoder can share the same name).
+     * This is the primary way to find a codec from the user perspective.
+     */
     const char *name;
+    /**
+     * Type of the codec: audio, video, subtitle, etc.
+     */
     enum CodecType type;
+    /**
+     * Identifier of the codec family.
+     * Two decoders with the same ID can decode the same streams.
+     * Two encoders with the same ID can encode compatible streams.
+     */
     enum CodecID id;
     int priv_data_size;
     int (*init)(AVCodecContext *);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070611/04e41a26/attachment.pgp>



More information about the ffmpeg-devel mailing list