Esempio n. 1
0
 * call-back invoked to notify about volume changes
 */
static void volcb(void *addr, unsigned newvol)
{
    struct priv *p = addr;
    p->vol = newvol;
}

static const struct mp_chmap sndio_layouts[MP_NUM_CHANNELS + 1] = {
    {0},                                        // empty
    {1, {MP_SPEAKER_ID_FL}},                    // mono
    MP_CHMAP2(FL, FR),                          // stereo
    {0},                                        // 2.1
    MP_CHMAP4(FL, FR, BL, BR),                  // 4.0
    {0},                                        // 5.0
    MP_CHMAP6(FL, FR, BL, BR, FC, LFE),         // 5.1
    {0},                                        // 6.1
    MP_CHMAP8(FL, FR, BL, BR, FC, LFE, SL, SR), // 7.1
    /* above is the fixed channel assignment for sndio, since we need to fill
       all channels and cannot insert silence, not all layouts are supported. */
};

/*
 * open device and setup parameters
 * return: 0=success -1=fail
 */
static int init(struct ao *ao)
{
    struct priv *p = ao->priv;

    struct af_to_par {
Esempio n. 2
0
File: chmap.c Progetto: ihling/mpv
    {"7.1(alsa)",       "fl-fr-bl-br-fc-lfe-sl-sr"}, // not in lavc
    {"7.1(wide)",       "fl-fr-fc-lfe-bl-br-flc-frc"},
    {"7.1(wide-side)",  "fl-fr-fc-lfe-flc-frc-sl-sr"},
    {"octagonal",       "fl-fr-fc-bl-br-bc-sl-sr"},
    {"downmix",         "dl-dr"},
    {0}
};

static const struct mp_chmap default_layouts[MP_NUM_CHANNELS + 1] = {
    {0},                                        // empty
    MP_CHMAP_INIT_MONO,                         // mono
    MP_CHMAP2(FL, FR),                          // stereo
    MP_CHMAP3(FL, FR, LFE),                     // 2.1
    MP_CHMAP4(FL, FR, FC, BC),                  // 4.0
    MP_CHMAP5(FL, FR, FC, BL,  BR),             // 5.0
    MP_CHMAP6(FL, FR, FC, LFE, BL, BR),         // 5.1
    MP_CHMAP7(FL, FR, FC, LFE, BC, SL, SR),     // 6.1
    MP_CHMAP8(FL, FR, FC, LFE, BL, BR, SL, SR), // 7.1
};

// The channel order was lavc/waveex, but differs from lavc for 5, 6 and 8
// channels. 3 and 7 channels were likely undefined (no ALSA support).
// I'm not sure about the 4 channel case: ALSA uses "quad", while the ffmpeg
// default layout is "4.0".
static const char *mplayer_layouts[MP_NUM_CHANNELS + 1] = {
    [1] = "mono",
    [2] = "stereo",
    [4] = "quad",
    [5] = "5.0(alsa)",
    [6] = "5.1(alsa)",
    [8] = "7.1(alsa)",