00001 // Filename: ffmpegAudio.cxx 00002 // Created by: jyelon (01Aug2007) 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 "ffmpegAudio.h" 00016 00017 #ifdef HAVE_FFMPEG 00018 00019 #include "ffmpegAudioCursor.h" 00020 00021 TypeHandle FfmpegAudio::_type_handle; 00022 00023 //////////////////////////////////////////////////////////////////// 00024 // Function: FfmpegAudio::Constructor 00025 // Access: Protected 00026 // Description: xxx 00027 //////////////////////////////////////////////////////////////////// 00028 FfmpegAudio:: 00029 FfmpegAudio(const Filename &name) : 00030 MovieAudio(name) 00031 { 00032 _filename = name; 00033 } 00034 00035 //////////////////////////////////////////////////////////////////// 00036 // Function: FfmpegAudio::Destructor 00037 // Access: Protected, Virtual 00038 // Description: xxx 00039 //////////////////////////////////////////////////////////////////// 00040 FfmpegAudio:: 00041 ~FfmpegAudio() { 00042 } 00043 00044 //////////////////////////////////////////////////////////////////// 00045 // Function: FfmpegAudio::open 00046 // Access: Published, Virtual 00047 // Description: Open this audio, returning a MovieAudioCursor 00048 //////////////////////////////////////////////////////////////////// 00049 PT(MovieAudioCursor) FfmpegAudio:: 00050 open() { 00051 PT(FfmpegAudioCursor) result = new FfmpegAudioCursor(this); 00052 if (result->_format_ctx == 0) { 00053 movies_cat.error() << "Could not open " << _filename << "\n"; 00054 return NULL; 00055 } else { 00056 return (MovieAudioCursor*)(FfmpegAudioCursor*)result; 00057 } 00058 } 00059 00060 //////////////////////////////////////////////////////////////////// 00061 00062 #endif // HAVE_FFMPEG