# MovieVideoCursor

from pandac.PandaModules import MovieVideoCursor

Class : MovieVideoCursor
Description : A MovieVideo is actually any source that provides a sequence of video frames. That could include an AVI file, a digital camera, or an internet TV station. A MovieVideoCursor is a handle that lets you read data sequentially from a MovieVideo.
Thread safety: each individual MovieVideoCursor must be owned and accessed by a single thread. It is OK for two different threads to open the same file at the same time, as long as they use separate MovieVideoCursor objects.

## Inheritance:

MovieVideoCursor: TypedWritableReferenceCount
TypedWritableReferenceCount: TypedWritable ReferenceCount
TypedWritable: TypedObject
TypedObject: MemoryBase
MemoryBase:
ReferenceCount: MemoryBase

## Methods of MovieVideoCursor:

aborted
canSeek
canSeekFast
fetchIntoBitbucket
fetchIntoTexture
fetchIntoTextureAlpha
fetchIntoTextureRgb
getClassType
getNumComponents
getSource
lastStart
length
nextStart
sizeX
sizeY

## Methods of TypedWritableReferenceCount:

getClassType

## Methods of TypedWritable:

getClassType

## Methods of TypedObject:

getClassType
getType
getTypeIndex
isExactType
isOfType

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

aborted bool MovieVideoCursor::aborted(void) const; Description: Returns true if the video has aborted prematurely. For example, this could occur if the Movie was actually an internet TV station, and the connection was lost. Reaching the normal end of the video does not constitute an 'abort' condition.

canSeek bool MovieVideoCursor::can_seek(void) const; Description: Returns true if the movie can seek. If this is true, seeking is still not guaranteed to be fast: for some movies, seeking is implemented by rewinding to the beginning and then fast-forwarding to the desired location. Even if the movie cannot seek, the fetch methods can still advance to an arbitrary location by reading frames and discarding them. However, to move backward, can_seek must return true.

canSeekFast bool MovieVideoCursor::can_seek_fast(void) const; Description: Returns true if seek operations are constant time.

fetchIntoBitbucket virtual void MovieVideoCursor::fetch_into_bitbucket(double time); Description: Discards the next video frame. Still sets last_start and next_start. See fetch_into_buffer for more details.

fetchIntoTexture virtual void MovieVideoCursor::fetch_into_texture(double time, Texture *t, int page); Description: Reads the specified video frame into the specified texture. See fetch_into_buffer for more details.

fetchIntoTextureAlpha virtual void MovieVideoCursor::fetch_into_texture_alpha(double time, Texture *t, int page, int alpha_src); Description: Reads the specified video frame into the alpha channel of the supplied texture. The RGB channels of the texture are not touched. See fetch_into_buffer for more details.

fetchIntoTextureRgb virtual void MovieVideoCursor::fetch_into_texture_rgb(double time, Texture *t, int page); Description: Reads the specified video frame into the RGB channels of the supplied texture. The alpha channel of the texture is not touched. See fetch_into_buffer for more details.

getClassType static TypeHandle MovieVideoCursor::get_class_type(void); Undocumented function.

getNumComponents int MovieVideoCursor::get_num_components(void) const; Description: Returns 4 if the movie has an alpha channel, 3 otherwise.

getSource PointerTo< MovieVideo > MovieVideoCursor::get_source(void) const; Filename: movieVideoCursor.I Created by: jyelon (02Jul07) PANDA 3D SOFTWARE Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved All use of this software is subject to the terms of the Panda 3d Software license. You should have received a copy of this license along with this source code; you will also find a current copy of the license at http://etc.cmu.edu/panda3d/docs/license/ . To contact the maintainers of this program write to panda3d-general@lists.sourceforge.net . Description: Get the MovieVideo which this cursor references.

lastStart double MovieVideoCursor::last_start(void) const; Description: Returns the start time of the last frame you read. MovieVideoCursor streams have variable frame rates. Each frame will specify how long it is to be displayed. These lengths may not be equal from frame to frame.

length double MovieVideoCursor::length(void) const; Description: Returns the length of the movie. Some kinds of Movie, such as internet TV station, might not have a predictable length. In that case, the length will be set to a very large number: 1.0E10. If the internet TV station goes offline, the video or audio stream will set its abort flag. Reaching the end of the movie (ie, the specified length) normally does not cause the abort flag to be set. The video and audio streams produced by get_video and get_audio are always of unlimited duration - you can always read another video frame or another audio sample. This is true even if the specified length is reached, or an abort is flagged. If either stream runs out of data, it will synthesize blank video frames and silent audio samples as necessary to satisfy read requests. Some AVI files have incorrect length values encoded into them - usually, they're a second or two long or short. When playing such an AVI using the Movie class, you may see a slightly truncated video, or a slightly elongated video (padded with black frames). There are utilities out there to fix the length values in AVI files.

nextStart double MovieVideoCursor::next_start(void) const; Description: Returns the start time of the next frame you can read. MovieVideoCursor streams have variable frame rates. Each frame will specify how long it is to be displayed. These lengths may not be equal from frame to frame.

sizeX int MovieVideoCursor::size_x(void) const; Description: Get the horizontal size of the movie.

sizeY int MovieVideoCursor::size_y(void) const; Description: Get the vertical size of the movie.

getClassType static TypeHandle TypedWritableReferenceCount::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedWritable::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedObject::get_class_type(void); Undocumented function.

getType virtual TypeHandle TypedObject::get_type(void) const = 0; Derived classes should override this function to return get_class_type().

getTypeIndex int TypedObject::get_type_index(void) const; Description: Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index().

isExactType bool TypedObject::is_exact_type(TypeHandle handle) const; Description: Returns true if the current object is the indicated type exactly.

isOfType bool TypedObject::is_of_type(TypeHandle handle) const; Description: Returns true if the current object is or derives from the indicated type.

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is true if the new reference count is nonzero, false if it is zero.