Panda3D
|
00001 // Filename: movieVideo.cxx 00002 // Created by: jyelon (02Jul07) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "movieVideo.h" 00016 #include "config_movies.h" 00017 00018 TypeHandle MovieVideo::_type_handle; 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: MovieVideo::Constructor 00022 // Access: Public 00023 // Description: This constructor returns a null video stream --- a 00024 // stream of plain blue and white frames that last one 00025 // second each. To get more interesting video, you need 00026 // to construct a subclass of this class. 00027 //////////////////////////////////////////////////////////////////// 00028 MovieVideo:: 00029 MovieVideo(const string &name) : 00030 Namable(name) 00031 { 00032 } 00033 00034 //////////////////////////////////////////////////////////////////// 00035 // Function: MovieVideo::Destructor 00036 // Access: Public, Virtual 00037 // Description: 00038 //////////////////////////////////////////////////////////////////// 00039 MovieVideo:: 00040 ~MovieVideo() { 00041 } 00042 00043 //////////////////////////////////////////////////////////////////// 00044 // Function: MovieVideo::open 00045 // Access: Published, Virtual 00046 // Description: Open this video, returning a MovieVideoCursor. 00047 //////////////////////////////////////////////////////////////////// 00048 PT(MovieVideoCursor) MovieVideo:: 00049 open() { 00050 return new MovieVideoCursor(this); 00051 } 00052 00053 //////////////////////////////////////////////////////////////////// 00054 // Function: MovieVideo::get 00055 // Access: Published, Static 00056 // Description: Obtains a MovieVideo that references a file. 00057 //////////////////////////////////////////////////////////////////// 00058 PT(MovieVideo) MovieVideo:: 00059 get(const Filename &name) { 00060 #ifdef HAVE_FFMPEG 00061 // Someday, I'll probably put a dispatcher here. 00062 // But for now, just hardwire it to go to FFMPEG. 00063 return new FfmpegVideo(name); 00064 #else 00065 return new MovieVideo("Load-Failure Stub"); 00066 #endif 00067 } 00068