It seems feasible:

We start with:

static int AC3_encode_init(AVCodecContext *avctx)

And the struct AVCodecContext contain the number of channels:

typedef struct AVCodecContext {
     int bit_rate;
     int bit_rate_tolerance; /* amount of +- bits (>0)*/
     int flags;
     int sub_id;    /* some codecs needs additionnal format info. It is
                       stored there */

     int me_method; /* ME algorithm used for video coding */

     /* extra data from parent application to codec, e.g. huffman table
        for mjpeg */
     /* the parent should allocate and free this buffer */
     void *extradata;
     int extradata_size;

     /* video only */
     int frame_rate; /* frames per sec multiplied by FRAME_RATE_BASE */
     int width, height;
     int aspect_ratio_info;
#define FF_ASPECT_SQUARE 1
#define FF_ASPECT_4_3_625 2
#define FF_ASPECT_4_3_525 3
#define FF_ASPECT_16_9_625 4
#define FF_ASPECT_16_9_525 5
     int gop_size; /* 0 = intra only */
     enum PixelFormat pix_fmt;  /* pixel format, see PIX_FMT_xxx */
     int repeat_pict; /* when decoding, this signal how much the picture */
                      /* must be delayed.                                */
                      /* extra_delay = (repeat_pict / 2) * (1/fps)       */
     /* if non NULL, 'draw_horiz_band' is called by the libavcodec
        decoder to draw an horizontal band. It improve cache usage. Not
        all codecs can do that. You must check the codec capabilities
        before */
     void (*draw_horiz_band)(struct AVCodecContext *s,
                             UINT8 **src_ptr, int linesize,
                             int y, int width, int height);

     /* audio only */
     int sample_rate; /* samples per sec */
     int channels;
            ^
Here       |


Then, I'm a little bit lost, but I will figure it out.

My only problem is that this library seems to be dedicated to
video encoding. What if we try to use it for only sound/music
encoding ???

Regards
-- 
Emmanuel

To iterate is human; to recurse, is divine.
   -- Unknown



-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
Alsa-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to