MetaDataWorker.h 2.88 KB
Newer Older
Christophe Courtaut's avatar
Christophe Courtaut committed
1
/*****************************************************************************
2
 * MetaDataWorker.h: MetaDataWorker
Christophe Courtaut's avatar
Christophe Courtaut committed
3
4
5
6
 *****************************************************************************
 * Copyright (C) 2008-2009 the VLMC team
 *
 * Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
7
 * Authors: Geoffroy Lacarriere <geoffroylaca@gmail.com>
Christophe Courtaut's avatar
Christophe Courtaut committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 *
 * 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.
 *****************************************************************************/
23

24
25
#ifndef METADATAWORKER_H
#define METADATAWORKER_H
26
27
28
29

#include <QList>
#include <QTemporaryFile>
#include <QThread>
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
30
#include <QWidget>
31
#include "Media.h"
32
33
#include "VLCMediaPlayer.h"

34
class MetaDataWorker : public QObject
35
36
{
    Q_OBJECT
37
    Q_DISABLE_COPY( MetaDataWorker )
38

39
    public:
40
41
        MetaDataWorker( Media* media );
        ~MetaDataWorker();
42
        void                        compute();
43

44
    private:
45
46
47
        void                        computeVideoMetaData();
        void                        computeImageMetaData();

48
49
50
51
52
53
54
55
        //AMEM part :
        static  void                openSoundBuffer( void* datas, unsigned int* freq,
                                                        unsigned int* nbChannels, unsigned int* fourCCFormat,
                                                        unsigned int* frameSize );
        static  void                playSoundBuffer( void* datas, unsigned char* buffer,
                                                     size_t buffSize, unsigned int nbSample );
        static  void                closeSoundBuffer( void* datas );
        static  void                instanceParameterHandler( void*, char*, char* );
56
57

    private:
58
59
        void                        getMetaData();

60
    private:
61
62
        LibVLCpp::MediaPlayer*      m_mediaPlayer;

63
        Media*                      m_currentMedia;
64
        QString                     m_tmpSnapshotFilename;
65

66
67
68
        bool                        m_mediaIsPlaying;
        bool                        m_lengthHasChanged;

69
70
    private slots:
        void    renderSnapshot();
71
        void    setSnapshot();
72
        void    startAudioDataParsing();
73
        void    stopAudioDataParsing();
74
75
        void    entrypointPlaying();
        void    entrypointLengthChanged();
76
77
};

78
#endif // METADATAWORKER_H