X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fframework%2Fmlt_producer.h;h=6f98ad7439008d930be6ee7d13d703d5d36ee898;hb=e5fd66367b6f976e3bcb0ada98408afcb40cb2ce;hp=f79e19209c1d5dabf8ae30b259b4f6d1f1014fa5;hpb=3e00d7e35326b6fecbd95f459266f91fc60e6f15;p=mlt diff --git a/src/framework/mlt_producer.h b/src/framework/mlt_producer.h index f79e1920..6f98ad74 100644 --- a/src/framework/mlt_producer.h +++ b/src/framework/mlt_producer.h @@ -1,21 +1,23 @@ -/* - * mlt_producer.h -- abstraction for all producer services - * Copyright (C) 2003-2004 Ushodaya Enterprises Limited - * Author: Charles Yates +/** + * \file mlt_producer.h + * \brief abstraction for all producer services + * + * Copyright (C) 2003-2008 Ushodaya Enterprises Limited + * \author Charles Yates * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _MLT_PRODUCER_H_ @@ -24,26 +26,65 @@ #include "mlt_service.h" #include "mlt_filter.h" -/** The interface definition for all producers. -*/ +/** \brief Producer abstract service class + * + * A producer is a service that generates audio, video, and metadata. + * Some day it may also generate text (subtitles). This is not to say + * a producer "synthesizes," rather that is an origin of data within the + * service network - that could be through synthesis or reading a stream. + * + * \extends mlt_service + * \event \em producer-changed + * \properties \em mlt_type the name of the service subclass, e.g. mlt_producer + * \properties \em mlt_service the name of a producer subclass + * \properties \em _position the current position of the play head, relative to the in point + * \properties \em _frame the current position of the play head, relative to the beginning of the resource + * \properties \em _speed the current speed factor, where 1.0 is normal + * \properties \em aspect_ratio sample aspect ratio + * \properties \em length the duration of the cut in frames + * \properties \em eof the end-of-file behavior, one of: pause, continue, loop + * \properties \em resource the file name, stream address, or the class name in angle brackets + * \properties \em _cut set if this producer is a "cut" producer + * \properties \em mlt_mix stores the data for a "mix" producer + * \properties \em _cut_parent holds a reference to the cut's parent producer + * \properties \em ignore_points Set this to temporarily disable the in and out points. + * \properties \em use_clone holds a reference to a clone's producer, as created by mlt_producer_optimise + * \properties \em _clone is the index of the clone in the list of clones stored on the clone's producer + * \properties \em _clones is the number of clones of the producer, as created by mlt_producer_optimise + * \properties \em _clone.{N} holds a reference to the N'th clone of the producer, as created by mlt_producer_optimise + * \properties \em meta.* holds metadata - there is a loose taxonomy to be defined + * \properties \em set.* holds properties to set on a frame produced + * \todo define the media metadata taxonomy + */ struct mlt_producer_s { - // We're implementing service here + /** A producer is a service. */ struct mlt_service_s parent; - // Public virtual methods + /** Get a frame of data (virtual function). + * + * \param mlt_producer a producer + * \param mlt_frame_ptr a frame pointer by reference + * \param int an index + * \return true if there was an error + */ int ( *get_frame )( mlt_producer, mlt_frame_ptr, int ); + + /** the destructor virtual function */ mlt_destructor close; - void *close_object; + void *close_object; /**< the object supplied to the close virtual function */ - // Private data - void *local; - void *child; + void *local; /**< \private instance object */ + void *child; /**< \private the object of a subclass */ }; -/** Public final methods -*/ +/* + * Public final methods + */ + +#define MLT_PRODUCER_SERVICE( producer ) ( &( producer )->parent ) +#define MLT_PRODUCER_PROPERTIES( producer ) MLT_SERVICE_PROPERTIES( MLT_PRODUCER_SERVICE( producer ) ) extern int mlt_producer_init( mlt_producer self, void *child ); extern mlt_producer mlt_producer_new( ); @@ -68,6 +109,7 @@ extern mlt_filter mlt_producer_filter( mlt_producer self, int index ); extern mlt_producer mlt_producer_cut( mlt_producer self, int in, int out ); extern int mlt_producer_is_cut( mlt_producer self ); extern int mlt_producer_is_mix( mlt_producer self ); +extern int mlt_producer_is_blank( mlt_producer self ); extern mlt_producer mlt_producer_cut_parent( mlt_producer self ); extern int mlt_producer_optimise( mlt_producer self ); extern void mlt_producer_close( mlt_producer self );