AudioClipWorkflow.h 2.31 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/*****************************************************************************
 * AudioClipWorkflow.h : Clip workflow. Will extract a single frame from a VLCMedia
 *****************************************************************************
 * Copyright (C) 2008-2009 the VLMC team
 *
 * Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef AUDIOCLIPWORKFLOW_H
#define AUDIOCLIPWORKFLOW_H

#include "ClipWorkflow.h"

class   AudioClipWorkflow : public ClipWorkflow
{
    public:
31 32 33 34
        struct  AudioSample
        {
            unsigned char*  buff;
            size_t          size;
35 36
            unsigned int    nbSample;
            unsigned int    nbChannels;
37
            quint64         ptsDiff;
38
        };
39 40 41 42 43 44 45
        AudioClipWorkflow( Clip* clip );
        ~AudioClipWorkflow();
        void*                   getLockCallback();
        void*                   getUnlockCallback();
        virtual void*           getOutput();

    private:
46 47
        //FIXME: this should be temporary
        AudioSample*            m_buffer;
48 49 50 51 52
        void                    initVlcOutput();
        static void             lock( AudioClipWorkflow* clipWorkflow, uint8_t** pcm_buffer , unsigned int size );
        static void             unlock( AudioClipWorkflow* clipWorkflow, uint8_t* pcm_buffer,
                                      unsigned int channels, unsigned int rate,
                                      unsigned int nb_samples, unsigned int bits_per_sample,
53
                                      unsigned int size, quint64 pts );
54 55 56
};

#endif // AUDIOCLIPWORKFLOW_H