15 #include "config_ffmpeg.h" 17 #include "ffmpegVideo.h" 18 #include "ffmpegVideoCursor.h" 19 #include "ffmpegAudio.h" 20 #include "ffmpegAudioCursor.h" 22 #include "movieTypeRegistry.h" 25 #include "libavcodec/avcodec.h" 28 ConfigureDef(config_ffmpeg);
29 NotifyCategoryDef(ffmpeg,
"");
31 ConfigureFn(config_ffmpeg) {
36 (
"ffmpeg-max-readahead-frames", 2,
37 PRC_DESC(
"The maximum number of frames ahead which an ffmpeg decoder thread " 38 "should read in advance of actual playback. Set this to 0 to " 39 "decode ffmpeg videos in the main thread."));
42 (
"ffmpeg-show-seek-frames",
true,
43 PRC_DESC(
"Set this true to allow showing the intermediate results of seeking " 44 "through the ffmpeg stream to a target frame, or false to hold the " 45 "current frame until the target frame is achieved. This has the " 46 "biggest effect on videos that are too expensive to decode in real " 47 "time: when this is true, the video can be seen to animate at least " 48 "a little bit; when it is false, you may get long periods of one " 52 (
"ffmpeg-support-seek",
true,
53 PRC_DESC(
"True to use the av_seek_frame() function to seek within ffmpeg " 54 "video files. If this is false, Panda will only seek within a " 55 "file by reading it from the beginning until the desired point, " 56 "which can be much slower. Set this false only if you suspect " 57 "a problem with av_seek_frame()."));
60 (
"ffmpeg-global-lock",
false,
61 PRC_DESC(
"Set this true to enable a single global mutex across *all* ffmpeg " 62 "operations. Leave this false to use the mutex only for " 63 "the ffmpeg operations that are generally known to be " 64 "not thread-safe. This will negatively affect ffmpeg performance, " 65 "especially when decoding multiple videos at once (including the " 66 "left and right channels of a stereo video). Set this true only " 67 "if you suspect a problem with ffmpeg's own thread-safe nature."));
70 (
"ffmpeg-thread-priority", TP_normal,
71 PRC_DESC(
"The default thread priority at which to start ffmpeg decoder " 75 (
"ffmpeg-read-buffer-size", 4096,
76 PRC_DESC(
"The size in bytes of the buffer used when reading input files. " 77 "This is important for performance. A typical size is that of a " 78 "cache page, e.g. 4kb."));
90 static bool initialized =
false;
98 FfmpegVideo::init_type();
99 FfmpegVideoCursor::init_type();
100 FfmpegAudio::init_type();
101 FfmpegAudioCursor::init_type();
void register_audio_type(MakeAudioFunc func, const string &extensions)
Registers a MovieAudio type, so that files with any of the given extensions will be loaded as this ty...
void register_video_type(MakeVideoFunc func, const string &extensions)
Registers a MovieVideo type, so that files with any of the given extensions will be loaded as this ty...
This is a convenience class to specialize ConfigVariable as a boolean type.
This class records the different types of MovieAudio and MovieVideo that are available for loading...
static void register_with_read_factory()
Tells the BamReader how to create objects of type FfmpegVideo.
static void register_protocol()
Should be called at startup to attach the appropriate hooks between Panda and FFMpeg.
static void register_with_read_factory()
Tells the BamReader how to create objects of type FfmpegVideo.
This class specializes ConfigVariable as an enumerated type.
static MovieTypeRegistry * get_global_ptr()
Returns a pointer to the global MovieTypeRegistry instance.
This is a convenience class to specialize ConfigVariable as an integer type.