Panda3D

ffmpegAudio.cxx

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