Updated the docs with the new _request methods

Original commit message from CVS:
Updated the docs with the new _request methods
This commit is contained in:
Wim Taymans 2001-01-23 20:03:07 +00:00
parent d20f0b4bae
commit 59211a49ff
7 changed files with 97 additions and 109 deletions

View file

@ -206,7 +206,7 @@ gst_element_get_padtemplate_list
gst_element_get_padtemplate_by_name
gst_element_add_ghost_pad
gst_element_remove_ghost_pad
gst_element_request_pad
gst_element_request_compatible_pad
gst_element_request_pad_by_name
gst_element_connect
gst_element_disconnect

View file

@ -327,7 +327,7 @@ circumstances.
@pad:
<!-- ##### FUNCTION gst_element_request_pad ##### -->
<!-- ##### FUNCTION gst_element_request_compatible_pad ##### -->
<para>
</para>
@ -335,8 +335,6 @@ circumstances.
@element:
@templ:
@Returns:
<!-- # Unused Parameters # -->
@temp:
<!-- ##### FUNCTION gst_element_request_pad_by_name ##### -->

View file

@ -217,13 +217,6 @@ the stream.
</para>
<!-- ##### MACRO GST_SINESRC ##### -->
<para>
</para>
@obj:
<!-- ##### FUNCTION gst_object_get_type ##### -->
<para>
@ -231,6 +224,13 @@ the stream.
@Returns:
<!-- ##### MACRO GST_SINESRC ##### -->
<para>
</para>
@obj:
<!-- ##### SECTION ./tmpl/plugin.sgml:Long_Description ##### -->
<para>
@ -1381,6 +1381,16 @@ The end point of a filter graph
@Returns:
<!-- ##### FUNCTION gst_element_request_pad ##### -->
<para>
</para>
@element:
@templ:
@Returns:
@temp:
<!-- ##### FUNCTION gst_pad_set_caps ##### -->
<para>

View file

