annotate data/fileio/VideoFileReader.h @ 167:2ac52ea3c1c4

video mouse events are in SDL now. The code is really better now, but there is a display bug when you zoom in, zoom out
author benoitrigolleau
date Fri, 16 Nov 2007 15:18:44 +0000
parents e63e8272dcb0
children be6d31baecb9
rev   line source
ivand_qmul@125 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
ivand_qmul@125 2
ivand_qmul@125 3 /*
ivand_qmul@125 4 Sound Access
ivand_qmul@125 5 EASAIER client application.
ivand_qmul@125 6 Queen Mary 2007. Ivan Damnjanovic.
ivand_qmul@125 7
ivand_qmul@125 8 This program is free software; you can redistribute it and/or
ivand_qmul@125 9 modify it under the terms of the GNU General Public License as
ivand_qmul@125 10 published by the Free Software Foundation; either version 2 of the
ivand_qmul@125 11 License, or (at your option) any later version. See the file
ivand_qmul@125 12 COPYING included with this distribution for more information.
ivand_qmul@125 13 */
ivand_qmul@125 14
ivand_qmul@125 15 #ifndef _VIDEO_FILE_READER_H_
ivand_qmul@125 16 #define _VIDEO_FILE_READER_H_
ivand_qmul@125 17
ivand_qmul@125 18 #ifdef HAVE_FFMPEG
ivand_qmul@125 19 #ifdef __cplusplus
ivand_qmul@125 20 extern "C" {
ivand_qmul@125 21 #endif
ivand_qmul@125 22 #include "SDL_ffmpeg.h"
ivand_qmul@125 23
ivand_qmul@125 24 #ifdef __cplusplus
ivand_qmul@125 25 }
ivand_qmul@125 26 #endif
ivand_qmul@125 27 #include "../../sv/main/MainWindow.h"
ivand_qmul@125 28 #include "CodedAudioFileReader.h"
ivand_qmul@125 29 //#include "base/AudioCallbackPlaySource.h"
ivand_qmul@125 30
ivand_qmul@125 31
ivand_qmul@125 32 #include <set>
ivand_qmul@125 33 //class AudioCallbackPlaySource;
ivand_qmul@125 34 class QProgressDialog;
ivand_qmul@125 35
ivand_qmul@125 36 class VideoFileReader : public CodedAudioFileReader
ivand_qmul@125 37 {
ivand_qmul@125 38 public:
ivand_qmul@125 39 VideoFileReader(QString path, bool showProgress, CacheMode cacheMode);
ivand_qmul@125 40 virtual ~VideoFileReader();
ivand_qmul@125 41
ivand_qmul@125 42 virtual QString getError() const { return m_error; }
ivand_qmul@125 43
ivand_qmul@125 44 static void getSupportedExtensions(std::set<QString> &extensions);
benoitrigolleau@167 45 void VideoFileReader::processEvents();
ivand_qmul@125 46
ivand_qmul@125 47 protected:
ivand_qmul@125 48 QString m_path;
ivand_qmul@125 49 QString m_error;
ivand_qmul@125 50 size_t m_fileSize;
ivand_qmul@125 51 double m_bitrateNum;
ivand_qmul@125 52 size_t m_bitrateDenom;
ivand_qmul@125 53 SDL_Surface *screen;
ivand_qmul@125 54 SDL_ffmpegFile* film;
ivand_qmul@125 55 QProgressDialog *m_progress;
benoitrigolleau@145 56 bool m_cancelled;
benoitrigolleau@145 57 int m_width;
benoitrigolleau@145 58 int m_height;
benoitrigolleau@167 59 float m_zoomfactor;
ivand_qmul@125 60
ivand_qmul@125 61
ivand_qmul@125 62
ivand_qmul@125 63
ivand_qmul@125 64 bool decodeAudio(SDL_ffmpegFile* file);
ivand_qmul@125 65 bool videoInit(SDL_ffmpegFile* file);
ivand_qmul@125 66 int videoPlay();
ivand_qmul@125 67 static int videoPlayCall(void*);
ivand_qmul@125 68 };
ivand_qmul@125 69
ivand_qmul@125 70 #endif
ivand_qmul@125 71
ivand_qmul@125 72 #endif