VideoCore provides support for video streams to an window display.
It takes the approach that a display may have one or more video
streams, each of which has one or more which independent video streams
pass. Written in C++, and created with the idea to helping the
developers.
The source code is under
the LGPL license. This means that it is completely free to use for
commercial and non commercial applications.
Example using the implementation class
This example shows how you can use the
implementation class.
// We are including the main header file it that contains // the implementation class. #include <ceVideoCoreImpl.h> #include <cstdio> // For printf.
// We are using the namespace "ce" (CorEngine) by default (Optional). using namespace ce;
// We are creating our own manager class, inheriting the implementation class. class CVideoManager : public IVideoManagerImpl<CVideoManager> { public:
inline short Example(void) const { // Retrieves the information of the window (Optional). SWindowInfo *WindowInfo = this -> Video -> GetWindowInfo();
// This method creates an window (Optional, but is required for get // the video information). if (this -> Video -> CreateVideoWindow() == 0) return 1;
// Video handles. unsigned int video1; unsigned int video2;
// Load a video file. video1 = this -> Video -> LoadVideoFile("video1.mpg", CE_VIDEO_NOPLAYBAR | CE_VIDEO_NOMENU | CE_VIDEO_AUTOPLAY);
video2 = this -> Video -> LoadVideoFile("video2.mpg", CE_VIDEO_HIDE);
// Initialize the window main loop. this -> Video -> InitVideoWindow();
// Release the video (Optional). this -> Video -> ReleaseVideo(video1);
// This method sets the video's show state. this -> Video -> ShowVideo(video2, TRUE);
// Update the window main loop. while (this -> Video -> UpdateVideoWindow()) continue;
// Release all the videos (Optional). this -> Video -> ReleaseAllVideos();
// This method unregisters a window, freeing the memory required // for the window (Optional). this -> Video -> UnregisterVideoWindow();
int main(int argc, char **argv) { // We are creating a instance of our manager class. const CVideoManager Video;
// Verify the integrity of the manager class (Optional). if (Video -> VerifyVideoManager() == 0) return 1;
return Video -> Example(); }
Note : Use the implementation
class, because is more easy.
Example using the interface class
This example shows how you can use the interface
class.
// We are including the main header file it that contains the interface class. #include <ceVideoCore.h> #include <cstdio> // For printf.
// We are using the namespace "ce" (CorEngine) by default (Optional). using namespace ce;
int main(int argc, char **argv) { // We are creating a instance of the manager class. IVideoManager *Video = CreateVideoManager(); if (Video == NULL) return 1;
// Retrieves the information of the window (Optional). SWindowInfo *WindowInfo = Video -> GetWindowInfo();
// This method creates an window (Optional, but is required for get // the video information). if (Video -> CreateVideoWindow() == 0) { // Release the instance of the class manager. DestroyVideoManager(&Video); return 1; }
// Video handles. unsigned int video1; unsigned int video2;
// Load a video file. video1 = Video -> LoadVideoFile("video1.mpg", CE_VIDEO_NOPLAYBAR | CE_VIDEO_NOMENU | CE_VIDEO_AUTOPLAY);
video2 = Video -> LoadVideoFile("video2.mpg", CE_VIDEO_HIDE);
// Initialize the window main loop. Video -> InitVideoWindow();
// Release the video (Optional). Video -> ReleaseVideo(video1);
// This method sets the video's show state. Video -> ShowVideo(video2, TRUE);
// Update the window main loop. while (Video -> UpdateVideoWindow()) continue;
// Release all the videos (Optional). Video -> ReleaseAllVideos();
// This method unregisters a window, freeing the memory required // for the window (Optional). Video -> UnregisterVideoWindow();
// Release the instance of the class manager. DestroyVideoManager(&Video);
return 0; }
So here you know the basics for their use, for
more
information, I recommend reading the API documentation.
For support or
with any questions or suggestions, feel free to contact me.