@ -403,30 +403,12 @@ gst_element_get_padtemplate_by_compatible (GstElement *element, GstPadTemplate *
return newtempl;
}
/**
* gst_element_request_pad:
* @element: element to request a new pad from
* @templ: the padtemplate specifying the pad to connect to.
*
* Request a new pad from the element. The template will
* be used to decide what type of pad to create. This function
* is typically used for elements with a padtemplate with presence
* GST_PAD_REQUEST.
*
* Returns: the new pad that was created, NULL if no suitable pad can be
* created.
*/
static GstPad*
gst_element_request_pad (GstElement *element, GstPadTemplate *templ)
{
GstPad *newpad = NULL;
GstElementClass *oclass;
g_return_val_if_fail (element != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
g_return_val_if_fail (templ != NULL, NULL);
/* call the state change function so it can set the state */
oclass = GST_ELEMENT_CLASS (GTK_OBJECT (element)->klass);
if (oclass->request_new_pad)
newpad = (oclass->request_new_pad)(element, templ);

View file

@ -74,11 +74,11 @@ static inline char *_gst_print_statename(int state) {
// Note: using 8 bit shift mostly "just because", it leaves us enough room to grow <g>
#define GST_STATE_TRANSITION(obj) ((GST_STATE(obj)<<8) | GST_STATE_PENDING(obj))
#define GST_STATE_NULL_TO_READY ((GST_STATE_NULL<<8) | GST_STATE_READY)
#define GST_STATE_READY_TO_PLAYING ((GST_STATE_READY<<8) | GST_STATE_PLAYING)
#define GST_STATE_NULL_TO_READY ((GST_STATE_NULL<<8) | GST_STATE_READY)
#define GST_STATE_READY_TO_PLAYING ((GST_STATE_READY<<8) | GST_STATE_PLAYING)
#define GST_STATE_PLAYING_TO_PAUSED ((GST_STATE_PLAYING<<8) | GST_STATE_PAUSED)
#define GST_STATE_PAUSED_TO_PLAYING ((GST_STATE_PAUSED<<8) | GST_STATE_PLAYING)
#define GST_STATE_PLAYING_TO_READY ((GST_STATE_PLAYING<<8) | GST_STATE_READY)
#define GST_STATE_PLAYING_TO_READY ((GST_STATE_PLAYING<<8) | GST_STATE_READY)
#define GST_STATE_READY_TO_NULL ((GST_STATE_READY<<8) | GST_STATE_NULL)
#define GST_TYPE_ELEMENT \
@ -155,20 +155,20 @@ struct _GstElementClass {
GstElementFactory *elementfactory;
/* signal callbacks */
void (*state_change) (GstElement *element,GstElementState state);
void (*new_pad) (GstElement *element,GstPad *pad);
void (*state_change) (GstElement *element,GstElementState state);
void (*new_pad) (GstElement *element,GstPad *pad);
void (*new_ghost_pad) (GstElement *element,GstPad *pad);
void (*error) (GstElement *element,gchar *error);
void (*error) (GstElement *element,gchar *error);
void (*eos) (GstElement *element);
/* change the element state */
GstElementStateReturn (*change_state) (GstElement *element);
GstElementStateReturn (*change_state) (GstElement *element);
/* request a new pad */
GstPad* (*request_new_pad) (GstElement *element, GstPadTemplate *templ);
GstPad* (*request_new_pad) (GstElement *element, GstPadTemplate *templ);
/* create or read XML representation of self */
xmlNodePtr (*save_thyself) (GstElement *element, xmlNodePtr parent);
void (*restore_thyself) (GstElement *element, xmlNodePtr self, GHashTable *elements);
xmlNodePtr (*save_thyself) (GstElement *element, xmlNodePtr parent);
void (*restore_thyself) (GstElement *element, xmlNodePtr self, GHashTable *elements);
};
struct _GstElementDetails {
@ -208,7 +208,7 @@ GstPad* gst_element_get_pad (GstElement *element, const gchar *name);
GList* gst_element_get_pad_list (GstElement *element);
GList* gst_element_get_padtemplate_list (GstElement *element);
GstPadTemplate* gst_element_get_padtemplate_by_name (GstElement *element, const guchar *name);
void gst_element_add_ghost_pad (GstElement *element, GstPad *pad, gchar *name);
void gst_element_add_ghost_pad (GstElement *element, GstPad *pad, gchar *name);
void gst_element_remove_ghost_pad (GstElement *element, GstPad *pad);
GstPad* gst_element_request_compatible_pad (GstElement *element, GstPadTemplate *templ);
@ -241,29 +241,29 @@ GstElement* gst_element_load_thyself (xmlNodePtr parent, GHashTable *elements);
**/
GstElementFactory* gst_elementfactory_new (const gchar *name,GtkType type,
GstElementDetails *details);
void gst_elementfactory_destroy (GstElementFactory *elementfactory);
void gst_elementfactory_destroy (GstElementFactory *elementfactory);
GstElementFactory* gst_elementfactory_find (const gchar *name);
GList* gst_elementfactory_get_list (void);
void gst_elementfactory_add_padtemplate (GstElementFactory *elementfactory,
GstPadTemplate *templ);
void gst_elementfactory_add_padtemplate (GstElementFactory *elementfactory,
GstPadTemplate *templ);
gboolean gst_elementfactory_can_src_caps (GstElementFactory *factory,
gboolean gst_elementfactory_can_src_caps (GstElementFactory *factory,
GstCaps *caps);
gboolean gst_elementfactory_can_sink_caps (GstElementFactory *factory,
GstCaps *caps);
gboolean gst_elementfactory_can_src_caps_list (GstElementFactory *factory,
gboolean gst_elementfactory_can_sink_caps (GstElementFactory *factory,
GstCaps *caps);
gboolean gst_elementfactory_can_src_caps_list (GstElementFactory *factory,
GList *caps);
gboolean gst_elementfactory_can_sink_caps_list (GstElementFactory *factory,
GList *caps);
gboolean gst_elementfactory_can_sink_caps_list (GstElementFactory *factory,
GList *caps);
GstElement* gst_elementfactory_create (GstElementFactory *factory,
const gchar *name);
const gchar *name);
/* FIXME this name is wrong, probably so is the one above it */
GstElement* gst_elementfactory_make (const gchar *factoryname, const gchar *name);
xmlNodePtr gst_elementfactory_save_thyself (GstElementFactory *factory, xmlNodePtr parent);
xmlNodePtr gst_elementfactory_save_thyself (GstElementFactory *factory, xmlNodePtr parent);
GstElementFactory* gst_elementfactory_load_thyself (xmlNodePtr parent);
#ifdef __cplusplus
@ -271,5 +271,5 @@ GstElementFactory* gst_elementfactory_load_thyself (xmlNodePtr parent);
#endif /* __cplusplus */
#endif /* __GST_ELEMENT_H__ */
#endif /* __GST_ELEMENT_H__ */

View file

@ -80,8 +80,8 @@ gst_media_play_get_type(void)
return play_type;
}
static void
gst_media_play_class_init (GstMediaPlayClass *klass)
static void
gst_media_play_class_init (GstMediaPlayClass *klass)
{
GtkObjectClass *object_class;
@ -99,7 +99,7 @@ typedef struct {
} connect_struct;
/* we need more control here so... */
static void
static void
gst_media_play_connect_func (const gchar *handler_name,
GtkObject *object,
const gchar *signal_name,
@ -122,8 +122,8 @@ gst_media_play_connect_func (const gchar *handler_name,
}
static void
gst_media_play_init(GstMediaPlay *mplay)
static void
gst_media_play_init(GstMediaPlay *mplay)
{
GModule *symbols;
connect_struct data;
@ -144,7 +144,7 @@ gst_media_play_init(GstMediaPlay *mplay)
{
GtkArg arg;
GtkRange *range;
arg.name = "adjustment";
gtk_object_getv (GTK_OBJECT (mplay->slider), 1, &arg);
range = GTK_RANGE (GTK_VALUE_POINTER (arg));
@ -206,28 +206,28 @@ gst_media_play_init(GstMediaPlay *mplay)
}
GstMediaPlay *
gst_media_play_new ()
gst_media_play_new ()
{
return GST_MEDIA_PLAY (gtk_type_new (GST_TYPE_MEDIA_PLAY));
}
static void
gst_media_play_update_status_area (GstMediaPlay *play,
gulong current_time,
static void
gst_media_play_update_status_area (GstMediaPlay *play,
gulong current_time,
gulong total_time)
{
gchar time[14];
sprintf(time, "%02lu:%02lu / %02lu:%02lu",
sprintf(time, "%02lu:%02lu / %02lu:%02lu",
current_time/60, current_time%60,
total_time/60, total_time%60);
gst_status_area_set_playtime (play->status, time);
}
void
gst_media_play_start_uri (GstMediaPlay *play,
const guchar *uri)
void
gst_media_play_start_uri (GstMediaPlay *play,
const guchar *uri)
{
GstPlayReturn ret;
@ -241,7 +241,7 @@ gst_media_play_start_uri (GstMediaPlay *play,
gtk_widget_set_sensitive (play->slider, FALSE);
}
gtk_window_set_title (GTK_WINDOW (play->window),
gtk_window_set_title (GTK_WINDOW (play->window),
g_strconcat ( "Gstplay - ", uri, NULL));
gst_play_play (play->play);
@ -262,7 +262,7 @@ on_load_file_selected (GtkWidget *button,
gchar *file_name = gtk_file_selection_get_filename (GTK_FILE_SELECTION(selector));
gdk_threads_leave();
gst_media_play_start_uri (play, file_name);
gst_media_play_start_uri (play, file_name);
gdk_threads_enter();
g_free (data);
@ -297,10 +297,10 @@ on_open2_activate (GtkWidget *widget,
}
static void
static void
gst_media_play_set_arg (GtkObject *object,
GtkArg *arg,
guint id)
guint id)
{
GstMediaPlay *play;
play = GST_MEDIA_PLAY (object);
@ -312,10 +312,10 @@ gst_media_play_set_arg (GtkObject *object,
}
}
static void
static void
gst_media_play_get_arg (GtkObject *object,
GtkArg *arg,
guint id)
guint id)
{
GstMediaPlay *play;
@ -359,15 +359,15 @@ gst_media_play_state_changed (GstPlay *play,
gdk_threads_leave ();
}
void
on_gst_media_play_destroy (GtkWidget *widget,
void
on_gst_media_play_destroy (GtkWidget *widget,
GstMediaPlay *mplay)
{
gst_main_quit ();
}
void
on_exit_menu_activate (GtkWidget *widget,
void
on_exit_menu_activate (GtkWidget *widget,
GstMediaPlay *mplay)
{
gdk_threads_leave ();
@ -376,9 +376,9 @@ on_exit_menu_activate (GtkWidget *widget,
gst_main_quit ();
}
gint
on_gst_media_play_delete_event (GtkWidget *widget,
GdkEvent *event,
gint
on_gst_media_play_delete_event (GtkWidget *widget,
GdkEvent *event,
GstMediaPlay *mplay)
{
gdk_threads_leave ();
@ -387,8 +387,8 @@ on_gst_media_play_delete_event (GtkWidget *widget,
return FALSE;
}
void
on_extended1_activate (GtkCheckMenuItem *item,
void
on_extended1_activate (GtkCheckMenuItem *item,
GstMediaPlay *mplay)
{
gdk_threads_leave ();
@ -464,9 +464,9 @@ on_toggle_stop_toggled (GtkToggleButton *togglebutton,
update_buttons (play, GST_PLAY_STATE(play->play));
}
static void
update_buttons (GstMediaPlay *mplay,
GstPlayState state)
static void
update_buttons (GstMediaPlay *mplay,
GstPlayState state)
{
gtk_signal_handler_block_by_func (GTK_OBJECT (mplay->play_button),
GTK_SIGNAL_FUNC (on_toggle_play_toggled),
@ -503,10 +503,10 @@ update_buttons (GstMediaPlay *mplay,
mplay);
}
static void
static void
update_slider (GstMediaPlay *mplay,
GtkAdjustment *adjustment,
gfloat value)
GtkAdjustment *adjustment,
gfloat value)
{
gtk_signal_handler_block_by_func (GTK_OBJECT (adjustment),
GTK_SIGNAL_FUNC (gst_media_play_slider_changed),

View file

@ -25,20 +25,20 @@
//FIXME
#include <gst/meta/videoraw.h>
static void gst_videoscale_scale_yuv(GstVideoScale *scale, unsigned char *src, unsigned char *dest);
static void gst_videoscale_scale_rgb(GstVideoScale *scale, unsigned char *src, unsigned char *dest);
static void gst_videoscale_scale_yuv(GstVideoScale *scale, unsigned char *src, unsigned char *dest);
static void gst_videoscale_scale_rgb(GstVideoScale *scale, unsigned char *src, unsigned char *dest);
/* scalers */
static void generate_rowbytes(unsigned char *copy_row, int src_w, int dst_w, int bpp);
static void gst_videoscale_scale_nearest(GstVideoScale *scale, unsigned char *src, unsigned char *dest, int sw, int sh, int dw, int dh);
static void gst_videoscale_scale_plane_slow(GstVideoScale *scale, unsigned char *src, unsigned char *dest, int sw, int sh, int dw, int dh);
static void gst_videoscale_scale_nearest(GstVideoScale *scale, unsigned char *src, unsigned char *dest, int sw, int sh, int dw, int dh);
static void gst_videoscale_scale_plane_slow(GstVideoScale *scale, unsigned char *src, unsigned char *dest, int sw, int sh, int dw, int dh);
static void gst_videoscale_scale_point_sample(GstVideoScale *scale, unsigned char *src, unsigned char *dest, int sw, int sh, int dw, int dh);
/* filters */
static unsigned char gst_videoscale_bilinear(unsigned char *src, double x, double y, int sw, int sh);
static unsigned char gst_videoscale_bicubic(unsigned char *src, double x, double y, int sw, int sh);
GstVideoScale *gst_videoscale_new(gint sw, gint sh, gint dw, gint dh, GstColorSpaceType format, GstVideoScaleMethod method)
GstVideoScale *gst_videoscale_new(gint sw, gint sh, gint dw, gint dh, GstColorSpaceType format, GstVideoScaleMethod method)
{
GstVideoScale *new = g_malloc(sizeof(GstVideoScale));
gint scale_bytes;
@ -103,12 +103,12 @@ GstVideoScale *gst_videoscale_new(gint sw, gint sh, gint dw, gint dh, GstColorSp
return new;
}
void gst_videoscale_destroy(GstVideoScale *scale)
void gst_videoscale_destroy(GstVideoScale *scale)
{
g_free(scale);
}
static void gst_videoscale_scale_rgb(GstVideoScale *scale, unsigned char *src, unsigned char *dest)
static void gst_videoscale_scale_rgb(GstVideoScale *scale, unsigned char *src, unsigned char *dest)
{
int sw = scale->source_width;
int sh = scale->source_height;
@ -122,13 +122,13 @@ static void gst_videoscale_scale_rgb(GstVideoScale *scale, unsigned char *src, u
scale->scaler(scale, src, dest, sw, sh, dw, dh);
}
static void gst_videoscale_scale_yuv(GstVideoScale *scale, unsigned char *src, unsigned char *dest)
static void gst_videoscale_scale_yuv(GstVideoScale *scale, unsigned char *src, unsigned char *dest)
{
int sw = scale->source_width;
int sh = scale->source_height;
int dw = scale->dest_width;
int dh = scale->dest_height;
GST_DEBUG (0,"videoscale: scaling YUV420P %dx%d to %dx%d\n", sw, sh, dw, dh);
scale->scaler(scale, src, dest, sw, sh, dw, dh);
@ -194,12 +194,12 @@ static unsigned char gst_videoscale_bicubic(unsigned char *src, double x, double
a4 = a*a*(1-a);
k2 = MAX(0, k-1);
t1=a1*RC(j-1,k2)+ a2*RC(j,k2)+ a3*RC(j+1,k2)- a4*RC(j+2,k2);
t2=a1*RC(j-1,k)+ a2*RC(j,k)+ a3*RC(j+1,k)- a4*RC(j+2,k);
t1=a1*RC(j-1,k2)+ a2*RC(j,k2)+ a3*RC(j+1,k2)- a4*RC(j+2,k2);
t2=a1*RC(j-1,k)+ a2*RC(j,k)+ a3*RC(j+1,k)- a4*RC(j+2,k);
k2 = MIN(sh, k+1);
t3=a1*RC(j-1,k2)+ a2*RC(j,k2)+ a3*RC(j+1,k2)- a4*RC(j+2,k2);
t3=a1*RC(j-1,k2)+ a2*RC(j,k2)+ a3*RC(j+1,k2)- a4*RC(j+2,k2);
k2 = MIN(sh, k+2);
t4=a1*RC(j-1,k2)+ a2*RC(j,k2)+ a3*RC(j+1,k2)- a4*RC(j+2,k2);
t4=a1*RC(j-1,k2)+ a2*RC(j,k2)+ a3*RC(j+1,k2)- a4*RC(j+2,k2);
dest= -b*(1-b)*(1-b)*t1+ (1-2*b*b+b*b*b)*t2+ b*(1+b-b*b)*t3+ b*b*(b-1)*t4;
@ -236,7 +236,6 @@ static void gst_videoscale_scale_plane_slow(GstVideoScale *scale, unsigned char
}
}
}
}
#define PREFIX16 0x66
@ -290,13 +289,13 @@ static void generate_rowbytes(unsigned char *copy_row, int src_w, int dst_w, int
}
static void gst_videoscale_scale_point_sample(GstVideoScale *scale, unsigned char *src, unsigned char *dest, int sw, int sh, int dw, int dh)
static void gst_videoscale_scale_point_sample(GstVideoScale *scale, unsigned char *src, unsigned char *dest, int sw, int sh, int dw, int dh)
{
int ypos, yinc, y;
int xpos, xinc, x;
int sum, xcount, ycount, loop;
unsigned char *srcp, *srcp2;
GST_DEBUG (0,"videoscale: scaling nearest %p %p %d\n", src, dest, dw);
@ -337,13 +336,13 @@ static void gst_videoscale_scale_point_sample(GstVideoScale *scale, unsigned cha
}
}
static void gst_videoscale_scale_nearest(GstVideoScale *scale, unsigned char *src, unsigned char *dest, int sw, int sh, int dw, int dh)
static void gst_videoscale_scale_nearest(GstVideoScale *scale, unsigned char *src, unsigned char *dest, int sw, int sh, int dw, int dh)
{
int pos, inc, y;
int u1, u2;
scale->temp = scale->copy_row;
GST_DEBUG (0,"videoscale: scaling nearest %p %p %p %d\n", scale->copy_row, src, dest, dw);
@ -356,7 +355,7 @@ static void gst_videoscale_scale_nearest(GstVideoScale *scale, unsigned char *sr
src += sw;
pos-=0x10000;
}
__asm__ __volatile__ ("
movl %2, %%eax\n
call *%%eax
@ -364,11 +363,10 @@ static void gst_videoscale_scale_nearest(GstVideoScale *scale, unsigned char *sr
: "=&D" (u1), "=&S" (u2)
: "g" (scale->temp), "0" (dest), "1" (src)
: "memory" );
dest+= dw;
pos += inc;
}
GST_DEBUG (0,"videoscale: scaling nearest done %p\n", scale->copy_row);
GST_DEBUG(0,"videoscale: scaling nearest done %p\n", scale->copy_row);
}