3 * \brief interface declaration for all service classes
5 * Copyright (C) 2003-2008 Ushodaya Enterprises Limited
6 * \author Charles Yates <charles.yates@pandora.be>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef _MLT_SERVICE_H_
24 #define _MLT_SERVICE_H_
26 #include "mlt_properties.h"
27 #include "mlt_profile.h"
29 /** \brief Service abstract base class
31 * \extends mlt_properties
32 * The service is the base class for all of the interesting classes and
33 * plugins for MLT. A service can have multiple inputs connections to
34 * other services called its "producers" but only a single output to another
35 * service called its "consumer." A service that has both producer and
36 * consumer connections is called a filter. Any service can have zero or more
37 * filters "attached" to it. We call any collection of services and their
38 * connections a "service network," which is similar to what DirectShow calls
39 * a filter graph or what gstreamer calls an element pipeline.
41 * \event \em service-changed
42 * \event \em property-changed
43 * \properties \em mlt_type identifies the subclass
44 * \properties \em resource is either the stream identifier or grandchild-class
45 * \properties \em in where to start playing
46 * \properties \em _filter_private Set this on a service to ensure that attached filters are handled privately.
47 * See modules/core/filter_region.c and modules/core/filter_watermark.c for examples.
48 * \properties \em disable Set this on a filter to disable it while keeping it in the object model.
49 * \properties \em _profile stores the mlt_profile for a service
54 struct mlt_properties_s parent
; /**< \private */
56 /** Get a frame of data (virtual function).
58 * \param mlt_producer a producer
59 * \param mlt_frame_ptr a frame pointer by reference
61 * \return true if there was an error
63 int ( *get_frame
)( mlt_service self
, mlt_frame_ptr frame
, int index
);
65 /** the destructor virtual function */
67 void *close_object
; /**< the object supplied to the close virtual function */
69 void *local
; /**< \private instance object */
70 void *child
; /**< \private the object of a subclass */
73 #define MLT_SERVICE_PROPERTIES( service ) ( &( service )->parent )
75 extern int mlt_service_init( mlt_service self
, void *child
);
76 extern void mlt_service_lock( mlt_service self
);
77 extern void mlt_service_unlock( mlt_service self
);
78 extern mlt_service_type
mlt_service_identify( mlt_service self
);
79 extern int mlt_service_connect_producer( mlt_service self
, mlt_service producer
, int index
);
80 extern mlt_service
mlt_service_get_producer( mlt_service self
);
81 extern int mlt_service_get_frame( mlt_service self
, mlt_frame_ptr frame
, int index
);
82 extern mlt_properties
mlt_service_properties( mlt_service self
);
83 extern mlt_service
mlt_service_consumer( mlt_service self
);
84 extern mlt_service
mlt_service_producer( mlt_service self
);
85 extern int mlt_service_attach( mlt_service self
, mlt_filter filter
);
86 extern int mlt_service_detach( mlt_service self
, mlt_filter filter
);
87 extern void mlt_service_apply_filters( mlt_service self
, mlt_frame frame
, int index
);
88 extern mlt_filter
mlt_service_filter( mlt_service self
, int index
);
89 extern mlt_profile
mlt_service_profile( mlt_service self
);
90 extern void mlt_service_close( mlt_service self
);