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__
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
18 // For compilers that support precompilation, includes "wx/wx.h".
19 #include "wx/wxprec.h"
25 // for all others, include the necessary headers (this file is usually all you
26 // need because it includes almost all "standard" wxWidgets headers
29 #include "wx/stream.h"
30 #include "wx/string.h"
31 #include "wx/window.h"
35 #include "wx/mmedia/defs.h"
37 // ----------------------------------------------------------------------------
38 // wxMMedia2 (video) types
52 // ----------------------------------------------------------------------------
55 class WXDLLIMPEXP_MMEDIA wxVideoBaseDriver
: public wxObject
{
56 DECLARE_ABSTRACT_CLASS(wxVideoBaseDriver
)
58 wxWindow
*m_video_output
;
62 wxVideoBaseDriver(wxInputStream
& str
);
63 wxVideoBaseDriver(const wxString
& filename
);
65 virtual ~wxVideoBaseDriver();
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;
74 virtual bool SetSize(wxSize size
) = 0;
75 virtual bool GetSize(wxSize
& size
) const = 0;
77 // Test the capability of the driver to handle the specified type
78 virtual bool IsCapable(wxVideoType
WXUNUSED(v_type
)) const { return false; }
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;
89 virtual double GetFrameRate() const = 0;
90 // Return number of frames
91 virtual wxUint32
GetNbFrames() const = 0;
93 // Called when the movie finished
94 virtual void OnFinished() {}
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();
100 // They return the state of the movie.
101 virtual bool IsPaused() const = 0;
102 virtual bool IsStopped() const = 0;
105 WXDLLIMPEXP_MMEDIA wxFrame
*wxVideoCreateFrame(wxVideoBaseDriver
*vid_drv
);