Panda3D
ffmpegAudio.cxx
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file ffmpegAudio.cxx
10 * @author jyelon
11 * @date 2007-08-01
12 */
13
14#include "config_ffmpeg.h"
15#include "ffmpegAudio.h"
16#include "ffmpegAudioCursor.h"
17#include "dcast.h"
18
19TypeHandle FfmpegAudio::_type_handle;
20
21/**
22 * xxx
23 */
25FfmpegAudio(const Filename &name) :
26 MovieAudio(name)
27{
28 _filename = name;
29}
30
31/**
32 * xxx
33 */
36}
37
38/**
39 * Open this audio, returning a MovieAudioCursor
40 */
41PT(MovieAudioCursor) FfmpegAudio::
42open() {
43 PT(FfmpegAudioCursor) result = new FfmpegAudioCursor(this);
44 if (result->_format_ctx == nullptr) {
45 ffmpeg_cat.error() << "Could not open " << _filename << "\n";
46 return nullptr;
47 } else {
48 return (MovieAudioCursor*)(FfmpegAudioCursor*)result;
49 }
50}
51
52/**
53 * Obtains a MovieAudio that references a file.
54 */
55PT(MovieAudio) FfmpegAudio::
56make(const Filename &name) {
57 return DCAST(MovieAudio, new FfmpegAudio(name));
58}
A stream that generates a sequence of audio samples.
virtual ~FfmpegAudio()
xxx
Definition: ffmpegAudio.cxx:35
FfmpegAudio(const Filename &name)
xxx
Definition: ffmpegAudio.cxx:25
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:39
A MovieAudio is actually any source that provides a sequence of audio samples.
A MovieAudio is actually any source that provides a sequence of audio samples.
Definition: movieAudio.h:44
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PT(MovieAudioCursor) FfmpegAudio
Open this audio, returning a MovieAudioCursor.
Definition: ffmpegAudio.cxx:41
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.