Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Wanted: Samples for testing of Private Stream 1 Audio



Hi,

      I'd like have some more information or samples about
private stream 1 and their data structure therein.

For testing purpose I'd like to get some (legal) samplers with
linear PCM, AC3 not(!) from DVB recorded, and DTS.  These three
samplers should have at least 30 seconds to be able to be viewed
with VDR (or transcoded to be viewable with VDR).

I'm trying with my current test version of the bitstreamout plugin
to switch between different stream types with the following piece
of code:

[...]
    if ((b[6] & 0xC0) != 0x80)
        goto out;                       // Not Mpeg2 PES

    if (char2int(b[0],b[1],b[2],b[3]) == PS1magic) {
        int len = ((b[4]<<8)|b[5]) + 6;
        int off = b[8] + 9;

        //
        // If the stream provides PTS/DTS information and/or
        // the data in the pay load is marked as aligned we
        // assume that that we'll find immediately the sync words
        // of the pay load its self or the corresponding sub
        // stream identification with the offset to the pay load.
        //
        if ((b[7] & 0xC0) || (b[6] & 0x04)) {

            if (!ScanPayOfPS1(&b[off], off))
                goto out;

            if (!running) {
                if (!failed)
                    Activate(true);
                goto out;               // Activation may take a moment
            }
        }
[...]

together with the main code of ScanPayOfPS1():

inline bool cReplayOutAC3::ScanPayOfPS1(const uchar *pay, int &off)
{
    switch ((pay[0] & 0xf8)) {
    case 0x80 ... 0x87:                                 // AC3
        off += ((pay[2]<<8)|pay[3]) + 3;                // ?? Is this correct
    case 0x08:                                          // AC3 from DVB
        if (!stream) stream = &ac3;
        break;
    case 0x88:                                          // DTS
        off += ((pay[2]<<8)|pay[3]) + 3;                // ?? Is this correct
        if (!stream) stream = &dts;
        break;
    case 0xA0 ... 0xA7:                                 // lPCM
        off += ((pay[2]<<8)|pay[3]) + 7;                // ?? Is this correct
        if (!stream) {
            stream = &pcm;
            switch (pay[5]) {
            case 0x00:
            case 0x01:
                pcm.sample_rate = 48000;
                break;
            case 0x21:
                pcm.sample_rate = 44100;
                break;
            case 0x31:
                pcm.sample_rate = 32000;
                break;
            default:
                stream = NULL;
                break;
            }
        }
        break;
    default:
        break;
    }
    return (stream != NULL);
}

[...]

The detection of linear PCM does not work with the samples self generated
for the DVB card.  The question is: How linear PCM streams are included within
the private stream 1 of none DVB sources.


        Werner


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index