view data/fileio/VideoFileReader.h @ 282:d9319859a4cf tip

(none)
author benoitrigolleau
date Fri, 31 Oct 2008 11:00:24 +0000
parents be6d31baecb9
children
line wrap: on
line source
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */

/*   
	Sound Access
		EASAIER client application.
		Queen Mary 2007. Ivan Damnjanovic.

	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.  See the file
	COPYING included with this distribution for more information.
*/

#ifndef _VIDEO_FILE_READER_H_
#define _VIDEO_FILE_READER_H_

#include <set>

#ifdef HAVE_FFMPEG
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/
#include "videoio/SDL_ffmpeg.h"

#ifdef __cplusplus
}
#endif /*__cplusplus*/

#include "../../sv/main/MainWindow.h"
#include "CodedAudioFileReader.h"
//#include "base/AudioCallbackPlaySource.h"

//class AudioCallbackPlaySource;
class QProgressDialog;

class VideoFileReader : public CodedAudioFileReader
{
public:
    VideoFileReader(QString path, bool showProgress, CacheMode cacheMode);
    virtual ~VideoFileReader();

    virtual QString getError() const { return m_error; }

    static void getSupportedExtensions(std::set<QString> &extensions);
    void processEvents();
    
protected:
    QString m_path;
    QString m_error;
    size_t m_fileSize;
    double m_bitrateNum;
    size_t m_bitrateDenom;
	SDL_Surface *screen;
	SDL_ffmpegFile* film;
    QProgressDialog *m_progress;
    bool m_cancelled;
	int m_width;
	int m_height;
	float m_zoomfactor;
	
	

   
    bool decodeAudio(SDL_ffmpegFile* file);
	bool videoInit(SDL_ffmpegFile* file);
	int videoPlay(); 
	static int videoPlayCall(void*);
};

#endif /*HAVE_FFMPEG*/

#endif /*_VIDEO_FILE_READER_H_*/