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" wxWidgets headers
33 #include "wx/stream.h"
34 #include "wx/string.h"
35 #include "wx/window.h"
39 #include "wx/mmedia/defs.h"
41 // ----------------------------------------------------------------------------
42 // wxMMedia2 (video) types
56 // ----------------------------------------------------------------------------
59 class WXDLLIMPEXP_MMEDIA wxVideoBaseDriver
: public wxObject
{
60 DECLARE_ABSTRACT_CLASS(wxVideoBaseDriver
)
62 wxWindow
*m_video_output
;
66 wxVideoBaseDriver(wxInputStream
& str
);
67 wxVideoBaseDriver(const wxString
& filename
);
69 virtual ~wxVideoBaseDriver();
71 // Usual functions ... They all return false in case of errors.
72 virtual bool Play() = 0;
73 virtual bool Stop() = 0;
74 virtual bool Pause() = 0;
75 virtual bool Resume() = 0;
78 virtual bool SetSize(wxSize size
) = 0;
79 virtual bool GetSize(wxSize
& size
) const = 0;
81 // Test the capability of the driver to handle the specified type
82 virtual bool IsCapable(wxVideoType
WXUNUSED(v_type
)) const { return false; }
84 // Return the video codec name
85 virtual wxString
GetMovieCodec() const = 0;
86 // Return the audio codec name
87 virtual wxString
GetAudioCodec() const = 0;
88 // Return misc info about audio
89 virtual wxUint32
GetSampleRate() const = 0;
90 virtual wxUint8
GetChannels() const = 0;
91 virtual wxUint8
GetBPS() const = 0;
93 virtual double GetFrameRate() const = 0;
94 // Return number of frames
95 virtual wxUint32
GetNbFrames() const = 0;
97 // Called when the movie finished
98 virtual void OnFinished() {}
100 // Attaches the video output to a window. The video will be shown in that window.
101 virtual bool AttachOutput(wxWindow
& output
);
102 virtual void DetachOutput();
104 // They return the state of the movie.
105 virtual bool IsPaused() const = 0;
106 virtual bool IsStopped() const = 0;
109 WXDLLIMPEXP_MMEDIA wxFrame
*wxVideoCreateFrame(wxVideoBaseDriver
*vid_drv
);