1// ///////////////////////////////////////////////////////////////////////////// 2// Name: vidbase.h 3// Purpose: wxMMedia 4// Author: Guilhem Lavaux 5// Created: 1997 6// Updated: 1998 7// Copyright: (C) 1997, 1998, Guilhem Lavaux 8// CVS: $Id: vidbase.h 35650 2005-09-23 12:56:45Z MR $ 9// License: wxWindows license 10// ///////////////////////////////////////////////////////////////////////////// 11/* Real -*- C++ -*- */ 12#ifndef __VID_bdrv_H__ 13#define __VID_bdrv_H__ 14 15// ---------------------------------------------------------------------------- 16// headers 17// ---------------------------------------------------------------------------- 18// For compilers that support precompilation, includes "wx/wx.h". 19#include "wx/wxprec.h" 20 21#ifdef __BORLANDC__ 22 #pragma hdrstop 23#endif 24 25// for all others, include the necessary headers (this file is usually all you 26// need because it includes almost all "standard" wxWidgets headers 27#ifndef WX_PRECOMP 28 #include "wx/defs.h" 29 #include "wx/stream.h" 30 #include "wx/string.h" 31 #include "wx/window.h" 32 #include "wx/frame.h" 33#endif 34 35#include "wx/mmedia/defs.h" 36 37// ---------------------------------------------------------------------------- 38// wxMMedia2 (video) types 39 40typedef enum { 41 wxVIDEO_MSAVI, 42 wxVIDEO_MPEG, 43 wxVIDEO_QT, 44 wxVIDEO_GIF, 45 wxVIDEO_JMOV, 46 wxVIDEO_FLI, 47 wxVIDEO_IFF, 48 wxVIDEO_SGI, 49 wxVIDEO_MPEG2 50} wxVideoType; 51 52// ---------------------------------------------------------------------------- 53// Classes definition 54 55class WXDLLIMPEXP_MMEDIA wxVideoBaseDriver : public wxObject { 56 DECLARE_ABSTRACT_CLASS(wxVideoBaseDriver) 57protected: 58 wxWindow *m_video_output; 59public: 60 // Ctors 61 wxVideoBaseDriver(); 62 wxVideoBaseDriver(wxInputStream& str); 63 wxVideoBaseDriver(const wxString& filename); 64 // Dtor 65 virtual ~wxVideoBaseDriver(); 66 67 // Usual functions ... They all return false in case of errors. 68 virtual bool Play() = 0; 69 virtual bool Stop() = 0; 70 virtual bool Pause() = 0; 71 virtual bool Resume() = 0; 72 73 // Size management 74 virtual bool SetSize(wxSize size) = 0; 75 virtual bool GetSize(wxSize& size) const = 0; 76 77 // Test the capability of the driver to handle the specified type 78 virtual bool IsCapable(wxVideoType WXUNUSED(v_type)) const { return false; } 79 80 // Return the video codec name 81 virtual wxString GetMovieCodec() const = 0; 82 // Return the audio codec name 83 virtual wxString GetAudioCodec() const = 0; 84 // Return misc info about audio 85 virtual wxUint32 GetSampleRate() const = 0; 86 virtual wxUint8 GetChannels() const = 0; 87 virtual wxUint8 GetBPS() const = 0; 88 // Return frame rate 89 virtual double GetFrameRate() const = 0; 90 // Return number of frames 91 virtual wxUint32 GetNbFrames() const = 0; 92 93 // Called when the movie finished 94 virtual void OnFinished() {} 95 96 // Attaches the video output to a window. The video will be shown in that window. 97 virtual bool AttachOutput(wxWindow& output); 98 virtual void DetachOutput(); 99 100 // They return the state of the movie. 101 virtual bool IsPaused() const = 0; 102 virtual bool IsStopped() const = 0; 103}; 104 105WXDLLIMPEXP_MMEDIA wxFrame *wxVideoCreateFrame(wxVideoBaseDriver *vid_drv); 106 107 108#endif 109