|
|
||||||||||||||||||||
VideoCore API Documentationpre-alpha versionIntroductionWelcome to the Main API Documentation for VideoCore. The source code is released under the LGPL license, meaning it is free for you to use in your projects, even if they are commercial. Of course, we suggest you read the full text of the license by looking at the local LICENSE file or ceVideoCore.h. LinksNamespaces: Central namespace for this entire library. A good place to begin looking. Example using the implementation classThis 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(); WindowInfo -> width = 512; WindowInfo -> height = 384; WindowInfo -> resize = TRUE; // 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(); return 0; }; // Operator -> (Optional). const CVideoManager* operator -> (void) const { return this; }; }; 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 classThis 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(); WindowInfo -> width = 512; WindowInfo -> height = 384; WindowInfo -> resize = TRUE; // 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. |
|||||||||||||||||||||
|