Panda3D
|
Classes | |
class | FfmpegBuffer |
Public Member Functions | |
FfmpegVideoCursor (FfmpegVideo *src) | |
virtual void | finalize (BamReader *manager) |
Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed. More... | |
virtual TypeHandle | force_init_type () |
int | get_max_readahead_frames () const |
Returns the maximum number of frames that a sub-thread will attempt to read ahead of the current frame. More... | |
ThreadPriority | get_thread_priority () const |
Returns the current thread priority of the thread that decodes the ffmpeg video stream (if max_readahead_frames is nonzero). More... | |
virtual TypeHandle | get_type () const |
bool | is_thread_started () const |
Returns true if the thread has been started, false if not. More... | |
virtual | PT (Buffer) fetch_buffer() |
void | set_max_readahead_frames (int max_readahead_frames) |
Specifies the maximum number of frames that a sub-thread will attempt to read ahead of the current frame. More... | |
void | set_thread_priority (ThreadPriority thread_priority) |
Changes the thread priority of the thread that decodes the ffmpeg video stream (if max_readahead_frames is nonzero). More... | |
virtual bool | set_time (double timestamp, int loop_count) |
See MovieVideoCursor::set_time(). More... | |
void | start_thread () |
Explicitly starts the ffmpeg decoding thread after it has been stopped by a call to stop_thread(). More... | |
void | stop_thread () |
Explicitly stops the ffmpeg decoding thread. More... | |
virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
Writes the contents of this object to the datagram for shipping out to a Bam file. More... | |
![]() | |
bool | aborted () const |
virtual void | apply_to_texture (const Buffer *buffer, Texture *t, int page) |
Stores this buffer's contents in the indicated texture. More... | |
virtual void | apply_to_texture_alpha (const Buffer *buffer, Texture *t, int page, int alpha_src) |
Copies this buffer's contents into the alpha channel of the supplied texture. More... | |
virtual void | apply_to_texture_rgb (const Buffer *buffer, Texture *t, int page) |
Copies this buffer's contents into the RGB channels of the supplied texture. More... | |
bool | can_seek () const |
bool | can_seek_fast () const |
virtual int | complete_pointers (TypedWritable **plist, BamReader *manager) |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). More... | |
int | get_num_components () const |
double | length () const |
PT (MovieVideo) get_source() const | |
bool | ready () const |
void | setup_texture (Texture *tex) const |
Set up the specified Texture object to contain content from this movie. More... | |
int | size_x () const |
int | size_y () const |
bool | streaming () const |
![]() | |
TypedWritableReferenceCount (const TypedWritableReferenceCount ©) | |
virtual ReferenceCount * | as_reference_count () |
Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. More... | |
void | operator= (const TypedWritableReferenceCount ©) |
![]() | |
TypedWritable (const TypedWritable ©) | |
string | encode_to_bam_stream () const |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. More... | |
bool | encode_to_bam_stream (string &data, BamWriter *writer=NULL) const |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. More... | |
UpdateSeq | get_bam_modified () const |
Returns the current bam_modified counter. More... | |
void | mark_bam_modified () |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More... | |
void | operator= (const TypedWritable ©) |
virtual bool | require_fully_complete () const |
Some objects require all of their nested pointers to have been completed before the objects themselves can be completed. More... | |
virtual void | update_bam_nested (BamWriter *manager) |
Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates. More... | |
![]() | |
TypedObject (const TypedObject ©) | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
int | get_best_parent_from_Set (const std::set< int > &) const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. More... | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. More... | |
void | operator= (const TypedObject ©) |
![]() | |
int | get_ref_count () const |
Returns the current reference count. More... | |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
static void | register_with_read_factory () |
Tells the BamReader how to create objects of type FfmpegVideo. More... | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
static | PT (TypedWritableReferenceCount) decode_from_bam_stream(const string &data |
![]() | |
static bool | decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, const string &data, BamReader *reader=NULL) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string. More... | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. More... | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
Friends | |
class | FfmpegVideo |
Additional Inherited Members | |
![]() | |
static BamReader * | reader = NULL) |
![]() | |
static TypedWritable *const | Null = (TypedWritable*)0L |
Definition at line 42 of file ffmpegVideoCursor.h.
|
virtual |
Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.
Reimplemented from TypedWritable.
Definition at line 1237 of file ffmpegVideoCursor.cxx.
References FfmpegVideoCursor::FfmpegBuffer::compare_timestamp(), and BamReader::register_finalize().
Referenced by write_datagram().
int FfmpegVideoCursor::get_max_readahead_frames | ( | ) | const |
Returns the maximum number of frames that a sub-thread will attempt to read ahead of the current frame.
See set_max_readahead_frames().
Definition at line 213 of file ffmpegVideoCursor.cxx.
References set_thread_priority().
Referenced by set_max_readahead_frames().
ThreadPriority FfmpegVideoCursor::get_thread_priority | ( | ) | const |
Returns the current thread priority of the thread that decodes the ffmpeg video stream (if max_readahead_frames is nonzero).
Definition at line 248 of file ffmpegVideoCursor.cxx.
References start_thread().
Referenced by set_thread_priority().
bool FfmpegVideoCursor::is_thread_started | ( | ) | const |
Returns true if the thread has been started, false if not.
This will always return false if max_readahead_frames is 0.
Definition at line 327 of file ffmpegVideoCursor.cxx.
References set_time().
Referenced by set_thread_priority(), and stop_thread().
|
static |
Tells the BamReader how to create objects of type FfmpegVideo.
Definition at line 1210 of file ffmpegVideoCursor.cxx.
References BamReader::get_factory(), Factory< Type >::register_factory(), and write_datagram().
Referenced by set_time().
void FfmpegVideoCursor::set_max_readahead_frames | ( | int | max_readahead_frames | ) |
Specifies the maximum number of frames that a sub-thread will attempt to read ahead of the current frame.
Setting this to a nonzero allows the video decoding to take place in a sub-thread, which smoothes out the video decoding time by spreading it evenly over several frames. Set this number larger to increase the buffer between the currently visible frame and the first undecoded frame; set it smaller to reduce memory consumption.
Setting this to zero forces the video to be decoded in the main thread. If threading is not available in the Panda build, this value is always zero.
Definition at line 183 of file ffmpegVideoCursor.cxx.
References get_max_readahead_frames(), start_thread(), and stop_thread().
void FfmpegVideoCursor::set_thread_priority | ( | ThreadPriority | thread_priority | ) |
Changes the thread priority of the thread that decodes the ffmpeg video stream (if max_readahead_frames is nonzero).
Normally you shouldn't mess with this, but there may be special cases where a precise balance of CPU utilization between the main thread and the various ffmpeg service threads may be needed.
Definition at line 229 of file ffmpegVideoCursor.cxx.
References get_thread_priority(), is_thread_started(), start_thread(), and stop_thread().
Referenced by get_max_readahead_frames().
|
virtual |
See MovieVideoCursor::set_time().
Reimplemented from MovieVideoCursor.
Definition at line 337 of file ffmpegVideoCursor.cxx.
References Thread::consider_yield(), register_with_read_factory(), and stop_thread().
Referenced by is_thread_started().
void FfmpegVideoCursor::start_thread | ( | ) |
Explicitly starts the ffmpeg decoding thread after it has been stopped by a call to stop_thread().
The thread is normally started automatically, so there is no need to call this method unless you have previously called stop_thread() for some reason.
Definition at line 262 of file ffmpegVideoCursor.cxx.
References stop_thread().
Referenced by get_thread_priority(), set_max_readahead_frames(), and set_thread_priority().
void FfmpegVideoCursor::stop_thread | ( | ) |
Explicitly stops the ffmpeg decoding thread.
There is normally no reason to do this unless you want to maintain precise control over what threads are consuming CPU resources. Calling this method will make the video update in the main thread, regardless of the setting of max_readahead_frames, until you call start_thread() again.
Definition at line 294 of file ffmpegVideoCursor.cxx.
References is_thread_started().
Referenced by set_max_readahead_frames(), set_thread_priority(), set_time(), and start_thread().
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from MovieVideoCursor.
Definition at line 1221 of file ffmpegVideoCursor.cxx.
References finalize(), and MovieVideoCursor::write_datagram().
Referenced by register_with_read_factory().