1 // /////////////////////////////////////////////////////////////////////////////
4 // Author: Guilhem Lavaux
7 // Copyright: (C) 1997, 1998, Guilhem Lavaux
9 // License: wxWindows license
10 // /////////////////////////////////////////////////////////////////////////////
11 /* Real -*- C++ -*- */
12 #ifndef __VID_bdrv_H__
13 #define __VID_bdrv_H__
16 #pragma interface "vidbase.h"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
22 // For compilers that support precompilation, includes "wx/wx.h".
23 #include "wx/wxprec.h"
29 // for all others, include the necessary headers (this file is usually all you
30 // need because it includes almost all "standard" wxWindows headers
33 #include "wx/stream.h"
34 #include "wx/string.h"
35 #include "wx/window.h"
39 // ----------------------------------------------------------------------------
40 // wxMMedia2 (video) types
54 // ----------------------------------------------------------------------------
57 class WXDLLEXPORT wxVideoBaseDriver
: public wxObject
{
58 DECLARE_ABSTRACT_CLASS(wxVideoBaseDriver
)
60 wxWindow
*m_video_output
;
64 wxVideoBaseDriver(wxInputStream
& str
);
65 wxVideoBaseDriver(const wxString
& filename
);
67 virtual ~wxVideoBaseDriver();
69 // Usual functions ... They all return FALSE in case of errors.
70 virtual bool Play() = 0;
71 virtual bool Stop() = 0;
72 virtual bool Pause() = 0;
73 virtual bool Resume() = 0;
76 virtual bool SetSize(wxSize size
) = 0;
77 virtual bool GetSize(wxSize
& size
) const = 0;
79 // Test the capability of the driver to handle the specified type
80 virtual bool IsCapable(wxVideoType
WXUNUSED(v_type
)) const { return FALSE
; }
82 // Return the video codec name
83 virtual wxString
GetMovieCodec() const = 0;
84 // Return the audio codec name
85 virtual wxString
GetAudioCodec() const = 0;
86 // Return misc info about audio
87 virtual wxUint32
GetSampleRate() const = 0;
88 virtual wxUint8
GetChannels() const = 0;
89 virtual wxUint8
GetBPS() const = 0;
91 virtual double GetFrameRate() const = 0;
92 // Return number of frames
93 virtual wxUint32
GetNbFrames() const = 0;
95 // Called when the movie finished
96 virtual void OnFinished() {}
98 // Attaches the video output to a window. The video will be shown in that window.
99 virtual bool AttachOutput(wxWindow
& output
);
100 virtual void DetachOutput();
102 // They return the state of the movie.
103 virtual bool IsPaused() const = 0;
104 virtual bool IsStopped() const = 0;
107 WXDLLEXPORT wxFrame
*wxVideoCreateFrame(wxVideoBaseDriver
*vid_drv
);