From 4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 15 Mar 2004 19:32:27 +0000 Subject: [PATCH] don't mix tabs and spaces Original commit message from CVS: don't mix tabs and spaces --- ChangeLog | 4 + examples/capsfilter/capsfilter1.c | 2 +- examples/dynparams/filter.c | 96 +- examples/gstplay/player.c | 2 +- examples/indexing/indexmpeg.c | 29 +- examples/seeking/cdparanoia.c | 24 +- examples/seeking/cdplayer.c | 19 +- examples/seeking/seek.c | 51 +- examples/seeking/spider_seek.c | 25 +- examples/seeking/vorbisfile.c | 24 +- examples/stats/mp2ogg.c | 18 +- ext/arts/gst_arts.c | 25 +- ext/arts/gst_artsio_impl.cc | 52 +- ext/artsd/gstartsdsink.c | 41 +- ext/audiofile/gstafparse.c | 117 +- ext/audiofile/gstafsink.c | 51 +- ext/audiofile/gstafsrc.c | 55 +- ext/cdaudio/gstcdaudio.c | 118 +- ext/divx/gstdivxdec.c | 49 +- ext/divx/gstdivxenc.c | 39 +- ext/faac/gstfaac.c | 168 +- ext/faad/gstfaad.c | 132 +- ext/gsm/gstgsm.c | 2 +- ext/gsm/gstgsmdec.c | 31 +- ext/gsm/gstgsmenc.c | 25 +- ext/hermes/gsthermescolorspace.c | 239 +-- ext/ivorbis/vorbis.c | 2 +- ext/ivorbis/vorbisfile.c | 496 ++--- ext/jack/gstjack.c | 111 +- ext/jack/gstjackbin.c | 195 +- ext/ladspa/gstladspa.c | 226 +-- ext/ladspa/load.c | 56 +- ext/ladspa/search.c | 16 +- ext/lcs/gstcolorspace.c | 63 +- ext/libfame/gstlibfame.c | 146 +- ext/mpeg2enc/gstmpeg2enc.cc | 33 +- ext/mpeg2enc/gstmpeg2encoptions.cc | 220 +-- ext/mpeg2enc/gstmpeg2encpicturereader.cc | 21 +- ext/mplex/gstmplex.cc | 86 +- ext/mplex/gstmplexibitstream.cc | 18 +- ext/mplex/gstmplexjob.cc | 37 +- ext/musicbrainz/gsttrm.c | 37 +- ext/nas/nassink.c | 221 +-- ext/sdl/sdlvideosink.c | 96 +- ext/shout/gstshout.c | 131 +- ext/smoothwave/gstsmoothwave.c | 23 +- ext/snapshot/gstsnapshot.c | 33 +- ext/sndfile/gstsf.c | 231 +-- ext/swfdec/gstswfdec.c | 200 +- ext/tarkin/gsttarkin.c | 4 +- ext/tarkin/gsttarkindec.c | 76 +- ext/tarkin/gsttarkinenc.c | 34 +- ext/tarkin/info.c | 140 +- ext/tarkin/mem.c | 15 +- ext/tarkin/tarkin.c | 60 +- ext/tarkin/wavelet.c | 2 +- ext/tarkin/wavelet_coeff.c | 76 +- ext/tarkin/wavelet_xform.c | 98 +- ext/xine/xine.c | 4 +- ext/xine/xineaudiodec.c | 89 +- ext/xine/xineaudiosink.c | 92 +- ext/xine/xineinput.c | 44 +- ext/xvid/gstxvid.c | 262 +-- ext/xvid/gstxviddec.c | 45 +- ext/xvid/gstxvidenc.c | 63 +- gst-libs/gst/audio/audio.c | 40 +- gst-libs/gst/audio/audioclock.c | 5 +- gst-libs/gst/audio/gstaudiofilter.c | 11 +- gst-libs/gst/audio/gstaudiofiltertemplate.c | 7 +- gst-libs/gst/colorbalance/colorbalance.c | 16 +- .../gst/colorbalance/colorbalancechannel.c | 6 +- gst-libs/gst/gconf/gconf.c | 16 +- gst-libs/gst/idct/fastintidct.c | 26 +- gst-libs/gst/idct/floatidct.c | 6 +- gst-libs/gst/idct/ieeetest.c | 60 +- gst-libs/gst/idct/intidct.c | 108 +- gst-libs/gst/idct/mmx32idct.c | 572 +++--- gst-libs/gst/media-info/media-info-priv.c | 95 +- gst-libs/gst/media-info/media-info-test.c | 2 +- gst-libs/gst/media-info/media-info.c | 101 +- gst-libs/gst/mixer/mixer.c | 40 +- gst-libs/gst/mixer/mixertrack.c | 10 +- gst-libs/gst/navigation/navigation.c | 8 +- gst-libs/gst/play/play.c | 208 +- gst-libs/gst/propertyprobe/propertyprobe.c | 12 +- gst-libs/gst/resample/dtos.c | 5 +- gst-libs/gst/resample/resample.c | 88 +- gst-libs/gst/resample/test.c | 6 +- gst-libs/gst/riff/riff-media.c | 180 +- gst-libs/gst/riff/riff-read.c | 165 +- gst-libs/gst/tuner/tuner.c | 56 +- gst-libs/gst/tuner/tunerchannel.c | 8 +- gst-libs/gst/tuner/tunernorm.c | 4 +- gst-libs/gst/video/gstvideosink.c | 2 +- gst-libs/gst/video/video.c | 8 +- gst-libs/gst/xoverlay/xoverlay.c | 24 +- .../gst/xwindowlistener/xwindowlistener.c | 150 +- gst/cdxaparse/gstcdxaparse.c | 12 +- gst/chart/gstchart.c | 49 +- gst/colorspace/gstcolorspace.c | 211 ++- gst/colorspace/yuv2rgb.c | 196 +- gst/deinterlace/gstdeinterlace.c | 85 +- gst/festival/gstfestival.c | 33 +- gst/filter/gstbpwsinc.c | 44 +- gst/filter/gstfilter.c | 2 +- gst/filter/gstiir.c | 14 +- gst/filter/gstlpwsinc.c | 26 +- gst/flx/gstflxdec.c | 185 +- gst/mixmatrix/mixmatrix.c | 55 +- gst/modplug/gstmodplug.cc | 124 +- gst/mpeg1sys/buffer.c | 168 +- gst/mpeg1sys/gstmpeg1systemencode.c | 105 +- gst/mpeg1sys/systems.c | 10 +- gst/mpeg1videoparse/gstmp1videoparse.c | 245 +-- gst/mpeg2sub/gstmpeg2subt.c | 155 +- gst/mpegaudioparse/gstmpegaudioparse.c | 139 +- gst/overlay/gstoverlay.c | 41 +- gst/passthrough/gstpassthrough.c | 41 +- gst/playondemand/demo-mp3.c | 6 +- gst/playondemand/gstplayondemand.c | 61 +- gst/qtdemux/qtdemux.c | 721 +++---- gst/rtjpeg/RTjpeg.c | 1686 ++++++++--------- gst/rtjpeg/gstrtjpeg.c | 4 +- gst/rtjpeg/gstrtjpegdec.c | 5 +- gst/rtjpeg/gstrtjpegenc.c | 5 +- gst/smooth/gstsmooth.c | 37 +- gst/smoothwave/gstsmoothwave.c | 23 +- gst/smpte/barboxwipes.c | 702 +++---- gst/smpte/gstsmpte.c | 53 +- gst/smpte/paint.c | 36 +- gst/spectrum/demo-osssrc.c | 2 +- gst/spectrum/fix_fft.c | 70 +- gst/spectrum/gstspectrum.c | 7 +- gst/speed/demo-mp3.c | 4 +- gst/speed/gstspeed.c | 11 +- gst/stereo/gststereo.c | 15 +- gst/switch/gstswitch.c | 72 +- gst/vbidec/gstvbidec.c | 22 +- gst/vbidec/vbidata.c | 704 +++---- gst/vbidec/vbiscreen.c | 126 +- gst/videocrop/gstvideocrop.c | 17 +- gst/videodrop/gstvideodrop.c | 22 +- gst/virtualdub/gstvirtualdub.c | 66 +- gst/virtualdub/gstxsharpen.c | 128 +- gst/y4m/gsty4mencode.c | 13 +- sys/cdrom/gstcdplayer.c | 70 +- sys/dxr3/ac3_padder.c | 154 +- sys/dxr3/dxr3audiosink.c | 131 +- sys/dxr3/dxr3init.c | 6 +- sys/dxr3/dxr3spusink.c | 53 +- sys/dxr3/dxr3videosink.c | 187 +- sys/glsink/gstgl_nvimage.c | 20 +- sys/glsink/gstgl_pdrimage.c | 24 +- sys/glsink/gstgl_rgbimage.c | 30 +- sys/glsink/gstglsink.c | 81 +- sys/glsink/gstglxwindow.c | 26 +- sys/glsink/regcomb_yuvrgb.c | 39 +- sys/qcam/dark.c | 104 +- sys/qcam/exposure.c | 14 +- sys/qcam/gstqcamsrc.c | 46 +- sys/qcam/qcam-Linux.c | 14 +- sys/qcam/qcam-lib.c | 164 +- sys/qcam/qcam-os.c | 14 +- sys/v4l2/gstv4l2.c | 4 +- sys/v4l2/gstv4l2colorbalance.c | 8 +- sys/v4l2/gstv4l2element.c | 128 +- sys/v4l2/gstv4l2src.c | 545 +++--- sys/v4l2/gstv4l2tuner.c | 18 +- sys/v4l2/gstv4l2xoverlay.c | 4 +- sys/v4l2/v4l2-overlay_calls.c | 10 +- sys/v4l2/v4l2_calls.c | 228 +-- sys/v4l2/v4l2src_calls.c | 82 +- sys/vcd/vcdsrc.c | 37 +- 173 files changed, 8097 insertions(+), 7987 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f1b9d3240..1f2de023c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-03-15 Thomas Vander Stichele + + * *.c, *.cc: don't mix tabs and spaces + 2004-03-15 Thomas Vander Stichele * gst-libs/gst/play/play.c: (gst_play_pipeline_setup): diff --git a/examples/capsfilter/capsfilter1.c b/examples/capsfilter/capsfilter1.c index 46e127a212..5948d60161 100644 --- a/examples/capsfilter/capsfilter1.c +++ b/examples/capsfilter/capsfilter1.c @@ -72,7 +72,7 @@ main (gint argc, gchar * argv[]) /* force RGB data passing between colorspace and xvideosink */ res = gst_element_link_filtered (colorspace, "src", xvideosink, "sink", GST_CAPS_NEW ("filtercaps", - "video/raw", "format", GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB ")) + "video/raw", "format", GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB ")) )); if (!res) { g_print ("could not connect colorspace and xvideosink\n"); diff --git a/examples/dynparams/filter.c b/examples/dynparams/filter.c index 982a4c7ad1..5178d28bdc 100644 --- a/examples/dynparams/filter.c +++ b/examples/dynparams/filter.c @@ -15,17 +15,17 @@ /* filter UI data */ struct _filter_ui { - GtkWidget *window; /* top-level interface window */ + GtkWidget *window; /* top-level interface window */ - GtkWidget *buttons; /* all of the control buttons */ - GtkWidget *parse, *play, *stop; /* control buttons */ + GtkWidget *buttons; /* all of the control buttons */ + GtkWidget *parse, *play, *stop; /* control buttons */ - GtkWidget *feedback; /* here's where we'll tell you stuff */ - GtkTextBuffer *fb_buffer; /* feedback buffer */ - GtkWidget *selection; /* the place to input element stuff */ - GtkWidget *input, *filter, *output; /* the selection widgets */ + GtkWidget *feedback; /* here's where we'll tell you stuff */ + GtkTextBuffer *fb_buffer; /* feedback buffer */ + GtkWidget *selection; /* the place to input element stuff */ + GtkWidget *input, *filter, *output; /* the selection widgets */ - GtkWidget *control; /* the dynamically generated control UI */ + GtkWidget *control; /* the dynamically generated control UI */ }; typedef struct _filter_ui _filter_ui_t; @@ -33,13 +33,13 @@ typedef struct _filter_ui _filter_ui_t; /* back-end data */ struct _filter_data { - _filter_ui_t *ui; /* the UI data */ + _filter_ui_t *ui; /* the UI data */ gchar *input_pipe, *output_pipe, *filter_element; gchar *pipe_string; GList *filter_choices; gboolean playing; - GstElement *input, *output; /* these are in and out bins */ + GstElement *input, *output; /* these are in and out bins */ GstElement *pipeline; GstElement *filter; }; @@ -75,21 +75,21 @@ gst_bin_find_unconnected_pad (GstBin * bin, GstPadDirection direction, while (pads) { /* check if the direction matches */ if (GST_PAD_DIRECTION (GST_PAD (pads->data)) == direction) { - if (GST_PAD_PEER (GST_PAD (pads->data)) == NULL) { - /* found it ! */ - g_print ("DEBUG: found an unconnected pad !\n"); - pad = GST_PAD (pads->data); - } + if (GST_PAD_PEER (GST_PAD (pads->data)) == NULL) { + /* found it ! */ + g_print ("DEBUG: found an unconnected pad !\n"); + pad = GST_PAD (pads->data); + } } if (pad) - break; /* found one already */ + break; /* found one already */ pads = g_list_next (pads); } elements = g_list_next (elements); } g_print ("DEBUG: find_unconnected stop\n"); - if (pad == NULL) /* we didn't find it at all */ + if (pad == NULL) /* we didn't find it at all */ return NULL; pad = gst_ghost_pad_new (name, pad); @@ -157,37 +157,37 @@ ui_control_create (GstElement * element, GtkWidget * control, _filter_ui_t * ui) gtk_container_add (GTK_CONTAINER (hbox), widget); gtk_widget_show (widget); switch (G_PARAM_SPEC_VALUE_TYPE (specs[i])) { - case G_TYPE_INT64: - widget = gtk_hscale_new_with_range ( - (gdouble) (((GParamSpecInt64 *) specs[i])->minimum), - (gdouble) (((GParamSpecInt64 *) specs[i])->maximum), 1.0); - gtk_range_set_value (GTK_RANGE (widget), - (gdouble) ((GParamSpecInt64 *) specs[i])->default_value); - break; + case G_TYPE_INT64: + widget = gtk_hscale_new_with_range ( + (gdouble) (((GParamSpecInt64 *) specs[i])->minimum), + (gdouble) (((GParamSpecInt64 *) specs[i])->maximum), 1.0); + gtk_range_set_value (GTK_RANGE (widget), + (gdouble) ((GParamSpecInt64 *) specs[i])->default_value); + break; - case G_TYPE_INT: - widget = gtk_hscale_new_with_range ( - (gdouble) (((GParamSpecInt *) specs[i])->minimum), - (gdouble) (((GParamSpecInt *) specs[i])->maximum), 1.0); - gtk_range_set_value (GTK_RANGE (widget), - (gdouble) ((GParamSpecInt *) specs[i])->default_value); - break; - case G_TYPE_FLOAT: - widget = gtk_hscale_new_with_range ( - (gdouble) (((GParamSpecFloat *) specs[i])->minimum), - (gdouble) (((GParamSpecFloat *) specs[i])->maximum), 0.00001); - gtk_range_set_value (GTK_RANGE (widget), - (gdouble) ((GParamSpecFloat *) specs[i])->default_value); - break; + case G_TYPE_INT: + widget = gtk_hscale_new_with_range ( + (gdouble) (((GParamSpecInt *) specs[i])->minimum), + (gdouble) (((GParamSpecInt *) specs[i])->maximum), 1.0); + gtk_range_set_value (GTK_RANGE (widget), + (gdouble) ((GParamSpecInt *) specs[i])->default_value); + break; + case G_TYPE_FLOAT: + widget = gtk_hscale_new_with_range ( + (gdouble) (((GParamSpecFloat *) specs[i])->minimum), + (gdouble) (((GParamSpecFloat *) specs[i])->maximum), 0.00001); + gtk_range_set_value (GTK_RANGE (widget), + (gdouble) ((GParamSpecFloat *) specs[i])->default_value); + break; } /* create the dparam object */ dparam = gst_dpsmooth_new (G_PARAM_SPEC_VALUE_TYPE (specs[i])); g_object_set (G_OBJECT (dparam), "update_period", 2000000LL, NULL); g_assert (gst_dpman_attach_dparam (dpman, - (gchar *) g_param_spec_get_name (specs[i]), dparam)); + (gchar *) g_param_spec_get_name (specs[i]), dparam)); gst_dpman_set_mode (dpman, "asynchronous"); g_signal_connect (widget, "value-changed", - G_CALLBACK (cb_dynparm_value_changed), dparam); + G_CALLBACK (cb_dynparm_value_changed), dparam); cb_dynparm_value_changed (GTK_RANGE (widget), dparam); gtk_container_add (GTK_CONTAINER (hbox), widget); @@ -315,7 +315,7 @@ cb_parse_clicked (GtkButton * button, gpointer * user_data) fd->input = GST_ELEMENT (gst_parse_launch (fd->input_pipe, &error)); if (error) { ui_feedback_add (fd->ui, "Error : parsing input pipeline : %s\n", - error->message); + error->message); g_error_free (error); return; } @@ -329,7 +329,7 @@ cb_parse_clicked (GtkButton * button, gpointer * user_data) fd->output = GST_ELEMENT (gst_parse_launch (fd->output_pipe, &error)); if (error) { ui_feedback_add (fd->ui, "Error : parsing output pipeline : %s\n", - error->message); + error->message); g_error_free (error); return; } @@ -340,7 +340,7 @@ cb_parse_clicked (GtkButton * button, gpointer * user_data) fd->filter = gst_element_factory_make (fd->filter_element, "filter"); if (fd->filter == NULL) { ui_feedback_add (fd->ui, "Error : could not create element %s\n", - fd->filter_element); + fd->filter_element); return; } @@ -359,14 +359,14 @@ cb_parse_clicked (GtkButton * button, gpointer * user_data) "source"); if (src_pad == NULL) { ui_feedback_add (fd->ui, - "Error : could not find an unconnected source pad !\n"); + "Error : could not find an unconnected source pad !\n"); return; } sink_pad = gst_bin_find_unconnected_pad (GST_BIN (fd->output), GST_PAD_SINK, "sink"); if (sink_pad == NULL) { ui_feedback_add (fd->ui, - "Error : could not find an unconnected sink pad !\n"); + "Error : could not find an unconnected sink pad !\n"); return; } gst_element_add_pad (fd->input, src_pad); @@ -417,8 +417,8 @@ init_data (_filter_data_t * fd) void create_ui (_filter_ui_t * fui, _filter_data_t * fd) { - GtkWidget *widget; /* temporary widget */ - GtkWidget *vbox; /* temporary vbox */ + GtkWidget *widget; /* temporary widget */ + GtkWidget *vbox; /* temporary vbox */ g_print ("DEBUG: creating top-level window\n"); fui->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); @@ -480,7 +480,7 @@ create_ui (_filter_ui_t * fui, _filter_data_t * fd) widget = gtk_label_new ("Output Pipe"); gtk_container_add (GTK_CONTAINER (vbox), widget); fui->output = gtk_entry_new (); - gtk_entry_set_text (GTK_ENTRY (fui->output), "osssink fragment=1572872"); /* fixme: gconf default ? */ + gtk_entry_set_text (GTK_ENTRY (fui->output), "osssink fragment=1572872"); /* fixme: gconf default ? */ gtk_container_add (GTK_CONTAINER (vbox), fui->output); gtk_container_add (GTK_CONTAINER (fui->selection), vbox); g_signal_connect (G_OBJECT (fui->output), "activate", diff --git a/examples/gstplay/player.c b/examples/gstplay/player.c index 3272778bf6..a23d3a0184 100644 --- a/examples/gstplay/player.c +++ b/examples/gstplay/player.c @@ -36,7 +36,7 @@ print_tag (const GstTagList * list, const gchar * tag, gpointer unused) g_assert (gst_tag_list_get_string_index (list, tag, i, &str)); } else { str = - g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, i)); + g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, i)); } if (i == 0) { diff --git a/examples/indexing/indexmpeg.c b/examples/indexing/indexmpeg.c index 48a7ca2372..5c1296098d 100644 --- a/examples/indexing/indexmpeg.c +++ b/examples/indexing/indexmpeg.c @@ -29,21 +29,21 @@ entry_added (GstIndex * index, GstIndexEntry * entry) switch (entry->type) { case GST_INDEX_ENTRY_ID: g_print ("id %d describes writer %s\n", entry->id, - GST_INDEX_ID_DESCRIPTION (entry)); + GST_INDEX_ID_DESCRIPTION (entry)); break; case GST_INDEX_ENTRY_FORMAT: g_print ("%d: registered format %d for %s\n", entry->id, - GST_INDEX_FORMAT_FORMAT (entry), GST_INDEX_FORMAT_KEY (entry)); + GST_INDEX_FORMAT_FORMAT (entry), GST_INDEX_FORMAT_KEY (entry)); break; case GST_INDEX_ENTRY_ASSOCIATION: { gint i; g_print ("%p, %d: %08x ", entry, entry->id, - GST_INDEX_ASSOC_FLAGS (entry)); + GST_INDEX_ASSOC_FLAGS (entry)); for (i = 0; i < GST_INDEX_NASSOCS (entry); i++) { - g_print ("%d %lld ", GST_INDEX_ASSOC_FORMAT (entry, i), - GST_INDEX_ASSOC_VALUE (entry, i)); + g_print ("%d %lld ", GST_INDEX_ASSOC_FORMAT (entry, i), + GST_INDEX_ASSOC_VALUE (entry, i)); } g_print ("\n"); break; @@ -60,7 +60,8 @@ typedef struct GstElement *bin; GstElement *pipeline; GstIndex *index; -} dyn_link; +} +dyn_link; static void dynamic_link (GstPadTemplate * templ, GstPad * newpad, gpointer data) @@ -205,18 +206,18 @@ main (gint argc, gchar * argv[]) GstElement *sink; struct poptOption options[] = { {"verbose", 'v', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &verbose, 0, - "Print index entries", NULL}, + "Print index entries", NULL}, {"quiet", 'q', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &quiet, 0, - "don't print progress bar", NULL}, + "don't print progress bar", NULL}, POPT_TABLEEND }; if (!gst_init_check_with_popt_table (&argc, &argv, options) || argc < 3) { g_print ("usage: %s [-v] \n" - " type can be: 0 mpeg_systems\n" - " 1 mpeg_decoder\n" - " -v : report added index entries\n" - " -q : don't print progress\n", argv[0]); + " type can be: 0 mpeg_systems\n" + " 1 mpeg_decoder\n" + " -v : report added index entries\n" + " -q : don't print progress\n", argv[0]); return -1; } @@ -225,7 +226,7 @@ main (gint argc, gchar * argv[]) if (index) { if (verbose) g_signal_connect (G_OBJECT (index), "entry_added", - G_CALLBACK (entry_added), NULL); + G_CALLBACK (entry_added), NULL); g_object_set (G_OBJECT (index), "resolver", 1, NULL); } @@ -284,7 +285,7 @@ main (gint argc, gchar * argv[]) gst_index_get_writer_id (index, GST_OBJECT (src), &id); entry = gst_index_get_assoc_entry (index, id, GST_INDEX_LOOKUP_BEFORE, 0, - GST_FORMAT_TIME, G_MAXINT64); + GST_FORMAT_TIME, G_MAXINT64); g_assert (entry); gst_index_entry_assoc_map (entry, GST_FORMAT_TIME, &result); total_tm = result * 60 / GST_SECOND; diff --git a/examples/seeking/cdparanoia.c b/examples/seeking/cdparanoia.c index e750f3468f..c4a58cf86a 100644 --- a/examples/seeking/cdparanoia.c +++ b/examples/seeking/cdparanoia.c @@ -29,7 +29,7 @@ get_position_info (GstElement * cdparanoia) if (format == GST_FORMAT_TIME) { position /= GST_SECOND; g_print ("%s: %lld:%02lld", definition->nick, position / 60, - position % 60); + position % 60); } else { g_print ("%s: %lld", definition->nick, position); } @@ -72,16 +72,16 @@ get_track_info (GstElement * cdparanoia) res = gst_pad_query (pad, GST_QUERY_TOTAL, &format, &total); if (res) { if (format == GST_FORMAT_TIME) { - total /= GST_SECOND; - g_print ("%s total: %lld:%02lld\n", definition->nick, total / 60, - total % 60); + total /= GST_SECOND; + g_print ("%s total: %lld:%02lld\n", definition->nick, total / 60, + total % 60); } else - g_print ("%s total: %lld\n", definition->nick, total); + g_print ("%s total: %lld\n", definition->nick, total); if (format == track_format) - total_tracks = total; + total_tracks = total; else if (format == GST_FORMAT_TIME) - total_time = total; + total_time = total; } else g_print ("failed to get %s total\n", definition->nick); @@ -110,12 +110,12 @@ get_track_info (GstElement * cdparanoia) /* for the first track (i==0) we wait until we have the * time of the next track */ if (i > 0) { - gint64 length = time - time_count; + gint64 length = time - time_count; - g_print ("track %d: %lld:%02lld -> %lld:%02lld, length: %lld:%02lld\n", - i - 1, - time_count / 60, time_count % 60, - time / 60, time % 60, length / 60, length % 60); + g_print ("track %d: %lld:%02lld -> %lld:%02lld, length: %lld:%02lld\n", + i - 1, + time_count / 60, time_count % 60, + time / 60, time % 60, length / 60, length % 60); } } else { g_print ("could not get time for track %d\n", i); diff --git a/examples/seeking/cdplayer.c b/examples/seeking/cdplayer.c index 1e823cc5b5..d83c78e648 100644 --- a/examples/seeking/cdplayer.c +++ b/examples/seeking/cdplayer.c @@ -47,7 +47,8 @@ typedef struct { const gchar *name; const GstFormat format; -} seek_format; +} +seek_format; static seek_format seek_formats[] = { {"tim", GST_FORMAT_TIME}, @@ -76,9 +77,9 @@ query_durations () format = seek_formats[i].format; res = gst_element_query (element, GST_QUERY_TOTAL, &format, &value); if (res) { - g_print ("%s %13lld | ", seek_formats[i].name, value); + g_print ("%s %13lld | ", seek_formats[i].name, value); } else { - g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); + g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); } i++; } @@ -105,9 +106,9 @@ query_positions () format = seek_formats[i].format; res = gst_element_query (element, GST_QUERY_POSITION, &format, &value); if (res) { - g_print ("%s %13lld | ", seek_formats[i].name, value); + g_print ("%s %13lld | ", seek_formats[i].name, value); } else { - g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); + g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); } i++; } @@ -137,7 +138,7 @@ update_scale (gpointer data) if (stats) { if (clock) g_print ("clock: %13llu (%s)\n", position, - gst_object_get_name (GST_OBJECT (clock))); + gst_object_get_name (GST_OBJECT (clock))); query_durations (); query_positions (); } @@ -184,7 +185,7 @@ stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data) g_print ("seek to %lld on element %s\n", real, GST_ELEMENT_NAME (seekable)); s_event = gst_event_new_seek (GST_FORMAT_TIME | - GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH, real); + GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH, real); res = gst_element_send_event (seekable, s_event); @@ -208,7 +209,7 @@ play_cb (GtkButton * button, gpointer data) if (!GST_FLAG_IS_SET (pipeline, GST_BIN_SELF_SCHEDULABLE)) gtk_idle_add ((GtkFunction) iterate, pipeline); update_id = - gtk_timeout_add (UPDATE_INTERVAL, (GtkFunction) update_scale, pipeline); + gtk_timeout_add (UPDATE_INTERVAL, (GtkFunction) update_scale, pipeline); } } @@ -237,7 +238,7 @@ main (int argc, char **argv) *play_button, *pause_button, *stop_button, *hscale; struct poptOption options[] = { {"stats", 's', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &stats, 0, - "Show element stats", NULL}, + "Show element stats", NULL}, POPT_TABLEEND }; diff --git a/examples/seeking/seek.c b/examples/seeking/seek.c index 34a6958dee..e8d6bc0455 100644 --- a/examples/seeking/seek.c +++ b/examples/seeking/seek.c @@ -28,7 +28,8 @@ typedef struct const gchar *padname; GstPad *target; GstElement *bin; -} dyn_link; +} +dyn_link; static GstElement * gst_element_factory_make_or_warn (gchar * type, gchar * name) @@ -372,7 +373,7 @@ make_avi_pipeline (const gchar * location) gst_element_set_state (audio_bin, GST_STATE_PAUSED); setup_dynamic_link (demux, "audio_00", gst_element_get_pad (a_decoder, - "sink"), audio_bin); + "sink"), audio_bin); seekable = gst_element_get_pad (a_queue, "src"); seekable_pads = g_list_prepend (seekable_pads, seekable); @@ -400,7 +401,7 @@ make_avi_pipeline (const gchar * location) gst_element_set_state (video_bin, GST_STATE_PAUSED); setup_dynamic_link (demux, "video_00", gst_element_get_pad (v_decoder, - "sink"), video_bin); + "sink"), video_bin); seekable = gst_element_get_pad (v_queue, "src"); seekable_pads = g_list_prepend (seekable_pads, seekable); @@ -448,7 +449,7 @@ make_mpeg_pipeline (const gchar * location) gst_bin_add (GST_BIN (audio_thread), audiosink); setup_dynamic_link (demux, "audio_00", gst_element_get_pad (a_decoder, - "sink"), audio_bin); + "sink"), audio_bin); seekable = gst_element_get_pad (a_queue, "src"); seekable_pads = g_list_prepend (seekable_pads, seekable); @@ -470,7 +471,7 @@ make_mpeg_pipeline (const gchar * location) gst_bin_add_many (GST_BIN (video_thread), v_queue, v_filter, videosink, NULL); setup_dynamic_link (demux, "video_00", gst_element_get_pad (v_decoder, - "sink"), video_bin); + "sink"), video_bin); seekable = gst_element_get_pad (v_queue, "src"); seekable_pads = g_list_prepend (seekable_pads, seekable); @@ -519,7 +520,7 @@ make_mpegnt_pipeline (const gchar * location) gst_bin_add (GST_BIN (audio_thread), audiosink); setup_dynamic_link (demux, "audio_00", gst_element_get_pad (a_decoder, - "sink"), audio_bin); + "sink"), audio_bin); seekable = gst_element_get_pad (a_queue, "src"); seekable_pads = g_list_prepend (seekable_pads, seekable); @@ -536,7 +537,7 @@ make_mpegnt_pipeline (const gchar * location) gst_bin_add_many (GST_BIN (video_bin), v_decoder, v_filter, videosink, NULL); setup_dynamic_link (demux, "video_00", gst_element_get_pad (v_decoder, - "sink"), video_bin); + "sink"), video_bin); seekable = gst_element_get_pad (v_decoder, "src"); seekable_pads = g_list_prepend (seekable_pads, seekable); @@ -572,7 +573,8 @@ typedef struct { const gchar *name; const GstFormat format; -} seek_format; +} +seek_format; static seek_format seek_formats[] = { {"tim", GST_FORMAT_TIME}, @@ -599,9 +601,9 @@ query_rates (void) format = seek_formats[i].format; if (gst_pad_convert (pad, GST_FORMAT_TIME, GST_SECOND, &format, &value)) { - g_print ("%s %13lld | ", seek_formats[i].name, value); + g_print ("%s %13lld | ", seek_formats[i].name, value); } else { - g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); + g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); } i++; @@ -630,9 +632,9 @@ query_durations () format = seek_formats[i].format; res = gst_pad_query (pad, GST_QUERY_TOTAL, &format, &value); if (res) { - g_print ("%s %13lld | ", seek_formats[i].name, value); + g_print ("%s %13lld | ", seek_formats[i].name, value); } else { - g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); + g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); } i++; } @@ -660,9 +662,9 @@ query_positions () format = seek_formats[i].format; res = gst_pad_query (pad, GST_QUERY_POSITION, &format, &value); if (res) { - g_print ("%s %13lld | ", seek_formats[i].name, value); + g_print ("%s %13lld | ", seek_formats[i].name, value); } else { - g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); + g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); } i++; } @@ -691,7 +693,7 @@ update_scale (gpointer data) if (stats) { g_print ("clock: %13llu (%s)\n", position, - gst_object_get_name (GST_OBJECT (clock))); + gst_object_get_name (GST_OBJECT (clock))); query_durations (); query_positions (); query_rates (); @@ -740,10 +742,10 @@ stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data) GstPad *seekable = GST_PAD (walk->data); g_print ("seek to %lld on pad %s:%s\n", real, - GST_DEBUG_PAD_NAME (seekable)); + GST_DEBUG_PAD_NAME (seekable)); s_event = - gst_event_new_seek (GST_FORMAT_TIME | GST_SEEK_METHOD_SET | - GST_SEEK_FLAG_FLUSH, real); + gst_event_new_seek (GST_FORMAT_TIME | GST_SEEK_METHOD_SET | + GST_SEEK_FLAG_FLUSH, real); res = gst_pad_send_event (seekable, s_event); @@ -756,10 +758,10 @@ stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data) GstElement *seekable = GST_ELEMENT (walk->data); g_print ("seek to %lld on element %s\n", real, - gst_element_get_name (seekable)); + gst_element_get_name (seekable)); s_event = - gst_event_new_seek (GST_FORMAT_TIME | GST_SEEK_METHOD_SET | - GST_SEEK_FLAG_FLUSH, real); + gst_event_new_seek (GST_FORMAT_TIME | GST_SEEK_METHOD_SET | + GST_SEEK_FLAG_FLUSH, real); res = gst_element_send_event (seekable, s_event); @@ -782,7 +784,7 @@ play_cb (GtkButton * button, gpointer data) gst_element_set_state (pipeline, GST_STATE_PLAYING); gtk_idle_add ((GtkFunction) iterate, pipeline); update_id = - gtk_timeout_add (UPDATE_INTERVAL, (GtkFunction) update_scale, pipeline); + gtk_timeout_add (UPDATE_INTERVAL, (GtkFunction) update_scale, pipeline); } } @@ -808,7 +810,8 @@ typedef struct { gchar *name; GstElement *(*func) (const gchar * location); -} Pipeline; +} +Pipeline; static Pipeline pipelines[] = { {"mp3", make_mp3_pipeline}, @@ -848,7 +851,7 @@ main (int argc, char **argv) *play_button, *pause_button, *stop_button, *hscale; struct poptOption options[] = { {"stats", 's', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &stats, 0, - "Show pad stats", NULL}, + "Show pad stats", NULL}, POPT_TABLEEND }; gint type; diff --git a/examples/seeking/spider_seek.c b/examples/seeking/spider_seek.c index d2c2c6b217..dc9ddfd676 100644 --- a/examples/seeking/spider_seek.c +++ b/examples/seeking/spider_seek.c @@ -91,7 +91,8 @@ typedef struct { const gchar *name; const GstFormat format; -} seek_format; +} +seek_format; static seek_format seek_formats[] = { {"tim", GST_FORMAT_TIME}, @@ -118,9 +119,9 @@ query_rates (void) format = seek_formats[i].format; if (gst_pad_convert (pad, GST_FORMAT_TIME, GST_SECOND, &format, &value)) { - g_print ("%s %13lld | ", seek_formats[i].name, value); + g_print ("%s %13lld | ", seek_formats[i].name, value); } else { - g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); + g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); } i++; @@ -149,9 +150,9 @@ query_durations () format = seek_formats[i].format; res = gst_element_query (element, GST_QUERY_TOTAL, &format, &value); if (res) { - g_print ("%s %13lld | ", seek_formats[i].name, value); + g_print ("%s %13lld | ", seek_formats[i].name, value); } else { - g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); + g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); } i++; } @@ -178,9 +179,9 @@ query_positions () format = seek_formats[i].format; res = gst_element_query (element, GST_QUERY_POSITION, &format, &value); if (res) { - g_print ("%s %13lld | ", seek_formats[i].name, value); + g_print ("%s %13lld | ", seek_formats[i].name, value); } else { - g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); + g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); } i++; } @@ -208,7 +209,7 @@ update_scale (gpointer data) if (stats) { g_print ("clock: %13llu (%s)\n", position, - gst_object_get_name (GST_OBJECT (clock))); + gst_object_get_name (GST_OBJECT (clock))); query_durations (); query_positions (); query_rates (); @@ -255,7 +256,7 @@ stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data) g_print ("seek to %lld on element %s\n", real, GST_ELEMENT_NAME (seekable)); s_event = gst_event_new_seek (GST_FORMAT_TIME | - GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH, real); + GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH, real); res = gst_element_send_event (seekable, s_event); @@ -279,7 +280,7 @@ play_cb (GtkButton * button, gpointer data) if (!GST_FLAG_IS_SET (pipeline, GST_BIN_SELF_SCHEDULABLE)) gtk_idle_add ((GtkFunction) iterate, pipeline); update_id = - gtk_timeout_add (UPDATE_INTERVAL, (GtkFunction) update_scale, pipeline); + gtk_timeout_add (UPDATE_INTERVAL, (GtkFunction) update_scale, pipeline); } } @@ -309,9 +310,9 @@ main (int argc, char **argv) gboolean threaded = FALSE; struct poptOption options[] = { {"threaded", 't', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &threaded, 0, - "Run the pipeline in a toplevel thread", NULL}, + "Run the pipeline in a toplevel thread", NULL}, {"stats", 's', POPT_ARG_NONE | POPT_ARGFLAG_STRIP, &stats, 0, - "Show element stats", NULL}, + "Show element stats", NULL}, POPT_TABLEEND }; diff --git a/examples/seeking/vorbisfile.c b/examples/seeking/vorbisfile.c index ec6844a07a..afb4ecc4e2 100644 --- a/examples/seeking/vorbisfile.c +++ b/examples/seeking/vorbisfile.c @@ -65,20 +65,20 @@ print_lbs_info (struct probe_context *context, gint stream) /* get start and end position of this stream */ res = gst_pad_convert (context->pad, - context->ls_format, stream, &format, &value_start); + context->ls_format, stream, &format, &value_start); res &= gst_pad_convert (context->pad, - context->ls_format, stream + 1, &format, &value_end); + context->ls_format, stream + 1, &format, &value_end); if (res) { /* substract to get the length */ value_end -= value_start; if (format == GST_FORMAT_TIME) { - value_end /= (GST_SECOND / 100); - g_print (" %s: %lld:%02lld.%02lld\n", definition->nick, - value_end / 6000, (value_end / 100) % 60, (value_end % 100)); + value_end /= (GST_SECOND / 100); + g_print (" %s: %lld:%02lld.%02lld\n", definition->nick, + value_end / 6000, (value_end / 100) % 60, (value_end % 100)); } else { - g_print (" %s: %lld\n", definition->nick, value_end); + g_print (" %s: %lld\n", definition->nick, value_end); } } else g_print (" could not get logical stream %s\n", definition->nick); @@ -180,13 +180,13 @@ collect_stream_properties (struct probe_context *context) if (res) { if (format == GST_FORMAT_TIME) { - value /= (GST_SECOND / 100); - g_print (" total %s: %lld:%02lld.%02lld\n", definition->nick, - value / 6000, (value / 100) % 60, (value % 100)); + value /= (GST_SECOND / 100); + g_print (" total %s: %lld:%02lld.%02lld\n", definition->nick, + value / 6000, (value / 100) % 60, (value % 100)); } else { - if (format == context->ls_format) - context->total_ls = value; - g_print (" total %s: %lld\n", definition->nick, value); + if (format == context->ls_format) + context->total_ls = value; + g_print (" total %s: %lld\n", definition->nick, value); } } } diff --git a/examples/stats/mp2ogg.c b/examples/stats/mp2ogg.c index 55d79e90c7..3fb437febc 100644 --- a/examples/stats/mp2ogg.c +++ b/examples/stats/mp2ogg.c @@ -47,7 +47,7 @@ main (gint argc, gchar * argv[]) if (!pipeline) { if (error) g_print ("ERROR: pipeline could not be constructed: %s\n", - error->message); + error->message); else g_print ("ERROR: pipeline could not be constructed\n"); return -1; @@ -80,18 +80,18 @@ main (gint argc, gchar * argv[]) format = GST_FORMAT_BYTES; /* see how many bytes are genereated per 8 seconds (== bitrate) */ gst_pad_convert (enc_src, GST_FORMAT_TIME, 8 * GST_SECOND, - &format, &bitrate_enc); + &format, &bitrate_enc); gst_pad_convert (dec_sink, GST_FORMAT_TIME, 8 * GST_SECOND, - &format, &bitrate_dec); + &format, &bitrate_dec); g_print ("[%2dm %.2ds] of [%2dm %.2ds], " - "src avg bitrate: %lld, dest avg birate: %lld, ratio [%02.2f] \r", - (gint) (position / (GST_SECOND * 60)), - (gint) (position / (GST_SECOND)) % 60, - (gint) (duration / (GST_SECOND * 60)), - (gint) (duration / (GST_SECOND)) % 60, - bitrate_dec, bitrate_enc, (gfloat) bitrate_dec / bitrate_enc); + "src avg bitrate: %lld, dest avg birate: %lld, ratio [%02.2f] \r", + (gint) (position / (GST_SECOND * 60)), + (gint) (position / (GST_SECOND)) % 60, + (gint) (duration / (GST_SECOND * 60)), + (gint) (duration / (GST_SECOND)) % 60, + bitrate_dec, bitrate_enc, (gfloat) bitrate_dec / bitrate_enc); } g_print ("\n"); diff --git a/ext/arts/gst_arts.c b/ext/arts/gst_arts.c index 16906e6953..0eff0852b0 100644 --- a/ext/arts/gst_arts.c +++ b/ext/arts/gst_arts.c @@ -42,21 +42,21 @@ static GstStaticPadTemplate sink_temp = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "depth = (int) 16, " - "width = (int) 16, " - "signed = (boolean) true, " - "channels = (int) 2, " "endianness = (int) byte_order") + "depth = (int) 16, " + "width = (int) 16, " + "signed = (boolean) true, " + "channels = (int) 2, " "endianness = (int) byte_order") ); static GstStaticPadTemplate src_temp = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "depth = (int) 16, " - "width = (int) 16, " - "signed = (boolean) true, " - "channels = (int) 2, " - "rate = (int) 44100, " "endianness = (int) byte_order") + "depth = (int) 16, " + "width = (int) 16, " + "signed = (boolean) true, " + "channels = (int) 2, " + "rate = (int) 44100, " "endianness = (int) byte_order") ); enum @@ -93,8 +93,9 @@ gst_arts_get_type (void) 0, (GInstanceInitFunc) gst_arts_init, }; + gst_arts_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstArts", &gst_arts_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstArts", &gst_arts_info, 0); } return gst_arts_type; } @@ -128,12 +129,12 @@ gst_arts_init (GstARTS * arts) { arts->sinkpad = gst_pad_new_from_template (gst_element_get_pad_template (GST_ELEMENT - (arts), "sink"), "sink"); + (arts), "sink"), "sink"); gst_element_add_pad (GST_ELEMENT (arts), arts->sinkpad); arts->srcpad = gst_pad_new_from_template (gst_element_get_pad_template (GST_ELEMENT - (arts), "src"), "src"); + (arts), "src"), "src"); gst_element_add_pad (GST_ELEMENT (arts), arts->srcpad); gst_element_set_loop_function (GST_ELEMENT (arts), gst_arts_loop); diff --git a/ext/arts/gst_artsio_impl.cc b/ext/arts/gst_artsio_impl.cc index b08aa93a07..18d099ea34 100644 --- a/ext/arts/gst_artsio_impl.cc +++ b/ext/arts/gst_artsio_impl.cc @@ -44,40 +44,40 @@ namespace Gst while (fulfilled < samples) { - if (remainingsamples == 0) { + if (remainingsamples == 0) { //fprintf(stderr,"need to get a buffer\n"); - if (inbuf) { - gst_data_unref (inbuf); - inbuf = NULL; - } - // start by pulling a buffer from GStreamer - inbuf = gst_pad_pull (sinkpad); + if (inbuf) { + gst_data_unref (inbuf); + inbuf = NULL; + } + // start by pulling a buffer from GStreamer + inbuf = gst_pad_pull (sinkpad); - while (GST_IS_EVENT (inbuf)) { - switch (GST_EVENT_TYPE (inbuf)) { - case GST_EVENT_EOS: - gst_element_set_eos (GST_PAD_PARENT (sinkpad)); - default: - break; - } - gst_pad_event_default (srcpad, GST_EVENT (inbuf)); - inbuf = gst_pad_pull (sinkpad); - } + while (GST_IS_EVENT (inbuf)) { + switch (GST_EVENT_TYPE (inbuf)) { + case GST_EVENT_EOS: + gst_element_set_eos (GST_PAD_PARENT (sinkpad)); + default: + break; + } + gst_pad_event_default (srcpad, GST_EVENT (inbuf)); + inbuf = gst_pad_pull (sinkpad); + } - dataptr = GST_BUFFER_DATA (GST_BUFFER (inbuf)); - remainingsamples = GST_BUFFER_SIZE (GST_BUFFER (inbuf)) / 4; + dataptr = GST_BUFFER_DATA (GST_BUFFER (inbuf)); + remainingsamples = GST_BUFFER_SIZE (GST_BUFFER (inbuf)) / 4; //fprintf(stderr,"got a buffer with %d samples\n",remainingsamples); - } + } - unsigned long count = MIN (remainingsamples, samples - fulfilled); + unsigned long count = MIN (remainingsamples, samples - fulfilled); //fprintf(stderr,"have %d samples left, can fill %d\n",remainingsamples,count); - convert_stereo_i16le_2float (count, dataptr, outleft, outright); + convert_stereo_i16le_2float (count, dataptr, outleft, outright); //s = (gint16 *)dataptr; //fprintf(stderr,"samples in are %d and %d, out are %f and %f\n",s[0],s[1],outleft[0],outright[0]); - remainingsamples -= count; - dataptr += 4 * count; - fulfilled += count; + remainingsamples -= count; + dataptr += 4 * count; + fulfilled += count; } } @@ -112,7 +112,7 @@ namespace Gst GST_BUFFER_SIZE (outbuf) = samples * 4; memset (GST_BUFFER_DATA (outbuf), 0, samples * 4); convert_stereo_2float_i16le (samples, inleft, inright, - GST_BUFFER_DATA (outbuf)); + GST_BUFFER_DATA (outbuf)); //s = (gint16 *)GST_BUFFER_DATA(outbuf); //fprintf(stderr,"samples in are %f and %f, out are %d and %d\n",inleft[0],inright[0],s[0],s[1]); gst_pad_push (srcpad, GST_DATA (outbuf)); diff --git a/ext/artsd/gstartsdsink.c b/ext/artsd/gstartsdsink.c index 8a2f7a32f3..16a7269976 100644 --- a/ext/artsd/gstartsdsink.c +++ b/ext/artsd/gstartsdsink.c @@ -91,9 +91,10 @@ gst_artsdsink_get_type (void) 0, (GInstanceInitFunc) gst_artsdsink_init, }; + artsdsink_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstArtsdsink", - &artsdsink_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstArtsdsink", + &artsdsink_info, 0); } return artsdsink_type; } @@ -119,9 +120,9 @@ gst_artsdsink_class_init (GstArtsdsinkClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MUTE, g_param_spec_boolean ("mute", "mute", "mute", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MUTE, g_param_spec_boolean ("mute", "mute", "mute", TRUE, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = gst_artsdsink_set_property; gobject_class->get_property = gst_artsdsink_get_property; @@ -134,7 +135,7 @@ gst_artsdsink_init (GstArtsdsink * artsdsink) { artsdsink->sinkpad = gst_pad_new_from_template (gst_element_get_pad_template (GST_ELEMENT - (artsdsink), "sink"), "sink"); + (artsdsink), "sink"), "sink"); gst_element_add_pad (GST_ELEMENT (artsdsink), artsdsink->sinkpad); gst_pad_set_chain_function (artsdsink->sinkpad, gst_artsdsink_chain); gst_pad_set_link_function (artsdsink->sinkpad, gst_artsdsink_link); @@ -190,24 +191,24 @@ gst_artsdsink_chain (GstPad * pad, GstData * _data) if (GST_BUFFER_DATA (buf) != NULL) { gst_trace_add_entry (NULL, 0, GPOINTER_TO_INT (buf), - "artsdsink: writing to server"); + "artsdsink: writing to server"); if (!artsdsink->mute && artsdsink->connected) { int bytes; void *bufptr = GST_BUFFER_DATA (buf); int bufsize = GST_BUFFER_SIZE (buf); GST_DEBUG ("artsdsink: stream=%p data=%p size=%d", - artsdsink->stream, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf)); + artsdsink->stream, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf)); do { - bytes = arts_write (artsdsink->stream, bufptr, bufsize); - if (bytes < 0) { - fprintf (stderr, "arts_write error: %s\n", arts_error_text (bytes)); - gst_buffer_unref (buf); - return; - } - bufptr += bytes; - bufsize -= bytes; + bytes = arts_write (artsdsink->stream, bufptr, bufsize); + if (bytes < 0) { + fprintf (stderr, "arts_write error: %s\n", arts_error_text (bytes)); + gst_buffer_unref (buf); + return; + } + bufptr += bytes; + bufsize -= bytes; } while (bufsize > 0); } } @@ -230,11 +231,11 @@ gst_artsdsink_set_property (GObject * object, guint prop_id, break; case ARG_NAME: if (artsdsink->connect_name != NULL) - g_free (artsdsink->connect_name); + g_free (artsdsink->connect_name); if (g_value_get_string (value) == NULL) - artsdsink->connect_name = NULL; + artsdsink->connect_name = NULL; else - artsdsink->connect_name = g_strdup (g_value_get_string (value)); + artsdsink->connect_name = g_strdup (g_value_get_string (value)); break; default: break; @@ -268,7 +269,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "artsdsink", GST_RANK_NONE, - GST_TYPE_ARTSDSINK)) + GST_TYPE_ARTSDSINK)) return FALSE; return TRUE; @@ -337,7 +338,7 @@ gst_artsdsink_change_state (GstElement * element) } else { if (!GST_FLAG_IS_SET (element, GST_ARTSDSINK_OPEN)) { if (!gst_artsdsink_open_audio (GST_ARTSDSINK (element))) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; } } diff --git a/ext/audiofile/gstafparse.c b/ext/audiofile/gstafparse.c index 00c9fd8168..ddc61e0c61 100644 --- a/ext/audiofile/gstafparse.c +++ b/ext/audiofile/gstafparse.c @@ -57,13 +57,13 @@ GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "rate = (int) [ 1, MAX ], " - "channels = (int) [ 1, MAX ], " - "endianness = (int) BYTE_ORDER, " - "width = (int) { 8, 16 }, " - "depth = (int) { 8, 16 }, " - "signed = (boolean) { true, false }, " - "buffer-frames = (int) [ 1, MAX ]") + "rate = (int) [ 1, MAX ], " + "channels = (int) [ 1, MAX ], " + "endianness = (int) BYTE_ORDER, " + "width = (int) { 8, 16 }, " + "depth = (int) { 8, 16 }, " + "signed = (boolean) { true, false }, " + "buffer-frames = (int) [ 1, MAX ]") ); static GstStaticPadTemplate afparse_sink_factory = @@ -112,9 +112,10 @@ gst_afparse_get_type (void) 0, (GInstanceInitFunc) gst_afparse_init, }; + afparse_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstAFParse", &afparse_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstAFParse", &afparse_info, + 0); } return afparse_type; } @@ -151,13 +152,13 @@ gst_afparse_init (GstAFParse * afparse) { afparse->srcpad = gst_pad_new_from_template (gst_element_get_pad_template (GST_ELEMENT - (afparse), "src"), "src"); + (afparse), "src"), "src"); gst_pad_use_explicit_caps (afparse->srcpad); gst_element_add_pad (GST_ELEMENT (afparse), afparse->srcpad); afparse->sinkpad = gst_pad_new_from_template (gst_element_get_pad_template (GST_ELEMENT - (afparse), "sink"), "sink"); + (afparse), "sink"), "sink"); gst_element_add_pad (GST_ELEMENT (afparse), afparse->sinkpad); gst_element_set_loop_function (GST_ELEMENT (afparse), gst_afparse_loop); @@ -217,8 +218,8 @@ gst_afparse_loop (GstElement * element) &v_width); if (afGetCompression != AF_COMPRESSION_NONE || afGetByteOrder (afparse->file, - AF_DEFAULT_TRACK) != afGetVirtualByteOrder (afparse->file, - AF_DEFAULT_TRACK) || s_format != v_format || s_width != v_width) { + AF_DEFAULT_TRACK) != afGetVirtualByteOrder (afparse->file, + AF_DEFAULT_TRACK) || s_format != v_format || s_width != v_width) { bypass_afread = FALSE; } @@ -241,24 +242,24 @@ gst_afparse_loop (GstElement * element) got_bytes = gst_bytestream_read (bs, &buf, bytes_per_read); if (got_bytes == 0) { - /* we need to check for an event. */ - gst_bytestream_get_status (bs, &waiting, &event); - if (event && GST_EVENT_TYPE (event) == GST_EVENT_EOS) { - gst_pad_push (afparse->srcpad, - GST_DATA (gst_event_new (GST_EVENT_EOS))); - gst_element_set_eos (GST_ELEMENT (afparse)); - break; - } + /* we need to check for an event. */ + gst_bytestream_get_status (bs, &waiting, &event); + if (event && GST_EVENT_TYPE (event) == GST_EVENT_EOS) { + gst_pad_push (afparse->srcpad, + GST_DATA (gst_event_new (GST_EVENT_EOS))); + gst_element_set_eos (GST_ELEMENT (afparse)); + break; + } } else { - GST_BUFFER_TIMESTAMP (buf) = afparse->timestamp; - gst_pad_push (afparse->srcpad, GST_DATA (buf)); - if (got_bytes != bytes_per_read) { - /* this shouldn't happen very often */ - /* FIXME calculate the timestamps based on the fewer bytes received */ + GST_BUFFER_TIMESTAMP (buf) = afparse->timestamp; + gst_pad_push (afparse->srcpad, GST_DATA (buf)); + if (got_bytes != bytes_per_read) { + /* this shouldn't happen very often */ + /* FIXME calculate the timestamps based on the fewer bytes received */ - } else { - afparse->timestamp += frames_per_read * 1E9 / afparse->rate; - } + } else { + afparse->timestamp += frames_per_read * 1E9 / afparse->rate; + } } } while (TRUE); @@ -269,17 +270,17 @@ gst_afparse_loop (GstElement * element) GST_BUFFER_TIMESTAMP (buf) = afparse->timestamp; data = GST_BUFFER_DATA (buf); numframes = - afReadFrames (afparse->file, AF_DEFAULT_TRACK, data, frames_per_read); + afReadFrames (afparse->file, AF_DEFAULT_TRACK, data, frames_per_read); /* events are handled in gst_afparse_vf_read so if there are no * frames it must be EOS */ if (numframes < 1) { - gst_buffer_unref (buf); + gst_buffer_unref (buf); - gst_pad_push (afparse->srcpad, - GST_DATA (gst_event_new (GST_EVENT_EOS))); - gst_element_set_eos (GST_ELEMENT (afparse)); - break; + gst_pad_push (afparse->srcpad, + GST_DATA (gst_event_new (GST_EVENT_EOS))); + gst_element_set_eos (GST_ELEMENT (afparse)); + break; } GST_BUFFER_SIZE (buf) = numframes * frames_to_bytes; gst_pad_push (afparse->srcpad, GST_DATA (buf)); @@ -334,7 +335,7 @@ gst_afparse_plugin_init (GstPlugin * plugin) return FALSE; if (!gst_element_register (plugin, "afparse", GST_RANK_NONE, - GST_TYPE_AFPARSE)) + GST_TYPE_AFPARSE)) return FALSE; return TRUE; @@ -363,35 +364,35 @@ gst_afparse_open_file (GstAFParse * afparse) afparse->channels = afGetChannels (afparse->file, AF_DEFAULT_TRACK); afGetSampleFormat (afparse->file, AF_DEFAULT_TRACK, - &sampleFormat, &sampleWidth); + &sampleFormat, &sampleWidth); switch (sampleFormat) { case AF_SAMPFMT_TWOSCOMP: - afparse->is_signed = TRUE; - break; + afparse->is_signed = TRUE; + break; case AF_SAMPFMT_UNSIGNED: - afparse->is_signed = FALSE; - break; + afparse->is_signed = FALSE; + break; case AF_SAMPFMT_FLOAT: case AF_SAMPFMT_DOUBLE: - GST_DEBUG ("ERROR: float data not supported yet !\n"); + GST_DEBUG ("ERROR: float data not supported yet !\n"); } afparse->rate = (guint) afGetRate (afparse->file, AF_DEFAULT_TRACK); afparse->width = sampleWidth; GST_DEBUG ("input file: %d channels, %d width, %d rate, signed %s\n", - afparse->channels, afparse->width, afparse->rate, - afparse->is_signed ? "yes" : "no"); + afparse->channels, afparse->width, afparse->rate, + afparse->is_signed ? "yes" : "no"); } /* set caps on src */ /*FIXME: add all the possible formats, especially float ! */ gst_pad_set_explicit_caps (afparse->srcpad, gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "signed", G_TYPE_BOOLEAN, afparse->is_signed, - "width", G_TYPE_INT, afparse->width, - "depth", G_TYPE_INT, afparse->width, - "rate", G_TYPE_INT, afparse->rate, - "channels", G_TYPE_INT, afparse->channels, NULL)); + "endianness", G_TYPE_INT, G_BYTE_ORDER, + "signed", G_TYPE_BOOLEAN, afparse->is_signed, + "width", G_TYPE_INT, afparse->width, + "depth", G_TYPE_INT, afparse->width, + "rate", G_TYPE_INT, afparse->rate, + "channels", G_TYPE_INT, afparse->channels, NULL)); GST_FLAG_SET (afparse, GST_AFPARSE_OPEN); @@ -433,17 +434,17 @@ gst_afparse_vf_read (AFvirtualfile * vfile, void *data, size_t nbytes) } switch (GST_EVENT_TYPE (event)) { case GST_EVENT_EOS: - return 0; + return 0; case GST_EVENT_FLUSH: - GST_DEBUG ("flush"); - break; + GST_DEBUG ("flush"); + break; case GST_EVENT_DISCONTINUOUS: - GST_DEBUG ("seek done"); - got_bytes = gst_bytestream_peek_bytes (bs, &bytes, nbytes); - break; + GST_DEBUG ("seek done"); + got_bytes = gst_bytestream_peek_bytes (bs, &bytes, nbytes); + break; default: - g_warning ("unknown event %d", GST_EVENT_TYPE (event)); - got_bytes = gst_bytestream_peek_bytes (bs, &bytes, nbytes); + g_warning ("unknown event %d", GST_EVENT_TYPE (event)); + got_bytes = gst_bytestream_peek_bytes (bs, &bytes, nbytes); } } diff --git a/ext/audiofile/gstafsink.c b/ext/audiofile/gstafsink.c index eeac509f12..a24991d189 100644 --- a/ext/audiofile/gstafsink.c +++ b/ext/audiofile/gstafsink.c @@ -65,13 +65,13 @@ GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "rate = (int) [ 1, MAX ], " - "channels = (int) [ 1, 2 ], " - "endianness = (int) BYTE_ORDER, " - "width = (int) { 8, 16 }, " - "depth = (int) { 8, 16 }, " - "signed = (boolean) { true, false }, " - "buffer-frames = (int) [ 1, MAX ]") + "rate = (int) [ 1, MAX ], " + "channels = (int) [ 1, 2 ], " + "endianness = (int) BYTE_ORDER, " + "width = (int) { 8, 16 }, " + "depth = (int) { 8, 16 }, " + "signed = (boolean) { true, false }, " + "buffer-frames = (int) [ 1, MAX ]") ); /* we use an enum for the output type arg */ @@ -93,7 +93,7 @@ gst_afsink_types_get_type (void) if (!afsink_types_type) { afsink_types_type = - g_enum_register_static ("GstAudiosinkTypes", afsink_types); + g_enum_register_static ("GstAudiosinkTypes", afsink_types); } return afsink_types_type; } @@ -136,8 +136,9 @@ gst_afsink_get_type (void) 0, (GInstanceInitFunc) gst_afsink_init, }; + afsink_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstAFSink", &afsink_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstAFSink", &afsink_info, 0); } return afsink_type; } @@ -166,8 +167,8 @@ gst_afsink_class_init (GstAFSinkClass * klass) gst_element_class_install_std_props (GST_ELEMENT_CLASS (klass), "location", ARG_LOCATION, G_PARAM_READWRITE, NULL); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TYPE, g_param_spec_enum ("type", "type", "type", GST_TYPE_AFSINK_TYPES, 0, G_PARAM_READWRITE)); /* CHECKME! */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_OUTPUT_ENDIANNESS, g_param_spec_int ("endianness", "endianness", "endianness", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TYPE, g_param_spec_enum ("type", "type", "type", GST_TYPE_AFSINK_TYPES, 0, G_PARAM_READWRITE)); /* CHECKME! */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_OUTPUT_ENDIANNESS, g_param_spec_int ("endianness", "endianness", "endianness", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ gst_afsink_signals[SIGNAL_HANDOFF] = g_signal_new ("handoff", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, @@ -188,7 +189,7 @@ gst_afsink_init (GstAFSink * afsink) afsink->sinkpad = gst_pad_new_from_template (gst_element_get_pad_template (GST_ELEMENT - (afsink), "sink"), "sink"); + (afsink), "sink"), "sink"); gst_element_add_pad (GST_ELEMENT (afsink), afsink->sinkpad); gst_pad_set_chain_function (afsink->sinkpad, gst_afsink_chain); @@ -217,14 +218,14 @@ gst_afsink_set_property (GObject * object, guint prop_id, const GValue * value, case ARG_LOCATION: /* the element must be stopped or paused in order to do this */ g_return_if_fail ((GST_STATE (sink) < GST_STATE_PLAYING) - || (GST_STATE (sink) == GST_STATE_PAUSED)); + || (GST_STATE (sink) == GST_STATE_PAUSED)); if (sink->filename) - g_free (sink->filename); + g_free (sink->filename); sink->filename = g_strdup (g_value_get_string (value)); if ((GST_STATE (sink) == GST_STATE_PAUSED) - && (sink->filename != NULL)) { - gst_afsink_close_file (sink); - gst_afsink_open_file (sink); + && (sink->filename != NULL)) { + gst_afsink_close_file (sink); + gst_afsink_open_file (sink); } break; @@ -236,7 +237,7 @@ gst_afsink_set_property (GObject * object, guint prop_id, const GValue * value, int end = g_value_get_int (value); if (end == 1234 || end == 4321) - sink->endianness_output = end; + sink->endianness_output = end; } break; default: @@ -291,8 +292,8 @@ gst_afsink_open_file (GstAFSink * sink) AFfilesetup outfilesetup; const GstCaps *caps; GstStructure *structure; - int sample_format; /* audiofile's sample format, look in audiofile.h */ - int byte_order = 0; /* audiofile's byte order defines */ + int sample_format; /* audiofile's sample format, look in audiofile.h */ + int byte_order = 0; /* audiofile's byte order defines */ g_return_val_if_fail (!GST_FLAG_IS_SET (sink, GST_AFSINK_OPEN), FALSE); @@ -342,8 +343,8 @@ gst_afsink_open_file (GstAFSink * sink) sink->file = afOpenFile (sink->filename, "w", outfilesetup); if (sink->file == AF_NULL_FILEHANDLE) { GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, - (_("Could not open file \"%s\" for writing."), sink->filename), - ("system error: %s", strerror (errno))); + (_("Could not open file \"%s\" for writing."), sink->filename), + ("system error: %s", strerror (errno))); return FALSE; } @@ -364,7 +365,7 @@ gst_afsink_close_file (GstAFSink * sink) /* if (fclose (sink->file) != 0) */ if (afCloseFile (sink->file) != 0) { GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE, - (_("Error closing file \"%s\"."), sink->filename), GST_ERROR_SYSTEM); + (_("Error closing file \"%s\"."), sink->filename), GST_ERROR_SYSTEM); } else { GST_FLAG_UNSET (sink, GST_AFSINK_OPEN); } @@ -417,10 +418,10 @@ gst_afsink_chain (GstPad * pad, GstData * _data) int frameCount = 0; frameCount = - GST_BUFFER_SIZE (buf) / ((afsink->width / 8) * afsink->channels); + GST_BUFFER_SIZE (buf) / ((afsink->width / 8) * afsink->channels); /* g_print ("DEBUG: writing %d frames ", frameCount); */ ret = afWriteFrames (afsink->file, AF_DEFAULT_TRACK, - GST_BUFFER_DATA (buf), frameCount); + GST_BUFFER_DATA (buf), frameCount); if (ret == AF_BAD_WRITE || ret == AF_BAD_LSEEK) { printf ("afsink : Warning : afWriteFrames returned an error (%d)\n", ret); } diff --git a/ext/audiofile/gstafsrc.c b/ext/audiofile/gstafsrc.c index 98a2d38b1a..d0ce73f99e 100644 --- a/ext/audiofile/gstafsrc.c +++ b/ext/audiofile/gstafsrc.c @@ -62,13 +62,13 @@ static GstStaticPadTemplate afsrc_src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "rate = (int) [ 1, MAX ], " - "channels = (int) [ 1, MAX ], " - "endianness = (int) BYTE_ORDER, " - "width = (int) { 8, 16 }, " - "depth = (int) { 8, 16 }, " - "signed = (boolean) { true, false }, " - "buffer-frames = (int) [ 1, MAX ]") + "rate = (int) [ 1, MAX ], " + "channels = (int) [ 1, MAX ], " + "endianness = (int) BYTE_ORDER, " + "width = (int) { 8, 16 }, " + "depth = (int) { 8, 16 }, " + "signed = (boolean) { true, false }, " + "buffer-frames = (int) [ 1, MAX ]") ); /* we use an enum for the output type arg */ @@ -133,8 +133,9 @@ gst_afsrc_get_type (void) 0, (GInstanceInitFunc) gst_afsrc_init, }; + afsrc_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstAFSrc", &afsrc_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstAFSrc", &afsrc_info, 0); } return afsrc_type; } @@ -181,7 +182,7 @@ gst_afsrc_init (GstAFSrc * afsrc) /* no need for a template, caps are set based on file, right ? */ afsrc->srcpad = gst_pad_new_from_template (gst_element_get_pad_template (GST_ELEMENT - (afsrc), "src"), "src"); + (afsrc), "src"), "src"); gst_element_add_pad (GST_ELEMENT (afsrc), afsrc->srcpad); gst_pad_use_explicit_caps (afsrc->srcpad); gst_pad_set_get_function (afsrc->srcpad, gst_afsrc_get); @@ -258,7 +259,7 @@ gst_afsrc_set_property (GObject * object, guint prop_id, const GValue * value, switch (prop_id) { case ARG_LOCATION: if (src->filename) - g_free (src->filename); + g_free (src->filename); src->filename = g_strdup (g_value_get_string (value)); break; default: @@ -316,8 +317,8 @@ gst_afsrc_open_file (GstAFSrc * src) src->file = afOpenFile (src->filename, "r", AF_NULL_FILESETUP); if (src->file == AF_NULL_FILEHANDLE) { GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, - (_("Could not open file \"%s\" for reading."), src->filename), - ("system error: %s", strerror (errno))); + (_("Could not open file \"%s\" for reading."), src->filename), + ("system error: %s", strerror (errno))); return FALSE; } @@ -327,33 +328,33 @@ gst_afsrc_open_file (GstAFSrc * src) src->channels = afGetChannels (src->file, AF_DEFAULT_TRACK); afGetSampleFormat (src->file, AF_DEFAULT_TRACK, - &sampleFormat, &sampleWidth); + &sampleFormat, &sampleWidth); switch (sampleFormat) { case AF_SAMPFMT_TWOSCOMP: - src->is_signed = TRUE; - break; + src->is_signed = TRUE; + break; case AF_SAMPFMT_UNSIGNED: - src->is_signed = FALSE; - break; + src->is_signed = FALSE; + break; case AF_SAMPFMT_FLOAT: case AF_SAMPFMT_DOUBLE: - GST_DEBUG ("ERROR: float data not supported yet !\n"); + GST_DEBUG ("ERROR: float data not supported yet !\n"); } src->rate = (guint) afGetRate (src->file, AF_DEFAULT_TRACK); src->width = sampleWidth; GST_DEBUG ("input file: %d channels, %d width, %d rate, signed %s\n", - src->channels, src->width, src->rate, src->is_signed ? "yes" : "no"); + src->channels, src->width, src->rate, src->is_signed ? "yes" : "no"); } /* set caps on src */ gst_pad_set_explicit_caps (src->srcpad, gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "signed", G_TYPE_BOOLEAN, src->is_signed, - "width", G_TYPE_INT, src->width, - "depth", G_TYPE_INT, src->width, - "rate", G_TYPE_INT, src->rate, - "channels", G_TYPE_INT, src->channels, NULL)); + "endianness", G_TYPE_INT, G_BYTE_ORDER, + "signed", G_TYPE_BOOLEAN, src->is_signed, + "width", G_TYPE_INT, src->width, + "depth", G_TYPE_INT, src->width, + "rate", G_TYPE_INT, src->rate, + "channels", G_TYPE_INT, src->channels, NULL)); GST_FLAG_SET (src, GST_AFSRC_OPEN); @@ -369,7 +370,7 @@ gst_afsrc_close_file (GstAFSrc * src) /* if (fclose (src->file) != 0) */ if (afCloseFile (src->file) != 0) { GST_ELEMENT_ERROR (src, RESOURCE, CLOSE, - (_("Error closing file \"%s\"."), src->filename), GST_ERROR_SYSTEM); + (_("Error closing file \"%s\"."), src->filename), GST_ERROR_SYSTEM); } else { GST_FLAG_UNSET (src, GST_AFSRC_OPEN); } @@ -393,7 +394,7 @@ gst_afsrc_change_state (GstElement * element) /* g_print ("DEBUG: GST_AFSRC_OPEN not set\n"); */ if (!gst_afsrc_open_file (GST_AFSRC (element))) { /* g_print ("DEBUG: element tries to open file\n"); */ - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; } } } diff --git a/ext/cdaudio/gstcdaudio.c b/ext/cdaudio/gstcdaudio.c index 95bd30d07c..f622d5e42a 100644 --- a/ext/cdaudio/gstcdaudio.c +++ b/ext/cdaudio/gstcdaudio.c @@ -134,9 +134,10 @@ gst_cdaudio_get_type (void) (GInstanceInitFunc) gst_cdaudio_init, NULL }; + gst_cdaudio_type = - g_type_register_static (GST_TYPE_BIN, "GstCDAudio", &gst_cdaudio_info, - 0); + g_type_register_static (GST_TYPE_BIN, "GstCDAudio", &gst_cdaudio_info, + 0); track_format = gst_format_register ("track", "CD track"); sector_format = gst_format_register ("sector", "CD sector"); @@ -163,22 +164,22 @@ gst_cdaudio_class_init (GstCDAudioClass * klass) g_object_class_install_property (gobject_klass, ARG_DEVICE, g_param_spec_string ("device", "Device", "CDROM device", - NULL, G_PARAM_READWRITE)); + NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_klass, ARG_DISCID, g_param_spec_ulong ("discid", "Disc ID", "CDDB Disc ID", - 0, G_MAXULONG, 0, G_PARAM_READABLE)); + 0, G_MAXULONG, 0, G_PARAM_READABLE)); g_object_class_install_property (gobject_klass, ARG_VOLUME_FL, g_param_spec_int ("volume_fl", "Volume fl", "Front left volume", - 0, 255, 255, G_PARAM_READWRITE)); + 0, 255, 255, G_PARAM_READWRITE)); g_object_class_install_property (gobject_klass, ARG_VOLUME_FR, g_param_spec_int ("volume_fr", "Volume fr", "Front right volume", - 0, 255, 255, G_PARAM_READWRITE)); + 0, 255, 255, G_PARAM_READWRITE)); g_object_class_install_property (gobject_klass, ARG_VOLUME_BL, g_param_spec_int ("volume_bl", "Volume bl", "Back left volume", - 0, 255, 255, G_PARAM_READWRITE)); + 0, 255, 255, G_PARAM_READWRITE)); g_object_class_install_property (gobject_klass, ARG_VOLUME_BR, g_param_spec_int ("volume_br", "Volume br", "Back right volume", - 0, 255, 255, G_PARAM_READWRITE)); + 0, 255, 255, G_PARAM_READWRITE)); gst_cdaudio_signals[TRACK_CHANGE] = g_signal_new ("track-change", G_TYPE_FROM_CLASS (klass), @@ -290,10 +291,10 @@ print_track_info (GstCDAudio * cdaudio) for (i = 0; i < cdaudio->info.disc_total_tracks; i++) { g_print ("%d %d %d %d:%02d\n", i, - cdaudio->info.disc_track[i].track_length.frames, - cdaudio->info.disc_track[i].track_pos.frames, - cdaudio->info.disc_track[i].track_length.minutes, - cdaudio->info.disc_track[i].track_length.seconds); + cdaudio->info.disc_track[i].track_length.frames, + cdaudio->info.disc_track[i].track_pos.frames, + cdaudio->info.disc_track[i].track_length.minutes, + cdaudio->info.disc_track[i].track_length.seconds); } } @@ -310,14 +311,14 @@ gst_cdaudio_change_state (GstElement * element) case GST_STATE_READY_TO_PAUSED: cdaudio->cd_desc = cd_init_device (cdaudio->device); if (cdaudio->cd_desc < 0) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; /* close tray */ if (cd_close (cdaudio->cd_desc) < 0) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; if (cd_stat (cdaudio->cd_desc, &cdaudio->info) < 0) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; print_track_info (cdaudio); @@ -331,12 +332,12 @@ gst_cdaudio_change_state (GstElement * element) gint res; if (cdaudio->was_playing) - res = cd_resume (cdaudio->cd_desc); + res = cd_resume (cdaudio->cd_desc); else - res = cd_play (cdaudio->cd_desc, 1); + res = cd_play (cdaudio->cd_desc, 1); if (res < 0) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; cdaudio->was_playing = TRUE; g_timer_start (cdaudio->timer); @@ -344,14 +345,14 @@ gst_cdaudio_change_state (GstElement * element) } case GST_STATE_PLAYING_TO_PAUSED: if (cd_pause (cdaudio->cd_desc) < 0) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; g_timer_stop (cdaudio->timer); break; case GST_STATE_PAUSED_TO_READY: if (cd_stop (cdaudio->cd_desc) < 0) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; if (cd_finish (cdaudio->cd_desc) < 0) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; break; case GST_STATE_READY_TO_NULL: break; @@ -386,15 +387,15 @@ gst_cdaudio_send_event (GstElement * element, GstEvent * event) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_SEEK: switch (GST_EVENT_SEEK_FORMAT (event)) { - case GST_FORMAT_TIME: - { - cd_play_pos (cdaudio->cd_desc, 1, - GST_EVENT_SEEK_OFFSET (event) / (60 * GST_SECOND)); - break; - } - default: - res = FALSE; - break; + case GST_FORMAT_TIME: + { + cd_play_pos (cdaudio->cd_desc, 1, + GST_EVENT_SEEK_OFFSET (event) / (60 * GST_SECOND)); + break; + } + default: + res = FALSE; + break; } break; default: @@ -412,8 +413,8 @@ gst_cdaudio_get_formats (GstElement * element) GST_FORMAT_TIME, GST_FORMAT_BYTES, GST_FORMAT_DEFAULT, - 0, /* fillted below */ - 0, /* fillted below */ + 0, /* fillted below */ + 0, /* fillted below */ 0, }; @@ -441,6 +442,7 @@ gst_cdaudio_get_query_types (GstElement * element) GST_QUERY_SEGMENT_END, 0 }; + return query_types; } @@ -465,36 +467,36 @@ gst_cdaudio_query (GstElement * element, GstQueryType type, switch (type) { case GST_QUERY_TOTAL: switch (*format) { - case GST_FORMAT_TIME: - *value = (cdaudio->info.disc_length.minutes * 60 + - cdaudio->info.disc_length.seconds) * GST_SECOND; - break; - default: - { - if (*format == track_format) { - *value = cdaudio->info.disc_total_tracks; - } else { - res = FALSE; - } - break; - } + case GST_FORMAT_TIME: + *value = (cdaudio->info.disc_length.minutes * 60 + + cdaudio->info.disc_length.seconds) * GST_SECOND; + break; + default: + { + if (*format == track_format) { + *value = cdaudio->info.disc_total_tracks; + } else { + res = FALSE; + } + break; + } } break; case GST_QUERY_POSITION: switch (*format) { - case GST_FORMAT_TIME: - *value = (cdaudio->info.disc_time.minutes * 60 + - cdaudio->info.disc_time.seconds) * GST_SECOND; - break; - default: - { - if (*format == track_format) { - *value = cdaudio->info.disc_current_track; - } else { - res = FALSE; - } - break; - } + case GST_FORMAT_TIME: + *value = (cdaudio->info.disc_time.minutes * 60 + + cdaudio->info.disc_time.seconds) * GST_SECOND; + break; + default: + { + if (*format == track_format) { + *value = cdaudio->info.disc_current_track; + } else { + res = FALSE; + } + break; + } } break; default: diff --git a/ext/divx/gstdivxdec.c b/ext/divx/gstdivxdec.c index 737a14ec37..d4aa460267 100644 --- a/ext/divx/gstdivxdec.c +++ b/ext/divx/gstdivxdec.c @@ -37,16 +37,16 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-divx, " - "divxversion = (int) [ 3, 5 ], " - "width = (int) [ 16, 4096 ], " - "height = (int) [ 16, 4096 ], " "framerate = (double) [ 0, MAX ]") + "divxversion = (int) [ 3, 5 ], " + "width = (int) [ 16, 4096 ], " + "height = (int) [ 16, 4096 ], " "framerate = (double) [ 0, MAX ]") ); static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ I420, YUY2, YV12, UYVY }") - /* FIXME: 15/16/24/32bpp RGB */ + /* FIXME: 15/16/24/32bpp RGB */ ) ); @@ -125,8 +125,9 @@ gst_divxdec_get_type (void) 0, (GInstanceInitFunc) gst_divxdec_init, }; + divxdec_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstDivxDec", &divxdec_info, 0); + "GstDivxDec", &divxdec_info, 0); } return divxdec_type; } @@ -222,7 +223,7 @@ gst_divxdec_setup (GstDivxDec * divxdec) } if ((ret = decore (&handle, DEC_OPT_INIT, &xinit, NULL)) != 0) { GST_ELEMENT_ERROR (divxdec, LIBRARY, INIT, (NULL), - ("divx library error: %s (%d)", gst_divxdec_error (ret), ret)); + ("divx library error: %s (%d)", gst_divxdec_error (ret), ret)); return FALSE; } @@ -239,7 +240,7 @@ gst_divxdec_setup (GstDivxDec * divxdec) if ((ret = decore (divxdec->handle, DEC_OPT_SETOUT, &output, NULL)) != 0) { GST_ELEMENT_ERROR (divxdec, LIBRARY, SETTINGS, (NULL), - ("error setting output: %s (%d)", gst_divxdec_error (ret), ret)); + ("error setting output: %s (%d)", gst_divxdec_error (ret), ret)); gst_divxdec_unset (divxdec); return FALSE; } @@ -275,7 +276,7 @@ gst_divxdec_chain (GstPad * pad, GstData * _data) if (!divxdec->handle) { if (gst_divxdec_negotiate (divxdec) <= 0) { GST_ELEMENT_ERROR (divxdec, CORE, TOO_LAZY, (NULL), - ("No format set - aborting")); + ("No format set - aborting")); gst_buffer_unref (buf); return; } @@ -296,7 +297,7 @@ gst_divxdec_chain (GstPad * pad, GstData * _data) if ((ret = decore (divxdec->handle, DEC_OPT_FRAME, &xframe, NULL))) { GST_ELEMENT_ERROR (divxdec, STREAM, DECODE, (NULL), - ("Error decoding divx frame: %s (%d)", gst_divxdec_error (ret), ret)); + ("Error decoding divx frame: %s (%d)", gst_divxdec_error (ret), ret)); gst_buffer_unref (buf); return; } @@ -395,16 +396,22 @@ gst_divxdec_negotiate (GstDivxDec * divxdec) gint depth, bpp; guint32 csp; gint bitcnt; - } fmt_list[] = { + } + fmt_list[] = + { { GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'), 16, 16, - GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'), 0}, { + GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'), 0} + , { GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'), 16, 16, - GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'), 0}, { + GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'), 0} + , { GST_MAKE_FOURCC ('I', '4', '2', '0'), 12, 12, - GST_MAKE_FOURCC ('I', '4', '2', '0'), 0}, { + GST_MAKE_FOURCC ('I', '4', '2', '0'), 0} + , { GST_MAKE_FOURCC ('Y', 'V', '1', '2'), 12, 12, - GST_MAKE_FOURCC ('Y', 'V', '1', '2'), 0}, { + GST_MAKE_FOURCC ('Y', 'V', '1', '2'), 0} + , { 0, 0, 0, 0, 0} }; gint i; @@ -413,13 +420,13 @@ gst_divxdec_negotiate (GstDivxDec * divxdec) divxdec->csp = fmt_list[i].csp; caps = gst_caps_new_simple ("video/x-raw-yuv", - "width", G_TYPE_INT, divxdec->width, - "height", G_TYPE_INT, divxdec->height, - "framerate", G_TYPE_DOUBLE, divxdec->fps, - "format", GST_TYPE_FOURCC, fmt_list[i].fourcc, NULL); + "width", G_TYPE_INT, divxdec->width, + "height", G_TYPE_INT, divxdec->height, + "framerate", G_TYPE_DOUBLE, divxdec->fps, + "format", GST_TYPE_FOURCC, fmt_list[i].fourcc, NULL); if (gst_divxdec_setup (divxdec) && - gst_pad_set_explicit_caps (divxdec->srcpad, caps)) { + gst_pad_set_explicit_caps (divxdec->srcpad, caps)) { divxdec->csp = fmt_list[i].csp; divxdec->bpp = fmt_list[i].bpp; divxdec->bitcnt = fmt_list[i].bitcnt; @@ -468,8 +475,8 @@ plugin_init (GstPlugin * plugin) lib_version = decore (NULL, DEC_OPT_VERSION, 0, 0); if (lib_version != DECORE_VERSION) { g_warning ("Version mismatch! This plugin was compiled for " - "DivX version %d, while your library has version %d!", - DECORE_VERSION, lib_version); + "DivX version %d, while your library has version %d!", + DECORE_VERSION, lib_version); return FALSE; } diff --git a/ext/divx/gstdivxenc.c b/ext/divx/gstdivxenc.c index 6d294bb811..3def13d114 100644 --- a/ext/divx/gstdivxenc.c +++ b/ext/divx/gstdivxenc.c @@ -38,7 +38,7 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ I420, YUY2, YV12, YVYU, UYVY }") - /* FIXME: 15/16/24/32bpp RGB */ + /* FIXME: 15/16/24/32bpp RGB */ ) ); @@ -46,9 +46,9 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-divx, " - "divxversion = (int) 5, " - "width = (int) [ 16, 4096 ], " - "height = (int) [ 16, 4096 ], " "framerate = (double) [ 0, MAX ]") + "divxversion = (int) 5, " + "width = (int) [ 16, 4096 ], " + "height = (int) [ 16, 4096 ], " "framerate = (double) [ 0, MAX ]") ); @@ -137,8 +137,9 @@ gst_divxenc_get_type (void) 0, (GInstanceInitFunc) gst_divxenc_init, }; + divxenc_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstDivxEnc", &divxenc_info, 0); + "GstDivxEnc", &divxenc_info, 0); } return divxenc_type; } @@ -171,20 +172,20 @@ gst_divxenc_class_init (GstDivxEncClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BITRATE, g_param_spec_ulong ("bitrate", "Bitrate", - "Target video bitrate", 0, G_MAXULONG, 0, G_PARAM_READWRITE)); + "Target video bitrate", 0, G_MAXULONG, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MAXKEYINTERVAL, g_param_spec_int ("max_key_interval", "Max. Key Interval", - "Maximum number of frames between two keyframes", - 0, G_MAXINT, 0, G_PARAM_READWRITE)); + "Maximum number of frames between two keyframes", + 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BUFSIZE, g_param_spec_ulong ("buffer_size", "Buffer Size", - "Size of the video buffers", 0, G_MAXULONG, 0, G_PARAM_READABLE)); + "Size of the video buffers", 0, G_MAXULONG, 0, G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_QUALITY, g_param_spec_int ("quality", "Quality", - "Amount of Motion Estimation", 1, 5, 3, G_PARAM_READWRITE)); + "Amount of Motion Estimation", 1, 5, 3, G_PARAM_READWRITE)); gobject_class->set_property = gst_divxenc_set_property; gobject_class->get_property = gst_divxenc_get_property; @@ -221,7 +222,7 @@ gst_divxenc_init (GstDivxEnc * divxenc) /* bitrate, etc. */ divxenc->width = divxenc->height = divxenc->csp = divxenc->bitcnt = -1; divxenc->bitrate = 512 * 1024; - divxenc->max_key_interval = -1; /* default - 2*fps */ + divxenc->max_key_interval = -1; /* default - 2*fps */ divxenc->buffer_size = 512 * 1024; divxenc->quality = 3; @@ -279,8 +280,8 @@ gst_divxenc_setup (GstDivxEnc * divxenc) if ((ret = encore (&handle, ENC_OPT_INIT, &input, &output))) { GST_ELEMENT_ERROR (divxenc, LIBRARY, SETTINGS, (NULL), - ("Error setting up divx encoder: %s (%d)", - gst_divxenc_error (ret), ret)); + ("Error setting up divx encoder: %s (%d)", + gst_divxenc_error (ret), ret)); return FALSE; } @@ -339,7 +340,7 @@ gst_divxenc_chain (GstPad * pad, GstData * _data) if ((ret = encore (divxenc->handle, ENC_OPT_ENCODE, &xframe, &xres))) { GST_ELEMENT_ERROR (divxenc, LIBRARY, ENCODE, (NULL), - ("Error encoding divx frame: %s (%d)", gst_divxenc_error (ret), ret)); + ("Error encoding divx frame: %s (%d)", gst_divxenc_error (ret), ret)); gst_buffer_unref (buf); return; } @@ -427,9 +428,9 @@ gst_divxenc_connect (GstPad * pad, const GstCaps * caps) GstCaps *new_caps; new_caps = gst_caps_new_simple ("video/x-divx", - "divxversion", G_TYPE_INT, 5, - "width", G_TYPE_INT, w, - "height", G_TYPE_INT, h, "framerate", G_TYPE_DOUBLE, fps, NULL); + "divxversion", G_TYPE_INT, 5, + "width", G_TYPE_INT, w, + "height", G_TYPE_INT, h, "framerate", G_TYPE_DOUBLE, fps, NULL); ret = gst_pad_set_explicit_caps (divxenc->srcpad, new_caps); if (ret <= 0) { @@ -509,8 +510,8 @@ plugin_init (GstPlugin * plugin) lib_version = encore (NULL, ENC_OPT_VERSION, 0, 0); if (lib_version != ENCORE_VERSION) { g_warning ("Version mismatch! This plugin was compiled for " - "DivX version %d, while your library has version %d!", - ENCORE_VERSION, lib_version); + "DivX version %d, while your library has version %d!", + ENCORE_VERSION, lib_version); return FALSE; } diff --git a/ext/faac/gstfaac.c b/ext/faac/gstfaac.c index 2241014b2d..cc66fd9735 100644 --- a/ext/faac/gstfaac.c +++ b/ext/faac/gstfaac.c @@ -27,15 +27,15 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/mpeg, " - "mpegversion = (int) { 4, 2 }, " - "channels = (int) [ 1, 6 ], " "rate = (int) [ 8000, 96000 ]") + "mpegversion = (int) { 4, 2 }, " + "channels = (int) [ 1, 6 ], " "rate = (int) [ 8000, 96000 ]") ); static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("audio/x-raw-int, " "endianness = (int) BYTE_ORDER, " "signed = (boolean) TRUE, " "width = (int) 16, " "depth = (int) 16, " "rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 6]; " "audio/x-raw-int, " "endianness = (int) BYTE_ORDER, " "signed = (boolean) TRUE, " "width = (int) 32, " "depth = (int) 24, " "rate = (int) [ 8000, 96000], " "channels = (int) [ 1, 6]; " "audio/x-raw-float, " "endianness = (int) BYTE_ORDER, " "depth = (int) 32, " /* sizeof (gfloat) */ - "rate = (int) [ 8000, 96000], " "channels = (int) [ 1, 6]") + GST_STATIC_CAPS ("audio/x-raw-int, " "endianness = (int) BYTE_ORDER, " "signed = (boolean) TRUE, " "width = (int) 16, " "depth = (int) 16, " "rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 6]; " "audio/x-raw-int, " "endianness = (int) BYTE_ORDER, " "signed = (boolean) TRUE, " "width = (int) 32, " "depth = (int) 24, " "rate = (int) [ 8000, 96000], " "channels = (int) [ 1, 6]; " "audio/x-raw-float, " "endianness = (int) BYTE_ORDER, " "depth = (int) 32, " /* sizeof (gfloat) */ + "rate = (int) [ 8000, 96000], " "channels = (int) [ 1, 6]") ); enum @@ -88,7 +88,7 @@ gst_faac_get_type (void) }; gst_faac_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstFaac", &gst_faac_info, 0); + "GstFaac", &gst_faac_info, 0); } return gst_faac_type; @@ -129,7 +129,7 @@ gst_faac_profile_get_type (void) }; gst_faac_profile_type = g_enum_register_static ("GstFaacProfile", - gst_faac_profile); + gst_faac_profile); } return gst_faac_profile_type; @@ -150,7 +150,7 @@ gst_faac_shortctl_get_type (void) }; gst_faac_shortctl_type = g_enum_register_static ("GstFaacShortCtl", - gst_faac_shortctl); + gst_faac_shortctl); } return gst_faac_shortctl_type; @@ -167,20 +167,20 @@ gst_faac_class_init (GstFaacClass * klass) /* properties */ g_object_class_install_property (gobject_class, ARG_BITRATE, g_param_spec_int ("bitrate", "Bitrate (bps)", "Bitrate in bits/sec", - 8 * 1024, 320 * 1024, 128 * 1024, G_PARAM_READWRITE)); + 8 * 1024, 320 * 1024, 128 * 1024, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_PROFILE, g_param_spec_enum ("profile", "Profile", "MPEG/AAC encoding profile", - GST_TYPE_FAAC_PROFILE, MAIN, G_PARAM_READWRITE)); + GST_TYPE_FAAC_PROFILE, MAIN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_TNS, g_param_spec_boolean ("tns", "TNS", "Use temporal noise shaping", - FALSE, G_PARAM_READWRITE)); + FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_MIDSIDE, g_param_spec_boolean ("midside", "Midside", "Allow mid/side encoding", - TRUE, G_PARAM_READWRITE)); + TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_SHORTCTL, g_param_spec_enum ("shortctl", "Block type", - "Block type encorcing", - GST_TYPE_FAAC_SHORTCTL, MAIN, G_PARAM_READWRITE)); + "Block type encorcing", + GST_TYPE_FAAC_SHORTCTL, MAIN, G_PARAM_READWRITE)); /* virtual functions */ gstelement_class->change_state = gst_faac_change_state; @@ -257,11 +257,11 @@ gst_faac_sinkconnect (GstPad * pad, const GstCaps * caps) bps = 2; break; case 24: - fmt = FAAC_INPUT_32BIT; /* 24-in-32, actually */ + fmt = FAAC_INPUT_32BIT; /* 24-in-32, actually */ bps = 4; break; case 32: - fmt = FAAC_INPUT_FLOAT; /* see template, this is right */ + fmt = FAAC_INPUT_FLOAT; /* see template, this is right */ bps = 4; break; } @@ -282,7 +282,7 @@ gst_faac_sinkconnect (GstPad * pad, const GstCaps * caps) /* if the other side was already set-up, redo that */ if (GST_PAD_CAPS (faac->srcpad)) return gst_faac_srcconnect (faac->srcpad, - gst_pad_get_allowed_caps (faac->srcpad)); + gst_pad_get_allowed_caps (faac->srcpad)); /* else, that'll be done later */ return GST_PAD_LINK_OK; @@ -335,7 +335,7 @@ gst_faac_srcconnect (GstPad * pad, const GstCaps * caps) * that (that the next element is filesink or any element * that does want ADTS headers). */ - conf->outputFormat = 0; /* raw, no ADTS headers */ + conf->outputFormat = 0; /* raw, no ADTS headers */ conf->shortctl = faac->shortctl; if (!faacEncSetConfiguration (faac->handle, conf)) { GST_WARNING ("Faac doesn't support the current conf"); @@ -343,19 +343,19 @@ gst_faac_srcconnect (GstPad * pad, const GstCaps * caps) } newcaps = gst_caps_new_simple ("audio/mpeg", - "mpegversion", G_TYPE_INT, mpegversion, - "channels", G_TYPE_INT, faac->channels, - "rate", G_TYPE_INT, faac->samplerate, NULL); + "mpegversion", G_TYPE_INT, mpegversion, + "channels", G_TYPE_INT, faac->channels, + "rate", G_TYPE_INT, faac->samplerate, NULL); ret = gst_pad_try_set_caps (faac->srcpad, newcaps); switch (ret) { case GST_PAD_LINK_OK: case GST_PAD_LINK_DONE: - return GST_PAD_LINK_DONE; + return GST_PAD_LINK_DONE; case GST_PAD_LINK_DELAYED: - return GST_PAD_LINK_DELAYED; + return GST_PAD_LINK_DELAYED; default: - break; + break; } } @@ -374,33 +374,33 @@ gst_faac_chain (GstPad * pad, GstData * data) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_EOS: - /* flush first */ - while (1) { - outbuf = gst_buffer_new_and_alloc (faac->bytes); - if ((ret_size = faacEncEncode (faac->handle, - NULL, 0, GST_BUFFER_DATA (outbuf), faac->bytes)) < 0) { - GST_ELEMENT_ERROR (faac, LIBRARY, ENCODE, (NULL), (NULL)); - gst_event_unref (event); - gst_buffer_unref (outbuf); - return; - } + /* flush first */ + while (1) { + outbuf = gst_buffer_new_and_alloc (faac->bytes); + if ((ret_size = faacEncEncode (faac->handle, + NULL, 0, GST_BUFFER_DATA (outbuf), faac->bytes)) < 0) { + GST_ELEMENT_ERROR (faac, LIBRARY, ENCODE, (NULL), (NULL)); + gst_event_unref (event); + gst_buffer_unref (outbuf); + return; + } - if (ret_size > 0) { - GST_BUFFER_SIZE (outbuf) = ret_size; - GST_BUFFER_TIMESTAMP (outbuf) = 0; - GST_BUFFER_DURATION (outbuf) = 0; - gst_pad_push (faac->srcpad, GST_DATA (outbuf)); - } else { - break; - } - } + if (ret_size > 0) { + GST_BUFFER_SIZE (outbuf) = ret_size; + GST_BUFFER_TIMESTAMP (outbuf) = 0; + GST_BUFFER_DURATION (outbuf) = 0; + gst_pad_push (faac->srcpad, GST_DATA (outbuf)); + } else { + break; + } + } - gst_element_set_eos (GST_ELEMENT (faac)); - gst_pad_push (faac->srcpad, data); - return; + gst_element_set_eos (GST_ELEMENT (faac)); + gst_pad_push (faac->srcpad, data); + return; default: - gst_pad_event_default (pad, event); - return; + gst_pad_event_default (pad, event); + return; } } @@ -408,16 +408,16 @@ gst_faac_chain (GstPad * pad, GstData * data) if (!faac->handle) { GST_ELEMENT_ERROR (faac, CORE, NEGOTIATION, (NULL), - ("format wasn't negotiated before chain function")); + ("format wasn't negotiated before chain function")); gst_buffer_unref (inbuf); return; } if (!GST_PAD_CAPS (faac->srcpad)) { if (gst_faac_srcconnect (faac->srcpad, - gst_pad_get_allowed_caps (faac->srcpad)) <= 0) { + gst_pad_get_allowed_caps (faac->srcpad)) <= 0) { GST_ELEMENT_ERROR (faac, CORE, NEGOTIATION, (NULL), - ("failed to negotiate MPEG/AAC format with next element")); + ("failed to negotiate MPEG/AAC format with next element")); gst_buffer_unref (inbuf); return; } @@ -433,27 +433,27 @@ gst_faac_chain (GstPad * pad, GstData * data) /* do we have enough data for one frame? */ if (in_size / faac->bps < faac->samples) { if (in_size > size) { - GstBuffer *merge; + GstBuffer *merge; - /* this is panic! we got a buffer, but still don't have enough - * data. Merge them and retry in the next cycle... */ - merge = gst_buffer_merge (faac->cache, inbuf); - gst_buffer_unref (faac->cache); - gst_buffer_unref (inbuf); - faac->cache = merge; + /* this is panic! we got a buffer, but still don't have enough + * data. Merge them and retry in the next cycle... */ + merge = gst_buffer_merge (faac->cache, inbuf); + gst_buffer_unref (faac->cache); + gst_buffer_unref (inbuf); + faac->cache = merge; } else if (in_size == size) { - /* this shouldn't happen, but still... */ - faac->cache = inbuf; + /* this shouldn't happen, but still... */ + faac->cache = inbuf; } else if (in_size > 0) { - faac->cache = gst_buffer_create_sub (inbuf, size - in_size, in_size); - GST_BUFFER_DURATION (faac->cache) = - GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (faac->cache) / size; - GST_BUFFER_TIMESTAMP (faac->cache) = - GST_BUFFER_TIMESTAMP (inbuf) + (GST_BUFFER_DURATION (inbuf) * - (size - in_size) / size); - gst_buffer_unref (inbuf); + faac->cache = gst_buffer_create_sub (inbuf, size - in_size, in_size); + GST_BUFFER_DURATION (faac->cache) = + GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (faac->cache) / size; + GST_BUFFER_TIMESTAMP (faac->cache) = + GST_BUFFER_TIMESTAMP (inbuf) + (GST_BUFFER_DURATION (inbuf) * + (size - in_size) / size); + gst_buffer_unref (inbuf); } else { - gst_buffer_unref (inbuf); + gst_buffer_unref (inbuf); } return; @@ -466,7 +466,7 @@ gst_faac_chain (GstPad * pad, GstData * data) /* merge */ subbuf = gst_buffer_create_sub (inbuf, 0, frame_size - (in_size - size)); GST_BUFFER_DURATION (subbuf) = - GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (subbuf) / size; + GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (subbuf) / size; merge = gst_buffer_merge (faac->cache, subbuf); gst_buffer_unref (faac->cache); gst_buffer_unref (subbuf); @@ -475,17 +475,17 @@ gst_faac_chain (GstPad * pad, GstData * data) } else { subbuf = gst_buffer_create_sub (inbuf, size - in_size, frame_size); GST_BUFFER_DURATION (subbuf) = - GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (subbuf) / size; + GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (subbuf) / size; GST_BUFFER_TIMESTAMP (subbuf) = - GST_BUFFER_TIMESTAMP (inbuf) + (GST_BUFFER_DURATION (inbuf) * - (size - in_size) / size); + GST_BUFFER_TIMESTAMP (inbuf) + (GST_BUFFER_DURATION (inbuf) * + (size - in_size) / size); } outbuf = gst_buffer_new_and_alloc (faac->bytes); if ((ret_size = faacEncEncode (faac->handle, - (gint32 *) GST_BUFFER_DATA (subbuf), - GST_BUFFER_SIZE (subbuf) / faac->bps, - GST_BUFFER_DATA (outbuf), faac->bytes)) < 0) { + (gint32 *) GST_BUFFER_DATA (subbuf), + GST_BUFFER_SIZE (subbuf) / faac->bps, + GST_BUFFER_DATA (outbuf), faac->bytes)) < 0) { GST_ELEMENT_ERROR (faac, LIBRARY, ENCODE, (NULL), (NULL)); gst_buffer_unref (inbuf); gst_buffer_unref (subbuf); @@ -495,14 +495,14 @@ gst_faac_chain (GstPad * pad, GstData * data) if (ret_size > 0) { GST_BUFFER_SIZE (outbuf) = ret_size; if (faac->cache_time != GST_CLOCK_TIME_NONE) { - GST_BUFFER_TIMESTAMP (outbuf) = faac->cache_time; - faac->cache_time = GST_CLOCK_TIME_NONE; + GST_BUFFER_TIMESTAMP (outbuf) = faac->cache_time; + faac->cache_time = GST_CLOCK_TIME_NONE; } else - GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (subbuf); + GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (subbuf); GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (subbuf); if (faac->cache_duration) { - GST_BUFFER_DURATION (outbuf) += faac->cache_duration; - faac->cache_duration = 0; + GST_BUFFER_DURATION (outbuf) += faac->cache_duration; + faac->cache_duration = 0; } gst_pad_push (faac->srcpad, GST_DATA (outbuf)); } else { @@ -516,7 +516,7 @@ gst_faac_chain (GstPad * pad, GstData * data) gst_buffer_unref (outbuf); if (faac->cache_time != GST_CLOCK_TIME_NONE) - faac->cache_time = GST_BUFFER_TIMESTAMP (subbuf); + faac->cache_time = GST_BUFFER_TIMESTAMP (subbuf); faac->cache_duration += GST_BUFFER_DURATION (subbuf); } @@ -589,12 +589,12 @@ gst_faac_change_state (GstElement * element) switch (GST_STATE_TRANSITION (element)) { case GST_STATE_PAUSED_TO_READY: if (faac->handle) { - faacEncClose (faac->handle); - faac->handle = NULL; + faacEncClose (faac->handle); + faac->handle = NULL; } if (faac->cache) { - gst_buffer_unref (faac->cache); - faac->cache = NULL; + gst_buffer_unref (faac->cache); + faac->cache = NULL; } faac->cache_time = GST_CLOCK_TIME_NONE; faac->cache_duration = 0; diff --git a/ext/faad/gstfaad.c b/ext/faad/gstfaad.c index 4ddc5ae75c..719fb89d2c 100644 --- a/ext/faad/gstfaad.c +++ b/ext/faad/gstfaad.c @@ -29,23 +29,23 @@ GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/mpeg, " - "systemstream = (bool) FALSE, " "mpegversion = { (int) 2, (int) 4 }") + "systemstream = (bool) FALSE, " "mpegversion = { (int) 2, (int) 4 }") ); GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (bool) TRUE, " - "width = (int) { 16, 24, 32 }, " - "depth = (int) { 16, 24, 32 }, " - "rate = (int) [ 8000, 96000 ], " - "channels = (int) [ 1, 6 ]; " - "audio/x-raw-float, " - "endianness = (int) BYTE_ORDER, " - "depth = (int) { 32, 64 }, " - "rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 6 ]") + "endianness = (int) BYTE_ORDER, " + "signed = (bool) TRUE, " + "width = (int) { 16, 24, 32 }, " + "depth = (int) { 16, 24, 32 }, " + "rate = (int) [ 8000, 96000 ], " + "channels = (int) [ 1, 6 ]; " + "audio/x-raw-float, " + "endianness = (int) BYTE_ORDER, " + "depth = (int) { 32, 64 }, " + "rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 6 ]") ); static void gst_faad_base_init (GstFaadClass * klass); @@ -83,7 +83,7 @@ gst_faad_get_type (void) }; gst_faad_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstFaad", &gst_faad_info, 0); + "GstFaad", &gst_faad_info, 0); } return gst_faad_type; @@ -171,46 +171,46 @@ gst_faad_srcgetcaps (GstPad * pad) for (n = 0; fmt[n] != -1; n++) { switch (n) { - case FAAD_FMT_16BIT: - str = gst_structure_new ("audio/x-raw-int", - "signed", G_TYPE_BOOLEAN, TRUE, - "width", G_TYPE_INT, 16, "depth", G_TYPE_INT, 16, NULL); - break; - case FAAD_FMT_24BIT: - str = gst_structure_new ("audio/x-raw-int", - "signed", G_TYPE_BOOLEAN, TRUE, - "width", G_TYPE_INT, 24, "depth", G_TYPE_INT, 24, NULL); - break; - case FAAD_FMT_32BIT: - str = gst_structure_new ("audio/x-raw-int", - "signed", G_TYPE_BOOLEAN, TRUE, - "width", G_TYPE_INT, 32, "depth", G_TYPE_INT, 32, NULL); - break; - case FAAD_FMT_FLOAT: - str = gst_structure_new ("audio/x-raw-float", - "depth", G_TYPE_INT, 32, NULL); - break; - case FAAD_FMT_DOUBLE: - str = gst_structure_new ("audio/x-raw-float", - "depth", G_TYPE_INT, 64, NULL); - break; - default: - str = NULL; - break; + case FAAD_FMT_16BIT: + str = gst_structure_new ("audio/x-raw-int", + "signed", G_TYPE_BOOLEAN, TRUE, + "width", G_TYPE_INT, 16, "depth", G_TYPE_INT, 16, NULL); + break; + case FAAD_FMT_24BIT: + str = gst_structure_new ("audio/x-raw-int", + "signed", G_TYPE_BOOLEAN, TRUE, + "width", G_TYPE_INT, 24, "depth", G_TYPE_INT, 24, NULL); + break; + case FAAD_FMT_32BIT: + str = gst_structure_new ("audio/x-raw-int", + "signed", G_TYPE_BOOLEAN, TRUE, + "width", G_TYPE_INT, 32, "depth", G_TYPE_INT, 32, NULL); + break; + case FAAD_FMT_FLOAT: + str = gst_structure_new ("audio/x-raw-float", + "depth", G_TYPE_INT, 32, NULL); + break; + case FAAD_FMT_DOUBLE: + str = gst_structure_new ("audio/x-raw-float", + "depth", G_TYPE_INT, 64, NULL); + break; + default: + str = NULL; + break; } if (!str) - continue; + continue; if (faad->samplerate != -1) { - gst_structure_set (str, "rate", G_TYPE_INT, faad->samplerate, NULL); + gst_structure_set (str, "rate", G_TYPE_INT, faad->samplerate, NULL); } else { - gst_structure_set (str, "rate", GST_TYPE_INT_RANGE, 8000, 96000, NULL); + gst_structure_set (str, "rate", GST_TYPE_INT_RANGE, 8000, 96000, NULL); } if (faad->channels != -1) { - gst_structure_set (str, "channels", G_TYPE_INT, faad->channels, NULL); + gst_structure_set (str, "channels", G_TYPE_INT, faad->channels, NULL); } else { - gst_structure_set (str, "channels", GST_TYPE_INT_RANGE, 1, 6, NULL); + gst_structure_set (str, "channels", GST_TYPE_INT_RANGE, 1, 6, NULL); } gst_structure_set (str, "endianness", G_TYPE_INT, G_BYTE_ORDER, NULL); @@ -252,21 +252,21 @@ gst_faad_srcconnect (GstPad * pad, const GstCaps * caps) gint width; if (!gst_structure_get_int (structure, "depth", &depth) || - !gst_structure_get_int (structure, "width", &width)) + !gst_structure_get_int (structure, "width", &width)) return GST_PAD_LINK_REFUSED; if (depth != width) return GST_PAD_LINK_REFUSED; switch (depth) { case 16: - fmt = FAAD_FMT_16BIT; - break; + fmt = FAAD_FMT_16BIT; + break; case 24: - fmt = FAAD_FMT_24BIT; - break; + fmt = FAAD_FMT_24BIT; + break; case 32: - fmt = FAAD_FMT_32BIT; - break; + fmt = FAAD_FMT_32BIT; + break; } } else { if (!gst_structure_get_int (structure, "depth", &depth)) @@ -274,11 +274,11 @@ gst_faad_srcconnect (GstPad * pad, const GstCaps * caps) switch (depth) { case 32: - fmt = FAAD_FMT_FLOAT; - break; + fmt = FAAD_FMT_FLOAT; + break; case 64: - fmt = FAAD_FMT_DOUBLE; - break; + fmt = FAAD_FMT_DOUBLE; + break; } } @@ -310,12 +310,12 @@ gst_faad_chain (GstPad * pad, GstData * data) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_EOS: - gst_element_set_eos (GST_ELEMENT (faad)); - gst_pad_push (faad->srcpad, data); - return; + gst_element_set_eos (GST_ELEMENT (faad)); + gst_pad_push (faad->srcpad, data); + return; default: - gst_pad_event_default (pad, event); - return; + gst_pad_event_default (pad, event); + return; } } @@ -327,7 +327,7 @@ gst_faad_chain (GstPad * pad, GstData * data) guchar channels; faacDecInit (faad->handle, - GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf), &samplerate, &channels); + GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf), &samplerate, &channels); faad->samplerate = samplerate; faad->channels = channels; ret = gst_pad_renegotiate (faad->srcpad); @@ -342,7 +342,7 @@ gst_faad_chain (GstPad * pad, GstData * data) GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf)); if (info.error) { GST_ELEMENT_ERROR (faad, STREAM, DECODE, (NULL), - ("Failed to decode buffer: %s", faacDecGetErrorMessage (info.error))); + ("Failed to decode buffer: %s", faacDecGetErrorMessage (info.error))); gst_buffer_unref (buf); return; } @@ -384,13 +384,13 @@ gst_faad_change_state (GstElement * element) switch (GST_STATE_TRANSITION (element)) { case GST_STATE_NULL_TO_READY: if (!(faad->handle = faacDecOpen ())) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; else { - faacDecConfiguration *conf; + faacDecConfiguration *conf; - conf = faacDecGetCurrentConfiguration (faad->handle); - conf->defObjectType = LC; - faacDecSetConfiguration (faad->handle, conf); + conf = faacDecGetCurrentConfiguration (faad->handle); + conf->defObjectType = LC; + faacDecSetConfiguration (faad->handle, conf); } break; case GST_STATE_PAUSED_TO_READY: diff --git a/ext/gsm/gstgsm.c b/ext/gsm/gstgsm.c index 25ee7c934f..1f536e2d30 100644 --- a/ext/gsm/gstgsm.c +++ b/ext/gsm/gstgsm.c @@ -30,7 +30,7 @@ plugin_init (GstPlugin * plugin) if (!gst_element_register (plugin, "gsmenc", GST_RANK_NONE, GST_TYPE_GSMENC)) return FALSE; if (!gst_element_register (plugin, "gsmdec", GST_RANK_PRIMARY, - GST_TYPE_GSMDEC)) + GST_TYPE_GSMDEC)) return FALSE; return TRUE; diff --git a/ext/gsm/gstgsmdec.c b/ext/gsm/gstgsmdec.c index 0391a4032f..1b845a6433 100644 --- a/ext/gsm/gstgsmdec.c +++ b/ext/gsm/gstgsmdec.c @@ -75,8 +75,9 @@ gst_gsmdec_get_type (void) 0, (GInstanceInitFunc) gst_gsmdec_init, }; + gsmdec_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstGSMDec", &gsmdec_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstGSMDec", &gsmdec_info, 0); } return gsmdec_type; } @@ -86,7 +87,7 @@ GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-gsm, " - "rate = (int) [ 1000, 48000 ], " "channels = (int) 1") + "rate = (int) [ 1000, 48000 ], " "channels = (int) 1") ); static GstStaticPadTemplate gsmdec_src_template = @@ -94,11 +95,11 @@ GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) true, " - "width = (int) 16, " - "depth = (int) 16, " - "rate = (int) [ 1000, 48000 ], " "channels = (int) 1") + "endianness = (int) BYTE_ORDER, " + "signed = (boolean) true, " + "width = (int) 16, " + "depth = (int) 16, " + "rate = (int) [ 1000, 48000 ], " "channels = (int) 1") ); static void @@ -158,12 +159,12 @@ gst_gsmdec_sinkconnect (GstPad * pad, const GstCaps * caps) gst_structure_get_int (structure, "rate", &rate); if (gst_pad_try_set_caps (gsmdec->srcpad, - gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_BYTE_ORDER, - "signed", G_TYPE_BOOLEAN, TRUE, - "width", G_TYPE_INT, 16, - "depth", G_TYPE_INT, 16, - "rate", G_TYPE_INT, rate, "channels", G_TYPE_INT, 1, NULL)) > 0) { + gst_caps_new_simple ("audio/x-raw-int", + "endianness", G_TYPE_INT, G_BYTE_ORDER, + "signed", G_TYPE_BOOLEAN, TRUE, + "width", G_TYPE_INT, 16, + "depth", G_TYPE_INT, 16, + "rate", G_TYPE_INT, rate, "channels", G_TYPE_INT, 1, NULL)) > 0) { return GST_PAD_LINK_OK; } return GST_PAD_LINK_REFUSED; @@ -191,14 +192,14 @@ gst_gsmdec_chain (GstPad * pad, GstData * _data) GstBuffer *outbuf; memcpy (gsmdec->buffer + gsmdec->bufsize, data, - (33 - gsmdec->bufsize) * sizeof (gsm_byte)); + (33 - gsmdec->bufsize) * sizeof (gsm_byte)); outbuf = gst_buffer_new (); GST_BUFFER_DATA (outbuf) = g_malloc (160 * sizeof (gsm_signal)); GST_BUFFER_SIZE (outbuf) = 160 * sizeof (gsm_signal); gsm_decode (gsmdec->state, gsmdec->buffer, - (gsm_signal *) GST_BUFFER_DATA (outbuf)); + (gsm_signal *) GST_BUFFER_DATA (outbuf)); gst_pad_push (gsmdec->srcpad, GST_DATA (outbuf)); diff --git a/ext/gsm/gstgsmenc.c b/ext/gsm/gstgsmenc.c index c59a7c828a..90c9085220 100644 --- a/ext/gsm/gstgsmenc.c +++ b/ext/gsm/gstgsmenc.c @@ -75,8 +75,9 @@ gst_gsmenc_get_type (void) 0, (GInstanceInitFunc) gst_gsmenc_init, }; + gsmenc_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstGSMEnc", &gsmenc_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstGSMEnc", &gsmenc_info, 0); } return gsmenc_type; } @@ -86,7 +87,7 @@ GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-gsm, " - "rate = (int) [ 1000, 48000 ], " "channels = (int) 1") + "rate = (int) [ 1000, 48000 ], " "channels = (int) 1") ); static GstStaticPadTemplate gsmenc_sink_template = @@ -94,11 +95,11 @@ GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) true, " - "width = (int) 16, " - "depth = (int) 16, " - "rate = (int) [ 1000, 48000 ], " "channels = (int) 1") + "endianness = (int) BYTE_ORDER, " + "signed = (boolean) true, " + "width = (int) 16, " + "depth = (int) 16, " + "rate = (int) [ 1000, 48000 ], " "channels = (int) 1") ); static void @@ -164,9 +165,9 @@ gst_gsmenc_sinkconnect (GstPad * pad, const GstCaps * caps) structure = gst_caps_get_structure (caps, 0); gst_structure_get_int (structure, "rate", &gsmenc->rate); if (gst_pad_try_set_caps (gsmenc->srcpad, - gst_caps_new_simple ("audio/x-gsm", - "rate", G_TYPE_INT, gsmenc->rate, - "channels", G_TYPE_INT, 1, NULL)) > 0) { + gst_caps_new_simple ("audio/x-gsm", + "rate", G_TYPE_INT, gsmenc->rate, + "channels", G_TYPE_INT, 1, NULL)) > 0) { return GST_PAD_LINK_OK; } return GST_PAD_LINK_REFUSED; @@ -194,14 +195,14 @@ gst_gsmenc_chain (GstPad * pad, GstData * _data) GstBuffer *outbuf; memcpy (gsmenc->buffer + gsmenc->bufsize, data, - (160 - gsmenc->bufsize) * sizeof (gsm_signal)); + (160 - gsmenc->bufsize) * sizeof (gsm_signal)); outbuf = gst_buffer_new (); GST_BUFFER_DATA (outbuf) = g_malloc (33 * sizeof (gsm_byte)); GST_BUFFER_SIZE (outbuf) = 33 * sizeof (gsm_byte); gsm_encode (gsmenc->state, gsmenc->buffer, - (gsm_byte *) GST_BUFFER_DATA (outbuf)); + (gsm_byte *) GST_BUFFER_DATA (outbuf)); GST_BUFFER_TIMESTAMP (outbuf) = gsmenc->next_ts; gst_pad_push (gsmenc->srcpad, GST_DATA (outbuf)); diff --git a/ext/hermes/gsthermescolorspace.c b/ext/hermes/gsthermescolorspace.c index d6cbe9653f..03ea4dfe59 100644 --- a/ext/hermes/gsthermescolorspace.c +++ b/ext/hermes/gsthermescolorspace.c @@ -48,7 +48,8 @@ typedef enum GST_HERMES_COLORSPACE_RGB32_I420, GST_HERMES_COLORSPACE_RGB32_YV12, GST_HERMES_COLORSPACE_420_SWAP, -} GstColorSpaceConverterType; +} +GstColorSpaceConverterType; struct _GstHermesColorspace { @@ -85,7 +86,8 @@ typedef struct _GstHermesColorspaceFormat { GstStaticCaps caps; -} GstHermesColorspaceFormat; +} +GstHermesColorspaceFormat; static GstHermesColorspaceFormat gst_hermes_colorspace_formats[] = { {GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB)}, @@ -174,125 +176,125 @@ colorspace_setup_converter (GstHermesColorspace * space, GstCaps * from_caps, gst_structure_get_int (from_struct, "bpp", &from_bpp); switch (to_space) { - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): #ifdef HAVE_HERMES - { - gint to_bpp; + { + gint to_bpp; - gst_structure_get_int (to_struct, "bpp", &to_bpp); + gst_structure_get_int (to_struct, "bpp", &to_bpp); - gst_structure_get_int (from_struct, "red_mask", &space->source.r); - gst_structure_get_int (from_struct, "green_mask", &space->source.g); - gst_structure_get_int (from_struct, "blue_mask", &space->source.b); - space->source.a = 0; - space->srcbpp = space->source.bits = from_bpp; - space->source.indexed = 0; - space->source.has_colorkey = 0; + gst_structure_get_int (from_struct, "red_mask", &space->source.r); + gst_structure_get_int (from_struct, "green_mask", &space->source.g); + gst_structure_get_int (from_struct, "blue_mask", &space->source.b); + space->source.a = 0; + space->srcbpp = space->source.bits = from_bpp; + space->source.indexed = 0; + space->source.has_colorkey = 0; - GST_INFO ("source red mask %08x", space->source.r); - GST_INFO ("source green mask %08x", space->source.g); - GST_INFO ("source blue mask %08x", space->source.b); - GST_INFO ("source bpp %08x", space->srcbpp); + GST_INFO ("source red mask %08x", space->source.r); + GST_INFO ("source green mask %08x", space->source.g); + GST_INFO ("source blue mask %08x", space->source.b); + GST_INFO ("source bpp %08x", space->srcbpp); - gst_structure_get_int (to_struct, "red_mask", &space->dest.r); - gst_structure_get_int (to_struct, "green_mask", &space->dest.g); - gst_structure_get_int (to_struct, "blue_mask", &space->dest.b); - space->dest.a = 0; - space->destbpp = space->dest.bits = to_bpp; - space->dest.indexed = 0; - space->dest.has_colorkey = 0; + gst_structure_get_int (to_struct, "red_mask", &space->dest.r); + gst_structure_get_int (to_struct, "green_mask", &space->dest.g); + gst_structure_get_int (to_struct, "blue_mask", &space->dest.b); + space->dest.a = 0; + space->destbpp = space->dest.bits = to_bpp; + space->dest.indexed = 0; + space->dest.has_colorkey = 0; - GST_INFO ("dest red mask %08x", space->dest.r); - GST_INFO ("dest green mask %08x", space->dest.g); - GST_INFO ("dest blue mask %08x", space->dest.b); - GST_INFO ("dest bpp %08x", space->destbpp); + GST_INFO ("dest red mask %08x", space->dest.r); + GST_INFO ("dest green mask %08x", space->dest.g); + GST_INFO ("dest blue mask %08x", space->dest.b); + GST_INFO ("dest bpp %08x", space->destbpp); - if (!Hermes_ConverterRequest (space->h_handle, &space->source, - &space->dest)) { - g_warning ("Hermes: could not get converter\n"); - return FALSE; - } - GST_INFO ("converter set up"); - space->type = GST_HERMES_COLORSPACE_HERMES; - return TRUE; - } + if (!Hermes_ConverterRequest (space->h_handle, &space->source, + &space->dest)) { + g_warning ("Hermes: could not get converter\n"); + return FALSE; + } + GST_INFO ("converter set up"); + space->type = GST_HERMES_COLORSPACE_HERMES; + return TRUE; + } #else - g_warning ("colorspace: compiled without hermes!"); - return FALSE; + g_warning ("colorspace: compiled without hermes!"); + return FALSE; #endif - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - if (from_bpp == 32) { - space->type = GST_HERMES_COLORSPACE_RGB32_YV12; - space->destbpp = 12; - return TRUE; - } - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - if (from_bpp == 32) { - space->type = GST_HERMES_COLORSPACE_RGB32_I420; - space->destbpp = 12; - return TRUE; - } - case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): - GST_INFO ("colorspace: RGB to YUV with bpp %d not implemented!!", - from_bpp); - return FALSE; + case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): + if (from_bpp == 32) { + space->type = GST_HERMES_COLORSPACE_RGB32_YV12; + space->destbpp = 12; + return TRUE; + } + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + if (from_bpp == 32) { + space->type = GST_HERMES_COLORSPACE_RGB32_I420; + space->destbpp = 12; + return TRUE; + } + case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): + GST_INFO ("colorspace: RGB to YUV with bpp %d not implemented!!", + from_bpp); + return FALSE; } break; } case GST_MAKE_FOURCC ('I', '4', '2', '0'): switch (to_space) { - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): - GST_INFO ("colorspace: YUV to RGB"); + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + GST_INFO ("colorspace: YUV to RGB"); - gst_structure_get_int (to_struct, "bpp", &space->destbpp); - space->converter = - gst_hermes_colorspace_yuv2rgb_get_converter (from_caps, to_caps); - space->type = GST_HERMES_COLORSPACE_YUV_RGB; - return TRUE; - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - space->type = GST_HERMES_COLORSPACE_NONE; - space->destbpp = 12; - return TRUE; - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - space->type = GST_HERMES_COLORSPACE_420_SWAP; - space->destbpp = 12; - return TRUE; + gst_structure_get_int (to_struct, "bpp", &space->destbpp); + space->converter = + gst_hermes_colorspace_yuv2rgb_get_converter (from_caps, to_caps); + space->type = GST_HERMES_COLORSPACE_YUV_RGB; + return TRUE; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + space->type = GST_HERMES_COLORSPACE_NONE; + space->destbpp = 12; + return TRUE; + case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): + space->type = GST_HERMES_COLORSPACE_420_SWAP; + space->destbpp = 12; + return TRUE; } break; case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): switch (to_space) { - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - space->type = GST_HERMES_COLORSPACE_YUY2_I420; - space->destbpp = 12; - return TRUE; - case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): - space->type = GST_HERMES_COLORSPACE_NONE; - space->destbpp = 16; - return TRUE; - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): - GST_INFO ("colorspace: YUY2 to RGB not implemented!!"); - return FALSE; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + space->type = GST_HERMES_COLORSPACE_YUY2_I420; + space->destbpp = 12; + return TRUE; + case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): + space->type = GST_HERMES_COLORSPACE_NONE; + space->destbpp = 16; + return TRUE; + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + GST_INFO ("colorspace: YUY2 to RGB not implemented!!"); + return FALSE; } break; case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): switch (to_space) { - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): - GST_INFO ("colorspace: YV12 to RGB"); + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + GST_INFO ("colorspace: YV12 to RGB"); - gst_structure_get_int (to_struct, "bpp", &space->destbpp); - space->converter = - gst_hermes_colorspace_yuv2rgb_get_converter (from_caps, to_caps); - space->type = GST_HERMES_COLORSPACE_YUV_RGB; - return TRUE; - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - space->type = GST_HERMES_COLORSPACE_420_SWAP; - space->destbpp = 12; - return TRUE; - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - space->type = GST_HERMES_COLORSPACE_NONE; - space->destbpp = 12; - return TRUE; + gst_structure_get_int (to_struct, "bpp", &space->destbpp); + space->converter = + gst_hermes_colorspace_yuv2rgb_get_converter (from_caps, to_caps); + space->type = GST_HERMES_COLORSPACE_YUV_RGB; + return TRUE; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + space->type = GST_HERMES_COLORSPACE_420_SWAP; + space->destbpp = 12; + return TRUE; + case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): + space->type = GST_HERMES_COLORSPACE_NONE; + space->destbpp = 12; + return TRUE; } break; } @@ -387,8 +389,8 @@ gst_hermes_colorspace_link (GstPad * pad, const GstCaps * caps) GstCaps *fcaps; fcaps = - gst_caps_copy (gst_static_caps_get (&gst_hermes_colorspace_formats[i]. - caps)); + gst_caps_copy (gst_static_caps_get (&gst_hermes_colorspace_formats[i]. + caps)); icaps = gst_caps_intersect (caps, fcaps); if (!gst_caps_is_empty (icaps)) { @@ -413,8 +415,8 @@ gst_hermes_colorspace_link (GstPad * pad, const GstCaps * caps) othercaps = gst_caps_copy (gst_pad_get_negotiated_caps (otherpad)); gst_caps_set_simple (othercaps, - "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, fps, NULL); + "width", G_TYPE_INT, width, + "height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, fps, NULL); link_ret = gst_pad_try_set_caps (otherpad, othercaps); if (link_ret != GST_PAD_LINK_OK) { @@ -425,11 +427,11 @@ gst_hermes_colorspace_link (GstPad * pad, const GstCaps * caps) if (pad == space->srcpad) { space->src_format_index = i; gst_hermes_colorspace_structure_to_hermes_format (&space->src_format, - structure); + structure); } else { space->sink_format_index = i; gst_hermes_colorspace_structure_to_hermes_format (&space->sink_format, - structure); + structure); } space->sink_stride = width * (space->sink_format.bits / 8); @@ -442,7 +444,7 @@ gst_hermes_colorspace_link (GstPad * pad, const GstCaps * caps) if (gst_pad_is_negotiated (otherpad)) { if (!Hermes_ConverterRequest (space->h_handle, &space->sink_format, - &space->src_format)) { + &space->src_format)) { g_warning ("Hermes: could not get converter\n"); return GST_PAD_LINK_REFUSED; } @@ -469,9 +471,10 @@ gst_hermes_colorspace_get_type (void) 0, (GInstanceInitFunc) gst_hermes_colorspace_init, }; + colorspace_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstHermesColorspace", - &colorspace_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstHermesColorspace", + &colorspace_info, 0); } return colorspace_type; } @@ -481,12 +484,12 @@ static GstStaticPadTemplate gst_hermes_colorspace_src_pad_template = GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB "; " - GST_VIDEO_CAPS_RGBx "; " - GST_VIDEO_CAPS_BGRx "; " - GST_VIDEO_CAPS_xBGR "; " - GST_VIDEO_CAPS_BGR "; " - GST_VIDEO_CAPS_RGB "; " - GST_VIDEO_CAPS_RGB_16 "; " GST_VIDEO_CAPS_RGB_15) + GST_VIDEO_CAPS_RGBx "; " + GST_VIDEO_CAPS_BGRx "; " + GST_VIDEO_CAPS_xBGR "; " + GST_VIDEO_CAPS_BGR "; " + GST_VIDEO_CAPS_RGB "; " + GST_VIDEO_CAPS_RGB_16 "; " GST_VIDEO_CAPS_RGB_15) ); static GstStaticPadTemplate gst_hermes_colorspace_sink_pad_template = @@ -494,12 +497,12 @@ static GstStaticPadTemplate gst_hermes_colorspace_sink_pad_template = GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB "; " - GST_VIDEO_CAPS_RGBx "; " - GST_VIDEO_CAPS_BGRx "; " - GST_VIDEO_CAPS_xBGR "; " - GST_VIDEO_CAPS_BGR "; " - GST_VIDEO_CAPS_RGB "; " - GST_VIDEO_CAPS_RGB_16 "; " GST_VIDEO_CAPS_RGB_15) + GST_VIDEO_CAPS_RGBx "; " + GST_VIDEO_CAPS_BGRx "; " + GST_VIDEO_CAPS_xBGR "; " + GST_VIDEO_CAPS_BGR "; " + GST_VIDEO_CAPS_RGB "; " + GST_VIDEO_CAPS_RGB_16 "; " GST_VIDEO_CAPS_RGB_15) ); static void @@ -654,7 +657,7 @@ plugin_init (GstPlugin * plugin) g_return_val_if_fail (hermes_res != 0, FALSE); if (!gst_element_register (plugin, "hermescolorspace", GST_RANK_PRIMARY, - GST_TYPE_COLORSPACE)) + GST_TYPE_COLORSPACE)) return FALSE; return TRUE; diff --git a/ext/ivorbis/vorbis.c b/ext/ivorbis/vorbis.c index 774687d6df..7980f99a58 100644 --- a/ext/ivorbis/vorbis.c +++ b/ext/ivorbis/vorbis.c @@ -33,7 +33,7 @@ plugin_init (GstPlugin * plugin) return FALSE; if (!gst_element_register (plugin, "tremor", GST_RANK_PRIMARY, - ivorbisfile_get_type ())) + ivorbisfile_get_type ())) return FALSE; return TRUE; diff --git a/ext/ivorbis/vorbisfile.c b/ext/ivorbis/vorbisfile.c index 2f4f650377..9f84a8ebbc 100644 --- a/ext/ivorbis/vorbisfile.c +++ b/ext/ivorbis/vorbisfile.c @@ -152,13 +152,13 @@ ivorbisfile_get_type (void) }; ivorbisfile_type = g_type_register_static (GST_TYPE_ELEMENT, "Ivorbisfile", - &ivorbisfile_info, 0); + &ivorbisfile_info, 0); logical_stream_format = - gst_format_register ("logical_stream", "The logical stream"); + gst_format_register ("logical_stream", "The logical stream"); GST_DEBUG_CATEGORY_INIT (ivorbisfile_debug, "ivorbisfile", 0, - "vorbis in ogg decoding element (integer arithmetic)"); + "vorbis in ogg decoding element (integer arithmetic)"); } return ivorbisfile_type; } @@ -232,10 +232,10 @@ gst_ivorbisfile_class_init (IvorbisfileClass * klass) g_object_class_install_property (gobject_class, ARG_METADATA, g_param_spec_boxed ("metadata", "Metadata", "(logical) Stream metadata", - GST_TYPE_CAPS, G_PARAM_READABLE)); + GST_TYPE_CAPS, G_PARAM_READABLE)); g_object_class_install_property (gobject_class, ARG_STREAMINFO, g_param_spec_boxed ("streaminfo", "stream", - "(logical) Stream information", GST_TYPE_CAPS, G_PARAM_READABLE)); + "(logical) Stream information", GST_TYPE_CAPS, G_PARAM_READABLE)); gobject_class->get_property = gst_ivorbisfile_get_property; gobject_class->set_property = gst_ivorbisfile_set_property; @@ -311,25 +311,25 @@ gst_ivorbisfile_read (void *ptr, size_t size, size_t nmemb, void *datasource) gst_bytestream_get_status (ivorbisfile->bs, &avail, &event); switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_EOS: - GST_DEBUG ("eos"); - ivorbisfile->eos = TRUE; - if (avail == 0) { - gst_event_unref (event); - return 0; - } - break; - case GST_EVENT_DISCONTINUOUS: - GST_DEBUG ("discont"); - ivorbisfile->need_discont = TRUE; - default: - break; + case GST_EVENT_EOS: + GST_DEBUG ("eos"); + ivorbisfile->eos = TRUE; + if (avail == 0) { + gst_event_unref (event); + return 0; + } + break; + case GST_EVENT_DISCONTINUOUS: + GST_DEBUG ("discont"); + ivorbisfile->need_discont = TRUE; + default: + break; } gst_event_unref (event); if (avail > 0) - got_bytes = gst_bytestream_peek_bytes (ivorbisfile->bs, &data, avail); + got_bytes = gst_bytestream_peek_bytes (ivorbisfile->bs, &data, avail); else - got_bytes = 0; + got_bytes = 0; } } @@ -539,13 +539,13 @@ gst_ivorbisfile_loop (GstElement * element) ivorbisfile->total_bytes = 0; ivorbisfile->may_eos = FALSE; ivorbisfile->vf.seekable = gst_bytestream_seek (ivorbisfile->bs, 0, - GST_SEEK_METHOD_SET); + GST_SEEK_METHOD_SET); GST_DEBUG ("ivorbisfile: seekable: %s\n", - ivorbisfile->vf.seekable ? "yes" : "no"); + ivorbisfile->vf.seekable ? "yes" : "no"); /* open our custom ivorbisfile data object with the callbacks we provide */ if (ov_open_callbacks (ivorbisfile, &ivorbisfile->vf, NULL, 0, - ivorbisfile_ov_callbacks) < 0) { + ivorbisfile_ov_callbacks) < 0) { GST_ELEMENT_ERROR (element, STREAM, DECODE, (NULL), (NULL)); return; } @@ -560,45 +560,45 @@ gst_ivorbisfile_loop (GstElement * element) switch (ivorbisfile->seek_format) { case GST_FORMAT_TIME: { - gdouble seek_to = (gdouble) ivorbisfile->seek_value / GST_SECOND; + gdouble seek_to = (gdouble) ivorbisfile->seek_value / GST_SECOND; - if (ivorbisfile->seek_accurate) { - if (ov_time_seek (&ivorbisfile->vf, seek_to) == 0) { - ivorbisfile->need_discont = TRUE; - } - } else { - if (ov_time_seek_page (&ivorbisfile->vf, seek_to) == 0) { - ivorbisfile->need_discont = TRUE; - } - } - break; + if (ivorbisfile->seek_accurate) { + if (ov_time_seek (&ivorbisfile->vf, seek_to) == 0) { + ivorbisfile->need_discont = TRUE; + } + } else { + if (ov_time_seek_page (&ivorbisfile->vf, seek_to) == 0) { + ivorbisfile->need_discont = TRUE; + } + } + break; } case GST_FORMAT_DEFAULT: - if (ivorbisfile->seek_accurate) { - if (ov_pcm_seek (&ivorbisfile->vf, ivorbisfile->seek_value) == 0) { - ivorbisfile->need_discont = TRUE; - } - } else { - if (ov_pcm_seek_page (&ivorbisfile->vf, ivorbisfile->seek_value) == 0) { - ivorbisfile->need_discont = TRUE; - } - } - break; + if (ivorbisfile->seek_accurate) { + if (ov_pcm_seek (&ivorbisfile->vf, ivorbisfile->seek_value) == 0) { + ivorbisfile->need_discont = TRUE; + } + } else { + if (ov_pcm_seek_page (&ivorbisfile->vf, ivorbisfile->seek_value) == 0) { + ivorbisfile->need_discont = TRUE; + } + } + break; default: - if (ivorbisfile->seek_format == logical_stream_format) { - gint64 seek_to; + if (ivorbisfile->seek_format == logical_stream_format) { + gint64 seek_to; - seek_to = ivorbisfile->vf.offsets[ivorbisfile->seek_value]; + seek_to = ivorbisfile->vf.offsets[ivorbisfile->seek_value]; - if (ov_raw_seek (&ivorbisfile->vf, seek_to) == 0) { - ivorbisfile->need_discont = TRUE; - ivorbisfile->current_link = -1; - } else { - g_warning ("raw seek failed"); - } - } else - g_warning ("unknown seek method, implement me !"); - break; + if (ov_raw_seek (&ivorbisfile->vf, seek_to) == 0) { + ivorbisfile->need_discont = TRUE; + ivorbisfile->current_link = -1; + } else { + g_warning ("raw seek failed"); + } + } else + g_warning ("unknown seek method, implement me !"); + break; } ivorbisfile->seek_pending = FALSE; } @@ -630,7 +630,7 @@ gst_ivorbisfile_loop (GstElement * element) /* if the pad is not usable, don't push it out */ if (GST_PAD_IS_USABLE (ivorbisfile->srcpad)) { gst_pad_push (ivorbisfile->srcpad, - GST_DATA (gst_event_new (GST_EVENT_EOS))); + GST_DATA (gst_event_new (GST_EVENT_EOS))); } gst_element_set_eos (element); return; @@ -646,13 +646,13 @@ gst_ivorbisfile_loop (GstElement * element) /* if the pad is not usable, don't push it out */ if (GST_PAD_IS_USABLE (ivorbisfile->srcpad)) { - /* get stream stats */ - samples = (gint64) (ov_pcm_tell (&ivorbisfile->vf)); + /* get stream stats */ + samples = (gint64) (ov_pcm_tell (&ivorbisfile->vf)); - discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME, time, - GST_FORMAT_DEFAULT, samples, NULL); + discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME, time, + GST_FORMAT_DEFAULT, samples, NULL); - gst_pad_push (ivorbisfile->srcpad, GST_DATA (discont)); + gst_pad_push (ivorbisfile->srcpad, GST_DATA (discont)); } } @@ -714,90 +714,90 @@ gst_ivorbisfile_src_convert (GstPad * pad, switch (src_format) { case GST_FORMAT_BYTES: switch (*dest_format) { - case GST_FORMAT_DEFAULT: - *dest_value = src_value / (vi->channels * 2); - break; - case GST_FORMAT_TIME: - { - gint byterate = bytes_per_sample * vi->rate; + case GST_FORMAT_DEFAULT: + *dest_value = src_value / (vi->channels * 2); + break; + case GST_FORMAT_TIME: + { + gint byterate = bytes_per_sample * vi->rate; - if (byterate == 0) - return FALSE; - *dest_value = src_value * GST_SECOND / byterate; - break; - } - default: - res = FALSE; + if (byterate == 0) + return FALSE; + *dest_value = src_value * GST_SECOND / byterate; + break; + } + default: + res = FALSE; } case GST_FORMAT_DEFAULT: switch (*dest_format) { - case GST_FORMAT_BYTES: - *dest_value = src_value * bytes_per_sample; - break; - case GST_FORMAT_TIME: - if (vi->rate == 0) - return FALSE; - *dest_value = src_value * GST_SECOND / vi->rate; - break; - default: - res = FALSE; + case GST_FORMAT_BYTES: + *dest_value = src_value * bytes_per_sample; + break; + case GST_FORMAT_TIME: + if (vi->rate == 0) + return FALSE; + *dest_value = src_value * GST_SECOND / vi->rate; + break; + default: + res = FALSE; } break; case GST_FORMAT_TIME: switch (*dest_format) { - case GST_FORMAT_BYTES: - scale = bytes_per_sample; - case GST_FORMAT_DEFAULT: - *dest_value = src_value * scale * vi->rate / GST_SECOND; - break; - default: - res = FALSE; + case GST_FORMAT_BYTES: + scale = bytes_per_sample; + case GST_FORMAT_DEFAULT: + *dest_value = src_value * scale * vi->rate / GST_SECOND; + break; + default: + res = FALSE; } break; default: if (src_format == logical_stream_format) { - /* because we need to convert relative from 0, we have to add - * all pcm totals */ - gint i; - gint64 count = 0; + /* because we need to convert relative from 0, we have to add + * all pcm totals */ + gint i; + gint64 count = 0; - switch (*dest_format) { - case GST_FORMAT_BYTES: - res = FALSE; - break; - case GST_FORMAT_DEFAULT: - if (src_value > ivorbisfile->vf.links) { - src_value = ivorbisfile->vf.links; - } - for (i = 0; i < src_value; i++) { - vi = ov_info (&ivorbisfile->vf, i); + switch (*dest_format) { + case GST_FORMAT_BYTES: + res = FALSE; + break; + case GST_FORMAT_DEFAULT: + if (src_value > ivorbisfile->vf.links) { + src_value = ivorbisfile->vf.links; + } + for (i = 0; i < src_value; i++) { + vi = ov_info (&ivorbisfile->vf, i); - count += ov_pcm_total (&ivorbisfile->vf, i); - } - *dest_value = count; - break; - case GST_FORMAT_TIME: - { - if (src_value > ivorbisfile->vf.links) { - src_value = ivorbisfile->vf.links; - } - for (i = 0; i < src_value; i++) { - vi = ov_info (&ivorbisfile->vf, i); - if (vi->rate) - count += - ov_pcm_total (&ivorbisfile->vf, i) * GST_SECOND / vi->rate; - else - count += ov_time_total (&ivorbisfile->vf, i) * GST_SECOND; - } - /* we use the pcm totals to get the total time, it's more accurate */ - *dest_value = count; - break; - } - default: - res = FALSE; - } + count += ov_pcm_total (&ivorbisfile->vf, i); + } + *dest_value = count; + break; + case GST_FORMAT_TIME: + { + if (src_value > ivorbisfile->vf.links) { + src_value = ivorbisfile->vf.links; + } + for (i = 0; i < src_value; i++) { + vi = ov_info (&ivorbisfile->vf, i); + if (vi->rate) + count += + ov_pcm_total (&ivorbisfile->vf, i) * GST_SECOND / vi->rate; + else + count += ov_time_total (&ivorbisfile->vf, i) * GST_SECOND; + } + /* we use the pcm totals to get the total time, it's more accurate */ + *dest_value = count; + break; + } + default: + res = FALSE; + } } else - res = FALSE; + res = FALSE; break; } return res; @@ -816,34 +816,34 @@ gst_ivorbisfile_sink_convert (GstPad * pad, switch (src_format) { case GST_FORMAT_BYTES: switch (*dest_format) { - case GST_FORMAT_TIME: - break; - default: - if (*dest_format == logical_stream_format) { - } else - res = FALSE; + case GST_FORMAT_TIME: + break; + default: + if (*dest_format == logical_stream_format) { + } else + res = FALSE; } case GST_FORMAT_TIME: switch (*dest_format) { - case GST_FORMAT_BYTES: - break; - default: - if (*dest_format == logical_stream_format) { - } else - res = FALSE; + case GST_FORMAT_BYTES: + break; + default: + if (*dest_format == logical_stream_format) { + } else + res = FALSE; } default: if (src_format == logical_stream_format) { - switch (*dest_format) { - case GST_FORMAT_TIME: - break; - case GST_FORMAT_BYTES: - break; - default: - res = FALSE; - } + switch (*dest_format) { + case GST_FORMAT_TIME: + break; + case GST_FORMAT_BYTES: + break; + default: + res = FALSE; + } } else - res = FALSE; + res = FALSE; break; } @@ -858,6 +858,7 @@ gst_ivorbisfile_get_query_types (GstPad * pad) GST_QUERY_POSITION, 0 }; + return types; } @@ -878,67 +879,67 @@ gst_ivorbisfile_src_query (GstPad * pad, GstQueryType type, case GST_QUERY_TOTAL: { switch (*format) { - case GST_FORMAT_DEFAULT: - if (ivorbisfile->vf.seekable) - *value = ov_pcm_total (&ivorbisfile->vf, -1); - else - return FALSE; - break; - case GST_FORMAT_BYTES: - if (ivorbisfile->vf.seekable) - *value = ov_pcm_total (&ivorbisfile->vf, -1) * vi->channels * 2; - else - return FALSE; - break; - case GST_FORMAT_TIME: - if (ivorbisfile->vf.seekable) - *value = - (gint64) (ov_time_total (&ivorbisfile->vf, -1) * GST_SECOND); - else - return FALSE; - break; - default: - if (*format == logical_stream_format) { - if (ivorbisfile->vf.seekable) - *value = ivorbisfile->vf.links; - else - return FALSE; - } else - res = FALSE; - break; + case GST_FORMAT_DEFAULT: + if (ivorbisfile->vf.seekable) + *value = ov_pcm_total (&ivorbisfile->vf, -1); + else + return FALSE; + break; + case GST_FORMAT_BYTES: + if (ivorbisfile->vf.seekable) + *value = ov_pcm_total (&ivorbisfile->vf, -1) * vi->channels * 2; + else + return FALSE; + break; + case GST_FORMAT_TIME: + if (ivorbisfile->vf.seekable) + *value = + (gint64) (ov_time_total (&ivorbisfile->vf, -1) * GST_SECOND); + else + return FALSE; + break; + default: + if (*format == logical_stream_format) { + if (ivorbisfile->vf.seekable) + *value = ivorbisfile->vf.links; + else + return FALSE; + } else + res = FALSE; + break; } break; } case GST_QUERY_POSITION: switch (*format) { - case GST_FORMAT_TIME: - if (ivorbisfile->vf.seekable) - *value = (gint64) (ov_time_tell (&ivorbisfile->vf) * GST_SECOND); - else - *value = ivorbisfile->total_bytes * GST_SECOND - / (vi->rate * vi->channels * 2); - break; - case GST_FORMAT_BYTES: - if (ivorbisfile->vf.seekable) - *value = ov_pcm_tell (&ivorbisfile->vf) * vi->channels * 2; - else - *value = ivorbisfile->total_bytes; - break; - case GST_FORMAT_DEFAULT: - if (ivorbisfile->vf.seekable) - *value = ov_pcm_tell (&ivorbisfile->vf); - else - *value = ivorbisfile->total_bytes / (vi->channels * 2); - break; - default: - if (*format == logical_stream_format) { - if (ivorbisfile->vf.seekable) - *value = ivorbisfile->current_link; - else - return FALSE; - } else - res = FALSE; - break; + case GST_FORMAT_TIME: + if (ivorbisfile->vf.seekable) + *value = (gint64) (ov_time_tell (&ivorbisfile->vf) * GST_SECOND); + else + *value = ivorbisfile->total_bytes * GST_SECOND + / (vi->rate * vi->channels * 2); + break; + case GST_FORMAT_BYTES: + if (ivorbisfile->vf.seekable) + *value = ov_pcm_tell (&ivorbisfile->vf) * vi->channels * 2; + else + *value = ivorbisfile->total_bytes; + break; + case GST_FORMAT_DEFAULT: + if (ivorbisfile->vf.seekable) + *value = ov_pcm_tell (&ivorbisfile->vf); + else + *value = ivorbisfile->total_bytes / (vi->channels * 2); + break; + default: + if (*format == logical_stream_format) { + if (ivorbisfile->vf.seekable) + *value = ivorbisfile->current_link; + else + return FALSE; + } else + res = FALSE; + break; } break; default: @@ -956,6 +957,7 @@ gst_ivorbisfile_get_event_masks (GstPad * pad) {GST_EVENT_SEEK, GST_SEEK_METHOD_SET | GST_SEEK_FLAG_ACCURATE}, {0,} }; + return masks; } @@ -976,52 +978,52 @@ gst_ivorbisfile_src_event (GstPad * pad, GstEvent * event) GstFormat format; GST_DEBUG ("ivorbisfile: handling seek event on pad %s:%s", - GST_DEBUG_PAD_NAME (pad)); + GST_DEBUG_PAD_NAME (pad)); if (!ivorbisfile->vf.seekable) { - gst_event_unref (event); - GST_DEBUG ("vorbis stream is not seekable"); - return FALSE; + gst_event_unref (event); + GST_DEBUG ("vorbis stream is not seekable"); + return FALSE; } offset = GST_EVENT_SEEK_OFFSET (event); format = GST_EVENT_SEEK_FORMAT (event); switch (format) { - case GST_FORMAT_TIME: - ivorbisfile->seek_pending = TRUE; - ivorbisfile->seek_value = offset; - ivorbisfile->seek_format = format; - ivorbisfile->seek_accurate = GST_EVENT_SEEK_FLAGS (event) - & GST_SEEK_FLAG_ACCURATE; - break; - case GST_FORMAT_BYTES: - vi = ov_info (&ivorbisfile->vf, -1); - if (vi->channels == 0) { - GST_DEBUG ("vorbis stream has 0 channels ?"); - res = FALSE; - goto done; - } - offset /= vi->channels * 2; - /* fallthrough */ - case GST_FORMAT_DEFAULT: - ivorbisfile->seek_pending = TRUE; - ivorbisfile->seek_value = offset; - ivorbisfile->seek_format = format; - ivorbisfile->seek_accurate = GST_EVENT_SEEK_FLAGS (event) - & GST_SEEK_FLAG_ACCURATE; - break; - default: - if (format == logical_stream_format) { - ivorbisfile->seek_pending = TRUE; - ivorbisfile->seek_value = offset; - ivorbisfile->seek_format = format; - ivorbisfile->seek_accurate = GST_EVENT_SEEK_FLAGS (event) - & GST_SEEK_FLAG_ACCURATE; - } else { - GST_DEBUG ("unhandled seek format"); - res = FALSE; - } - break; + case GST_FORMAT_TIME: + ivorbisfile->seek_pending = TRUE; + ivorbisfile->seek_value = offset; + ivorbisfile->seek_format = format; + ivorbisfile->seek_accurate = GST_EVENT_SEEK_FLAGS (event) + & GST_SEEK_FLAG_ACCURATE; + break; + case GST_FORMAT_BYTES: + vi = ov_info (&ivorbisfile->vf, -1); + if (vi->channels == 0) { + GST_DEBUG ("vorbis stream has 0 channels ?"); + res = FALSE; + goto done; + } + offset /= vi->channels * 2; + /* fallthrough */ + case GST_FORMAT_DEFAULT: + ivorbisfile->seek_pending = TRUE; + ivorbisfile->seek_value = offset; + ivorbisfile->seek_format = format; + ivorbisfile->seek_accurate = GST_EVENT_SEEK_FLAGS (event) + & GST_SEEK_FLAG_ACCURATE; + break; + default: + if (format == logical_stream_format) { + ivorbisfile->seek_pending = TRUE; + ivorbisfile->seek_value = offset; + ivorbisfile->seek_format = format; + ivorbisfile->seek_accurate = GST_EVENT_SEEK_FLAGS (event) + & GST_SEEK_FLAG_ACCURATE; + } else { + GST_DEBUG ("unhandled seek format"); + res = FALSE; + } + break; } break; } diff --git a/ext/jack/gstjack.c b/ext/jack/gstjack.c index 41f078bc44..643896a8a4 100644 --- a/ext/jack/gstjack.c +++ b/ext/jack/gstjack.c @@ -106,8 +106,9 @@ gst_jack_get_type (void) 0, NULL, }; + jack_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstJack", &jack_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstJack", &jack_info, 0); } return jack_type; } @@ -129,8 +130,9 @@ gst_jack_sink_get_type (void) 0, (GInstanceInitFunc) gst_jack_init, }; + jack_type = - g_type_register_static (GST_TYPE_JACK, "GstJackSink", &jack_info, 0); + g_type_register_static (GST_TYPE_JACK, "GstJackSink", &jack_info, 0); } return jack_type; } @@ -152,8 +154,9 @@ gst_jack_src_get_type (void) 0, (GInstanceInitFunc) gst_jack_init, }; + jack_type = - g_type_register_static (GST_TYPE_JACK, "GstJackSrc", &jack_info, 0); + g_type_register_static (GST_TYPE_JACK, "GstJackSrc", &jack_info, 0); } return jack_type; } @@ -240,7 +243,7 @@ gst_jack_set_property (GObject * object, guint prop_id, const GValue * value, switch (prop_id) { case ARG_PORT_NAME_PREFIX: if (this->port_name_prefix) - g_free (this->port_name_prefix); + g_free (this->port_name_prefix); this->port_name_prefix = g_strdup (g_value_get_string (value)); break; default: @@ -318,8 +321,8 @@ gst_jack_request_new_pad (GstElement * element, GstPadTemplate * templ, l = *pad_list; while (l) { if (strcmp (GST_JACK_PAD (l)->name, name) == 0) { - g_warning ("requested port name %s already in use.", name); - return NULL; + g_warning ("requested port name %s already in use.", name); + return NULL; } l = l->next; } @@ -338,7 +341,7 @@ gst_jack_request_new_pad (GstElement * element, GstPadTemplate * templ, count = GPOINTER_TO_INT (g_hash_table_lookup (port_name_counts, - this->port_name_prefix)); + this->port_name_prefix)); g_hash_table_insert (port_name_counts, g_strdup (this->port_name_prefix), GINT_TO_POINTER (count + 1)); @@ -377,26 +380,26 @@ gst_jack_change_state (GstElement * element) JACK_DEBUG ("%s: READY", GST_OBJECT_NAME (GST_OBJECT (this))); if (!this->bin) { - if (!(this->bin = (GstJackBin *) gst_element_get_managing_bin (element)) - || !GST_IS_JACK_BIN (this->bin)) { - this->bin = NULL; - g_warning ("jack element %s needs to be contained in a jack bin.", - GST_OBJECT_NAME (element)); - return GST_STATE_FAILURE; - } + if (!(this->bin = (GstJackBin *) gst_element_get_managing_bin (element)) + || !GST_IS_JACK_BIN (this->bin)) { + this->bin = NULL; + g_warning ("jack element %s needs to be contained in a jack bin.", + GST_OBJECT_NAME (element)); + return GST_STATE_FAILURE; + } - /* fixme: verify that all names are unique */ - l = this->pads; - pads = - (this->direction == - GST_PAD_SRC) ? &this->bin->src_pads : &this->bin->sink_pads; - while (l) { - pad = GST_JACK_PAD (l); - JACK_DEBUG ("%s: appending pad %s:%s to list", GST_OBJECT_NAME (this), - pad->name, pad->peer_name); - *pads = g_list_append (*pads, pad); - l = g_list_next (l); - } + /* fixme: verify that all names are unique */ + l = this->pads; + pads = + (this->direction == + GST_PAD_SRC) ? &this->bin->src_pads : &this->bin->sink_pads; + while (l) { + pad = GST_JACK_PAD (l); + JACK_DEBUG ("%s: appending pad %s:%s to list", GST_OBJECT_NAME (this), + pad->name, pad->peer_name); + *pads = g_list_append (*pads, pad); + l = g_list_next (l); + } } break; @@ -404,18 +407,18 @@ gst_jack_change_state (GstElement * element) JACK_DEBUG ("%s: PAUSED", GST_OBJECT_NAME (GST_OBJECT (this))); if (GST_STATE (element) == GST_STATE_READY) { - /* we're in READY->PAUSED */ - l = this->pads; - while (l) { - pad = GST_JACK_PAD (l); - caps = gst_caps_copy (gst_pad_get_negotiated_caps (pad->pad)); - gst_caps_set_simple (caps, - "rate", G_TYPE_INT, (int) this->bin->rate, - "buffer-frames", G_TYPE_INT, (gint) this->bin->nframes, NULL); - if (gst_pad_try_set_caps (pad->pad, caps) <= 0) - return GST_STATE_FAILURE; - l = g_list_next (l); - } + /* we're in READY->PAUSED */ + l = this->pads; + while (l) { + pad = GST_JACK_PAD (l); + caps = gst_caps_copy (gst_pad_get_negotiated_caps (pad->pad)); + gst_caps_set_simple (caps, + "rate", G_TYPE_INT, (int) this->bin->rate, + "buffer-frames", G_TYPE_INT, (gint) this->bin->nframes, NULL); + if (gst_pad_try_set_caps (pad->pad, caps) <= 0) + return GST_STATE_FAILURE; + l = g_list_next (l); + } } break; case GST_STATE_PLAYING: @@ -444,7 +447,7 @@ gst_jack_link (GstPad * pad, const GstCaps * caps) gst_structure_get_int (structure, "rate", &rate); gst_structure_get_int (structure, "buffer-frames", &buffer_frames); if (this->bin && (rate != this->bin->rate || - buffer_frames != this->bin->nframes)) + buffer_frames != this->bin->nframes)) return GST_PAD_LINK_REFUSED; return GST_PAD_LINK_OK; @@ -471,17 +474,17 @@ gst_jack_loop (GstElement * element) buffer = GST_BUFFER (gst_pad_pull (pad->pad)); if (GST_IS_EVENT (buffer)) { - GstEvent *event = GST_EVENT (buffer); + GstEvent *event = GST_EVENT (buffer); - switch (GST_EVENT_TYPE (buffer)) { - case GST_EVENT_EOS: - gst_element_set_eos (element); - gst_event_unref (event); - return; - default: - gst_pad_event_default (pad->pad, event); - return; - } + switch (GST_EVENT_TYPE (buffer)) { + case GST_EVENT_EOS: + gst_element_set_eos (element); + gst_event_unref (event); + return; + default: + gst_pad_event_default (pad->pad, event); + return; + } } /* if the other plugins only give out buffer-frames or less (as @@ -490,8 +493,8 @@ gst_jack_loop (GstElement * element) next */ memcpy (pad->data, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer)); if (len != GST_BUFFER_SIZE (buffer)) - memset (pad->data + GST_BUFFER_SIZE (buffer), 0, - len - GST_BUFFER_SIZE (buffer)); + memset (pad->data + GST_BUFFER_SIZE (buffer), 0, + len - GST_BUFFER_SIZE (buffer)); gst_buffer_unref (buffer); } else { @@ -509,15 +512,15 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "jackbin", GST_RANK_NONE, - GST_TYPE_JACK_BIN)) + GST_TYPE_JACK_BIN)) return FALSE; if (!gst_element_register (plugin, "jacksrc", GST_RANK_NONE, - GST_TYPE_JACK_SRC)) + GST_TYPE_JACK_SRC)) return FALSE; if (!gst_element_register (plugin, "jacksink", GST_RANK_NONE, - GST_TYPE_JACK_SINK)) + GST_TYPE_JACK_SINK)) return FALSE; return TRUE; diff --git a/ext/jack/gstjackbin.c b/ext/jack/gstjackbin.c index 9be6e91563..c2c4957015 100644 --- a/ext/jack/gstjackbin.c +++ b/ext/jack/gstjackbin.c @@ -64,8 +64,9 @@ gst_jack_bin_get_type (void) 0, (GInstanceInitFunc) gst_jack_bin_init, }; + jack_bin_type = - g_type_register_static (GST_TYPE_BIN, "GstJackBin", &jack_bin_info, 0); + g_type_register_static (GST_TYPE_BIN, "GstJackBin", &jack_bin_info, 0); } return jack_bin_type; } @@ -111,17 +112,17 @@ gst_jack_bin_change_state (GstElement * element) case GST_STATE_NULL: JACK_DEBUG ("jackbin: NULL state"); if (this->client) { - JACK_DEBUG ("jackbin: closing client"); - jack_client_close (this->client); - this->client = NULL; + JACK_DEBUG ("jackbin: closing client"); + jack_client_close (this->client); + this->client = NULL; } if (_jackbin) - signal (SIGHUP, SIG_DFL); + signal (SIGHUP, SIG_DFL); _jackbin = NULL; if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + return GST_ELEMENT_CLASS (parent_class)->change_state (element); break; case GST_STATE_READY: @@ -131,116 +132,116 @@ gst_jack_bin_change_state (GstElement * element) signal (SIGHUP, sighup_handler); if (!this->client) { - if (!(this->client = jack_client_new ("gst-jack"))) { - g_warning ("jack server not running?"); - return GST_STATE_FAILURE; - } + if (!(this->client = jack_client_new ("gst-jack"))) { + g_warning ("jack server not running?"); + return GST_STATE_FAILURE; + } - gst_scheduler_setup (GST_ELEMENT_SCHED (this)); + gst_scheduler_setup (GST_ELEMENT_SCHED (this)); - jack_set_process_callback (this->client, process, this); - jack_set_sample_rate_callback (this->client, sample_rate, this); - jack_set_buffer_size_callback (this->client, buffer_size, this); - this->nframes = jack_get_buffer_size (this->client); - jack_on_shutdown (this->client, shutdown, this); + jack_set_process_callback (this->client, process, this); + jack_set_sample_rate_callback (this->client, sample_rate, this); + jack_set_buffer_size_callback (this->client, buffer_size, this); + this->nframes = jack_get_buffer_size (this->client); + jack_on_shutdown (this->client, shutdown, this); } if (GST_FLAG_IS_SET (GST_OBJECT (this), GST_JACK_OPEN)) { - l = this->src_pads; - while (l) { - JACK_DEBUG ("jackbin: unregistering pad %s:%s", - GST_JACK_PAD (l)->name, GST_JACK_PAD (l)->peer_name); - jack_port_unregister (this->client, GST_JACK_PAD (l)->port); - l = g_list_next (l); - } - l = this->sink_pads; - while (l) { - JACK_DEBUG ("jackbin: unregistering pad %s:%s", - GST_JACK_PAD (l)->name, GST_JACK_PAD (l)->peer_name); - jack_port_unregister (this->client, GST_JACK_PAD (l)->port); - l = g_list_next (l); - } - GST_FLAG_UNSET (GST_OBJECT (this), GST_JACK_OPEN); + l = this->src_pads; + while (l) { + JACK_DEBUG ("jackbin: unregistering pad %s:%s", + GST_JACK_PAD (l)->name, GST_JACK_PAD (l)->peer_name); + jack_port_unregister (this->client, GST_JACK_PAD (l)->port); + l = g_list_next (l); + } + l = this->sink_pads; + while (l) { + JACK_DEBUG ("jackbin: unregistering pad %s:%s", + GST_JACK_PAD (l)->name, GST_JACK_PAD (l)->peer_name); + jack_port_unregister (this->client, GST_JACK_PAD (l)->port); + l = g_list_next (l); + } + GST_FLAG_UNSET (GST_OBJECT (this), GST_JACK_OPEN); - if (GST_FLAG_IS_SET (GST_OBJECT (this), GST_JACK_ACTIVE)) { - JACK_DEBUG ("jackbin: deactivating client"); - jack_deactivate (this->client); - GST_FLAG_UNSET (GST_OBJECT (this), GST_JACK_ACTIVE); - } + if (GST_FLAG_IS_SET (GST_OBJECT (this), GST_JACK_ACTIVE)) { + JACK_DEBUG ("jackbin: deactivating client"); + jack_deactivate (this->client); + GST_FLAG_UNSET (GST_OBJECT (this), GST_JACK_ACTIVE); + } } if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + return GST_ELEMENT_CLASS (parent_class)->change_state (element); break; case GST_STATE_PAUSED: JACK_DEBUG ("jackbin: PAUSED"); if (!GST_FLAG_IS_SET (GST_OBJECT (this), GST_JACK_OPEN)) { - l = this->src_pads; - while (l) { - pad = GST_JACK_PAD (l); - JACK_DEBUG ("jackbin: registering input port %s (peer %s)", pad->name, - pad->peer_name); - pad->port = - jack_port_register (this->client, pad->name, - JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput | JackPortIsTerminal, 0); - l = g_list_next (l); - } - l = this->sink_pads; - while (l) { - pad = GST_JACK_PAD (l); - JACK_DEBUG ("jackbin: registering output port %s (peer %s)", - pad->name, pad->peer_name); - pad->port = - jack_port_register (this->client, pad->name, - JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput | JackPortIsTerminal, - 0); - l = g_list_next (l); - } + l = this->src_pads; + while (l) { + pad = GST_JACK_PAD (l); + JACK_DEBUG ("jackbin: registering input port %s (peer %s)", pad->name, + pad->peer_name); + pad->port = + jack_port_register (this->client, pad->name, + JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput | JackPortIsTerminal, 0); + l = g_list_next (l); + } + l = this->sink_pads; + while (l) { + pad = GST_JACK_PAD (l); + JACK_DEBUG ("jackbin: registering output port %s (peer %s)", + pad->name, pad->peer_name); + pad->port = + jack_port_register (this->client, pad->name, + JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput | JackPortIsTerminal, + 0); + l = g_list_next (l); + } - /* must activate before connecting */ - if (!GST_FLAG_IS_SET (GST_OBJECT (this), GST_JACK_ACTIVE)) { - JACK_DEBUG ("jackbin: activating client"); - jack_activate (this->client); - GST_FLAG_SET (GST_OBJECT (this), GST_JACK_ACTIVE); - } + /* must activate before connecting */ + if (!GST_FLAG_IS_SET (GST_OBJECT (this), GST_JACK_ACTIVE)) { + JACK_DEBUG ("jackbin: activating client"); + jack_activate (this->client); + GST_FLAG_SET (GST_OBJECT (this), GST_JACK_ACTIVE); + } - l = this->src_pads; - while (l) { - pad = GST_JACK_PAD (l); - JACK_DEBUG ("connecting jack port %s to gst jack port %s", - pad->peer_name, jack_port_name (pad->port)); - if (jack_connect (this->client, pad->peer_name, - jack_port_name (pad->port))) { - g_warning ("jackbin: could not connect %s and %s", pad->peer_name, - jack_port_name (pad->port)); - return GST_STATE_FAILURE; - } - l = g_list_next (l); - } - l = this->sink_pads; - while (l) { - pad = GST_JACK_PAD (l); - JACK_DEBUG ("connecting gst jack port %s to jack port %s", - jack_port_name (pad->port), pad->peer_name); - if (jack_connect (this->client, jack_port_name (pad->port), - pad->peer_name)) { - g_warning ("jackbin: could not connect %s and %s", pad->peer_name, - jack_port_name (pad->port)); - return GST_STATE_FAILURE; - } - l = g_list_next (l); - } + l = this->src_pads; + while (l) { + pad = GST_JACK_PAD (l); + JACK_DEBUG ("connecting jack port %s to gst jack port %s", + pad->peer_name, jack_port_name (pad->port)); + if (jack_connect (this->client, pad->peer_name, + jack_port_name (pad->port))) { + g_warning ("jackbin: could not connect %s and %s", pad->peer_name, + jack_port_name (pad->port)); + return GST_STATE_FAILURE; + } + l = g_list_next (l); + } + l = this->sink_pads; + while (l) { + pad = GST_JACK_PAD (l); + JACK_DEBUG ("connecting gst jack port %s to jack port %s", + jack_port_name (pad->port), pad->peer_name); + if (jack_connect (this->client, jack_port_name (pad->port), + pad->peer_name)) { + g_warning ("jackbin: could not connect %s and %s", pad->peer_name, + jack_port_name (pad->port)); + return GST_STATE_FAILURE; + } + l = g_list_next (l); + } - JACK_DEBUG ("jackbin: setting OPEN flag"); - GST_FLAG_SET (GST_OBJECT (this), GST_JACK_OPEN); + JACK_DEBUG ("jackbin: setting OPEN flag"); + GST_FLAG_SET (GST_OBJECT (this), GST_JACK_OPEN); - if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + if (GST_ELEMENT_CLASS (parent_class)->change_state) + return GST_ELEMENT_CLASS (parent_class)->change_state (element); } else { - if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + if (GST_ELEMENT_CLASS (parent_class)->change_state) + return GST_ELEMENT_CLASS (parent_class)->change_state (element); } break; @@ -248,7 +249,7 @@ gst_jack_bin_change_state (GstElement * element) JACK_DEBUG ("jackbin: PLAYING"); if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + return GST_ELEMENT_CLASS (parent_class)->change_state (element); break; } diff --git a/ext/ladspa/gstladspa.c b/ext/ladspa/gstladspa.c index 4f6c1f0cf2..37417fb6ed 100644 --- a/ext/ladspa/gstladspa.c +++ b/ext/ladspa/gstladspa.c @@ -28,8 +28,8 @@ #include #include "gstladspa.h" -#include /* main ladspa sdk include file */ -#include "utils.h" /* ladspa sdk utility functions */ +#include /* main ladspa sdk include file */ +#include "utils.h" /* ladspa sdk utility functions */ /* 1.0 and the 1.1 preliminary headers don't define a version, but 1.1 final does */ @@ -107,13 +107,13 @@ gst_ladspa_base_init (GstLADSPAClass * klass) /* the factories take ownership of the name */ if (LADSPA_IS_PORT_INPUT (desc->PortDescriptors[j])) { - templ = gst_pad_template_new (name, GST_PAD_SINK, GST_PAD_ALWAYS, - gst_caps_copy (gst_static_caps_get (&ladspa_pad_caps))); - klass->numsinkpads++; + templ = gst_pad_template_new (name, GST_PAD_SINK, GST_PAD_ALWAYS, + gst_caps_copy (gst_static_caps_get (&ladspa_pad_caps))); + klass->numsinkpads++; } else { - templ = gst_pad_template_new (name, GST_PAD_SRC, GST_PAD_ALWAYS, - gst_caps_copy (gst_static_caps_get (&ladspa_pad_caps))); - klass->numsrcpads++; + templ = gst_pad_template_new (name, GST_PAD_SRC, GST_PAD_ALWAYS, + gst_caps_copy (gst_static_caps_get (&ladspa_pad_caps))); + klass->numsrcpads++; } gst_element_class_add_pad_template (element_class, templ); @@ -132,7 +132,7 @@ gst_ladspa_base_init (GstLADSPAClass * klass) else if ((klass->numsinkpads > 0) && (klass->numsrcpads == 0)) details->klass = "Sink/Audio/LADSPA"; else - details->klass = "Filter/Effect/Audio/LADSPA"; /* whatever this is */ + details->klass = "Filter/Effect/Audio/LADSPA"; /* whatever this is */ gst_element_class_set_details (element_class, details); klass->srcpad_portnums = g_new0 (gint, klass->numsrcpads); @@ -144,9 +144,9 @@ gst_ladspa_base_init (GstLADSPAClass * klass) for (j = 0; j < desc->PortCount; j++) { if (LADSPA_IS_PORT_AUDIO (desc->PortDescriptors[j])) { if (LADSPA_IS_PORT_INPUT (desc->PortDescriptors[j])) - klass->sinkpad_portnums[sinkcount++] = j; + klass->sinkpad_portnums[sinkcount++] = j; else - klass->srcpad_portnums[srccount++] = j; + klass->srcpad_portnums[srccount++] = j; } } @@ -185,7 +185,7 @@ gst_ladspa_class_init (GstLADSPAClass * klass) /* walk through the ports, count the input, output and control ports */ for (i = 0; i < desc->PortCount; i++) { if (!LADSPA_IS_PORT_AUDIO (desc->PortDescriptors[i]) && - LADSPA_IS_PORT_INPUT (desc->PortDescriptors[i])) + LADSPA_IS_PORT_INPUT (desc->PortDescriptors[i])) klass->numcontrols++; } @@ -199,7 +199,7 @@ gst_ladspa_class_init (GstLADSPAClass * klass) /* walk through the ports, note the portnums for control params */ for (i = 0; i < desc->PortCount; i++) { if (!LADSPA_IS_PORT_AUDIO (desc->PortDescriptors[i]) && - LADSPA_IS_PORT_INPUT (desc->PortDescriptors[i])) + LADSPA_IS_PORT_INPUT (desc->PortDescriptors[i])) klass->control_portnums[controlcount++] = i; } @@ -232,27 +232,27 @@ gst_ladspa_class_init (GstLADSPAClass * klass) if (LADSPA_IS_HINT_BOUNDED_BELOW (hintdesc)) { klass->control_info[i].lower = TRUE; klass->control_info[i].lowerbound = - desc->PortRangeHints[current_portnum].LowerBound; + desc->PortRangeHints[current_portnum].LowerBound; } else { if (argtype == G_TYPE_INT) - klass->control_info[i].lowerbound = (gfloat) G_MININT; + klass->control_info[i].lowerbound = (gfloat) G_MININT; if (argtype == G_TYPE_FLOAT) - klass->control_info[i].lowerbound = -G_MAXFLOAT; + klass->control_info[i].lowerbound = -G_MAXFLOAT; } if (LADSPA_IS_HINT_BOUNDED_ABOVE (hintdesc)) { klass->control_info[i].upper = TRUE; klass->control_info[i].upperbound = - desc->PortRangeHints[current_portnum].UpperBound; + desc->PortRangeHints[current_portnum].UpperBound; if (LADSPA_IS_HINT_SAMPLE_RATE (hintdesc)) { - klass->control_info[i].samplerate = TRUE; - klass->control_info[i].upperbound *= 44100; /* FIXME? */ + klass->control_info[i].samplerate = TRUE; + klass->control_info[i].upperbound *= 44100; /* FIXME? */ } } else { if (argtype == G_TYPE_INT) - klass->control_info[i].upperbound = (gfloat) G_MAXINT; + klass->control_info[i].upperbound = (gfloat) G_MAXINT; if (argtype == G_TYPE_FLOAT) - klass->control_info[i].upperbound = G_MAXFLOAT; + klass->control_info[i].upperbound = G_MAXFLOAT; } /* use the lowerbound as the default value */ @@ -262,49 +262,49 @@ gst_ladspa_class_init (GstLADSPAClass * klass) /* figure out the defaults */ if (LADSPA_IS_HINT_HAS_DEFAULT (hintdesc)) { if (LADSPA_IS_HINT_DEFAULT_MINIMUM (hintdesc)) - klass->control_info[i].def = klass->control_info[i].lowerbound; + klass->control_info[i].def = klass->control_info[i].lowerbound; else if (LADSPA_IS_HINT_DEFAULT_LOW (hintdesc)) - if (LADSPA_IS_HINT_LOGARITHMIC (hintdesc)) - klass->control_info[i].def = - exp (0.75 * log (klass->control_info[i].lowerbound) + - 0.25 * log (klass->control_info[i].upperbound)); - else - klass->control_info[i].def = - (0.75 * klass->control_info[i].lowerbound + - 0.25 * klass->control_info[i].upperbound); + if (LADSPA_IS_HINT_LOGARITHMIC (hintdesc)) + klass->control_info[i].def = + exp (0.75 * log (klass->control_info[i].lowerbound) + + 0.25 * log (klass->control_info[i].upperbound)); + else + klass->control_info[i].def = + (0.75 * klass->control_info[i].lowerbound + + 0.25 * klass->control_info[i].upperbound); else if (LADSPA_IS_HINT_DEFAULT_MIDDLE (hintdesc)) - if (LADSPA_IS_HINT_LOGARITHMIC (hintdesc)) - klass->control_info[i].def = - exp (0.5 * log (klass->control_info[i].lowerbound) + - 0.5 * log (klass->control_info[i].upperbound)); - else - klass->control_info[i].def = - (0.5 * klass->control_info[i].lowerbound + - 0.5 * klass->control_info[i].upperbound); + if (LADSPA_IS_HINT_LOGARITHMIC (hintdesc)) + klass->control_info[i].def = + exp (0.5 * log (klass->control_info[i].lowerbound) + + 0.5 * log (klass->control_info[i].upperbound)); + else + klass->control_info[i].def = + (0.5 * klass->control_info[i].lowerbound + + 0.5 * klass->control_info[i].upperbound); else if (LADSPA_IS_HINT_DEFAULT_HIGH (hintdesc)) - if (LADSPA_IS_HINT_LOGARITHMIC (hintdesc)) - klass->control_info[i].def = - exp (0.25 * log (klass->control_info[i].lowerbound) + - 0.75 * log (klass->control_info[i].upperbound)); - else - klass->control_info[i].def = - (0.25 * klass->control_info[i].lowerbound + - 0.75 * klass->control_info[i].upperbound); + if (LADSPA_IS_HINT_LOGARITHMIC (hintdesc)) + klass->control_info[i].def = + exp (0.25 * log (klass->control_info[i].lowerbound) + + 0.75 * log (klass->control_info[i].upperbound)); + else + klass->control_info[i].def = + (0.25 * klass->control_info[i].lowerbound + + 0.75 * klass->control_info[i].upperbound); else if (LADSPA_IS_HINT_DEFAULT_MAXIMUM (hintdesc)) - klass->control_info[i].def = klass->control_info[i].upperbound; + klass->control_info[i].def = klass->control_info[i].upperbound; else if (LADSPA_IS_HINT_DEFAULT_0 (hintdesc)) - klass->control_info[i].def = 0.0; + klass->control_info[i].def = 0.0; else if (LADSPA_IS_HINT_DEFAULT_1 (hintdesc)) - klass->control_info[i].def = 1.0; + klass->control_info[i].def = 1.0; else if (LADSPA_IS_HINT_DEFAULT_100 (hintdesc)) - klass->control_info[i].def = 100.0; + klass->control_info[i].def = 100.0; else if (LADSPA_IS_HINT_DEFAULT_440 (hintdesc)) - klass->control_info[i].def = 440.0; + klass->control_info[i].def = 440.0; } #endif /* LADSPA_IS_HINT_HAS_DEFAULT */ klass->control_info[i].def = CLAMP (klass->control_info[i].def, - klass->control_info[i].lowerbound, klass->control_info[i].upperbound); + klass->control_info[i].lowerbound, klass->control_info[i].upperbound); if (LADSPA_IS_PORT_INPUT (desc->PortDescriptors[current_portnum])) { argperms = G_PARAM_READWRITE; @@ -326,7 +326,7 @@ gst_ladspa_class_init (GstLADSPAClass * klass) g_strcanon (argname, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-'); /* satisfy glib2 (argname[0] must be [A-Za-z]) */ if (!((argname[0] >= 'a' && argname[0] <= 'z') || (argname[0] >= 'A' - && argname[0] <= 'Z'))) { + && argname[0] <= 'Z'))) { tempstr = argname; argname = g_strconcat ("param-", argname, NULL); g_free (tempstr); @@ -338,9 +338,9 @@ gst_ladspa_class_init (GstLADSPAClass * klass) gchar *numargname = g_strdup_printf ("%s_%d", argname, numarg++); while (g_object_class_find_property (G_OBJECT_CLASS (klass), - numargname) != NULL) { - g_free (numargname); - numargname = g_strdup_printf ("%s_%d", argname, numarg++); + numargname) != NULL) { + g_free (numargname); + numargname = g_strdup_printf ("%s_%d", argname, numarg++); } argname = numargname; } @@ -351,19 +351,19 @@ gst_ladspa_class_init (GstLADSPAClass * klass) if (argtype == G_TYPE_BOOLEAN) { paramspec = - g_param_spec_boolean (argname, argname, argname, FALSE, argperms); + g_param_spec_boolean (argname, argname, argname, FALSE, argperms); } else if (argtype == G_TYPE_INT) { paramspec = g_param_spec_int (argname, argname, argname, - (gint) klass->control_info[i].lowerbound, - (gint) klass->control_info[i].upperbound, - (gint) klass->control_info[i].def, argperms); + (gint) klass->control_info[i].lowerbound, + (gint) klass->control_info[i].upperbound, + (gint) klass->control_info[i].def, argperms); } else if (klass->control_info[i].samplerate) { paramspec = g_param_spec_float (argname, argname, argname, - 0.0, G_MAXFLOAT, 0.0, argperms); + 0.0, G_MAXFLOAT, 0.0, argperms); } else { paramspec = g_param_spec_float (argname, argname, argname, - klass->control_info[i].lowerbound, klass->control_info[i].upperbound, - klass->control_info[i].def, argperms); + klass->control_info[i].lowerbound, klass->control_info[i].upperbound, + klass->control_info[i].def, argperms); } /* properties have an offset of 1 */ @@ -395,7 +395,7 @@ gst_ladspa_init (GstLADSPA * ladspa) srccount = 0; for (l = GST_ELEMENT_CLASS (oclass)->padtemplates; l; l = l->next) { GstPad *pad = gst_pad_new_from_template (GST_PAD_TEMPLATE (l->data), - GST_PAD_TEMPLATE_NAME_TEMPLATE (l->data)); + GST_PAD_TEMPLATE_NAME_TEMPLATE (l->data)); gst_pad_set_link_function (pad, gst_ladspa_link); gst_element_add_pad ((GstElement *) ladspa, pad); @@ -413,32 +413,32 @@ gst_ladspa_init (GstLADSPA * ladspa) ladspa->controls[i] = cinfo.def; if (cinfo.toggled) { - gst_dpman_add_required_dparam_callback (ladspa->dpman, - g_param_spec_int (cinfo.param_name, cinfo.name, cinfo.name, - 0, 1, (gint) (ladspa->controls[i]), G_PARAM_READWRITE), - "int", gst_ladspa_update_int, &(ladspa->controls[i]) - ); + gst_dpman_add_required_dparam_callback (ladspa->dpman, + g_param_spec_int (cinfo.param_name, cinfo.name, cinfo.name, + 0, 1, (gint) (ladspa->controls[i]), G_PARAM_READWRITE), + "int", gst_ladspa_update_int, &(ladspa->controls[i]) + ); } else if (cinfo.integer) { - gst_dpman_add_required_dparam_callback (ladspa->dpman, - g_param_spec_int (cinfo.param_name, cinfo.name, cinfo.name, - (gint) cinfo.lowerbound, (gint) cinfo.upperbound, - (gint) ladspa->controls[i], G_PARAM_READWRITE), - "int", gst_ladspa_update_int, &(ladspa->controls[i]) - ); + gst_dpman_add_required_dparam_callback (ladspa->dpman, + g_param_spec_int (cinfo.param_name, cinfo.name, cinfo.name, + (gint) cinfo.lowerbound, (gint) cinfo.upperbound, + (gint) ladspa->controls[i], G_PARAM_READWRITE), + "int", gst_ladspa_update_int, &(ladspa->controls[i]) + ); } else if (cinfo.samplerate) { - gst_dpman_add_required_dparam_direct (ladspa->dpman, - g_param_spec_float (cinfo.param_name, cinfo.name, cinfo.name, - cinfo.lowerbound, cinfo.upperbound, - ladspa->controls[i], G_PARAM_READWRITE), - "hertz-rate-bound", &(ladspa->controls[i]) - ); + gst_dpman_add_required_dparam_direct (ladspa->dpman, + g_param_spec_float (cinfo.param_name, cinfo.name, cinfo.name, + cinfo.lowerbound, cinfo.upperbound, + ladspa->controls[i], G_PARAM_READWRITE), + "hertz-rate-bound", &(ladspa->controls[i]) + ); } else { - gst_dpman_add_required_dparam_direct (ladspa->dpman, - g_param_spec_float (cinfo.param_name, cinfo.name, cinfo.name, - cinfo.lowerbound, cinfo.upperbound, - ladspa->controls[i], G_PARAM_READWRITE), - "float", &(ladspa->controls[i]) - ); + gst_dpman_add_required_dparam_direct (ladspa->dpman, + g_param_spec_float (cinfo.param_name, cinfo.name, cinfo.name, + cinfo.lowerbound, cinfo.upperbound, + ladspa->controls[i], G_PARAM_READWRITE), + "float", &(ladspa->controls[i]) + ); } } } @@ -446,7 +446,7 @@ gst_ladspa_init (GstLADSPA * ladspa) /* nonzero default needed to instantiate() some plugins */ ladspa->samplerate = 44100; - ladspa->buffer_frames = 0; /* should be set with caps */ + ladspa->buffer_frames = 0; /* should be set with caps */ ladspa->activated = FALSE; ladspa->inplace_broken = LADSPA_IS_INPLACE_BROKEN (ladspa->descriptor->Properties); @@ -464,7 +464,7 @@ gst_ladspa_init (GstLADSPA * ladspa) } else if (sinkcount > 1) { /* more than one sink pad needs loop mode */ DEBUG_OBJ (ladspa, "loop mode with %d sink pads and %d src pads", sinkcount, - srccount); + srccount); gst_element_set_loop_function (GST_ELEMENT (ladspa), gst_ladspa_loop); } else if (sinkcount == 0 && srccount == 0) { @@ -472,7 +472,7 @@ gst_ladspa_init (GstLADSPA * ladspa) * it for now */ } else { g_warning ("%d sink pads, %d src pads not yet supported", sinkcount, - srccount); + srccount); } gst_ladspa_instantiate (ladspa); @@ -500,7 +500,7 @@ gst_ladspa_link (GstPad * pad, const GstCaps * caps) for (l = gst_element_get_pad_list (element); l; l = l->next) if (pad != (GstPad *) l->data) if (gst_pad_try_set_caps ((GstPad *) l->data, caps) <= 0) - return GST_PAD_LINK_REFUSED; + return GST_PAD_LINK_REFUSED; /* we assume that the ladspa plugin can handle any sample rate, so this check gets put last */ @@ -523,7 +523,7 @@ static void gst_ladspa_force_src_caps (GstLADSPA * ladspa, GstPad * pad) { if (!ladspa->buffer_frames) { - ladspa->buffer_frames = 256; /* 5 ms at 44100 kHz (just a default...) */ + ladspa->buffer_frames = 256; /* 5 ms at 44100 kHz (just a default...) */ } DEBUG_OBJ (ladspa, "forcing caps with rate=%d, buffer-frames=%d", @@ -531,12 +531,12 @@ gst_ladspa_force_src_caps (GstLADSPA * ladspa, GstPad * pad) gst_pad_try_set_caps (pad, gst_caps_new ("ladspa_src_caps", - "audio/x-raw-float", - gst_props_new ("width", G_TYPE_INT (32), - "endianness", G_TYPE_INT (G_BYTE_ORDER), - "rate", G_TYPE_INT (ladspa->samplerate), - "buffer-frames", G_TYPE_INT (ladspa->buffer_frames), - "channels", G_TYPE_INT (1), NULL))); + "audio/x-raw-float", + gst_props_new ("width", G_TYPE_INT (32), + "endianness", G_TYPE_INT (G_BYTE_ORDER), + "rate", G_TYPE_INT (ladspa->samplerate), + "buffer-frames", G_TYPE_INT (ladspa->buffer_frames), + "channels", G_TYPE_INT (1), NULL))); } #endif @@ -629,7 +629,7 @@ gst_ladspa_instantiate (GstLADSPA * ladspa) /* connect the control ports */ for (i = 0; i < oclass->numcontrols; i++) desc->connect_port (ladspa->handle, - oclass->control_portnums[i], &(ladspa->controls[i])); + oclass->control_portnums[i], &(ladspa->controls[i])); /* reactivate if it was activated before the reinstantiation */ if (was_activated) @@ -731,13 +731,13 @@ gst_ladspa_loop (GstElement * element) /* push it out on all pads */ gst_data_ref_by_count ((GstData *) buffers_in[i], numsrcpads); for (j = 0; j < numsrcpads; j++) - gst_pad_push (ladspa->srcpads[j], GST_DATA (buffers_in[i])); + gst_pad_push (ladspa->srcpads[j], GST_DATA (buffers_in[i])); if (GST_EVENT_TYPE (buffers_in[i]) == GST_EVENT_EOS) { - /* shut down */ - gst_element_set_eos (element); - return; + /* shut down */ + gst_element_set_eos (element); + return; } else { - goto get_buffer; + goto get_buffer; } } @@ -745,8 +745,8 @@ gst_ladspa_loop (GstElement * element) largest_buffer = GST_BUFFER_SIZE (buffers_in[i]) / sizeof (gfloat); else largest_buffer = - MIN (GST_BUFFER_SIZE (buffers_in[i]) / sizeof (gfloat), - largest_buffer); + MIN (GST_BUFFER_SIZE (buffers_in[i]) / sizeof (gfloat), + largest_buffer); data_in[i] = (LADSPA_Data *) GST_BUFFER_DATA (buffers_in[i]); GST_BUFFER_TIMESTAMP (buffers_in[i]) = ladspa->timestamp; } @@ -761,7 +761,7 @@ gst_ladspa_loop (GstElement * element) } for (; i < numsrcpads; i++) { buffers_out[i] = - gst_buffer_new_and_alloc (ladspa->buffer_frames * sizeof (gfloat)); + gst_buffer_new_and_alloc (ladspa->buffer_frames * sizeof (gfloat)); GST_BUFFER_TIMESTAMP (buffers_out[i]) = ladspa->timestamp; data_out[i] = (LADSPA_Data *) GST_BUFFER_DATA (buffers_out[i]); } @@ -778,10 +778,10 @@ gst_ladspa_loop (GstElement * element) for (i = 0; i < numsinkpads; i++) desc->connect_port (ladspa->handle, oclass->sinkpad_portnums[i], - data_in[i]); + data_in[i]); for (i = 0; i < numsrcpads; i++) desc->connect_port (ladspa->handle, oclass->srcpad_portnums[i], - data_out[i]); + data_out[i]); desc->run (ladspa->handle, num_to_process); @@ -874,7 +874,7 @@ gst_ladspa_chain (GstPad * pad, GstData * _data) desc->connect_port (ladspa->handle, oclass->sinkpad_portnums[0], data_in); for (i = 0; i < numsrcpads; i++) desc->connect_port (ladspa->handle, oclass->srcpad_portnums[i], - data_out[i]); + data_out[i]); desc->run (ladspa->handle, num_to_process); @@ -891,7 +891,7 @@ gst_ladspa_chain (GstPad * pad, GstData * _data) if (numsrcpads) { for (i = 0; i < numsrcpads; i++) { DEBUG_OBJ (ladspa, "pushing buffer (%p, length %u bytes) on src pad %d", - buffers_out[i], GST_BUFFER_SIZE (buffers_out[i]), i); + buffers_out[i], GST_BUFFER_SIZE (buffers_out[i]), i); gst_pad_push (ladspa->srcpads[i], GST_DATA (buffers_out[i])); } @@ -979,7 +979,7 @@ ladspa_describe_plugin (const char *pcFullFilename, /* base-init temp alloc */ g_hash_table_insert (ladspa_descriptors, - GINT_TO_POINTER (0), (gpointer) desc); + GINT_TO_POINTER (0), (gpointer) desc); /* create the type now */ type = g_type_register_static (GST_TYPE_ELEMENT, type_name, &typeinfo, 0); @@ -988,7 +988,7 @@ ladspa_describe_plugin (const char *pcFullFilename, /* add this plugin to the hash */ g_hash_table_insert (ladspa_descriptors, - GINT_TO_POINTER (type), (gpointer) desc); + GINT_TO_POINTER (type), (gpointer) desc); } g_hash_table_remove (ladspa_descriptors, GINT_TO_POINTER (0)); diff --git a/ext/ladspa/load.c b/ext/ladspa/load.c index 98337f58b4..5ea3714b4f 100644 --- a/ext/ladspa/load.c +++ b/ext/ladspa/load.c @@ -63,36 +63,36 @@ dlopenLADSPA (const char *pcFilename, int iFlag) */ pcLADSPAPath = g_strdup_printf ("%s:/usr/lib/ladspa:/usr/local/lib/ladspa", - getenv ("LADSPA_PATH")); + getenv ("LADSPA_PATH")); if (pcLADSPAPath) { pcStart = pcLADSPAPath; while (*pcStart != '\0') { - pcEnd = pcStart; - while (*pcEnd != ':' && *pcEnd != '\0') - pcEnd++; + pcEnd = pcStart; + while (*pcEnd != ':' && *pcEnd != '\0') + pcEnd++; - pcBuffer = malloc (iFilenameLength + 2 + (pcEnd - pcStart)); - if (pcEnd > pcStart) - strncpy (pcBuffer, pcStart, pcEnd - pcStart); - iNeedSlash = 0; - if (pcEnd > pcStart) - if (*(pcEnd - 1) != '/') { - iNeedSlash = 1; - pcBuffer[pcEnd - pcStart] = '/'; - } - strcpy (pcBuffer + iNeedSlash + (pcEnd - pcStart), pcFilename); + pcBuffer = malloc (iFilenameLength + 2 + (pcEnd - pcStart)); + if (pcEnd > pcStart) + strncpy (pcBuffer, pcStart, pcEnd - pcStart); + iNeedSlash = 0; + if (pcEnd > pcStart) + if (*(pcEnd - 1) != '/') { + iNeedSlash = 1; + pcBuffer[pcEnd - pcStart] = '/'; + } + strcpy (pcBuffer + iNeedSlash + (pcEnd - pcStart), pcFilename); - pvResult = dlopen (pcBuffer, iFlag); + pvResult = dlopen (pcBuffer, iFlag); - free (pcBuffer); - if (pvResult != NULL) - return pvResult; + free (pcBuffer); + if (pvResult != NULL) + return pvResult; - pcStart = pcEnd; - if (*pcStart == ':') - pcStart++; + pcStart = pcEnd; + if (*pcStart == ':') + pcStart++; } } } @@ -134,7 +134,7 @@ loadLADSPAPluginLibrary (const char *pcPluginFilename) pvPluginHandle = dlopenLADSPA (pcPluginFilename, RTLD_NOW); if (!pvPluginHandle) { fprintf (stderr, - "Failed to load plugin \"%s\": %s\n", pcPluginFilename, dlerror ()); + "Failed to load plugin \"%s\": %s\n", pcPluginFilename, dlerror ()); exit (1); } @@ -169,10 +169,10 @@ findLADSPAPluginDescriptor (void *pvLADSPAPluginLibrary, if (pcError) { fprintf (stderr, - "Unable to find ladspa_descriptor() function in plugin " - "library file \"%s\": %s.\n" - "Are you sure this is a LADSPA plugin file?\n", - pcPluginLibraryFilename, pcError); + "Unable to find ladspa_descriptor() function in plugin " + "library file \"%s\": %s.\n" + "Are you sure this is a LADSPA plugin file?\n", + pcPluginLibraryFilename, pcError); exit (1); } } @@ -181,8 +181,8 @@ findLADSPAPluginDescriptor (void *pvLADSPAPluginLibrary, psDescriptor = pfDescriptorFunction (lPluginIndex); if (psDescriptor == NULL) { fprintf (stderr, - "Unable to find label \"%s\" in plugin library file \"%s\".\n", - pcPluginLabel, pcPluginLibraryFilename); + "Unable to find label \"%s\" in plugin library file \"%s\".\n", + pcPluginLabel, pcPluginLibraryFilename); exit (1); } if (strcmp (psDescriptor->Label, pcPluginLabel) == 0) diff --git a/ext/ladspa/search.c b/ext/ladspa/search.c index 0f690275f7..0e481a3624 100644 --- a/ext/ladspa/search.c +++ b/ext/ladspa/search.c @@ -61,7 +61,7 @@ static void } pcFilename = malloc (lDirLength + strlen (psDirectoryEntry->d_name) - + 1 + iNeedSlash); + + 1 + iNeedSlash); strcpy (pcFilename, pcDirectory); if (iNeedSlash) strcat (pcFilename, "/"); @@ -73,15 +73,15 @@ static void dlerror (); fDescriptorFunction - = (LADSPA_Descriptor_Function) dlsym (pvPluginHandle, - "ladspa_descriptor"); + = (LADSPA_Descriptor_Function) dlsym (pvPluginHandle, + "ladspa_descriptor"); if (dlerror () == NULL && fDescriptorFunction) { - /* We've successfully found a ladspa_descriptor function. Pass - it to the callback function. */ - fCallbackFunction (pcFilename, pvPluginHandle, fDescriptorFunction); + /* We've successfully found a ladspa_descriptor function. Pass + it to the callback function. */ + fCallbackFunction (pcFilename, pvPluginHandle, fDescriptorFunction); } else { - /* It was a library, but not a LADSPA one. Unload it. */ - dlclose (pcFilename); + /* It was a library, but not a LADSPA one. Unload it. */ + dlclose (pcFilename); } } free (pcFilename); diff --git a/ext/lcs/gstcolorspace.c b/ext/lcs/gstcolorspace.c index 064e52ca17..403e53b0de 100644 --- a/ext/lcs/gstcolorspace.c +++ b/ext/lcs/gstcolorspace.c @@ -106,15 +106,15 @@ static GstStaticPadTemplate gst_colorspace_src_template = GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_RGB "; " - GST_VIDEO_CAPS_BGR "; " - GST_VIDEO_CAPS_RGBx "; " - GST_VIDEO_CAPS_xRGB "; " - GST_VIDEO_CAPS_BGRx "; " - GST_VIDEO_CAPS_xBGR "; " - GST_VIDEO_CAPS_RGB_16 "; " - GST_VIDEO_CAPS_RGB_15 "; " - GST_VIDEO_CAPS_YUV ("{ I420, YV12, YUY2, YVYU, UYVY, YUV9, YVU9, " - "Y800, Y41P, Y41B, Y42B, IUY2 }") + GST_VIDEO_CAPS_BGR "; " + GST_VIDEO_CAPS_RGBx "; " + GST_VIDEO_CAPS_xRGB "; " + GST_VIDEO_CAPS_BGRx "; " + GST_VIDEO_CAPS_xBGR "; " + GST_VIDEO_CAPS_RGB_16 "; " + GST_VIDEO_CAPS_RGB_15 "; " + GST_VIDEO_CAPS_YUV ("{ I420, YV12, YUY2, YVYU, UYVY, YUV9, YVU9, " + "Y800, Y41P, Y41B, Y42B, IUY2 }") ) ); @@ -123,15 +123,15 @@ static GstStaticPadTemplate gst_colorspace_sink_template = GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_RGB "; " - GST_VIDEO_CAPS_BGR "; " - GST_VIDEO_CAPS_RGBx "; " - GST_VIDEO_CAPS_xRGB "; " - GST_VIDEO_CAPS_BGRx "; " - GST_VIDEO_CAPS_xBGR "; " - GST_VIDEO_CAPS_RGB_16 "; " - GST_VIDEO_CAPS_RGB_15 "; " - GST_VIDEO_CAPS_YUV ("{ I420, YV12, YUY2, YVYU, UYVY, YUV9, YVU9, " - "Y800, Y41P, Y41B, Y42B, IUY2 }") + GST_VIDEO_CAPS_BGR "; " + GST_VIDEO_CAPS_RGBx "; " + GST_VIDEO_CAPS_xRGB "; " + GST_VIDEO_CAPS_BGRx "; " + GST_VIDEO_CAPS_xBGR "; " + GST_VIDEO_CAPS_RGB_16 "; " + GST_VIDEO_CAPS_RGB_15 "; " + GST_VIDEO_CAPS_YUV ("{ I420, YV12, YUY2, YVYU, UYVY, YUV9, YVU9, " + "Y800, Y41P, Y41B, Y42B, IUY2 }") ) ); @@ -154,16 +154,16 @@ colorspace_find_lcs_format (const GstCaps * caps) ((LCSFormat *) rgb_fmt)->type = LCS_FORMAT_RGB_PACKED; gst_structure_get_int (structure, "bpp", - &((LCSFormat *) rgb_fmt)->bits_per_pixel); + &((LCSFormat *) rgb_fmt)->bits_per_pixel); gst_structure_get_int (structure, "red_mask", &mask); lcs_utils_mask_to_shift (mask, &rgb_fmt->bits_per_component[LCS_R], - &rgb_fmt->component_bit_offset[LCS_R]); + &rgb_fmt->component_bit_offset[LCS_R]); gst_structure_get_int (structure, "green_mask", &mask); lcs_utils_mask_to_shift (mask, &rgb_fmt->bits_per_component[LCS_G], - &rgb_fmt->component_bit_offset[LCS_G]); + &rgb_fmt->component_bit_offset[LCS_G]); gst_structure_get_int (structure, "blue_mask", &mask); lcs_utils_mask_to_shift (mask, &rgb_fmt->bits_per_component[LCS_B], - &rgb_fmt->component_bit_offset[LCS_B]); + &rgb_fmt->component_bit_offset[LCS_B]); rgb_fmt->bits_per_component[LCS_A] = 0; rgb_fmt->component_bit_offset[LCS_A] = 0; gst_structure_get_int (structure, "endianness", &endianness); @@ -224,7 +224,7 @@ colorspace_setup_converter (GstColorspace * space, const GstCaps * from_caps, if (space->converter) { GST_DEBUG ("trying from " GST_FOURCC_FORMAT " to " GST_FOURCC_FORMAT, - GST_FOURCC_ARGS (from_space), GST_FOURCC_ARGS (to_space)); + GST_FOURCC_ARGS (from_space), GST_FOURCC_ARGS (to_space)); space->disabled = FALSE; return TRUE; } @@ -290,9 +290,9 @@ gst_colorspace_link (GstPad * pad, const GstCaps * caps) othercaps = gst_caps_copy (gst_pad_get_negotiated_caps (otherpad)); gst_caps_set_simple (othercaps, - "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, - "framerate", G_TYPE_DOUBLE, framerate, NULL); + "width", G_TYPE_INT, width, + "height", G_TYPE_INT, height, + "framerate", G_TYPE_DOUBLE, framerate, NULL); ret = gst_pad_try_set_caps (otherpad, othercaps); if (!GST_PAD_LINK_SUCCESSFUL (ret)) { @@ -329,9 +329,10 @@ gst_colorspace_get_type (void) 0, (GInstanceInitFunc) gst_colorspace_init, }; + colorspace_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstColorspaceLCS", - &colorspace_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstColorspaceLCS", + &colorspace_info, 0); } return colorspace_type; } @@ -407,13 +408,13 @@ gst_colorspace_chain (GstPad * pad, GstData * _data) unsigned long size; lcs_format_buffer_size (lcs_converter_get_dest_format (space->converter), - space->width, space->height, &size); + space->width, space->height, &size); outbuf = gst_pad_alloc_buffer (space->srcpad, GST_BUFFER_OFFSET_NONE, size); lcs_convert_auto (space->converter, - GST_BUFFER_DATA (buf), - GST_BUFFER_DATA (outbuf), space->width, space->height); + GST_BUFFER_DATA (buf), + GST_BUFFER_DATA (outbuf), space->width, space->height); GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf); GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf); diff --git a/ext/libfame/gstlibfame.c b/ext/libfame/gstlibfame.c index 43e0e487b3..d438a61c41 100644 --- a/ext/libfame/gstlibfame.c +++ b/ext/libfame/gstlibfame.c @@ -66,23 +66,23 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-raw-yuv, " - "format = (fourcc) I420, " - "width = (int) [ 16, 4096 ], " - "height = (int) [ 16, 4096 ], " - "framerate = (double) { 23.976024, 24.0, 25.0, 29.970030, 30.0, " - " 50.0, 59.940060, 60.0 }") + "format = (fourcc) I420, " + "width = (int) [ 16, 4096 ], " + "height = (int) [ 16, 4096 ], " + "framerate = (double) { 23.976024, 24.0, 25.0, 29.970030, 30.0, " + " 50.0, 59.940060, 60.0 }") ); static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/mpeg, " - "mpegversion = (int) { 1, 4 }, " - "systemstream = (boolean) FALSE, " - "width = (int) [ 16, 4096 ], " - "height = (int) [ 16, 4096 ], " - "framerate = (double) { 23.976024, 24.0, 25.0, 29.970030, 30.0, " - " 50.0, 59.940060, 60.0 }") + "mpegversion = (int) { 1, 4 }, " + "systemstream = (boolean) FALSE, " + "width = (int) [ 16, 4096 ], " + "height = (int) [ 16, 4096 ], " + "framerate = (double) { 23.976024, 24.0, 25.0, 29.970030, 30.0, " + " 50.0, 59.940060, 60.0 }") ); #define MAX_FRAME_RATES 9 @@ -90,7 +90,8 @@ typedef struct { gint num; gint den; -} frame_rate_entry; +} +frame_rate_entry; static const frame_rate_entry frame_rates[] = { {0, 0}, @@ -115,12 +116,12 @@ framerate_to_index (gfloat fps) idx = i; } else { gfloat old_diff = fabs ((1. * frame_rates[idx].num / - frame_rates[idx].den) - fps), - new_diff = fabs ((1. * frame_rates[i].num / - frame_rates[i].den) - fps); + frame_rates[idx].den) - fps), + new_diff = fabs ((1. * frame_rates[i].num / + frame_rates[i].den) - fps); if (new_diff < old_diff) { - idx = i; + idx = i; } } } @@ -161,8 +162,9 @@ gst_fameenc_get_type (void) 0, (GInstanceInitFunc) gst_fameenc_init, }; + fameenc_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstFameEnc", &fameenc_info, 0); + "GstFameEnc", &fameenc_info, 0); } return fameenc_type; } @@ -214,8 +216,8 @@ gst_fameenc_class_init (GstFameEncClass * klass) walk = context->type_list; while (walk) { props = - g_list_insert_sorted (props, walk, - (GCompareFunc) gst_fameenc_item_compare); + g_list_insert_sorted (props, walk, + (GCompareFunc) gst_fameenc_item_compare); walk = walk->next; } @@ -239,21 +241,21 @@ gst_fameenc_class_init (GstFameEncClass * klass) do { if (strstr (walk->type, "/")) { - GEnumValue value; + GEnumValue value; - if (current_default == walk->item) - default_index = current_value; + if (current_default == walk->item) + default_index = current_value; - value.value = current_value++; - value.value_name = g_strdup (walk->type); - value.value_nick = g_strdup (walk->item->name); + value.value = current_value++; + value.value_name = g_strdup (walk->type); + value.value_nick = g_strdup (walk->item->name); - g_array_append_val (array, value); + g_array_append_val (array, value); } props_walk = g_list_next (props_walk); if (props_walk) - walk = (fame_list_t *) props_walk->data; + walk = (fame_list_t *) props_walk->data; } while (props_walk && !strncmp (walk->type, current_type, current_len)); @@ -262,43 +264,43 @@ gst_fameenc_class_init (GstFameEncClass * klass) GParamSpec *pspec; type = - g_enum_register_static (g_strdup_printf ("GstFameEnc_%s", - current_type), (GEnumValue *) array->data); + g_enum_register_static (g_strdup_printf ("GstFameEnc_%s", + current_type), (GEnumValue *) array->data); pspec = - g_param_spec_enum (current_type, current_type, - g_strdup_printf ("The FAME \"%s\" object", current_type), type, - default_index, G_PARAM_READWRITE); + g_param_spec_enum (current_type, current_type, + g_strdup_printf ("The FAME \"%s\" object", current_type), type, + default_index, G_PARAM_READWRITE); g_param_spec_set_qdata (pspec, fame_object_name, (gpointer) current_type); g_object_class_install_property (G_OBJECT_CLASS (klass), current_prop++, - pspec); + pspec); } } g_object_class_install_property (gobject_class, ARG_BITRATE, g_param_spec_int ("bitrate", "Bitrate", "Target bitrate (0 = VBR)", - 0, 5000000, 0, G_PARAM_READWRITE)); + 0, 5000000, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_QUALITY, g_param_spec_int ("quality", "Quality", - "Percentage of quality of compression (versus size)", 0, 100, 75, - G_PARAM_READWRITE)); + "Percentage of quality of compression (versus size)", 0, 100, 75, + G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_PATTERN, g_param_spec_string ("pattern", "Pattern", - "Encoding pattern of I, P, and B frames", "IPPPPPPPPPPP", - G_PARAM_READWRITE)); + "Encoding pattern of I, P, and B frames", "IPPPPPPPPPPP", + G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_FRAMES_PER_SEQUENCE, g_param_spec_int ("frames_per_sequence", "Frames Per Sequence", - "The number of frames in one sequence", 1, G_MAXINT, 12, - G_PARAM_READWRITE)); + "The number of frames in one sequence", 1, G_MAXINT, 12, + G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_FAME_VERBOSE, g_param_spec_boolean ("fame_verbose", "Fame Verbose", - "Make FAME produce verbose output", FALSE, G_PARAM_READWRITE)); + "Make FAME produce verbose output", FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_BUFFER_SIZE, g_param_spec_int ("buffer_size", "Buffer Size", - "Set the decoding output buffer size", 0, 1024 * 1024, - FAMEENC_BUFFER_SIZE, G_PARAM_READWRITE)); + "Set the decoding output buffer size", 0, 1024 * 1024, + FAMEENC_BUFFER_SIZE, G_PARAM_READWRITE)); } static GstPadLinkReturn @@ -386,13 +388,13 @@ gst_fameenc_init (GstFameEnc * fameenc) fameenc->fp.bitrate = 0; fameenc->fp.quality = 75; fameenc->fp.frame_rate_num = 25; - fameenc->fp.frame_rate_den = 1; /* avoid floating point exceptions */ + fameenc->fp.frame_rate_den = 1; /* avoid floating point exceptions */ fameenc->fp.frames_per_sequence = 12; fameenc->pattern = g_strdup ("IPPPPPPPPPP"); /* allocate space for the buffer */ - fameenc->buffer_size = FAMEENC_BUFFER_SIZE; /* FIXME */ + fameenc->buffer_size = FAMEENC_BUFFER_SIZE; /* FIXME */ fameenc->buffer = (unsigned char *) g_malloc (fameenc->buffer_size); fameenc->next_time = 0; @@ -454,12 +456,12 @@ gst_fameenc_chain (GstPad * pad, GstData * _data) /* FIXME: safeguard, remove me when a better way is found */ if (length > FAMEENC_BUFFER_SIZE) g_warning - ("FAMEENC_BUFFER_SIZE is defined too low, encoded slice has size %d !\n", - length); + ("FAMEENC_BUFFER_SIZE is defined too low, encoded slice has size %d !\n", + length); if (!fameenc->time_interval) { fameenc->time_interval = - GST_SECOND * fameenc->fp.frame_rate_den / fameenc->fp.frame_rate_num; + GST_SECOND * fameenc->fp.frame_rate_den / fameenc->fp.frame_rate_num; } fameenc->next_time += fameenc->time_interval; @@ -471,7 +473,7 @@ gst_fameenc_chain (GstPad * pad, GstData * _data) GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf); GST_DEBUG ("gst_fameenc_chain: pushing buffer of size %d", - GST_BUFFER_SIZE (outbuf)); + GST_BUFFER_SIZE (outbuf)); gst_pad_push (fameenc->srcpad, GST_DATA (outbuf)); } @@ -492,7 +494,7 @@ gst_fameenc_set_property (GObject * object, guint prop_id, if (fameenc->initialized) { GST_DEBUG - ("error: fameenc encoder already initialized, cannot set properties !"); + ("error: fameenc encoder already initialized, cannot set properties !"); return; } @@ -518,17 +520,17 @@ gst_fameenc_set_property (GObject * object, guint prop_id, break; default: if (prop_id >= ARG_FAME_PROPS_START) { - gchar *name; - gint index = g_value_get_enum (value); - GEnumValue *values; + gchar *name; + gint index = g_value_get_enum (value); + GEnumValue *values; - values = G_ENUM_CLASS (g_type_class_ref (pspec->value_type))->values; - name = (gchar *) g_param_spec_get_qdata (pspec, fame_object_name); + values = G_ENUM_CLASS (g_type_class_ref (pspec->value_type))->values; + name = (gchar *) g_param_spec_get_qdata (pspec, fame_object_name); - fame_register (fameenc->fc, name, fame_get_object (fameenc->fc, - values[index].value_name)); + fame_register (fameenc->fc, name, fame_get_object (fameenc->fc, + values[index].value_name)); } else - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } @@ -563,23 +565,23 @@ gst_fameenc_get_property (GObject * object, guint prop_id, break; default: if (prop_id >= ARG_FAME_PROPS_START) { - gchar *name; - gint index = 0; - GEnumValue *values; - fame_object_t *f_object; + gchar *name; + gint index = 0; + GEnumValue *values; + fame_object_t *f_object; - values = G_ENUM_CLASS (g_type_class_ref (pspec->value_type))->values; - name = (gchar *) g_param_spec_get_qdata (pspec, fame_object_name); + values = G_ENUM_CLASS (g_type_class_ref (pspec->value_type))->values; + name = (gchar *) g_param_spec_get_qdata (pspec, fame_object_name); - f_object = fame_get_object (fameenc->fc, name); + f_object = fame_get_object (fameenc->fc, name); - while (values[index].value_name) { - if (!strcmp (values[index].value_nick, f_object->name)) { - g_value_set_enum (value, index); - return; - } - index++; - } + while (values[index].value_name) { + if (!strcmp (values[index].value_nick, f_object->name)) { + g_value_set_enum (value, index); + return; + } + index++; + } } G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; diff --git a/ext/mpeg2enc/gstmpeg2enc.cc b/ext/mpeg2enc/gstmpeg2enc.cc index 1f6e582a5a..ee64d42041 100644 --- a/ext/mpeg2enc/gstmpeg2enc.cc +++ b/ext/mpeg2enc/gstmpeg2enc.cc @@ -33,7 +33,8 @@ static void add_fps (GstCaps * caps) { GstStructure *structure = gst_caps_get_structure (caps, 0); - GValue list = { 0 }, fps = { + GValue list = { 0 }, fps = + { 0}; gdouble fpss[] = { 24.0 / 1.001, 24.0, 25.0, 30.0 / 1.001, 30.0, 50.0, @@ -61,10 +62,10 @@ sink_templ (void) GstCaps *caps; caps = gst_caps_new_simple ("video/x-raw-yuv", - "format", GST_TYPE_FOURCC, - GST_MAKE_FOURCC ('I', '4', '2', '0'), - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, NULL); + "format", GST_TYPE_FOURCC, + GST_MAKE_FOURCC ('I', '4', '2', '0'), + "width", GST_TYPE_INT_RANGE, 16, 4096, + "height", GST_TYPE_INT_RANGE, 16, 4096, NULL); add_fps (caps); templ = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, caps); @@ -82,10 +83,10 @@ src_templ (void) GstCaps *caps; caps = gst_caps_new_simple ("video/mpeg", - "systemstream", G_TYPE_BOOLEAN, FALSE, - "mpegversion", GST_TYPE_INT_RANGE, 1, 2, - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, NULL); + "systemstream", G_TYPE_BOOLEAN, FALSE, + "mpegversion", GST_TYPE_INT_RANGE, 1, 2, + "width", GST_TYPE_INT_RANGE, 16, 4096, + "height", GST_TYPE_INT_RANGE, 16, 4096, NULL); add_fps (caps); templ = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, caps); @@ -132,8 +133,8 @@ gst_mpeg2enc_get_type (void) }; gst_mpeg2enc_type = - g_type_register_static (GST_TYPE_ELEMENT, - "GstMpeg2enc", &gst_mpeg2enc_info, (GTypeFlags) 0); + g_type_register_static (GST_TYPE_ELEMENT, + "GstMpeg2enc", &gst_mpeg2enc_info, (GTypeFlags) 0); } return gst_mpeg2enc_type; @@ -147,7 +148,7 @@ gst_mpeg2enc_base_init (GstMpeg2encClass * klass) "Codec/Video/Encoder", "High-quality MPEG-1/2 video encoder", "Andrew Stevens \n" - "Ronald Bultje " + "Ronald Bultje " }; GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -199,13 +200,13 @@ gst_mpeg2enc_init (GstMpeg2enc * enc) enc->sinkpad = gst_pad_new_from_template (gst_element_class_get_pad_template (klass, - "sink"), "sink"); + "sink"), "sink"); gst_pad_set_link_function (enc->sinkpad, gst_mpeg2enc_sink_link); gst_element_add_pad (element, enc->sinkpad); enc->srcpad = gst_pad_new_from_template (gst_element_class_get_pad_template (klass, - "src"), "src"); + "src"), "src"); gst_pad_use_explicit_caps (enc->srcpad); gst_element_add_pad (element, enc->srcpad); @@ -232,13 +233,13 @@ gst_mpeg2enc_loop (GstElement * element) if (!(caps = GST_PAD_CAPS (enc->sinkpad))) { GST_ELEMENT_ERROR (element, CORE, NEGOTIATION, (NULL), - ("format wasn't negotiated before loop function")); + ("format wasn't negotiated before loop function")); return; } /* create new encoder with these settings */ enc->encoder = new GstMpeg2Encoder (enc->options, enc->sinkpad, - caps, enc->srcpad); + caps, enc->srcpad); /* and set caps on other side */ othercaps = enc->encoder->getFormat (); diff --git a/ext/mpeg2enc/gstmpeg2encoptions.cc b/ext/mpeg2enc/gstmpeg2encoptions.cc index 8b6e776551..0d48ed29ae 100644 --- a/ext/mpeg2enc/gstmpeg2encoptions.cc +++ b/ext/mpeg2enc/gstmpeg2encoptions.cc @@ -96,7 +96,7 @@ gst_mpeg2enc_format_get_type (void) }; mpeg2enc_format_type = - g_enum_register_static ("GstMpeg2encFormat", mpeg2enc_formats); + g_enum_register_static ("GstMpeg2encFormat", mpeg2enc_formats); } return mpeg2enc_format_type; @@ -125,7 +125,7 @@ gst_mpeg2enc_framerate_get_type (void) }; mpeg2enc_framerate_type = - g_enum_register_static ("GstMpeg2encFramerate", mpeg2enc_framerates); + g_enum_register_static ("GstMpeg2encFramerate", mpeg2enc_framerates); } return mpeg2enc_framerate_type; @@ -150,7 +150,7 @@ gst_mpeg2enc_aspect_get_type (void) }; mpeg2enc_aspect_type = - g_enum_register_static ("GstMpeg2encAspect", mpeg2enc_aspects); + g_enum_register_static ("GstMpeg2encAspect", mpeg2enc_aspects); } return mpeg2enc_aspect_type; @@ -174,8 +174,8 @@ gst_mpeg2enc_interlace_mode_get_type (void) }; mpeg2enc_interlace_mode_type = - g_enum_register_static ("GstMpeg2encInterlaceMode", - mpeg2enc_interlace_modes); + g_enum_register_static ("GstMpeg2encInterlaceMode", + mpeg2enc_interlace_modes); } return mpeg2enc_interlace_mode_type; @@ -197,19 +197,19 @@ gst_mpeg2enc_quantisation_matrix_get_type (void) if (!mpeg2enc_quantisation_matrix_type) { static const GEnumValue mpeg2enc_quantisation_matrixes[] = { {GST_MPEG2ENC_QUANTISATION_MATRIX_DEFAULT, - "0", "Default"}, + "0", "Default"}, {GST_MPEG2ENC_QUANTISATION_MATRIX_HI_RES, - "1", "High resolution"}, + "1", "High resolution"}, {GST_MPEG2ENC_QUANTISATION_MATRIX_KVCD, - "2", "KVCD"}, + "2", "KVCD"}, {GST_MPEG2ENC_QUANTISATION_MATRIX_TMPGENC, - "3", "TMPGEnc"}, + "3", "TMPGEnc"}, {0, NULL, NULL}, }; mpeg2enc_quantisation_matrix_type = - g_enum_register_static ("GstMpeg2encQuantisationMatrix", - mpeg2enc_quantisation_matrixes); + g_enum_register_static ("GstMpeg2encQuantisationMatrix", + mpeg2enc_quantisation_matrixes); } return mpeg2enc_quantisation_matrix_type; @@ -233,7 +233,7 @@ gst_mpeg2enc_video_norm_get_type (void) }; mpeg2enc_video_norm_type = - g_enum_register_static ("GstMpeg2encVideoNorm", mpeg2enc_video_norms); + g_enum_register_static ("GstMpeg2encVideoNorm", mpeg2enc_video_norms); } return mpeg2enc_video_norm_type; @@ -256,8 +256,8 @@ gst_mpeg2enc_playback_field_order_get_type (void) }; mpeg2enc_playback_field_order_type = - g_enum_register_static ("GstMpeg2encPlaybackFieldOrders", - mpeg2enc_playback_field_orders); + g_enum_register_static ("GstMpeg2encPlaybackFieldOrders", + mpeg2enc_playback_field_orders); } return mpeg2enc_playback_field_order_type; @@ -288,160 +288,160 @@ GstMpeg2EncOptions::initProperties (GObjectClass * klass) /* encoding profile */ g_object_class_install_property (klass, ARG_FORMAT, g_param_spec_enum ("format", "Format", "Encoding profile format", - GST_TYPE_MPEG2ENC_FORMAT, 0, (GParamFlags) G_PARAM_READWRITE)); + GST_TYPE_MPEG2ENC_FORMAT, 0, (GParamFlags) G_PARAM_READWRITE)); /* input/output stream overrides */ g_object_class_install_property (klass, ARG_FRAMERATE, g_param_spec_enum ("framerate", "Framerate", "Output framerate", - GST_TYPE_MPEG2ENC_FRAMERATE, 0, (GParamFlags) G_PARAM_READWRITE)); + GST_TYPE_MPEG2ENC_FRAMERATE, 0, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_ASPECT, g_param_spec_enum ("aspect", "Aspect", "Display aspect ratio", - GST_TYPE_MPEG2ENC_ASPECT, 0, (GParamFlags) G_PARAM_READWRITE)); + GST_TYPE_MPEG2ENC_ASPECT, 0, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_INTERLACE_MODE, g_param_spec_enum ("interlace-mode", "Interlace mode", - "MPEG-2 motion estimation and encoding modes", - GST_TYPE_MPEG2ENC_INTERLACE_MODE, 0, - (GParamFlags) G_PARAM_READWRITE)); + "MPEG-2 motion estimation and encoding modes", + GST_TYPE_MPEG2ENC_INTERLACE_MODE, 0, + (GParamFlags) G_PARAM_READWRITE)); /* general encoding stream options */ g_object_class_install_property (klass, ARG_BITRATE, g_param_spec_int ("bitrate", "Bitrate", "Compressed video bitrate (kbps)", - 0, 10 * 1024, 1125, (GParamFlags) G_PARAM_READWRITE)); + 0, 10 * 1024, 1125, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_NONVIDEO_BITRATE, g_param_spec_int ("non-video-bitrate", "Non-video bitrate", - "Assumed bitrate of non-video for sequence splitting (kbps)", - 0, 10 * 1024, 0, (GParamFlags) G_PARAM_READWRITE)); + "Assumed bitrate of non-video for sequence splitting (kbps)", + 0, 10 * 1024, 0, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_QUANTISATION, g_param_spec_int ("quantisation", "Quantisation", - "Quantisation factor (0=default, 1=best, 31=worst)", - 0, 31, 0, (GParamFlags) G_PARAM_READWRITE)); + "Quantisation factor (0=default, 1=best, 31=worst)", + 0, 31, 0, (GParamFlags) G_PARAM_READWRITE)); /* stills options */ g_object_class_install_property (klass, ARG_VCD_STILL_SIZE, g_param_spec_int ("vcd-still-size", "VCD stills size", - "Size of VCD stills (in kB)", - 0, 512, 0, (GParamFlags) G_PARAM_READWRITE)); + "Size of VCD stills (in kB)", + 0, 512, 0, (GParamFlags) G_PARAM_READWRITE)); /* motion estimation options */ g_object_class_install_property (klass, ARG_MOTION_SEARCH_RADIUS, g_param_spec_int ("motion-search-radius", "Motion search radius", - "Motion compensation search radius", - 0, 32, 16, (GParamFlags) G_PARAM_READWRITE)); + "Motion compensation search radius", + 0, 32, 16, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_REDUCTION_4_4, g_param_spec_int ("reduction-4x4", "4x4 reduction", - "Reduction factor for 4x4 subsampled candidate motion estimates" - " (1=max. quality, 4=max. speed)", - 1, 4, 2, (GParamFlags) G_PARAM_READWRITE)); + "Reduction factor for 4x4 subsampled candidate motion estimates" + " (1=max. quality, 4=max. speed)", + 1, 4, 2, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_REDUCTION_2_2, g_param_spec_int ("reduction-2x2", "2x2 reduction", - "Reduction factor for 2x2 subsampled candidate motion estimates" - " (1=max. quality, 4=max. speed)", - 1, 4, 3, (GParamFlags) G_PARAM_READWRITE)); + "Reduction factor for 2x2 subsampled candidate motion estimates" + " (1=max. quality, 4=max. speed)", + 1, 4, 3, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_UNIT_COEFF_ELIM, g_param_spec_int ("unit-coeff-elim", "Unit coefficience elimination", - "How agressively small-unit picture blocks should be skipped", - -40, 40, 0, (GParamFlags) G_PARAM_READWRITE)); + "How agressively small-unit picture blocks should be skipped", + -40, 40, 0, (GParamFlags) G_PARAM_READWRITE)); /* GOP options */ g_object_class_install_property (klass, ARG_MIN_GOP_SIZE, g_param_spec_int ("min-gop-size", "Min. GOP size", - "Minimal size per Group-of-Pictures (-1=default)", - -1, 250, 0, (GParamFlags) G_PARAM_READWRITE)); + "Minimal size per Group-of-Pictures (-1=default)", + -1, 250, 0, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_MAX_GOP_SIZE, g_param_spec_int ("max-gop-size", "Max. GOP size", - "Maximal size per Group-of-Pictures (-1=default)", - -1, 250, 0, (GParamFlags) G_PARAM_READWRITE)); + "Maximal size per Group-of-Pictures (-1=default)", + -1, 250, 0, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_CLOSED_GOP, g_param_spec_boolean ("closed-gop", "Closed GOP", - "All Group-of-Pictures are closed (for multi-angle DVDs)", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + "All Group-of-Pictures are closed (for multi-angle DVDs)", + FALSE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_FORCE_B_B_P, g_param_spec_boolean ("force-b-b-p", "Force B-B-P", - "Force two B frames between I/P frames when closing GOP boundaries", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + "Force two B frames between I/P frames when closing GOP boundaries", + FALSE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_B_PER_REFFRAME, g_param_spec_int ("b-per-refframe", "B per ref. frame", - "Number of B frames between each I/P frame", - 0, 2, 2, (GParamFlags) G_PARAM_READWRITE)); + "Number of B frames between each I/P frame", + 0, 2, 2, (GParamFlags) G_PARAM_READWRITE)); /* quantisation options */ g_object_class_install_property (klass, ARG_QUANTISATION_REDUCTION, g_param_spec_float ("quantisation-reduction", "Quantisation reduction", - "Max. quantisation reduction for highly active blocks", - -4., 10., 0., (GParamFlags) G_PARAM_READWRITE)); + "Max. quantisation reduction for highly active blocks", + -4., 10., 0., (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_QUANT_REDUCTION_MAX_VAR, g_param_spec_float ("quant-reduction-max-var", - "Max. quant. reduction variance", - "Maximal luma variance below which quantisation boost is used", 0., - 2500., 0., (GParamFlags) G_PARAM_READWRITE)); + "Max. quant. reduction variance", + "Maximal luma variance below which quantisation boost is used", 0., + 2500., 0., (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_INTRA_DC_PRECISION, g_param_spec_int ("intra-dc-prec", "Intra. DC precision", - "Number of bits precision for DC (base colour) in MPEG-2 blocks", 8, - 11, 9, (GParamFlags) G_PARAM_READWRITE)); + "Number of bits precision for DC (base colour) in MPEG-2 blocks", 8, + 11, 9, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_REDUCE_HF, g_param_spec_float ("reduce-hf", "Reduce HF", - "How much to reduce high-frequency resolution (by increasing quantisation)", - 0., 2., 0., (GParamFlags) G_PARAM_READWRITE)); + "How much to reduce high-frequency resolution (by increasing quantisation)", + 0., 2., 0., (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_KEEP_HF, g_param_spec_boolean ("keep-hf", "Keep HF", - "Maximize high-frequency resolution (for high-quality sources)", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + "Maximize high-frequency resolution (for high-quality sources)", + FALSE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_QUANTISATION_MATRIX, g_param_spec_enum ("quant-matrix", "Quant. matrix", - "Quantisation matrix to use for encoding", - GST_TYPE_MPEG2ENC_QUANTISATION_MATRIX, 0, - (GParamFlags) G_PARAM_READWRITE)); + "Quantisation matrix to use for encoding", + GST_TYPE_MPEG2ENC_QUANTISATION_MATRIX, 0, + (GParamFlags) G_PARAM_READWRITE)); /* general options */ g_object_class_install_property (klass, ARG_BUFSIZE, g_param_spec_int ("bufsize", "Decoder buf. size", - "Target decoders video buffer size (kB)", - 20, 4000, 46, (GParamFlags) G_PARAM_READWRITE)); + "Target decoders video buffer size (kB)", + 20, 4000, 46, (GParamFlags) G_PARAM_READWRITE)); /* header flag settings */ g_object_class_install_property (klass, ARG_VIDEO_NORM, g_param_spec_enum ("norm", "Norm", - "Tag output for specific video norm", - GST_TYPE_MPEG2ENC_VIDEO_NORM, 0, (GParamFlags) G_PARAM_READWRITE)); + "Tag output for specific video norm", + GST_TYPE_MPEG2ENC_VIDEO_NORM, 0, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_SEQUENCE_LENGTH, g_param_spec_int ("sequence-length", "Sequence length", - "Place a sequence boundary after each MB (0=disable)", - 0, 10 * 1024, 0, (GParamFlags) G_PARAM_READWRITE)); + "Place a sequence boundary after each MB (0=disable)", + 0, 10 * 1024, 0, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_3_2_PULLDOWN, g_param_spec_boolean ("pulldown-3-2", "3-2 pull down", - "Generate header flags for 3-2 pull down 24fps movies", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + "Generate header flags for 3-2 pull down 24fps movies", + FALSE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_SEQUENCE_HEADER_EVERY_GOP, g_param_spec_boolean ("sequence-header-every-gop", - "Sequence hdr. every GOP", - "Include a sequence header in every GOP", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + "Sequence hdr. every GOP", + "Include a sequence header in every GOP", + FALSE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_DUMMY_SVCD_SOF, g_param_spec_boolean ("dummy-svcd-sof", "Dummy SVCD SOF", - "Generate dummy SVCD scan-data (for vcdimager)", - TRUE, (GParamFlags) G_PARAM_READWRITE)); + "Generate dummy SVCD scan-data (for vcdimager)", + TRUE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_PLAYBACK_FIELD_ORDER, g_param_spec_enum ("playback-field-order", "Playback field order", - "Force specific playback field order", - GST_TYPE_MPEG2ENC_PLAYBACK_FIELD_ORDER, Y4M_UNKNOWN, - (GParamFlags) G_PARAM_READWRITE)); + "Force specific playback field order", + GST_TYPE_MPEG2ENC_PLAYBACK_FIELD_ORDER, Y4M_UNKNOWN, + (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_CORRECT_SVCD_HDS, g_param_spec_boolean ("correct-svcd-hds", "Correct SVCD hor. size", - "Force SVCD width to 480 instead of 540/720", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + "Force SVCD width to 480 instead of 540/720", + FALSE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_ALTSCAN_MPEG2, g_param_spec_boolean ("altscan-mpeg2", "Alt. MPEG-2 scan", - "Alternate MPEG-2 block scanning. Disabling this might " - "make buggy players play SVCD streams", - TRUE, (GParamFlags) G_PARAM_READWRITE)); + "Alternate MPEG-2 block scanning. Disabling this might " + "make buggy players play SVCD streams", + TRUE, (GParamFlags) G_PARAM_READWRITE)); #if 0 "--dxr2-hack" #endif /* dangerous/experimental stuff */ g_object_class_install_property (klass, ARG_CONSTRAINTS, g_param_spec_boolean ("constraints", "Constraints", - "Use strict video resolution and bitrate checks", - TRUE, (GParamFlags) G_PARAM_READWRITE)); + "Use strict video resolution and bitrate checks", + TRUE, (GParamFlags) G_PARAM_READWRITE)); } /* @@ -520,18 +520,18 @@ GstMpeg2EncOptions::getProperty (guint prop_id, GValue * value) break; case ARG_QUANTISATION_MATRIX: switch (hf_quant) { - case 0: - g_value_set_enum (value, GST_MPEG2ENC_QUANTISATION_MATRIX_DEFAULT); - break; - case 2: - g_value_set_enum (value, GST_MPEG2ENC_QUANTISATION_MATRIX_HI_RES); - break; - case 3: - g_value_set_enum (value, GST_MPEG2ENC_QUANTISATION_MATRIX_KVCD); - break; - case 4: - g_value_set_enum (value, GST_MPEG2ENC_QUANTISATION_MATRIX_TMPGENC); - break; + case 0: + g_value_set_enum (value, GST_MPEG2ENC_QUANTISATION_MATRIX_DEFAULT); + break; + case 2: + g_value_set_enum (value, GST_MPEG2ENC_QUANTISATION_MATRIX_HI_RES); + break; + case 3: + g_value_set_enum (value, GST_MPEG2ENC_QUANTISATION_MATRIX_KVCD); + break; + case 4: + g_value_set_enum (value, GST_MPEG2ENC_QUANTISATION_MATRIX_TMPGENC); + break; } break; case ARG_BUFSIZE: @@ -636,26 +636,26 @@ GstMpeg2EncOptions::setProperty (guint prop_id, const GValue * value) case ARG_REDUCE_HF: hf_q_boost = g_value_get_float (value); if (hf_quant == 0 && hf_q_boost != 0.) - hf_quant = 1; + hf_quant = 1; break; case ARG_KEEP_HF: hf_quant = g_value_get_boolean (value) ? 2 : 0; break; case ARG_QUANTISATION_MATRIX: switch (g_value_get_enum (value)) { - case GST_MPEG2ENC_QUANTISATION_MATRIX_DEFAULT: - hf_quant = 0; - hf_q_boost = 0; - break; - case GST_MPEG2ENC_QUANTISATION_MATRIX_HI_RES: - hf_quant = 2; - break; - case GST_MPEG2ENC_QUANTISATION_MATRIX_KVCD: - hf_quant = 3; - break; - case GST_MPEG2ENC_QUANTISATION_MATRIX_TMPGENC: - hf_quant = 4; - break; + case GST_MPEG2ENC_QUANTISATION_MATRIX_DEFAULT: + hf_quant = 0; + hf_q_boost = 0; + break; + case GST_MPEG2ENC_QUANTISATION_MATRIX_HI_RES: + hf_quant = 2; + break; + case GST_MPEG2ENC_QUANTISATION_MATRIX_KVCD: + hf_quant = 3; + break; + case GST_MPEG2ENC_QUANTISATION_MATRIX_TMPGENC: + hf_quant = 4; + break; } break; case ARG_BUFSIZE: diff --git a/ext/mpeg2enc/gstmpeg2encpicturereader.cc b/ext/mpeg2enc/gstmpeg2encpicturereader.cc index be8789eea5..9ed8afc056 100644 --- a/ext/mpeg2enc/gstmpeg2encpicturereader.cc +++ b/ext/mpeg2enc/gstmpeg2encpicturereader.cc @@ -85,7 +85,9 @@ bool GstMpeg2EncPictureReader::LoadFrame () GstData * data; GstBuffer * - buf = NULL; + buf = + NULL; + gint i, x, @@ -93,10 +95,15 @@ bool GstMpeg2EncPictureReader::LoadFrame () n; guint8 * frame; + GstFormat - fmt = GST_FORMAT_DEFAULT; + fmt = + GST_FORMAT_DEFAULT; gint64 - pos = 0, tot = 0; + pos = + 0, + tot = + 0; gst_pad_query (GST_PAD_PEER (pad), GST_QUERY_POSITION, &fmt, &pos); gst_pad_query (GST_PAD_PEER (pad), GST_QUERY_TOTAL, &fmt, &tot); @@ -106,16 +113,16 @@ bool GstMpeg2EncPictureReader::LoadFrame () gst_pad_set_element_private (pad, NULL); } else if (!(data = gst_pad_pull (pad))) { GST_ELEMENT_ERROR (gst_pad_get_parent (pad), RESOURCE, READ, - (NULL), (NULL)); + (NULL), (NULL)); return true; } if (GST_IS_EVENT (data)) { if (GST_EVENT_TYPE (data) == GST_EVENT_EOS) { - gst_event_unref (GST_EVENT (data)); - return true; + gst_event_unref (GST_EVENT (data)); + return true; } else { - gst_pad_event_default (pad, GST_EVENT (data)); + gst_pad_event_default (pad, GST_EVENT (data)); } } else { buf = GST_BUFFER (data); diff --git a/ext/mplex/gstmplex.cc b/ext/mplex/gstmplex.cc index 8f2c93853f..9ec4a93143 100644 --- a/ext/mplex/gstmplex.cc +++ b/ext/mplex/gstmplex.cc @@ -39,7 +39,7 @@ GST_STATIC_PAD_TEMPLATE ("video_%d", GST_PAD_SINK, GST_PAD_REQUEST, GST_STATIC_CAPS ("video/mpeg, " - "mpegversion = (int) [ 1, 2 ], " "systemstream = (boolean) false") + "mpegversion = (int) [ 1, 2 ], " "systemstream = (boolean) false") ); static GstStaticPadTemplate audio_sink_templ = @@ -47,16 +47,16 @@ static GstStaticPadTemplate audio_sink_templ = GST_PAD_SINK, GST_PAD_REQUEST, GST_STATIC_CAPS ("audio/mpeg, " - "mpegversion = (int) 1, " - "layer = (int) [ 1, 2 ]; " - "audio/x-ac3; " - "audio/x-dts; " - "audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) TRUE, " - "width = (int) { 16, 20, 24 }, " - "depth = (int) { 16, 20, 24 }, " - "rate = (int) { 48000, 96000 }, " "channels = (int) [ 1, 6 ]") + "mpegversion = (int) 1, " + "layer = (int) [ 1, 2 ]; " + "audio/x-ac3; " + "audio/x-dts; " + "audio/x-raw-int, " + "endianness = (int) BYTE_ORDER, " + "signed = (boolean) TRUE, " + "width = (int) { 16, 20, 24 }, " + "depth = (int) { 16, 20, 24 }, " + "rate = (int) { 48000, 96000 }, " "channels = (int) [ 1, 6 ]") ); /* FIXME: subtitles */ @@ -99,8 +99,8 @@ gst_mplex_get_type (void) }; gst_mplex_type = - g_type_register_static (GST_TYPE_ELEMENT, - "GstMplex", &gst_mplex_info, (GTypeFlags) 0); + g_type_register_static (GST_TYPE_ELEMENT, + "GstMplex", &gst_mplex_info, (GTypeFlags) 0); } return gst_mplex_type; @@ -114,7 +114,7 @@ gst_mplex_base_init (GstMplexClass * klass) "Codec/Muxer", "High-quality MPEG/DVD/SVCD/VCD video/audio multiplexer", "Andrew Stevens \n" - "Ronald Bultje " + "Ronald Bultje " }; GstElementClass *element_class = GST_ELEMENT_CLASS (klass); @@ -191,7 +191,7 @@ gst_mplex_loop (GstElement * element) const GList *item; for (item = gst_element_get_pad_list (element); - item != NULL; item = item->next) { + item != NULL; item = item->next) { StreamKind type; GstMplexIBitStream *inputstream; JobStream *jobstream; @@ -202,16 +202,16 @@ gst_mplex_loop (GstElement * element) /* skip our source pad */ if (GST_PAD_DIRECTION (pad) == GST_PAD_SRC) - continue; + continue; /* create inputstream, assure we've got caps */ inputstream = new GstMplexIBitStream (pad); /* skip unnegotiated pads */ if (!(caps = GST_PAD_CAPS (pad))) { - delete inputstream; + delete inputstream; - continue; + continue; } /* get format */ @@ -219,41 +219,41 @@ gst_mplex_loop (GstElement * element) mime = gst_structure_get_name (structure); if (!strcmp (mime, "video/mpeg")) { - VideoParams *params; + VideoParams *params; - type = MPEG_VIDEO; + type = MPEG_VIDEO; - params = VideoParams::Default (mplex->job->mux_format); - mplex->job->video_param.push_back (params); - mplex->job->video_tracks++; + params = VideoParams::Default (mplex->job->mux_format); + mplex->job->video_param.push_back (params); + mplex->job->video_tracks++; } else if (!strcmp (mime, "audio/mpeg")) { - type = MPEG_AUDIO; - mplex->job->audio_tracks++; + type = MPEG_AUDIO; + mplex->job->audio_tracks++; } else if (!strcmp (mime, "audio/x-ac3")) { - type = AC3_AUDIO; - mplex->job->audio_tracks++; + type = AC3_AUDIO; + mplex->job->audio_tracks++; } else if (!strcmp (mime, "audio/x-dts")) { - type = DTS_AUDIO; - mplex->job->audio_tracks++; + type = DTS_AUDIO; + mplex->job->audio_tracks++; } else if (!strcmp (mime, "audio/x-raw-int")) { - LpcmParams *params; - gint bits, chans, rate; + LpcmParams *params; + gint bits, chans, rate; - type = LPCM_AUDIO; + type = LPCM_AUDIO; - /* set LPCM params */ - gst_structure_get_int (structure, "depth", &bits); - gst_structure_get_int (structure, "rate", &rate); - gst_structure_get_int (structure, "channels", &chans); - params = LpcmParams::Checked (rate, chans, bits); + /* set LPCM params */ + gst_structure_get_int (structure, "depth", &bits); + gst_structure_get_int (structure, "rate", &rate); + gst_structure_get_int (structure, "channels", &chans); + params = LpcmParams::Checked (rate, chans, bits); - mplex->job->lpcm_param.push_back (params); - mplex->job->audio_tracks++; - mplex->job->lpcm_tracks++; + mplex->job->lpcm_param.push_back (params); + mplex->job->audio_tracks++; + mplex->job->lpcm_tracks++; } else { - delete inputstream; + delete inputstream; - continue; + continue; } jobstream = new JobStream (inputstream, type); @@ -262,7 +262,7 @@ gst_mplex_loop (GstElement * element) if (!mplex->job->video_tracks && !mplex->job->audio_tracks) { GST_ELEMENT_ERROR (element, CORE, NEGOTIATION, (NULL), - ("no input video or audio tracks set up before loop function")); + ("no input video or audio tracks set up before loop function")); return; } diff --git a/ext/mplex/gstmplexibitstream.cc b/ext/mplex/gstmplexibitstream.cc index 612866f5d7..d749fe2a4e 100644 --- a/ext/mplex/gstmplexibitstream.cc +++ b/ext/mplex/gstmplexibitstream.cc @@ -53,7 +53,7 @@ IBitStream () if (!ReadIntoBuffer () && buffered == 0) { GST_ELEMENT_ERROR (gst_pad_get_parent (_pad), RESOURCE, READ, (NULL), - ("Failed to read from input pad %s", gst_pad_get_name (pad))); + ("Failed to read from input pad %s", gst_pad_get_name (pad))); } } @@ -70,6 +70,7 @@ size_t GstMplexIBitStream::ReadStreamBytes (uint8_t * buf, size_t size) { guint8 * data; + guint read; @@ -78,18 +79,19 @@ size_t GstMplexIBitStream::ReadStreamBytes (uint8_t * buf, size_t size) if ((read = gst_bytestream_peek_bytes (bs, &data, size)) != size) { GstEvent * - event; + event; + guint - pending; + pending; gst_bytestream_get_status (bs, &pending, &event); if (event) { switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_EOS: - eos = TRUE; - break; - default: - break; + case GST_EVENT_EOS: + eos = TRUE; + break; + default: + break; } gst_event_unref (event); } diff --git a/ext/mplex/gstmplexjob.cc b/ext/mplex/gstmplexjob.cc index 8ff23bdab5..f13aa36a01 100644 --- a/ext/mplex/gstmplexjob.cc +++ b/ext/mplex/gstmplexjob.cc @@ -68,7 +68,7 @@ gst_mplex_format_get_type (void) }; mplex_format_type = - g_enum_register_static ("GstMplexFormat", mplex_formats); + g_enum_register_static ("GstMplexFormat", mplex_formats); } return mplex_format_type; @@ -94,52 +94,53 @@ GstMplexJob::initProperties (GObjectClass * klass) /* encoding profile */ g_object_class_install_property (klass, ARG_FORMAT, g_param_spec_enum ("format", "Format", "Encoding profile format", - GST_TYPE_MPLEX_FORMAT, 0, (GParamFlags) G_PARAM_READWRITE)); + GST_TYPE_MPLEX_FORMAT, 0, (GParamFlags) G_PARAM_READWRITE)); /* total stream datarate. Normally, this shouldn't be needed, but * some DVD/VCD/SVCD players really need strict values to handle * the created files correctly. */ g_object_class_install_property (klass, ARG_MUX_BITRATE, g_param_spec_int ("mux-bitrate", "Mux. bitrate", - "Bitrate of output stream in kbps (0 = autodetect)", - 0, 15 * 1024, 0, (GParamFlags) G_PARAM_READWRITE)); + "Bitrate of output stream in kbps (0 = autodetect)", + 0, 15 * 1024, 0, (GParamFlags) G_PARAM_READWRITE)); #if 0 { - "video-buffer", 1, 0, 'b'}, + "video-buffer", 1, 0, 'b'} + , #endif /* some boolean stuff for headers */ g_object_class_install_property (klass, ARG_VBR, g_param_spec_boolean ("vbr", "VBR", - "Whether the input video stream is variable bitrate", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + "Whether the input video stream is variable bitrate", + FALSE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_SYSTEM_HEADERS, g_param_spec_boolean ("system-headers", "System headers", - "Create system header in every pack for generic formats", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + "Create system header in every pack for generic formats", + FALSE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (klass, ARG_SPLIT_SEQUENCE, g_param_spec_boolean ("split-sequence", "Split sequence", - "Simply split a sequence across files " - "(rather than building run-out/run-in)", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + "Simply split a sequence across files " + "(rather than building run-out/run-in)", + FALSE, (GParamFlags) G_PARAM_READWRITE)); /* size of a segment (followed by EOS) */ g_object_class_install_property (klass, ARG_SEGMENT_SIZE, g_param_spec_int ("max-segment-size", "Max. segment size", - "Max. size per segment/file in MB (0 = unlimited)", - 0, 10 * 1024, 0, (GParamFlags) G_PARAM_READWRITE)); + "Max. size per segment/file in MB (0 = unlimited)", + 0, 10 * 1024, 0, (GParamFlags) G_PARAM_READWRITE)); /* packets per pack (generic formats) */ g_object_class_install_property (klass, ARG_PACKETS_PER_PACK, g_param_spec_int ("packets-per-pack", "Packets per pack", - "Number of packets per pack for generic formats", - 1, 100, 1, (GParamFlags) G_PARAM_READWRITE)); + "Number of packets per pack for generic formats", + 1, 100, 1, (GParamFlags) G_PARAM_READWRITE)); /* size of one sector */ g_object_class_install_property (klass, ARG_SECTOR_SIZE, g_param_spec_int ("sector-size", "Sector size", - "Specify sector size in bytes for generic formats", - 256, 16384, 2048, (GParamFlags) G_PARAM_READWRITE)); + "Specify sector size in bytes for generic formats", + 256, 16384, 2048, (GParamFlags) G_PARAM_READWRITE)); } /* diff --git a/ext/musicbrainz/gsttrm.c b/ext/musicbrainz/gsttrm.c index 484be50fd1..cd5920ee73 100644 --- a/ext/musicbrainz/gsttrm.c +++ b/ext/musicbrainz/gsttrm.c @@ -46,11 +46,11 @@ GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (bool) TRUE, " - "width = (int) { 8, 16 }, " - "depth = (int) { 8, 16 }, " - "rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 2 ]") + "endianness = (int) BYTE_ORDER, " + "signed = (bool) TRUE, " + "width = (int) { 8, 16 }, " + "depth = (int) { 8, 16 }, " + "rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 2 ]") ); @@ -58,11 +58,11 @@ GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (bool) TRUE, " - "width = (int) { 8, 16 }, " - "depth = (int) { 8, 16 }, " - "rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 2 ]") + "endianness = (int) BYTE_ORDER, " + "signed = (bool) TRUE, " + "width = (int) { 8, 16 }, " + "depth = (int) { 8, 16 }, " + "rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 2 ]") ); @@ -102,8 +102,9 @@ gst_musicbrainz_get_type (void) 0, (GInstanceInitFunc) gst_musicbrainz_init, }; + musicbrainz_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstMusicBrainz", &musicbrainz_info, 0); + "GstMusicBrainz", &musicbrainz_info, 0); } return musicbrainz_type; } @@ -143,10 +144,10 @@ gst_musicbrainz_class_init (GstMusicBrainzClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SIGNATURE, g_param_spec_string ("signature", "signature", "signature", - NULL, G_PARAM_READABLE)); + NULL, G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ASCII_SIGNATURE, g_param_spec_string ("ascii_signature", "ascii_signature", - "ascii_signature", NULL, G_PARAM_READABLE)); + "ascii_signature", NULL, G_PARAM_READABLE)); gobject_class->set_property = gst_musicbrainz_set_property; gobject_class->get_property = gst_musicbrainz_get_property; @@ -154,7 +155,7 @@ gst_musicbrainz_class_init (GstMusicBrainzClass * klass) gst_musicbrainz_signals[SIGNAL_SIGNATURE_AVAILABLE] = g_signal_new ("signature-available", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstMusicBrainzClass, - signature_available), NULL, NULL, g_cclosure_marshal_VOID__VOID, + signature_available), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); gstelement_class->change_state = gst_musicbrainz_change_state; @@ -251,7 +252,7 @@ gst_musicbrainz_chain (GstPad * pad, GstData * data) if (musicbrainz->linked && !musicbrainz->data_available) if (gst_pad_query (gst_pad_get_peer (pad), GST_QUERY_TOTAL, &format, - &nanos)) { + &nanos)) { musicbrainz->total_time = nanos / GST_SECOND; trm_SetSongLength (musicbrainz->trm, musicbrainz->total_time); musicbrainz->data_available = TRUE; @@ -261,16 +262,16 @@ gst_musicbrainz_chain (GstPad * pad, GstData * data) if (!musicbrainz->signature_available && trm_GenerateSignature (musicbrainz->trm, GST_BUFFER_DATA (buf), - GST_BUFFER_SIZE (buf))) { + GST_BUFFER_SIZE (buf))) { GST_DEBUG ("Signature"); trm_FinalizeSignature (musicbrainz->trm, musicbrainz->signature, NULL); trm_ConvertSigToASCII (musicbrainz->trm, musicbrainz->signature, - musicbrainz->ascii_signature); + musicbrainz->ascii_signature); g_print ("Signature : %s\n", musicbrainz->ascii_signature); musicbrainz->signature_available = TRUE; g_signal_emit (G_OBJECT (musicbrainz), - gst_musicbrainz_signals[SIGNAL_SIGNATURE_AVAILABLE], 0); + gst_musicbrainz_signals[SIGNAL_SIGNATURE_AVAILABLE], 0); GST_DEBUG ("Signature : %s", musicbrainz->ascii_signature); diff --git a/ext/nas/nassink.c b/ext/nas/nassink.c index 6fd0d86ca6..7c3a10ac9e 100644 --- a/ext/nas/nassink.c +++ b/ext/nas/nassink.c @@ -51,17 +51,17 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianess = (int) BYTE_ORDER, " - "signed = (boolean) TRUE, " - "width = (int) 16, " - "depth = (int) 16, " - "rate = (int) [ 1000, 96000 ], " - "channels = (int) [ 1, 2 ]; " - "audio/x-raw-int, " - "signed = (boolean) FALSE, " - "width = (int) 8, " - "depth = (int) 8, " - "rate = (int) [ 1000, 96000 ], " "channels = (int) [ 1, 2 ]") + "endianess = (int) BYTE_ORDER, " + "signed = (boolean) TRUE, " + "width = (int) 16, " + "depth = (int) 16, " + "rate = (int) [ 1000, 96000 ], " + "channels = (int) [ 1, 2 ]; " + "audio/x-raw-int, " + "signed = (boolean) FALSE, " + "width = (int) 8, " + "depth = (int) 8, " + "rate = (int) [ 1000, 96000 ], " "channels = (int) [ 1, 2 ]") ); static void gst_nassink_base_init (gpointer g_class); @@ -111,9 +111,10 @@ gst_nassink_get_type (void) 0, (GInstanceInitFunc) gst_nassink_init, }; + nassink_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstNassink", &nassink_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstNassink", &nassink_info, + 0); } return nassink_type; @@ -127,7 +128,7 @@ gst_nassink_base_init (gpointer g_class) "Sink/Audio", "Plays audio to a Network Audio Server", "Laurent Vivier , " - "Arwed v. Merkatz " + "Arwed v. Merkatz " }; GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); @@ -152,8 +153,8 @@ gst_nassink_class_init (GstNassinkClass * klass) gobject_class->set_property = gst_nassink_set_property; gobject_class->get_property = gst_nassink_get_property; - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MUTE, g_param_spec_boolean ("mute", "mute", "mute", TRUE, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HOST, g_param_spec_string ("host", "host", "host", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MUTE, g_param_spec_boolean ("mute", "mute", "mute", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HOST, g_param_spec_string ("host", "host", "host", NULL, G_PARAM_READWRITE)); /* CHECKME */ gstelement_class->change_state = gst_nassink_change_state; } @@ -203,7 +204,7 @@ gst_nassink_getcaps (GstPad * pad) GstStructure *structure = gst_caps_get_structure (templatecaps, i); gst_structure_set (structure, "rate", GST_TYPE_INT_RANGE, - AuServerMinSampleRate (server), AuServerMaxSampleRate (server), NULL); + AuServerMinSampleRate (server), AuServerMaxSampleRate (server), NULL); } caps = gst_caps_intersect (templatecaps, gst_pad_get_pad_template_caps (pad)); gst_caps_free (templatecaps); @@ -291,28 +292,28 @@ gst_nassink_chain (GstPad * pad, GstData * _data) remaining = GST_BUFFER_SIZE (buf); while ((nassink->flow != AuNone) && (remaining > 0)) { - /* number of bytes we can copy to buffer */ + /* number of bytes we can copy to buffer */ - available = remaining > nassink->size - nassink->pos ? - nassink->size - nassink->pos : remaining; + available = remaining > nassink->size - nassink->pos ? + nassink->size - nassink->pos : remaining; - /* fill the buffer */ + /* fill the buffer */ - memcpy (nassink->buf + nassink->pos, GST_BUFFER_DATA (buf) + pos, - available); + memcpy (nassink->buf + nassink->pos, GST_BUFFER_DATA (buf) + pos, + available); - nassink->pos += available; - pos += available; + nassink->pos += available; + pos += available; - remaining -= available; + remaining -= available; - /* if we have more bytes, need to flush the buffer */ + /* if we have more bytes, need to flush the buffer */ - if (remaining > 0) { - while ((nassink->flow != AuNone) && (nassink->pos == nassink->size)) { - NAS_flush (nassink); - } - } + if (remaining > 0) { + while ((nassink->flow != AuNone) && (nassink->pos == nassink->size)) { + NAS_flush (nassink); + } + } } /* give some time to event handler */ @@ -340,11 +341,11 @@ gst_nassink_set_property (GObject * object, guint prop_id, const GValue * value, break; case ARG_HOST: if (nassink->host != NULL) - g_free (nassink->host); + g_free (nassink->host); if (g_value_get_string (value) == NULL) - nassink->host = NULL; + nassink->host = NULL; else - nassink->host = g_strdup (g_value_get_string (value)); + nassink->host = g_strdup (g_value_get_string (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -379,7 +380,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "nassink", GST_RANK_NONE, - GST_TYPE_NASSINK)) { + GST_TYPE_NASSINK)) { return FALSE; } @@ -460,17 +461,17 @@ gst_nassink_change_state (GstElement * element) switch (GST_STATE_PENDING (element)) { case GST_STATE_NULL: if (GST_FLAG_IS_SET (element, GST_NASSINK_OPEN)) - gst_nassink_close_audio (nassink); + gst_nassink_close_audio (nassink); break; case GST_STATE_READY: if (!GST_FLAG_IS_SET (element, GST_NASSINK_OPEN)) - gst_nassink_open_audio (nassink); + gst_nassink_open_audio (nassink); break; case GST_STATE_PAUSED: while (nassink->pos && nassink->buf) - NAS_flush (nassink); + NAS_flush (nassink); break; case GST_STATE_PLAYING: @@ -498,7 +499,7 @@ NAS_sendData (GstNassink * sink, AuUint32 numBytes) if (numBytes < (sink->pos)) { AuWriteElement (sink->audio, sink->flow, 0, - numBytes, sink->buf, AuFalse, NULL); + numBytes, sink->buf, AuFalse, NULL); memmove (sink->buf, sink->buf + numBytes, sink->pos - numBytes); @@ -506,7 +507,7 @@ NAS_sendData (GstNassink * sink, AuUint32 numBytes) } else { AuWriteElement (sink->audio, sink->flow, 0, - sink->pos, sink->buf, (numBytes > sink->pos), NULL); + sink->pos, sink->buf, (numBytes > sink->pos), NULL); sink->pos = 0; } } @@ -525,49 +526,49 @@ NAS_EventHandler (AuServer * aud, AuEvent * ev, AuEventHandlerRec * handler) switch (notify->kind) { - case AuElementNotifyKindLowWater: - NAS_sendData (sink, notify->num_bytes); - break; + case AuElementNotifyKindLowWater: + NAS_sendData (sink, notify->num_bytes); + break; - case AuElementNotifyKindState: + case AuElementNotifyKindState: - switch (notify->cur_state) { + switch (notify->cur_state) { - case AuStateStop: + case AuStateStop: - if (sink->flow != AuNone) { - if (notify->reason == AuReasonEOF) - AuStopFlow (handler->aud, sink->flow, NULL); - AuReleaseScratchFlow (handler->aud, sink->flow, NULL); - sink->flow = AuNone; - } - AuUnregisterEventHandler (handler->aud, handler); - break; + if (sink->flow != AuNone) { + if (notify->reason == AuReasonEOF) + AuStopFlow (handler->aud, sink->flow, NULL); + AuReleaseScratchFlow (handler->aud, sink->flow, NULL); + sink->flow = AuNone; + } + AuUnregisterEventHandler (handler->aud, handler); + break; - case AuStatePause: + case AuStatePause: - switch (notify->reason) { - case AuReasonUnderrun: - case AuReasonOverrun: - case AuReasonEOF: - case AuReasonWatermark: + switch (notify->reason) { + case AuReasonUnderrun: + case AuReasonOverrun: + case AuReasonEOF: + case AuReasonWatermark: - NAS_sendData (sink, notify->num_bytes); + NAS_sendData (sink, notify->num_bytes); - break; + break; - case AuReasonHardware: + case AuReasonHardware: - if (AuSoundRestartHardwarePauses) - AuStartFlow (handler->aud, sink->flow, NULL); - else - AuStopFlow (handler->aud, sink->flow, NULL); + if (AuSoundRestartHardwarePauses) + AuStartFlow (handler->aud, sink->flow, NULL); + else + AuStopFlow (handler->aud, sink->flow, NULL); - break; - } - break; - } - break; + break; + } + break; + } + break; } break; } @@ -582,8 +583,8 @@ NAS_getDevice (AuServer * aud, int numTracks) for (i = 0; i < AuServerNumDevices (aud); i++) { if ((AuDeviceKind (AuServerDevice (aud, i)) - == AuComponentKindPhysicalOutput) && - (AuDeviceNumTracks (AuServerDevice (aud, i)) == numTracks)) { + == AuComponentKindPhysicalOutput) && + (AuDeviceNumTracks (AuServerDevice (aud, i)) == numTracks)) { return AuDeviceIdentifier (AuServerDevice (aud, i)); @@ -631,18 +632,18 @@ NAS_createFlow (GstNassink * sink, unsigned char format, unsigned short rate, AuElement *oldelems; oldelems = - AuGetElements (sink->audio, sink->flow, &clocked, &num_elements, - &status); + AuGetElements (sink->audio, sink->flow, &clocked, &num_elements, + &status); if (num_elements > 0) { GST_CAT_DEBUG (NAS, "GetElements status: %i", status); if (oldelems) - AuFreeElements (sink->audio, num_elements, oldelems); + AuFreeElements (sink->audio, num_elements, oldelems); gst_nassink_close_audio (sink); gst_nassink_open_audio (sink); sink->flow = AuGetScratchFlow (sink->audio, NULL); if (sink->flow == 0) { - GST_CAT_DEBUG (NAS, "couldn't get flow"); - return -1; + GST_CAT_DEBUG (NAS, "couldn't get flow"); + return -1; } } } @@ -655,18 +656,18 @@ NAS_createFlow (GstNassink * sink, unsigned char format, unsigned short rate, AuElement *oldelems; oldelems = - AuGetElements (sink->audio, sink->flow, &clocked, &num_elements, - &status); + AuGetElements (sink->audio, sink->flow, &clocked, &num_elements, + &status); if (num_elements > 0) { GST_CAT_DEBUG (NAS, "GetElements status: %i", status); if (oldelems) - AuFreeElements (sink->audio, num_elements, oldelems); + AuFreeElements (sink->audio, num_elements, oldelems); gst_nassink_close_audio (sink); gst_nassink_open_audio (sink); sink->flow = AuGetScratchFlow (sink->audio, NULL); if (sink->flow == 0) { - GST_CAT_DEBUG (NAS, "couldn't get flow"); - return -1; + GST_CAT_DEBUG (NAS, "couldn't get flow"); + return -1; } } } @@ -674,38 +675,38 @@ NAS_createFlow (GstNassink * sink, unsigned char format, unsigned short rate, buf_samples = rate * NAS_SOUND_PORT_DURATION; - AuMakeElementImportClient (&elements[0], /* element */ - rate, /* rate */ - format, /* format */ - numTracks, /* number of tracks */ - AuTrue, /* discart */ - buf_samples, /* max samples */ + AuMakeElementImportClient (&elements[0], /* element */ + rate, /* rate */ + format, /* format */ + numTracks, /* number of tracks */ + AuTrue, /* discart */ + buf_samples, /* max samples */ (AuUint32) (buf_samples / 100 * AuSoundPortLowWaterMark), /* low water mark */ - 0, /* num actions */ + 0, /* num actions */ NULL); - AuMakeElementExportDevice (&elements[1], /* element */ - 0, /* input */ - sink->device, /* device */ - rate, /* rate */ - AuUnlimitedSamples, /* num samples */ - 0, /* num actions */ - NULL); /* actions */ + AuMakeElementExportDevice (&elements[1], /* element */ + 0, /* input */ + sink->device, /* device */ + rate, /* rate */ + AuUnlimitedSamples, /* num samples */ + 0, /* num actions */ + NULL); /* actions */ - AuSetElements (sink->audio, /* server */ - sink->flow, /* flow ID */ - AuTrue, /* clocked */ - 2, /* num elements */ - elements, /* elements */ + AuSetElements (sink->audio, /* server */ + sink->flow, /* flow ID */ + AuTrue, /* clocked */ + 2, /* num elements */ + elements, /* elements */ NULL); - AuRegisterEventHandler (sink->audio, /* server */ - AuEventHandlerIDMask, /* value mask */ - 0, /* type */ - sink->flow, /* flow ID */ - NAS_EventHandler, /* callback */ - (AuPointer) sink); /* data */ + AuRegisterEventHandler (sink->audio, /* server */ + AuEventHandlerIDMask, /* value mask */ + 0, /* type */ + sink->flow, /* flow ID */ + NAS_EventHandler, /* callback */ + (AuPointer) sink); /* data */ sink->size = buf_samples * numTracks * AuSizeofFormat (format); diff --git a/ext/sdl/sdlvideosink.c b/ext/sdl/sdlvideosink.c index f5d46a4f0a..3bbd0750c3 100644 --- a/ext/sdl/sdlvideosink.c +++ b/ext/sdl/sdlvideosink.c @@ -108,11 +108,11 @@ gst_sdlvideosink_get_type (void) }; sdlvideosink_type = g_type_register_static (GST_TYPE_VIDEOSINK, - "GstSDLVideoSink", &sdlvideosink_info, 0); + "GstSDLVideoSink", &sdlvideosink_info, 0); g_type_add_interface_static (sdlvideosink_type, - GST_TYPE_IMPLEMENTS_INTERFACE, &iface_info); + GST_TYPE_IMPLEMENTS_INTERFACE, &iface_info); g_type_add_interface_static (sdlvideosink_type, GST_TYPE_X_OVERLAY, - &xoverlay_info); + &xoverlay_info); } return sdlvideosink_type; @@ -135,11 +135,11 @@ gst_sdlvideosink_base_init (gpointer g_class) capslist = gst_caps_new_empty (); for (i = 0; i < 5; i++) { gst_caps_append_structure (capslist, - gst_structure_new ("video/x-raw-yuv", - "format", GST_TYPE_FOURCC, format[i], - "width", GST_TYPE_INT_RANGE, 1, G_MAXINT, - "height", GST_TYPE_INT_RANGE, 1, G_MAXINT, - "framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL)); + gst_structure_new ("video/x-raw-yuv", + "format", GST_TYPE_FOURCC, format[i], + "width", GST_TYPE_INT_RANGE, 1, G_MAXINT, + "height", GST_TYPE_INT_RANGE, 1, G_MAXINT, + "framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL)); } sink_template = gst_pad_template_new ("sink", @@ -207,7 +207,7 @@ gst_sdlvideosink_buffer_new (GstBufferPool * pool, if (sdlvideosink->format == SDL_YV12_OVERLAY || sdlvideosink->format == SDL_IYUV_OVERLAY) { GST_BUFFER_SIZE (buffer) = - sdlvideosink->width * sdlvideosink->height * 3 / 2; + sdlvideosink->width * sdlvideosink->height * 3 / 2; } else { GST_BUFFER_SIZE (buffer) = sdlvideosink->width * sdlvideosink->height * 2; } @@ -271,9 +271,9 @@ gst_sdlvideosink_init (GstSDLVideoSink * sdlvideosink) sdlvideosink->lock = g_mutex_new (); #if 0 - sdlvideosink->bufferpool = gst_buffer_pool_new (NULL, /* free */ - NULL, /* copy */ - (GstBufferPoolBufferNewFunction) gst_sdlvideosink_buffer_new, NULL, /* buffer copy, the default is fine */ + sdlvideosink->bufferpool = gst_buffer_pool_new (NULL, /* free */ + NULL, /* copy */ + (GstBufferPoolBufferNewFunction) gst_sdlvideosink_buffer_new, NULL, /* buffer copy, the default is fine */ (GstBufferPoolBufferFreeFunction) gst_sdlvideosink_buffer_free, sdlvideosink); #endif @@ -354,7 +354,7 @@ gst_sdlvideosink_lock (GstSDLVideoSink * sdlvideosink) /* assure that we've got a screen */ if (!sdlvideosink->screen || !sdlvideosink->overlay) { GST_ELEMENT_ERROR (sdlvideosink, LIBRARY, TOO_LAZY, (NULL), - ("Tried to lock screen without being set-up")); + ("Tried to lock screen without being set-up")); return FALSE; } @@ -362,13 +362,13 @@ gst_sdlvideosink_lock (GstSDLVideoSink * sdlvideosink) if (SDL_MUSTLOCK (sdlvideosink->screen)) { if (SDL_LockSurface (sdlvideosink->screen) < 0) { GST_ELEMENT_ERROR (sdlvideosink, LIBRARY, TOO_LAZY, (NULL), - ("SDL: couldn't lock the SDL video window: %s", SDL_GetError ())); + ("SDL: couldn't lock the SDL video window: %s", SDL_GetError ())); return FALSE; } } if (SDL_LockYUVOverlay (sdlvideosink->overlay) < 0) { GST_ELEMENT_ERROR (sdlvideosink, LIBRARY, TOO_LAZY, (NULL), - ("SDL: couldn\'t lock the SDL YUV overlay: %s", SDL_GetError ())); + ("SDL: couldn\'t lock the SDL YUV overlay: %s", SDL_GetError ())); return FALSE; } @@ -413,7 +413,7 @@ gst_sdlvideosink_initsdl (GstSDLVideoSink * sdlvideosink) /* Initialize the SDL library */ if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) { GST_ELEMENT_ERROR (sdlvideosink, LIBRARY, INIT, (NULL), - ("Couldn't initialize SDL: %s", SDL_GetError ())); + ("Couldn't initialize SDL: %s", SDL_GetError ())); return FALSE; } @@ -449,8 +449,8 @@ gst_sdlvideosink_create (GstSDLVideoSink * sdlvideosink) GST_VIDEOSINK_HEIGHT (sdlvideosink), 0, SDL_HWSURFACE | SDL_RESIZABLE); if (sdlvideosink->screen == NULL) { GST_ELEMENT_ERROR (sdlvideosink, LIBRARY, TOO_LAZY, (NULL), - ("SDL: Couldn't set %dx%d: %s", GST_VIDEOSINK_WIDTH (sdlvideosink), - GST_VIDEOSINK_HEIGHT (sdlvideosink), SDL_GetError ())); + ("SDL: Couldn't set %dx%d: %s", GST_VIDEOSINK_WIDTH (sdlvideosink), + GST_VIDEOSINK_HEIGHT (sdlvideosink), SDL_GetError ())); return FALSE; } @@ -459,16 +459,16 @@ gst_sdlvideosink_create (GstSDLVideoSink * sdlvideosink) sdlvideosink->height, sdlvideosink->format, sdlvideosink->screen); if (sdlvideosink->overlay == NULL) { GST_ELEMENT_ERROR (sdlvideosink, LIBRARY, TOO_LAZY, (NULL), - ("SDL: Couldn't create SDL YUV overlay (%dx%d \'" GST_FOURCC_FORMAT - "\'): %s", sdlvideosink->width, sdlvideosink->height, - GST_FOURCC_ARGS (sdlvideosink->format), SDL_GetError ())); + ("SDL: Couldn't create SDL YUV overlay (%dx%d \'" GST_FOURCC_FORMAT + "\'): %s", sdlvideosink->width, sdlvideosink->height, + GST_FOURCC_ARGS (sdlvideosink->format), SDL_GetError ())); return FALSE; } else { GST_DEBUG ("Using a %dx%d %dbpp SDL screen with a %dx%d \'" - GST_FOURCC_FORMAT "\' YUV overlay", GST_VIDEOSINK_WIDTH (sdlvideosink), - GST_VIDEOSINK_HEIGHT (sdlvideosink), - sdlvideosink->screen->format->BitsPerPixel, sdlvideosink->width, - sdlvideosink->height, GST_FOURCC_ARGS (sdlvideosink->format)); + GST_FOURCC_FORMAT "\' YUV overlay", GST_VIDEOSINK_WIDTH (sdlvideosink), + GST_VIDEOSINK_HEIGHT (sdlvideosink), + sdlvideosink->screen->format->BitsPerPixel, sdlvideosink->width, + sdlvideosink->height, GST_FOURCC_ARGS (sdlvideosink->format)); } sdlvideosink->rect.x = 0; @@ -505,7 +505,7 @@ gst_sdlvideosink_fixate (GstPad * pad, const GstCaps * caps) return newcaps; } if (gst_caps_structure_fixate_field_nearest_double (structure, "framerate", - 30.0)) { + 30.0)) { return newcaps; } @@ -555,13 +555,13 @@ gst_sdlvideosink_chain (GstPad * pad, GstData * _data) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_DISCONTINUOUS: - offset = GST_EVENT_DISCONT_OFFSET (event, 0).value; - /*gst_clock_handle_discont (sdlvideosink->clock, - (guint64) GST_EVENT_DISCONT_OFFSET (event, 0).value); */ - break; + offset = GST_EVENT_DISCONT_OFFSET (event, 0).value; + /*gst_clock_handle_discont (sdlvideosink->clock, + (guint64) GST_EVENT_DISCONT_OFFSET (event, 0).value); */ + break; default: - gst_pad_event_default (pad, event); - return; + gst_pad_event_default (pad, event); + return; } gst_event_unref (event); return; @@ -578,19 +578,19 @@ gst_sdlvideosink_chain (GstPad * pad, GstData * _data) /* buf->yuv - FIXME: bufferpool! */ if (sdlvideosink->format == SDL_IYUV_OVERLAY || - sdlvideosink->format == SDL_YV12_OVERLAY) { + sdlvideosink->format == SDL_YV12_OVERLAY) { memcpy (sdlvideosink->overlay->pixels[0], GST_BUFFER_DATA (buf), - sdlvideosink->width * sdlvideosink->height); + sdlvideosink->width * sdlvideosink->height); memcpy (sdlvideosink->overlay->pixels[1], - GST_BUFFER_DATA (buf) + sdlvideosink->width * sdlvideosink->height, - sdlvideosink->width * sdlvideosink->height / 4); + GST_BUFFER_DATA (buf) + sdlvideosink->width * sdlvideosink->height, + sdlvideosink->width * sdlvideosink->height / 4); memcpy (sdlvideosink->overlay->pixels[2], - GST_BUFFER_DATA (buf) + - sdlvideosink->width * sdlvideosink->height * 5 / 4, - sdlvideosink->width * sdlvideosink->height / 4); + GST_BUFFER_DATA (buf) + + sdlvideosink->width * sdlvideosink->height * 5 / 4, + sdlvideosink->width * sdlvideosink->height / 4); } else { memcpy (sdlvideosink->overlay->pixels[0], GST_BUFFER_DATA (buf), - sdlvideosink->width * sdlvideosink->height * 2); + sdlvideosink->width * sdlvideosink->height * 2); } gst_sdlvideosink_unlock (sdlvideosink); @@ -604,11 +604,11 @@ gst_sdlvideosink_chain (GstPad * pad, GstData * _data) while (SDL_PollEvent (&sdl_event)) { switch (sdl_event.type) { case SDL_VIDEORESIZE: - /* create a SDL window of the size requested by the user */ - GST_VIDEOSINK_WIDTH (sdlvideosink) = sdl_event.resize.w; - GST_VIDEOSINK_HEIGHT (sdlvideosink) = sdl_event.resize.h; - gst_sdlvideosink_create (sdlvideosink); - break; + /* create a SDL window of the size requested by the user */ + GST_VIDEOSINK_WIDTH (sdlvideosink) = sdl_event.resize.w; + GST_VIDEOSINK_HEIGHT (sdlvideosink) = sdl_event.resize.h; + gst_sdlvideosink_create (sdlvideosink); + break; } } } @@ -661,7 +661,7 @@ gst_sdlvideosink_change_state (GstElement * element) switch (GST_STATE_TRANSITION (element)) { case GST_STATE_NULL_TO_READY: if (!gst_sdlvideosink_initsdl (sdlvideosink)) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; GST_FLAG_SET (sdlvideosink, GST_SDLVIDEOSINK_OPEN); break; case GST_STATE_PAUSED_TO_READY: @@ -671,7 +671,7 @@ gst_sdlvideosink_change_state (GstElement * element) gst_sdlvideosink_deinitsdl (sdlvideosink); GST_FLAG_UNSET (sdlvideosink, GST_SDLVIDEOSINK_OPEN); break; - default: /* do nothing */ + default: /* do nothing */ break; } @@ -690,7 +690,7 @@ plugin_init (GstPlugin * plugin) return FALSE; if (!gst_element_register (plugin, "sdlvideosink", GST_RANK_NONE, - GST_TYPE_SDLVIDEOSINK)) + GST_TYPE_SDLVIDEOSINK)) return FALSE; return TRUE; diff --git a/ext/shout/gstshout.c b/ext/shout/gstshout.c index 3deb8cc68b..5f546deeab 100644 --- a/ext/shout/gstshout.c +++ b/ext/shout/gstshout.c @@ -50,19 +50,19 @@ enum enum { ARG_0, - ARG_IP, /* the ip of the server */ - ARG_PORT, /* the encoder port number on the server */ - ARG_PASSWORD, /* the encoder password on the server */ - ARG_PUBLIC, /* is this stream public? */ - ARG_NAME, /* Name of the stream */ - ARG_DESCRIPTION, /* Description of the stream */ - ARG_GENRE, /* Genre of the stream */ - ARG_MOUNT, /* mountpoint of stream (icecast only) */ - ARG_DUMPFILE, /* Dumpfile on the server for this stream (icecast only) */ - ARG_ICY, /* use icy headers for login? (for use with shoutcast) */ - ARG_AIM, /* AIM number (shoutcast only) */ - ARG_ICQ, /* ICQ number (shoutcast only) */ - ARG_IRC, /* IRC server (shoutcast only) */ + ARG_IP, /* the ip of the server */ + ARG_PORT, /* the encoder port number on the server */ + ARG_PASSWORD, /* the encoder password on the server */ + ARG_PUBLIC, /* is this stream public? */ + ARG_NAME, /* Name of the stream */ + ARG_DESCRIPTION, /* Description of the stream */ + ARG_GENRE, /* Genre of the stream */ + ARG_MOUNT, /* mountpoint of stream (icecast only) */ + ARG_DUMPFILE, /* Dumpfile on the server for this stream (icecast only) */ + ARG_ICY, /* use icy headers for login? (for use with shoutcast) */ + ARG_AIM, /* AIM number (shoutcast only) */ + ARG_ICQ, /* ICQ number (shoutcast only) */ + ARG_IRC, /* IRC server (shoutcast only) */ }; static GstStaticPadTemplate sink_template_factory = @@ -70,7 +70,7 @@ GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/mpeg, " - "mpegversion = (int) 1, " "layer = (int) [ 1, 3 ]") + "mpegversion = (int) 1, " "layer = (int) [ 1, 3 ]") ); static void gst_icecastsend_class_init (GstIcecastSendClass * klass); @@ -104,9 +104,10 @@ gst_icecastsend_get_type (void) sizeof (GstIcecastSend), 0, (GInstanceInitFunc) gst_icecastsend_init, }; + icecastsend_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstIcecastSend", - &icecastsend_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstIcecastSend", + &icecastsend_info, 0); } return icecastsend_type; } @@ -132,33 +133,33 @@ gst_icecastsend_class_init (GstIcecastSendClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_IP, g_param_spec_string ("ip", "ip", "ip", NULL, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PORT, g_param_spec_int ("port", "port", "port", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_IP, g_param_spec_string ("ip", "ip", "ip", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PORT, g_param_spec_int ("port", "port", "port", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PASSWORD, g_param_spec_string ("password", "password", "password", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PASSWORD, g_param_spec_string ("password", "password", "password", NULL, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PUBLIC, g_param_spec_boolean ("public", "public", "public", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PUBLIC, g_param_spec_boolean ("public", "public", "public", TRUE, G_PARAM_READWRITE)); /* CHECKME */ /* metadata */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DESCRIPTION, g_param_spec_string ("description", "description", "description", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DESCRIPTION, g_param_spec_string ("description", "description", "description", NULL, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_GENRE, g_param_spec_string ("genre", "genre", "genre", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_GENRE, g_param_spec_string ("genre", "genre", "genre", NULL, G_PARAM_READWRITE)); /* CHECKME */ /* icecast only */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MOUNT, g_param_spec_string ("mount", "mount", "mount", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MOUNT, g_param_spec_string ("mount", "mount", "mount", NULL, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DUMPFILE, g_param_spec_string ("dumpfile", "dumpfile", "dumpfile", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DUMPFILE, g_param_spec_string ("dumpfile", "dumpfile", "dumpfile", NULL, G_PARAM_READWRITE)); /* CHECKME */ /* shoutcast only */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ICY, g_param_spec_boolean ("icy", "icy", "icy", FALSE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ICY, g_param_spec_boolean ("icy", "icy", "icy", FALSE, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_AIM, g_param_spec_string ("aim", "aim", "aim", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_AIM, g_param_spec_string ("aim", "aim", "aim", NULL, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ICQ, g_param_spec_string ("icq", "icq", "icq", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ICQ, g_param_spec_string ("icq", "icq", "icq", NULL, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_IRC, g_param_spec_string ("irc", "irc", "irc", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_IRC, g_param_spec_string ("irc", "irc", "irc", NULL, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = gst_icecastsend_set_property; @@ -174,7 +175,7 @@ gst_icecastsend_init (GstIcecastSend * icecastsend) icecastsend->sinkpad = gst_pad_new_from_template (gst_element_class_get_pad_template (klass, - "sink"), "sink"); + "sink"), "sink"); gst_element_add_pad (GST_ELEMENT (icecastsend), icecastsend->sinkpad); gst_pad_set_chain_function (icecastsend->sinkpad, gst_icecastsend_chain); @@ -232,7 +233,7 @@ gst_icecastsend_set_property (GObject * object, guint prop_id, switch (prop_id) { case ARG_IP: if (icecastsend->ip) - g_free (icecastsend->ip); + g_free (icecastsend->ip); icecastsend->ip = g_strdup (g_value_get_string (value)); break; case ARG_PORT: @@ -240,64 +241,64 @@ gst_icecastsend_set_property (GObject * object, guint prop_id, break; case ARG_PASSWORD: if (icecastsend->password) - g_free (icecastsend->password); + g_free (icecastsend->password); icecastsend->password = g_strdup (g_value_get_string (value)); break; - case ARG_PUBLIC: /* is this stream public? */ + case ARG_PUBLIC: /* is this stream public? */ icecastsend->public = g_value_get_boolean (value); break; - case ARG_NAME: /* Name of the stream */ + case ARG_NAME: /* Name of the stream */ if (icecastsend->name) - g_free (icecastsend->name); + g_free (icecastsend->name); icecastsend->name = g_strdup (g_value_get_string (value)); break; - case ARG_DESCRIPTION: /* Description of the stream */ + case ARG_DESCRIPTION: /* Description of the stream */ if (icecastsend->description) - g_free (icecastsend->description); + g_free (icecastsend->description); icecastsend->description = g_strdup (g_value_get_string (value)); break; - case ARG_GENRE: /* Genre of the stream */ + case ARG_GENRE: /* Genre of the stream */ if (icecastsend->genre) - g_free (icecastsend->genre); + g_free (icecastsend->genre); icecastsend->genre = g_strdup (g_value_get_string (value)); break; - case ARG_MOUNT: /* mountpoint of stream (icecast only) */ + case ARG_MOUNT: /* mountpoint of stream (icecast only) */ if (icecastsend->mount) - g_free (icecastsend->mount); + g_free (icecastsend->mount); icecastsend->mount = g_strdup (g_value_get_string (value)); break; - case ARG_DUMPFILE: /* Dumpfile on the server for this stream (icecast only) */ + case ARG_DUMPFILE: /* Dumpfile on the server for this stream (icecast only) */ if (icecastsend->dumpfile) - g_free (icecastsend->dumpfile); + g_free (icecastsend->dumpfile); icecastsend->dumpfile = g_strdup (g_value_get_string (value)); break; - case ARG_ICY: /* use icy headers for login? (for use with shoutcast) */ + case ARG_ICY: /* use icy headers for login? (for use with shoutcast) */ icecastsend->icy = g_value_get_boolean (value); break; - case ARG_AIM: /* AIM number (shoutcast only) */ + case ARG_AIM: /* AIM number (shoutcast only) */ if (icecastsend->aim) - g_free (icecastsend->aim); + g_free (icecastsend->aim); icecastsend->aim = g_strdup (g_value_get_string (value)); break; - case ARG_ICQ: /* ICQ number (shoutcast only) */ + case ARG_ICQ: /* ICQ number (shoutcast only) */ if (icecastsend->icq) - g_free (icecastsend->icq); + g_free (icecastsend->icq); icecastsend->icq = g_strdup (g_value_get_string (value)); break; - case ARG_IRC: /* IRC server (shoutcast only) */ + case ARG_IRC: /* IRC server (shoutcast only) */ if (icecastsend->irc) - g_free (icecastsend->irc); + g_free (icecastsend->irc); icecastsend->irc = g_strdup (g_value_get_string (value)); break; @@ -326,43 +327,43 @@ gst_icecastsend_get_property (GObject * object, guint prop_id, GValue * value, case ARG_PASSWORD: g_value_set_string (value, icecastsend->password); break; - case ARG_PUBLIC: /* is this stream public? */ + case ARG_PUBLIC: /* is this stream public? */ g_value_set_boolean (value, icecastsend->public); break; - case ARG_NAME: /* Name of the stream */ + case ARG_NAME: /* Name of the stream */ g_value_set_string (value, icecastsend->name); break; - case ARG_DESCRIPTION: /* Description of the stream */ + case ARG_DESCRIPTION: /* Description of the stream */ g_value_set_string (value, icecastsend->description); break; - case ARG_GENRE: /* Genre of the stream */ + case ARG_GENRE: /* Genre of the stream */ g_value_set_string (value, icecastsend->genre); break; - case ARG_MOUNT: /* mountpoint of stream (icecast only) */ + case ARG_MOUNT: /* mountpoint of stream (icecast only) */ g_value_set_string (value, icecastsend->mount); break; - case ARG_DUMPFILE: /* Dumpfile on the server for this stream (icecast only) */ + case ARG_DUMPFILE: /* Dumpfile on the server for this stream (icecast only) */ g_value_set_string (value, icecastsend->dumpfile); break; - case ARG_ICY: /* use icy headers for login? (for use with shoutcast) */ + case ARG_ICY: /* use icy headers for login? (for use with shoutcast) */ g_value_set_boolean (value, icecastsend->icy); break; - case ARG_AIM: /* AIM number (shoutcast only) */ + case ARG_AIM: /* AIM number (shoutcast only) */ g_value_set_string (value, icecastsend->aim); break; - case ARG_ICQ: /* ICQ number (shoutcast only) */ + case ARG_ICQ: /* ICQ number (shoutcast only) */ g_value_set_string (value, icecastsend->icq); break; - case ARG_IRC: /* IRC server (shoutcast only) */ + case ARG_IRC: /* IRC server (shoutcast only) */ g_value_set_string (value, icecastsend->irc); break; @@ -407,12 +408,12 @@ gst_icecastsend_change_state (GstElement * element) icecastsend->conn.irc = icecastsend->irc; */ if (shout_connect (&icecastsend->conn)) { - g_print ("connected to server...\n"); + g_print ("connected to server...\n"); } else { - g_warning ("couldn't connect to server... (%i: %s)\n", - icecastsend->conn.error, SHOUT_ERRORS[icecastsend->conn.error]); - shout_disconnect (&icecastsend->conn); - return GST_STATE_FAILURE; + g_warning ("couldn't connect to server... (%i: %s)\n", + icecastsend->conn.error, SHOUT_ERRORS[icecastsend->conn.error]); + shout_disconnect (&icecastsend->conn); + return GST_STATE_FAILURE; } break; case GST_STATE_PAUSED_TO_READY: diff --git a/ext/smoothwave/gstsmoothwave.c b/ext/smoothwave/gstsmoothwave.c index 2abbdec2f2..9775e3d0d4 100644 --- a/ext/smoothwave/gstsmoothwave.c +++ b/ext/smoothwave/gstsmoothwave.c @@ -80,9 +80,10 @@ gst_smoothwave_get_type (void) 0, (GInstanceInitFunc) gst_smoothwave_init, }; + smoothwave_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSmoothWave", - &smoothwave_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSmoothWave", + &smoothwave_info, 0); } return smoothwave_type; } @@ -106,9 +107,9 @@ gst_smoothwave_class_init (GstSmoothWaveClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDTH, g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HEIGHT, g_param_spec_int ("height", "height", "height", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDGET, g_param_spec_object ("widget", "widget", "widget", GTK_TYPE_WIDGET, G_PARAM_READABLE)); /* CHECKME! */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDTH, g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HEIGHT, g_param_spec_int ("height", "height", "height", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDGET, g_param_spec_object ("widget", "widget", "widget", GTK_TYPE_WIDGET, G_PARAM_READABLE)); /* CHECKME! */ gobject_class->set_property = gst_smoothwave_set_property; gobject_class->get_property = gst_smoothwave_get_property; @@ -192,7 +193,7 @@ gst_smoothwave_chain (GstPad * pad, GstData * _data) for (i = 0; i < MAX (smoothwave->width, samplecount); i++) { gint16 y1 = (gint32) (samples[i * 2] * qheight) / 32768 + qheight; gint16 y2 = (gint32) (samples[(i * 2) + 1] * qheight) / 32768 + - (qheight * 3); + (qheight * 3); smoothwave->imagebuffer[y1 * smoothwave->width + i] = 0xff; smoothwave->imagebuffer[y2 * smoothwave->width + i] = 0xff; /* smoothwave->imagebuffer[i+(smoothwave->width*5)] = i; */ @@ -246,16 +247,16 @@ gst_smoothwave_set_property (GObject * object, guint prop_id, case ARG_WIDTH: smoothwave->width = g_value_get_int (value); gtk_drawing_area_size (GTK_DRAWING_AREA (smoothwave->image), - smoothwave->width, smoothwave->height); + smoothwave->width, smoothwave->height); gtk_widget_set_usize (GTK_WIDGET (smoothwave->image), - smoothwave->width, smoothwave->height); + smoothwave->width, smoothwave->height); break; case ARG_HEIGHT: smoothwave->height = g_value_get_int (value); gtk_drawing_area_size (GTK_DRAWING_AREA (smoothwave->image), - smoothwave->width, smoothwave->height); + smoothwave->width, smoothwave->height); gtk_widget_set_usize (GTK_WIDGET (smoothwave->image), - smoothwave->width, smoothwave->height); + smoothwave->width, smoothwave->height); break; default: break; @@ -297,7 +298,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "smoothwave", GST_RANK_NONE, - GST_TYPE_SMOOTHWAVE)) + GST_TYPE_SMOOTHWAVE)) return FALSE; return TRUE; diff --git a/ext/snapshot/gstsnapshot.c b/ext/snapshot/gstsnapshot.c index 66c505bc54..231cdce32e 100644 --- a/ext/snapshot/gstsnapshot.c +++ b/ext/snapshot/gstsnapshot.c @@ -112,9 +112,10 @@ gst_snapshot_get_type (void) 0, (GInstanceInitFunc) gst_snapshot_init, }; + snapshot_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSnapshot", &snapshot_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSnapshot", &snapshot_info, + 0); } return snapshot_type; } @@ -145,10 +146,10 @@ gst_snapshot_class_init (GstSnapshotClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FRAME, g_param_spec_long ("frame", "frame", "frame", - 0, G_MAXLONG, 0, G_PARAM_READWRITE)); + 0, G_MAXLONG, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATION, g_param_spec_string ("location", "location", "location", - 0, G_PARAM_READWRITE)); + 0, G_PARAM_READWRITE)); gst_snapshot_signals[SNAPSHOT_SIGNAL] = g_signal_new ("snapshot", G_TYPE_FROM_CLASS (klass), @@ -257,30 +258,30 @@ gst_snapshot_chain (GstPad * pad, GstData * _data) g_warning (" Can not open %s\n", snapshot->location); else { png_set_filter (snapshot->png_struct_ptr, 0, - PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE); + PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE); png_init_io (snapshot->png_struct_ptr, fp); png_set_compression_level (snapshot->png_struct_ptr, 9); png_set_IHDR (snapshot->png_struct_ptr, - snapshot->png_info_ptr, - snapshot->width, - snapshot->height, - snapshot->to_bpp / 3, - PNG_COLOR_TYPE_RGB, - PNG_INTERLACE_NONE, - PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); + snapshot->png_info_ptr, + snapshot->width, + snapshot->height, + snapshot->to_bpp / 3, + PNG_COLOR_TYPE_RGB, + PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); for (i = 0; i < snapshot->height; i++) - row_pointers[i] = data + (snapshot->width * i * snapshot->to_bpp / 8); + row_pointers[i] = data + (snapshot->width * i * snapshot->to_bpp / 8); png_write_info (snapshot->png_struct_ptr, snapshot->png_info_ptr); png_write_image (snapshot->png_struct_ptr, row_pointers); png_write_end (snapshot->png_struct_ptr, NULL); png_destroy_info_struct (snapshot->png_struct_ptr, - &snapshot->png_info_ptr); + &snapshot->png_info_ptr); png_destroy_write_struct (&snapshot->png_struct_ptr, (png_infopp) NULL); fclose (fp); g_signal_emit (G_OBJECT (snapshot), - gst_snapshot_signals[SNAPSHOT_SIGNAL], 0); + gst_snapshot_signals[SNAPSHOT_SIGNAL], 0); } @@ -337,7 +338,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "snapshot", GST_RANK_NONE, - GST_TYPE_SNAPSHOT)) + GST_TYPE_SNAPSHOT)) return FALSE; return TRUE; diff --git a/ext/sndfile/gstsf.c b/ext/sndfile/gstsf.c index f9e8862303..d48e2d4f1c 100644 --- a/ext/sndfile/gstsf.c +++ b/ext/sndfile/gstsf.c @@ -85,7 +85,7 @@ gst_sf_major_types_get_type (void) for (k = 0; k < count; k++) { format_info.format = k; sf_command (NULL, SFC_GET_FORMAT_MAJOR, &format_info, - sizeof (format_info)); + sizeof (format_info)); sf_major_types[k].value = format_info.format; sf_major_types[k].value_name = g_strdup (format_info.name); sf_major_types[k].value_nick = g_strdup (format_info.extension); @@ -94,19 +94,19 @@ gst_sf_major_types_get_type (void) just hope that sndfile gives us the list in alphabetical order, as it currently does. */ if (k > 0 - && strcmp (sf_major_types[k].value_nick, - sf_major_types[k - 1].value_nick) == 0) { - g_free (sf_major_types[k].value_nick); - sf_major_types[k].value_nick = - g_strconcat (sf_major_types[k - 1].value_nick, "-", - sf_major_types[k].value_name, NULL); - g_strcanon (sf_major_types[k].value_nick, - G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-'); + && strcmp (sf_major_types[k].value_nick, + sf_major_types[k - 1].value_nick) == 0) { + g_free (sf_major_types[k].value_nick); + sf_major_types[k].value_nick = + g_strconcat (sf_major_types[k - 1].value_nick, "-", + sf_major_types[k].value_name, NULL); + g_strcanon (sf_major_types[k].value_nick, + G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-'); } } sf_major_types_type = - g_enum_register_static ("GstSndfileMajorTypes", sf_major_types); + g_enum_register_static ("GstSndfileMajorTypes", sf_major_types); } return sf_major_types_type; } @@ -129,16 +129,16 @@ gst_sf_minor_types_get_type (void) for (k = 0; k < count; k++) { format_info.format = k; sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &format_info, - sizeof (format_info)); + sizeof (format_info)); sf_minor_types[k].value = format_info.format; sf_minor_types[k].value_name = g_strdup (format_info.name); sf_minor_types[k].value_nick = g_ascii_strdown (format_info.name, -1); g_strcanon (sf_minor_types[k].value_nick, G_CSET_a_2_z G_CSET_DIGITS "-", - '-'); + '-'); } sf_minor_types_type = - g_enum_register_static ("GstSndfileMinorTypes", sf_minor_types); + g_enum_register_static ("GstSndfileMinorTypes", sf_minor_types); } return sf_minor_types_type; } @@ -186,13 +186,14 @@ gst_sf_get_type (void) static const GTypeInfo sf_info = { sizeof (GstSFClass), NULL, NULL, - (GClassInitFunc) NULL, /* don't even initialize the class */ + (GClassInitFunc) NULL, /* don't even initialize the class */ NULL, NULL, sizeof (GstSF), 0, - (GInstanceInitFunc) NULL /* abstract base class */ + (GInstanceInitFunc) NULL /* abstract base class */ }; + sf_type = g_type_register_static (GST_TYPE_ELEMENT, "GstSF", &sf_info, 0); } return sf_type; @@ -215,8 +216,9 @@ gst_sfsrc_get_type (void) 0, (GInstanceInitFunc) gst_sf_init, }; + sfsrc_type = - g_type_register_static (GST_TYPE_SF, "GstSFSrc", &sfsrc_info, 0); + g_type_register_static (GST_TYPE_SF, "GstSFSrc", &sfsrc_info, 0); } return sfsrc_type; } @@ -238,8 +240,9 @@ gst_sfsink_get_type (void) 0, (GInstanceInitFunc) gst_sf_init, }; + sfsink_type = - g_type_register_static (GST_TYPE_SF, "GstSFSink", &sfsink_info, 0); + g_type_register_static (GST_TYPE_SF, "GstSFSink", &sfsink_info, 0); } return sfsink_type; } @@ -291,12 +294,12 @@ gst_sf_class_init (GstSFClass * klass) if (G_TYPE_FROM_CLASS (klass) == GST_TYPE_SFSRC) { pspec = g_param_spec_boolean ("loop", "Loop?", "Loop the output?", - FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT); + FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT); g_object_class_install_property (gobject_class, ARG_LOOP, pspec); pspec = - g_param_spec_boolean ("create-pads", "Create pads?", - "Create one pad for each channel in the sound file?", TRUE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT); + g_param_spec_boolean ("create-pads", "Create pads?", + "Create one pad for each channel in the sound file?", TRUE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT); g_object_class_install_property (gobject_class, ARG_CREATE_PADS, pspec); } @@ -338,17 +341,17 @@ gst_sf_set_property (GObject * object, guint prop_id, const GValue * value, switch (prop_id) { case ARG_LOCATION: if (GST_FLAG_IS_SET (object, GST_SF_OPEN)) - gst_sf_close_file (this); + gst_sf_close_file (this); if (this->filename) - g_free (this->filename); + g_free (this->filename); if (g_value_get_string (value)) - this->filename = g_strdup (g_value_get_string (value)); + this->filename = g_strdup (g_value_get_string (value)); else - this->filename = NULL; + this->filename = NULL; if (this->filename) - gst_sf_open_file (this); + gst_sf_open_file (this); break; case ARG_MAJOR_TYPE: @@ -366,10 +369,10 @@ gst_sf_set_property (GObject * object, guint prop_id, const GValue * value, case ARG_CREATE_PADS: this->create_pads = g_value_get_boolean (value); if (this->file && this->create_pads) { - int i; + int i; - for (i = g_list_length (this->channels); i < this->numchannels; i++) - gst_element_get_request_pad ((GstElement *) this, "src%d"); + for (i = g_list_length (this->channels); i < this->numchannels; i++) + gst_element_get_request_pad ((GstElement *) this, "src%d"); } break; @@ -450,13 +453,13 @@ gst_sf_change_state (GstElement * element) break; case GST_STATE_PLAYING_TO_PAUSED: gst_audio_clock_set_active (GST_AUDIO_CLOCK (this->provided_clock), - FALSE); + FALSE); break; case GST_STATE_PAUSED_TO_READY: break; case GST_STATE_READY_TO_NULL: if (GST_FLAG_IS_SET (this, GST_SF_OPEN)) - gst_sf_close_file (this); + gst_sf_close_file (this); break; } @@ -514,7 +517,7 @@ gst_sf_release_request_pad (GstElement * element, GstPad * pad) if (GST_STATE (element) == GST_STATE_PLAYING) { g_warning - ("You can't release a request pad if the element is PLAYING, sorry."); + ("You can't release a request pad if the element is PLAYING, sorry."); return; } @@ -557,9 +560,9 @@ gst_sf_link (GstPad * pad, const GstCaps * caps) if (this->buffer) g_free (this->buffer); this->buffer = - g_malloc (this->numchannels * this->buffer_frames * sizeof (float)); + g_malloc (this->numchannels * this->buffer_frames * sizeof (float)); memset (this->buffer, 0, - this->numchannels * this->buffer_frames * sizeof (float)); + this->numchannels * this->buffer_frames * sizeof (float)); } return GST_PAD_LINK_OK; } @@ -576,7 +579,7 @@ gst_sf_open_file (GstSF * this) if (!this->filename) { GST_ELEMENT_ERROR (this, RESOURCE, NOT_FOUND, - (_("No filename specified.")), (NULL)); + (_("No filename specified.")), (NULL)); return FALSE; } @@ -586,11 +589,11 @@ gst_sf_open_file (GstSF * this) } else { if (!this->rate) { INFO_OBJ (this, "Not opening %s yet because caps are not set", - this->filename); + this->filename); return FALSE; } else if (!this->numchannels) { INFO_OBJ (this, "Not opening %s yet because we have no input channels", - this->filename); + this->filename); return FALSE; } @@ -601,12 +604,12 @@ gst_sf_open_file (GstSF * this) info.format = this->format; INFO_OBJ (this, "Opening %s with rate %d, %d channels, format 0x%x", - this->filename, info.samplerate, info.channels, info.format); + this->filename, info.samplerate, info.channels, info.format); if (!sf_format_check (&info)) { GST_ELEMENT_ERROR (this, STREAM, ENCODE, (NULL), - ("Input parameters (rate:%d, channels:%d, format:0x%x) invalid", - info.samplerate, info.channels, info.format)); + ("Input parameters (rate:%d, channels:%d, format:0x%x) invalid", + info.samplerate, info.channels, info.format)); return FALSE; } } @@ -615,8 +618,8 @@ gst_sf_open_file (GstSF * this) if (!this->file) { GST_ELEMENT_ERROR (this, RESOURCE, OPEN_WRITE, - (_("Could not open file \"%s\" for writing."), this->filename), - ("soundfile error: %s", sf_strerror (NULL))); + (_("Could not open file \"%s\" for writing."), this->filename), + ("soundfile error: %s", sf_strerror (NULL))); return FALSE; } @@ -632,7 +635,7 @@ gst_sf_open_file (GstSF * this) int i; for (i = g_list_length (this->channels); i < this->numchannels; i++) - gst_element_get_request_pad ((GstElement *) this, "src%d"); + gst_element_get_request_pad ((GstElement *) this, "src%d"); } for (l = this->channels; l; l = l->next) @@ -656,8 +659,8 @@ gst_sf_close_file (GstSF * this) if ((err = sf_close (this->file))) GST_ELEMENT_ERROR (this, RESOURCE, CLOSE, - ("Could not close file file \"%s\".", this->filename), - ("soundfile error: %s", strerror (err))); + ("Could not close file file \"%s\".", this->filename), + ("soundfile error: %s", strerror (err))); else GST_FLAG_UNSET (this, GST_SF_OPEN); @@ -677,7 +680,7 @@ gst_sf_loop (GstElement * element) if (this->channels == NULL) { GST_ELEMENT_ERROR (element, CORE, PAD, (NULL), - ("You must connect at least one pad to sndfile elements.")); + ("You must connect at least one pad to sndfile elements.")); return; } @@ -694,7 +697,7 @@ gst_sf_loop (GstElement * element) if (!GST_FLAG_IS_SET (this, GST_SF_OPEN)) if (!gst_sf_open_file (this)) - return; /* we've already set gst_element_error */ + return; /* we've already set gst_element_error */ if (buffer_frames == 0) { /* we have to set the caps later */ @@ -702,9 +705,9 @@ gst_sf_loop (GstElement * element) } if (buf == NULL) { buf = this->buffer = - g_malloc (this->numchannels * this->buffer_frames * sizeof (float)); + g_malloc (this->numchannels * this->buffer_frames * sizeof (float)); memset (this->buffer, 0, - this->numchannels * this->buffer_frames * sizeof (float)); + this->numchannels * this->buffer_frames * sizeof (float)); } read = sf_readf_float (this->file, buf, buffer_frames); @@ -713,51 +716,51 @@ gst_sf_loop (GstElement * element) if (read) for (i = 0, l = this->channels; l; l = l->next, i++) { - channel = GST_SF_CHANNEL (l); + channel = GST_SF_CHANNEL (l); - /* don't push on disconnected pads -- useful for ::create-pads=TRUE */ - if (!GST_PAD_PEER (channel->pad)) - continue; + /* don't push on disconnected pads -- useful for ::create-pads=TRUE */ + if (!GST_PAD_PEER (channel->pad)) + continue; - if (!channel->caps_set) { - GstCaps *caps = - gst_caps_copy (GST_PAD_CAPS (GST_SF_CHANNEL (l)->pad)); - if (!caps) - caps = gst_caps_copy - (GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (GST_SF_CHANNEL - (l)->pad))); - gst_caps_set_simple (caps, "rate", G_TYPE_INT, this->rate, - "buffer-frames", G_TYPE_INT, this->buffer_frames, NULL); - if (!gst_pad_try_set_caps (GST_SF_CHANNEL (l)->pad, caps)) { - GST_ELEMENT_ERROR (this, CORE, NEGOTIATION, (NULL), - ("Opened file with sample rate %d, but could not set caps", - this->rate)); - gst_sf_close_file (this); - return; - } - channel->caps_set = TRUE; - } + if (!channel->caps_set) { + GstCaps *caps = + gst_caps_copy (GST_PAD_CAPS (GST_SF_CHANNEL (l)->pad)); + if (!caps) + caps = gst_caps_copy + (GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (GST_SF_CHANNEL + (l)->pad))); + gst_caps_set_simple (caps, "rate", G_TYPE_INT, this->rate, + "buffer-frames", G_TYPE_INT, this->buffer_frames, NULL); + if (!gst_pad_try_set_caps (GST_SF_CHANNEL (l)->pad, caps)) { + GST_ELEMENT_ERROR (this, CORE, NEGOTIATION, (NULL), + ("Opened file with sample rate %d, but could not set caps", + this->rate)); + gst_sf_close_file (this); + return; + } + channel->caps_set = TRUE; + } - out = gst_buffer_new_and_alloc (read * sizeof (float)); - data = (gfloat *) GST_BUFFER_DATA (out); - for (j = 0; j < read; j++) - data[j] = buf[j * nchannels + i % nchannels]; - gst_pad_push (channel->pad, GST_DATA (out)); + out = gst_buffer_new_and_alloc (read * sizeof (float)); + data = (gfloat *) GST_BUFFER_DATA (out); + for (j = 0; j < read; j++) + data[j] = buf[j * nchannels + i % nchannels]; + gst_pad_push (channel->pad, GST_DATA (out)); } this->time += read * (GST_SECOND / this->rate); gst_audio_clock_update_time ((GstAudioClock *) this->provided_clock, - this->time); + this->time); if (eos) { if (this->loop) { - sf_seek (this->file, (sf_count_t) 0, SEEK_SET); - eos = 0; + sf_seek (this->file, (sf_count_t) 0, SEEK_SET); + eos = 0; } else { - for (l = this->channels; l; l = l->next) - gst_pad_push (GST_SF_CHANNEL (l)->pad, - GST_DATA (gst_event_new (GST_EVENT_EOS))); - gst_element_set_eos (element); + for (l = this->channels; l; l = l->next) + gst_pad_push (GST_SF_CHANNEL (l)->pad, + GST_DATA (gst_event_new (GST_EVENT_EOS))); + gst_element_set_eos (element); } } } else { @@ -777,7 +780,7 @@ gst_sf_loop (GstElement * element) num_to_write = buffer_frames; INFO_OBJ (this, "looping, buffer_frames=%d, nchannels=%d", buffer_frames, - nchannels); + nchannels); for (i = 0, l = this->channels; l; l = l->next, i++) { channel = GST_SF_CHANNEL (l); @@ -786,40 +789,40 @@ gst_sf_loop (GstElement * element) in = GST_BUFFER (gst_pad_pull (channel->pad)); if (buffer_frames == 0) { - /* pulling a buffer from the pad should have caused capsnego to occur, - which then would set this->buffer_frames to a new value */ - buffer_frames = this->buffer_frames; - if (buffer_frames == 0) { - GST_ELEMENT_ERROR (element, CORE, NEGOTIATION, (NULL), - ("format wasn't negotiated before chain function")); - return; - } - buf = this->buffer; - num_to_write = buffer_frames; + /* pulling a buffer from the pad should have caused capsnego to occur, + which then would set this->buffer_frames to a new value */ + buffer_frames = this->buffer_frames; + if (buffer_frames == 0) { + GST_ELEMENT_ERROR (element, CORE, NEGOTIATION, (NULL), + ("format wasn't negotiated before chain function")); + return; + } + buf = this->buffer; + num_to_write = buffer_frames; } if (!GST_FLAG_IS_SET (this, GST_SF_OPEN)) - if (!gst_sf_open_file (this)) - return; /* we've already set gst_element_error */ + if (!gst_sf_open_file (this)) + return; /* we've already set gst_element_error */ if (GST_IS_EVENT (in)) { - switch (GST_EVENT_TYPE (in)) { - case GST_EVENT_EOS: - case GST_EVENT_INTERRUPT: - num_to_write = 0; - break; - default: - goto pull_again; - break; - } + switch (GST_EVENT_TYPE (in)) { + case GST_EVENT_EOS: + case GST_EVENT_INTERRUPT: + num_to_write = 0; + break; + default: + goto pull_again; + break; + } } if (num_to_write) { - data = (gfloat *) GST_BUFFER_DATA (in); - num_to_write = - MIN (num_to_write, GST_BUFFER_SIZE (in) / sizeof (gfloat)); - for (j = 0; j < num_to_write; j++) - buf[j * nchannels + i % nchannels] = data[j]; + data = (gfloat *) GST_BUFFER_DATA (in); + num_to_write = + MIN (num_to_write, GST_BUFFER_SIZE (in) / sizeof (gfloat)); + for (j = 0; j < num_to_write; j++) + buf[j * nchannels + i % nchannels] = data[j]; } gst_data_unref ((GstData *) in); @@ -828,14 +831,14 @@ gst_sf_loop (GstElement * element) if (num_to_write) { written = sf_writef_float (this->file, buf, num_to_write); if (written != num_to_write) - GST_ELEMENT_ERROR (element, RESOURCE, WRITE, - (_("Could not write to file \"%s\"."), this->filename), - ("soundfile error: %s", sf_strerror (this->file))); + GST_ELEMENT_ERROR (element, RESOURCE, WRITE, + (_("Could not write to file \"%s\"."), this->filename), + ("soundfile error: %s", sf_strerror (this->file))); } this->time += num_to_write * (GST_SECOND / this->rate); gst_audio_clock_update_time ((GstAudioClock *) this->provided_clock, - this->time); + this->time); if (num_to_write != buffer_frames) gst_element_set_eos (element); diff --git a/ext/swfdec/gstswfdec.c b/ext/swfdec/gstswfdec.c index 06723d1e87..b7c3c3dbc9 100644 --- a/ext/swfdec/gstswfdec.c +++ b/ext/swfdec/gstswfdec.c @@ -57,12 +57,12 @@ GST_STATIC_PAD_TEMPLATE ("audio_00", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "rate = (int) 44100, " - "channels = (int) 2, " - "endianness = (int) BYTE_ORDER, " - "width = (int) 16, " - "depth = (int) 16, " - "signed = (boolean) true, " "buffer-frames = (int) [ 1, MAX ]") + "rate = (int) 44100, " + "channels = (int) 2, " + "endianness = (int) BYTE_ORDER, " + "width = (int) 16, " + "depth = (int) 16, " + "signed = (boolean) true, " "buffer-frames = (int) [ 1, MAX ]") ); static GstStaticPadTemplate sink_template_factory = @@ -118,8 +118,9 @@ gst_swfdec_get_type (void) 0, (GInstanceInitFunc) gst_swfdec_init, }; + swfdec_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSwfdec", &swfdec_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSwfdec", &swfdec_info, 0); } return swfdec_type; } @@ -167,7 +168,7 @@ gst_swfdec_video_getcaps (GstPad * pad) caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad)); if (swfdec->have_format) { gst_caps_set_simple (caps, - "framerate", G_TYPE_DOUBLE, swfdec->frame_rate, NULL); + "framerate", G_TYPE_DOUBLE, swfdec->frame_rate, NULL); } return caps; @@ -247,20 +248,20 @@ gst_swfdec_loop (GstElement * element) buf = GST_BUFFER (gst_pad_pull (swfdec->sinkpad)); if (GST_IS_EVENT (buf)) { switch (GST_EVENT_TYPE (buf)) { - case GST_EVENT_EOS: - GST_DEBUG ("got eos"); - break; - default: - GST_DEBUG ("got event"); - break; + case GST_EVENT_EOS: + GST_DEBUG ("got eos"); + break; + default: + GST_DEBUG ("got event"); + break; } } else { if (!GST_BUFFER_DATA (buf)) { - GST_DEBUG ("expected non-null buffer"); + GST_DEBUG ("expected non-null buffer"); } ret = swfdec_decoder_addbits (swfdec->state, - GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf)); + GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf)); } } @@ -269,16 +270,16 @@ gst_swfdec_loop (GstElement * element) GstPadLinkReturn link_ret; swfdec_decoder_get_image_size (swfdec->state, - &swfdec->width, &swfdec->height); + &swfdec->width, &swfdec->height); swfdec_decoder_get_rate (swfdec->state, &swfdec->rate); swfdec->interval = GST_SECOND / swfdec->rate; caps = gst_caps_copy (gst_pad_get_pad_template_caps (swfdec->videopad)); swfdec_decoder_get_rate (swfdec->state, &swfdec->frame_rate); gst_caps_set_simple (caps, - "framerate", G_TYPE_DOUBLE, swfdec->frame_rate, - "height", G_TYPE_INT, swfdec->height, - "width", G_TYPE_INT, swfdec->width, NULL); + "framerate", G_TYPE_DOUBLE, swfdec->frame_rate, + "height", G_TYPE_INT, swfdec->height, + "width", G_TYPE_INT, swfdec->width, NULL); link_ret = gst_pad_try_set_caps (swfdec->videopad, caps); if (GST_PAD_LINK_SUCCESSFUL (link_ret)) { /* good */ @@ -301,7 +302,7 @@ gst_swfdec_loop (GstElement * element) //GST_BUFFER_SIZE(newbuf) = swfdec->width * swfdec->height * 3; newbuf = gst_pad_alloc_buffer (swfdec->videopad, GST_BUFFER_OFFSET_NONE, - swfdec->width * 4 * swfdec->height); + swfdec->width * 4 * swfdec->height); swfdec_decoder_get_image (swfdec->state, &data); copy_image (GST_BUFFER_DATA (newbuf), data, swfdec->width, swfdec->height); @@ -398,16 +399,16 @@ gst_swfdec_convert_sink (GstPad * pad, GstFormat src_format, gint64 src_value, switch (src_format) { case GST_FORMAT_BYTES: switch (*dest_format) { - case GST_FORMAT_TIME: - default: - res = FALSE; + case GST_FORMAT_TIME: + default: + res = FALSE; } break; case GST_FORMAT_TIME: switch (*dest_format) { - case GST_FORMAT_BYTES: - default: - res = FALSE; + case GST_FORMAT_BYTES: + default: + res = FALSE; } break; default: @@ -430,43 +431,43 @@ gst_swfdec_convert_src (GstPad * pad, GstFormat src_format, gint64 src_value, switch (src_format) { case GST_FORMAT_BYTES: switch (*dest_format) { - case GST_FORMAT_TIME: - default: - res = FALSE; + case GST_FORMAT_TIME: + default: + res = FALSE; } break; case GST_FORMAT_TIME: switch (*dest_format) { - case GST_FORMAT_BYTES: - *dest_value = src_value * 6 * (swfdec->width * swfdec->height >> 2) * - video_rates[swfdec->decoder->frame_rate_code] / GST_SECOND; - break; - case GST_FORMAT_DEFAULT: - *dest_value = - src_value * video_rates[swfdec->decoder->frame_rate_code] / - GST_SECOND; - break; - default: - res = FALSE; + case GST_FORMAT_BYTES: + *dest_value = src_value * 6 * (swfdec->width * swfdec->height >> 2) * + video_rates[swfdec->decoder->frame_rate_code] / GST_SECOND; + break; + case GST_FORMAT_DEFAULT: + *dest_value = + src_value * video_rates[swfdec->decoder->frame_rate_code] / + GST_SECOND; + break; + default: + res = FALSE; } break; case GST_FORMAT_DEFAULT: switch (*dest_format) { - case GST_FORMAT_TIME: - if (video_rates[swfdec->decoder->frame_rate_code] != 0.0) { - *dest_value = src_value * GST_SECOND / - video_rates[swfdec->decoder->frame_rate_code]; - } else - res = FALSE; - break; - case GST_FORMAT_BYTES: - *dest_value = src_value * 6 * (swfdec->width * swfdec->height >> 2); - break; - case GST_FORMAT_DEFAULT: - *dest_value = src_value; - break; - default: - res = FALSE; + case GST_FORMAT_TIME: + if (video_rates[swfdec->decoder->frame_rate_code] != 0.0) { + *dest_value = src_value * GST_SECOND / + video_rates[swfdec->decoder->frame_rate_code]; + } else + res = FALSE; + break; + case GST_FORMAT_BYTES: + *dest_value = src_value * 6 * (swfdec->width * swfdec->height >> 2); + break; + case GST_FORMAT_DEFAULT: + *dest_value = src_value; + break; + default: + res = FALSE; } break; default: @@ -489,31 +490,31 @@ gst_swfdec_src_query (GstPad * pad, GstQueryType type, case GST_QUERY_TOTAL: { switch (*format) { - case GST_FORMAT_TIME: - { - int n_frames; - int ret; + case GST_FORMAT_TIME: + { + int n_frames; + int ret; - res = FALSE; - ret = swfdec_decoder_get_n_frames (swfdec->state, &n_frames); - if (ret == SWF_OK) { - *value = n_frames * swfdec->interval; - res = TRUE; - } - break; - } - default: - res = FALSE; - break; + res = FALSE; + ret = swfdec_decoder_get_n_frames (swfdec->state, &n_frames); + if (ret == SWF_OK) { + *value = n_frames * swfdec->interval; + res = TRUE; + } + break; + } + default: + res = FALSE; + break; } break; } case GST_QUERY_POSITION: { switch (*format) { - default: - res = FALSE; - break; + default: + res = FALSE; + break; } break; } @@ -532,7 +533,8 @@ gst_swfdec_src_event (GstPad * pad, GstEvent * event) gboolean res = TRUE; GstSwfdec *swfdec; static const GstFormat formats[] = { GST_FORMAT_TIME, GST_FORMAT_BYTES }; -#define MAX_SEEK_FORMATS 1 /* we can only do time seeking for now */ + +#define MAX_SEEK_FORMATS 1 /* we can only do time seeking for now */ gint i; swfdec = GST_SWFDEC (gst_pad_get_parent (pad)); @@ -549,11 +551,11 @@ gst_swfdec_src_event (GstPad * pad, GstEvent * event) /* first bring the src_format to TIME */ if (!gst_pad_convert (pad, - GST_EVENT_SEEK_FORMAT (event), GST_EVENT_SEEK_OFFSET (event), - &format, &src_offset)) { - /* didn't work, probably unsupported seek format then */ - res = FALSE; - break; + GST_EVENT_SEEK_FORMAT (event), GST_EVENT_SEEK_OFFSET (event), + &format, &src_offset)) { + /* didn't work, probably unsupported seek format then */ + res = FALSE; + break; } /* shave off the flush flag, we'll need it later */ @@ -564,26 +566,26 @@ gst_swfdec_src_event (GstPad * pad, GstEvent * event) /* while we did not exhaust our seek formats without result */ for (i = 0; i < MAX_SEEK_FORMATS && !res; i++) { - gint64 desired_offset; + gint64 desired_offset; - format = formats[i]; + format = formats[i]; - /* try to convert requested format to one we can seek with on the sinkpad */ - if (gst_pad_convert (swfdec->sinkpad, GST_FORMAT_TIME, src_offset, - &format, &desired_offset)) { - GstEvent *seek_event; + /* try to convert requested format to one we can seek with on the sinkpad */ + if (gst_pad_convert (swfdec->sinkpad, GST_FORMAT_TIME, src_offset, + &format, &desired_offset)) { + GstEvent *seek_event; - /* conversion succeeded, create the seek */ - seek_event = - gst_event_new_seek (formats[i] | GST_SEEK_METHOD_SET | flush, - desired_offset); - /* do the seekk */ - if (gst_pad_send_event (GST_PAD_PEER (swfdec->sinkpad), seek_event)) { - /* seek worked, we're done, loop will exit */ - res = TRUE; - } - } - /* at this point, either the seek worked or res == FALSE */ + /* conversion succeeded, create the seek */ + seek_event = + gst_event_new_seek (formats[i] | GST_SEEK_METHOD_SET | flush, + desired_offset); + /* do the seekk */ + if (gst_pad_send_event (GST_PAD_PEER (swfdec->sinkpad), seek_event)) { + /* seek worked, we're done, loop will exit */ + res = TRUE; + } + } + /* at this point, either the seek worked or res == FALSE */ } break; } @@ -630,8 +632,8 @@ gst_swfdec_change_state (GstElement * element) /* if we are not closed by an EOS event do so now, this cen send a few frames but * we are prepared to not really send them (see above) */ if (!swfdec->closed) { - /*swf_close (swfdec->decoder); */ - swfdec->closed = TRUE; + /*swf_close (swfdec->decoder); */ + swfdec->closed = TRUE; } //gst_swfdec_vo_destroy (swfdec); break; diff --git a/ext/tarkin/gsttarkin.c b/ext/tarkin/gsttarkin.c index a87575d906..0e8d859a7d 100644 --- a/ext/tarkin/gsttarkin.c +++ b/ext/tarkin/gsttarkin.c @@ -28,11 +28,11 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "tarkinenc", GST_RANK_NONE, - GST_TYPE_TARKINENC)) + GST_TYPE_TARKINENC)) return FALSE; if (!gst_element_register (plugin, "tarkindec", GST_RANK_NONE, - GST_TYPE_TARKINDEC)) + GST_TYPE_TARKINDEC)) return FALSE; return TRUE; diff --git a/ext/tarkin/gsttarkindec.c b/ext/tarkin/gsttarkindec.c index b9f98784bd..a40c5319c8 100644 --- a/ext/tarkin/gsttarkindec.c +++ b/ext/tarkin/gsttarkindec.c @@ -85,8 +85,8 @@ tarkindec_get_type (void) }; tarkindec_type = - g_type_register_static (GST_TYPE_ELEMENT, "TarkinDec", &tarkindec_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "TarkinDec", &tarkindec_info, + 0); } return tarkindec_type; } @@ -145,7 +145,7 @@ gst_tarkindec_class_init (TarkinDecClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BITRATE, g_param_spec_int ("bitrate", "bitrate", "bitrate", - G_MININT, G_MAXINT, 3000, G_PARAM_READWRITE)); + G_MININT, G_MAXINT, 3000, G_PARAM_READWRITE)); parent_class = g_type_class_ref (GST_TYPE_ELEMENT); @@ -200,7 +200,7 @@ gst_tarkindec_chain (GstPad * pad, GstData * _data) if (!tarkindec->setup) { GST_ELEMENT_ERROR (tarkindec, CORE, NEGOTATION, (NULL), - ("decoder not initialized (input is not tarkin?)")); + ("decoder not initialized (input is not tarkin?)")); if (GST_IS_BUFFER (buf)) gst_buffer_unref (buf); else @@ -212,8 +212,8 @@ gst_tarkindec_chain (GstPad * pad, GstData * _data) switch (GST_EVENT_TYPE (buf)) { case GST_EVENT_EOS: default: - gst_pad_event_default (pad, GST_EVENT (buf)); - break; + gst_pad_event_default (pad, GST_EVENT (buf)); + break; } } else { gchar *data; @@ -235,43 +235,43 @@ gst_tarkindec_chain (GstPad * pad, GstData * _data) ogg_stream_pagein (&tarkindec->os, &tarkindec->og); while (ogg_stream_packetout (&tarkindec->os, &tarkindec->op)) { - if (tarkindec->op.e_o_s) - break; - if (tarkindec->nheader < 3) { /* 3 first packets to headerin */ - tarkin_synthesis_headerin (&tarkindec->ti, &tarkindec->tc, - &tarkindec->op); + if (tarkindec->op.e_o_s) + break; + if (tarkindec->nheader < 3) { /* 3 first packets to headerin */ + tarkin_synthesis_headerin (&tarkindec->ti, &tarkindec->tc, + &tarkindec->op); - if (tarkindec->nheader == 2) { - tarkin_synthesis_init (tarkindec->tarkin_stream, &tarkindec->ti); - } - tarkindec->nheader++; - } else { - tarkin_synthesis_packetin (tarkindec->tarkin_stream, &tarkindec->op); + if (tarkindec->nheader == 2) { + tarkin_synthesis_init (tarkindec->tarkin_stream, &tarkindec->ti); + } + tarkindec->nheader++; + } else { + tarkin_synthesis_packetin (tarkindec->tarkin_stream, &tarkindec->op); - while (tarkin_synthesis_frameout (tarkindec->tarkin_stream, &rgb, 0, - &date) == 0) { - GstBuffer *outbuf; + while (tarkin_synthesis_frameout (tarkindec->tarkin_stream, &rgb, 0, + &date) == 0) { + GstBuffer *outbuf; - layer = &tarkindec->tarkin_stream->layer->desc; + layer = &tarkindec->tarkin_stream->layer->desc; - if (!GST_PAD_CAPS (tarkindec->srcpad)) { - if (gst_pad_try_set_caps (tarkindec->srcpad, GST_CAPS_NEW ("tarkin_raw", "video/x-raw-rgb", "bpp", GST_PROPS_INT (24), "depth", GST_PROPS_INT (24), "endianness", GST_PROPS_INT (G_BYTE_ORDER), "red_mask", GST_PROPS_INT (0xff0000), "green_mask", GST_PROPS_INT (0xff00), "blue_mask", GST_PROPS_INT (0xff), "width", GST_PROPS_INT (layer->width), "height", GST_PROPS_INT (layer->height), "framerate", GST_PROPS_FLOAT (0.) /* FIXME!!! */ - )) <= 0) { - GST_ELEMENT_ERROR (tarkindec, CORE, NEGOTATION, (NULL), - ("could not output format")); - gst_buffer_unref (buf); - return; - } - } - outbuf = gst_buffer_new (); - GST_BUFFER_DATA (outbuf) = rgb; - GST_BUFFER_SIZE (outbuf) = layer->width * layer->height * 3; - GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_DONTFREE); - gst_pad_push (tarkindec->srcpad, GST_DATA (outbuf)); + if (!GST_PAD_CAPS (tarkindec->srcpad)) { + if (gst_pad_try_set_caps (tarkindec->srcpad, GST_CAPS_NEW ("tarkin_raw", "video/x-raw-rgb", "bpp", GST_PROPS_INT (24), "depth", GST_PROPS_INT (24), "endianness", GST_PROPS_INT (G_BYTE_ORDER), "red_mask", GST_PROPS_INT (0xff0000), "green_mask", GST_PROPS_INT (0xff00), "blue_mask", GST_PROPS_INT (0xff), "width", GST_PROPS_INT (layer->width), "height", GST_PROPS_INT (layer->height), "framerate", GST_PROPS_FLOAT (0.) /* FIXME!!! */ + )) <= 0) { + GST_ELEMENT_ERROR (tarkindec, CORE, NEGOTATION, (NULL), + ("could not output format")); + gst_buffer_unref (buf); + return; + } + } + outbuf = gst_buffer_new (); + GST_BUFFER_DATA (outbuf) = rgb; + GST_BUFFER_SIZE (outbuf) = layer->width * layer->height * 3; + GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_DONTFREE); + gst_pad_push (tarkindec->srcpad, GST_DATA (outbuf)); - tarkin_synthesis_freeframe (tarkindec->tarkin_stream, rgb); - } - } + tarkin_synthesis_freeframe (tarkindec->tarkin_stream, rgb); + } + } } } gst_buffer_unref (buf); diff --git a/ext/tarkin/gsttarkinenc.c b/ext/tarkin/gsttarkinenc.c index 4c62303dd6..f1d3853d3a 100644 --- a/ext/tarkin/gsttarkinenc.c +++ b/ext/tarkin/gsttarkinenc.c @@ -86,8 +86,8 @@ tarkinenc_get_type (void) }; tarkinenc_type = - g_type_register_static (GST_TYPE_ELEMENT, "TarkinEnc", &tarkinenc_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "TarkinEnc", &tarkinenc_info, + 0); } return tarkinenc_type; } @@ -146,15 +146,15 @@ gst_tarkinenc_class_init (TarkinEncClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BITRATE, g_param_spec_int ("bitrate", "bitrate", "bitrate", - G_MININT, G_MAXINT, 3000, G_PARAM_READWRITE)); + G_MININT, G_MAXINT, 3000, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_S_MOMENTS, g_param_spec_int ("s_moments", "Synthesis Moments", - "Number of vanishing moments for the synthesis filter", - 1, 4, 2, G_PARAM_READWRITE)); + "Number of vanishing moments for the synthesis filter", + 1, 4, 2, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_A_MOMENTS, g_param_spec_int ("a_moments", "Analysis Moments", - "Number of vanishing moments for the analysis filter", - 1, 4, 2, G_PARAM_READWRITE)); + "Number of vanishing moments for the analysis filter", + 1, 4, 2, G_PARAM_READWRITE)); parent_class = g_type_class_ref (GST_TYPE_ELEMENT); @@ -313,7 +313,7 @@ gst_tarkinenc_chain (GstPad * pad, GstData * _data) if (!tarkinenc->setup) { GST_ELEMENT_ERROR (tarkinenc, CORE, NEGOTIATION, (NULL), - ("encoder not initialized (input is not tarkin?)")); + ("encoder not initialized (input is not tarkin?)")); if (GST_IS_BUFFER (buf)) gst_buffer_unref (buf); else @@ -324,12 +324,12 @@ gst_tarkinenc_chain (GstPad * pad, GstData * _data) if (GST_IS_EVENT (buf)) { switch (GST_EVENT_TYPE (buf)) { case GST_EVENT_EOS: - tarkin_analysis_framein (tarkinenc->tarkin_stream, NULL, 0, NULL); /* EOS */ - tarkin_comment_clear (&tarkinenc->tc); - tarkin_stream_destroy (tarkinenc->tarkin_stream); + tarkin_analysis_framein (tarkinenc->tarkin_stream, NULL, 0, NULL); /* EOS */ + tarkin_comment_clear (&tarkinenc->tc); + tarkin_stream_destroy (tarkinenc->tarkin_stream); default: - gst_pad_event_default (pad, GST_EVENT (buf)); - break; + gst_pad_event_default (pad, GST_EVENT (buf)); + break; } } else { gchar *data; @@ -396,9 +396,9 @@ gst_tarkinenc_set_property (GObject * object, guint prop_id, s_moments = g_value_get_int (value); if (s_moments != 1 || s_moments != 2 || s_moments != 4) { - g_warning ("tarkinenc: s_moments must be 1, 2 or 4"); + g_warning ("tarkinenc: s_moments must be 1, 2 or 4"); } else { - tarkinenc->s_moments = s_moments; + tarkinenc->s_moments = s_moments; } break; } @@ -408,9 +408,9 @@ gst_tarkinenc_set_property (GObject * object, guint prop_id, a_moments = g_value_get_int (value); if (a_moments != 1 || a_moments != 2 || a_moments != 4) { - g_warning ("tarkinenc: a_moments must be 1, 2 or 4"); + g_warning ("tarkinenc: a_moments must be 1, 2 or 4"); } else { - tarkinenc->a_moments = a_moments; + tarkinenc->a_moments = a_moments; } break; } diff --git a/ext/tarkin/info.c b/ext/tarkin/info.c index 3b0871a30b..83fe1bae60 100644 --- a/ext/tarkin/info.c +++ b/ext/tarkin/info.c @@ -71,7 +71,7 @@ tarkin_comment_add (TarkinComment * vc, char *comment) void tarkin_comment_add_tag (TarkinComment * vc, char *tag, char *contents) { - char *comment = alloca (strlen (tag) + strlen (contents) + 2); /* +2 for = and \0 */ + char *comment = alloca (strlen (tag) + strlen (contents) + 2); /* +2 for = and \0 */ strcpy (comment, tag); strcat (comment, "="); @@ -99,7 +99,7 @@ tarkin_comment_query (TarkinComment * vc, char *tag, int count) { long i; int found = 0; - int taglen = strlen (tag) + 1; /* +1 for the = we append */ + int taglen = strlen (tag) + 1; /* +1 for the = we append */ char *fulltag = alloca (taglen + 1); strcpy (fulltag, tag); @@ -108,20 +108,20 @@ tarkin_comment_query (TarkinComment * vc, char *tag, int count) for (i = 0; i < vc->comments; i++) { if (!tagcompare (vc->user_comments[i], fulltag, taglen)) { if (count == found) - /* We return a pointer to the data, not a copy */ - return vc->user_comments[i] + taglen; + /* We return a pointer to the data, not a copy */ + return vc->user_comments[i] + taglen; else - found++; + found++; } } - return NULL; /* didn't find anything */ + return NULL; /* didn't find anything */ } int tarkin_comment_query_count (TarkinComment * vc, char *tag) { int i, count = 0; - int taglen = strlen (tag) + 1; /* +1 for the = we append */ + int taglen = strlen (tag) + 1; /* +1 for the = we append */ char *fulltag = alloca (taglen + 1); strcpy (fulltag, tag); @@ -143,7 +143,7 @@ tarkin_comment_clear (TarkinComment * vc) for (i = 0; i < vc->comments; i++) if (vc->user_comments[i]) - FREE (vc->user_comments[i]); + FREE (vc->user_comments[i]); if (vc->user_comments) FREE (vc->user_comments); if (vc->comment_lengths) @@ -200,7 +200,7 @@ _tarkin_unpack_info (TarkinInfo * vi, oggpack_buffer * opb) goto err_out; if (oggpack_read (opb, 1) != 1) - goto err_out; /* EOP check */ + goto err_out; /* EOP check */ #ifdef DBG_OGG printf ("Success\n"); @@ -245,7 +245,7 @@ _tarkin_unpack_comment (TarkinComment * vc, oggpack_buffer * opb) _v_readstring (opb, vc->user_comments[i], len); } if (oggpack_read (opb, 1) != 1) - goto err_out; /* EOP check */ + goto err_out; /* EOP check */ #ifdef DBG_OGG printf ("Success, read %d comments\n", vc->comments); @@ -284,55 +284,55 @@ _tarkin_unpack_layer_desc (TarkinInfo * vi, oggpack_buffer * opb) switch (layer->desc.format) { case TARKIN_GRAYSCALE: - layer->n_comp = 1; - layer->color_fwd_xform = grayscale_to_y; - layer->color_inv_xform = y_to_grayscale; - break; + layer->n_comp = 1; + layer->color_fwd_xform = grayscale_to_y; + layer->color_inv_xform = y_to_grayscale; + break; case TARKIN_RGB24: - layer->n_comp = 3; - layer->color_fwd_xform = rgb24_to_yuv; - layer->color_inv_xform = yuv_to_rgb24; - break; + layer->n_comp = 3; + layer->color_fwd_xform = rgb24_to_yuv; + layer->color_inv_xform = yuv_to_rgb24; + break; case TARKIN_RGB32: - layer->n_comp = 3; - layer->color_fwd_xform = rgb32_to_yuv; - layer->color_inv_xform = yuv_to_rgb32; - break; + layer->n_comp = 3; + layer->color_fwd_xform = rgb32_to_yuv; + layer->color_inv_xform = yuv_to_rgb32; + break; case TARKIN_RGBA: - layer->n_comp = 4; - layer->color_fwd_xform = rgba_to_yuv; - layer->color_inv_xform = yuv_to_rgba; - break; + layer->n_comp = 4; + layer->color_fwd_xform = rgba_to_yuv; + layer->color_inv_xform = yuv_to_rgba; + break; default: - return -TARKIN_INVALID_COLOR_FORMAT; + return -TARKIN_INVALID_COLOR_FORMAT; }; layer->waveletbuf = (Wavelet3DBuf **) CALLOC (layer->n_comp, - sizeof (Wavelet3DBuf *)); + sizeof (Wavelet3DBuf *)); layer->packet = MALLOC (layer->n_comp * sizeof (*layer->packet)); memset (layer->packet, 0, layer->n_comp * sizeof (*layer->packet)); for (j = 0; j < layer->n_comp; j++) { layer->waveletbuf[j] = wavelet_3d_buf_new (layer->desc.width, - layer->desc.height, layer->desc.frames_per_buf); + layer->desc.height, layer->desc.frames_per_buf); layer->packet[j].data = MALLOC (layer->desc.bitstream_len); layer->packet[j].storage = layer->desc.bitstream_len; } - vi->max_bitstream_len += layer->desc.bitstream_len + 2 * 10 * sizeof (uint32_t) * layer->n_comp; /* truncation tables */ + vi->max_bitstream_len += layer->desc.bitstream_len + 2 * 10 * sizeof (uint32_t) * layer->n_comp; /* truncation tables */ #ifdef DBG_OGG printf - ("\n layer%d: size %dx%dx%d, format %d, a_m %d, s_m %d, %d fpb\n", - i, layer->desc.width, layer->desc.height, layer->n_comp, - layer->desc.format, layer->desc.a_moments, layer->desc.s_moments, - layer->desc.frames_per_buf); + ("\n layer%d: size %dx%dx%d, format %d, a_m %d, s_m %d, %d fpb\n", + i, layer->desc.width, layer->desc.height, layer->n_comp, + layer->desc.format, layer->desc.a_moments, layer->desc.s_moments, + layer->desc.frames_per_buf); #endif - } /* for each layer */ + } /* for each layer */ if (oggpack_read (opb, 1) != 1) - goto err_out; /* EOP check */ + goto err_out; /* EOP check */ #ifdef DBG_OGG printf ("Success\n"); @@ -369,42 +369,42 @@ tarkin_synthesis_headerin (TarkinInfo * vi, TarkinComment * vc, ogg_packet * op) memset (buffer, 0, 6); _v_readstring (&opb, buffer, 6); if (memcmp (buffer, "tarkin", 6)) { - /* not a tarkin header */ - return (-TARKIN_NOT_TARKIN); + /* not a tarkin header */ + return (-TARKIN_NOT_TARKIN); } switch (packtype) { - case 0x01: /* least significant *bit* is read first */ - if (!op->b_o_s) { - /* Not the initial packet */ - return (-TARKIN_BAD_HEADER); - } - if (vi->inter.numerator != 0) { - /* previously initialized info header */ - return (-TARKIN_BAD_HEADER); - } + case 0x01: /* least significant *bit* is read first */ + if (!op->b_o_s) { + /* Not the initial packet */ + return (-TARKIN_BAD_HEADER); + } + if (vi->inter.numerator != 0) { + /* previously initialized info header */ + return (-TARKIN_BAD_HEADER); + } - return (_tarkin_unpack_info (vi, &opb)); + return (_tarkin_unpack_info (vi, &opb)); - case 0x03: /* least significant *bit* is read first */ - if (vi->inter.denominator == 0) { - /* um... we didn't get the initial header */ - return (-TARKIN_BAD_HEADER); - } + case 0x03: /* least significant *bit* is read first */ + if (vi->inter.denominator == 0) { + /* um... we didn't get the initial header */ + return (-TARKIN_BAD_HEADER); + } - return (_tarkin_unpack_comment (vc, &opb)); + return (_tarkin_unpack_comment (vc, &opb)); - case 0x05: /* least significant *bit* is read first */ - if (vi->inter.numerator == 0 || vc->vendor == NULL) { - /* um... we didn;t get the initial header or comments yet */ - return (-TARKIN_BAD_HEADER); - } + case 0x05: /* least significant *bit* is read first */ + if (vi->inter.numerator == 0 || vc->vendor == NULL) { + /* um... we didn;t get the initial header or comments yet */ + return (-TARKIN_BAD_HEADER); + } - return (_tarkin_unpack_layer_desc (vi, &opb)); + return (_tarkin_unpack_layer_desc (vi, &opb)); - default: - /* Not a valid tarkin header type */ - return (-TARKIN_BAD_HEADER); - break; + default: + /* Not a valid tarkin header type */ + return (-TARKIN_BAD_HEADER); + break; } } } @@ -462,10 +462,10 @@ _tarkin_pack_comment (oggpack_buffer * opb, TarkinComment * vc) for (i = 0; i < vc->comments; i++) { if (vc->user_comments[i]) { - oggpack_write (opb, vc->comment_lengths[i], 32); - _v_writestring (opb, vc->user_comments[i], vc->comment_lengths[i]); + oggpack_write (opb, vc->comment_lengths[i], 32); + _v_writestring (opb, vc->user_comments[i], vc->comment_lengths[i]); } else { - oggpack_write (opb, 0, 32); + oggpack_write (opb, 0, 32); } } } @@ -503,9 +503,9 @@ _tarkin_pack_layer_desc (oggpack_buffer * opb, TarkinInfo * vi) #ifdef DBG_OGG printf (" res. %dx%d, format %d, a_m %d, s_m %d, fpb %d\n", - layer->desc.width, layer->desc.height, layer->desc.format, - layer->desc.a_moments, layer->desc.s_moments, - layer->desc.frames_per_buf); + layer->desc.width, layer->desc.height, layer->desc.format, + layer->desc.a_moments, layer->desc.s_moments, + layer->desc.frames_per_buf); #endif } diff --git a/ext/tarkin/mem.c b/ext/tarkin/mem.c index 6b337ef3ad..5ef59f2f65 100644 --- a/ext/tarkin/mem.c +++ b/ext/tarkin/mem.c @@ -16,7 +16,8 @@ typedef struct char *allocated_in_func; char *allocated_in_file; unsigned int allocated_in_line; -} MemDesc; +} +MemDesc; static int initialized = 0; @@ -38,8 +39,8 @@ dbg_memleaks_done (int exitcode, void *dummy) MemDesc *d = &alloc_list[i]; fprintf (stderr, "chunk %p allocated in %s (%s: %u) not free'd !!\n", - d->mem, d->allocated_in_func, d->allocated_in_file, - d->allocated_in_line); + d->mem, d->allocated_in_func, d->allocated_in_file, + d->allocated_in_line); } free (alloc_list); } @@ -114,9 +115,9 @@ dbg_realloc (char *file, int line, char *func, char *what, if (mem != NULL) { fprintf (stderr, - "%s: trying to reallocate unknown chunk %p (%s)\n" - " in %s (%s: %u) !!!\n", - __FUNCTION__, mem, what, func, file, line); + "%s: trying to reallocate unknown chunk %p (%s)\n" + " in %s (%s: %u) !!!\n", + __FUNCTION__, mem, what, func, file, line); exit (-1); } @@ -137,7 +138,7 @@ dbg_free (char *file, int line, char *func, char *what, void *mem) free (mem); alloc_count--; memmove (&alloc_list[i], &alloc_list[i + 1], - (alloc_count - i) * sizeof (MemDesc)); + (alloc_count - i) * sizeof (MemDesc)); return; } } diff --git a/ext/tarkin/tarkin.c b/ext/tarkin/tarkin.c index b15b5512b4..70bfefc0bd 100644 --- a/ext/tarkin/tarkin.c +++ b/ext/tarkin/tarkin.c @@ -42,8 +42,8 @@ tarkin_stream_destroy (TarkinStream * s) for (i = 0; i < s->n_layers; i++) { if (s->layer[i].waveletbuf) { for (j = 0; j < s->layer[i].n_comp; j++) { - wavelet_3d_buf_destroy (s->layer[i].waveletbuf[j]); - FREE (s->layer[i].packet[j].data); + wavelet_3d_buf_destroy (s->layer[i].waveletbuf[j]); + FREE (s->layer[i].packet[j].data); } FREE (s->layer[i].waveletbuf); FREE (s->layer[i].packet); @@ -141,7 +141,7 @@ tarkin_analysis_add_layer (TarkinStream * s, TarkinVideoLayerDesc * tvld) for (i = 0; i < layer->n_comp; i++) { layer->waveletbuf[i] = wavelet_3d_buf_new (layer->desc.width, - layer->desc.height, layer->desc.frames_per_buf); + layer->desc.height, layer->desc.frames_per_buf); layer->packet[i].data = MALLOC (layer->desc.bitstream_len); layer->packet[i].storage = layer->desc.bitstream_len; } @@ -165,7 +165,7 @@ _analysis_packetout (TarkinStream * s, uint32_t layer_id, uint32_t comp) data_len = s->layer[layer_id].packet[comp].data_len; oggpack_writeinit (&opb); - oggpack_write (&opb, 0, 8); /* No feature flags for now */ + oggpack_write (&opb, 0, 8); /* No feature flags for now */ oggpack_write (&opb, layer_id, 12); oggpack_write (&opb, comp, 12); for (i = 0; i < data_len; i++) @@ -180,7 +180,7 @@ _analysis_packetout (TarkinStream * s, uint32_t layer_id, uint32_t comp) printf ("dbg_ogg: writing packet layer %d, comp %d, data_len %d %s\n", layer_id, comp, data_len, op.e_o_s ? "eos" : ""); #endif - s->layer[layer_id].packet[comp].data_len = 0; /* so direct call => eos */ + s->layer[layer_id].packet[comp].data_len = 0; /* so direct call => eos */ return (s->packet_out (s, &op)); } @@ -198,31 +198,31 @@ _stream_flush (TarkinStream * s) uint32_t comp_bitstream_len; TarkinPacket *packet = layer->packet + j; - /** + /** * implicit 6:1:1 subsampling */ if (j == 0) - comp_bitstream_len = - 6 * layer->desc.bitstream_len / (layer->n_comp + 5); + comp_bitstream_len = + 6 * layer->desc.bitstream_len / (layer->n_comp + 5); else - comp_bitstream_len = layer->desc.bitstream_len / (layer->n_comp + 5); + comp_bitstream_len = layer->desc.bitstream_len / (layer->n_comp + 5); if (packet->storage < comp_bitstream_len) { - packet->storage = comp_bitstream_len; - packet->data = REALLOC (packet->data, comp_bitstream_len); + packet->storage = comp_bitstream_len; + packet->data = REALLOC (packet->data, comp_bitstream_len); } wavelet_3d_buf_dump ("color-%d-%03d.pgm", - s->current_frame, j, layer->waveletbuf[j], j == 0 ? 0 : 128); + s->current_frame, j, layer->waveletbuf[j], j == 0 ? 0 : 128); wavelet_3d_buf_fwd_xform (layer->waveletbuf[j], - layer->desc.a_moments, layer->desc.s_moments); + layer->desc.a_moments, layer->desc.s_moments); wavelet_3d_buf_dump ("coeff-%d-%03d.pgm", - s->current_frame, j, layer->waveletbuf[j], 128); + s->current_frame, j, layer->waveletbuf[j], 128); packet->data_len = wavelet_3d_buf_encode_coeff (layer->waveletbuf[j], - packet->data, comp_bitstream_len); + packet->data, comp_bitstream_len); _analysis_packetout (s, i, j); } @@ -237,7 +237,7 @@ tarkin_analysis_framein (TarkinStream * s, uint8_t * frame, TarkinVideoLayer *layer; if (!frame) - return (_analysis_packetout (s, 0, 0)); /* eos */ + return (_analysis_packetout (s, 0, 0)); /* eos */ if ((layer_id >= s->n_layers) || (date->denominator == 0)) return (TARKIN_FAULT); @@ -286,7 +286,7 @@ TarkinError tarkin_synthesis_init (TarkinStream * s, TarkinInfo * ti) { s->ti = ti; - s->layer = ti->layer; /* It was malloc()ed by headerin() */ + s->layer = ti->layer; /* It was malloc()ed by headerin() */ s->n_layers = ti->n_layers; return (TARKIN_OK); } @@ -307,17 +307,17 @@ tarkin_synthesis_packetin (TarkinStream * s, ogg_packet * op) #endif oggpack_readinit (&opb, op->packet, op->bytes); flags = oggpack_read (&opb, 8); - layer_id = oggpack_read (&opb, 12); /* Theses are required for */ - comp = oggpack_read (&opb, 12); /* data hole handling (or maybe - * packetno would be enough ?) */ + layer_id = oggpack_read (&opb, 12); /* Theses are required for */ + comp = oggpack_read (&opb, 12); /* data hole handling (or maybe + * packetno would be enough ?) */ nread = 4; - if (flags) { /* This is void "infinite future features" feature ;) */ + if (flags) { /* This is void "infinite future features" feature ;) */ if (flags & 1 << 7) { junk = flags; while (junk & 1 << 7) - junk = oggpack_read (&opb, 8); /* allow for many future flags - that must be correctly ordonned. */ + junk = oggpack_read (&opb, 8); /* allow for many future flags + that must be correctly ordonned. */ } /* This shows how to get a feature's data: if (flags & TARKIN_FLAGS_EXAMPLE){ @@ -326,7 +326,7 @@ tarkin_synthesis_packetin (TarkinStream * s, ogg_packet * op) tp->example &= 0x4fffffff; } */ - for (junk = 1 << 31; junk & 1 << 31;) /* and many future data */ + for (junk = 1 << 31; junk & 1 << 31;) /* and many future data */ while ((junk = oggpack_read (&opb, 32)) & 1 << 30); /* That is, feature data comes in 30 bit chunks. We also have * 31 potentially usefull bits in last chunk. */ @@ -343,7 +343,7 @@ tarkin_synthesis_packetin (TarkinStream * s, ogg_packet * op) /* We now have for shure our data. */ packet = &s->layer[layer_id].packet[comp]; if (packet->data_len) - return (-TARKIN_UNUSED); /* Previous data wasn't used */ + return (-TARKIN_UNUSED); /* Previous data wasn't used */ if (packet->storage < data_len) { packet->storage = data_len + 255; @@ -371,19 +371,19 @@ tarkin_synthesis_frameout (TarkinStream * s, TarkinPacket *packet = layer->packet + j; if (packet->data_len == 0) - goto err_out; + goto err_out; wavelet_3d_buf_decode_coeff (layer->waveletbuf[j], packet->data, - packet->data_len); + packet->data_len); wavelet_3d_buf_dump ("rcoeff-%d-%03d.pgm", - s->current_frame, j, layer->waveletbuf[j], 128); + s->current_frame, j, layer->waveletbuf[j], 128); wavelet_3d_buf_inv_xform (layer->waveletbuf[j], - layer->desc.a_moments, layer->desc.s_moments); + layer->desc.a_moments, layer->desc.s_moments); wavelet_3d_buf_dump ("rcolor-%d-%03d.pgm", - s->current_frame, j, layer->waveletbuf[j], j == 0 ? 0 : 128); + s->current_frame, j, layer->waveletbuf[j], j == 0 ? 0 : 128); } /* We did successfylly read a block from this layer, acknowledge it. */ diff --git a/ext/tarkin/wavelet.c b/ext/tarkin/wavelet.c index cecce80a1e..77ce9a4c7b 100644 --- a/ext/tarkin/wavelet.c +++ b/ext/tarkin/wavelet.c @@ -118,7 +118,7 @@ wavelet_3d_buf_dump (char *fmt, snprintf (fname, 256, fmt, id, first_frame_in_buf + f); write_pgm16 (fname, buf->data + f * buf->width * buf->height, - buf->width, buf->height, offset); + buf->width, buf->height, offset); } } #endif diff --git a/ext/tarkin/wavelet_coeff.c b/ext/tarkin/wavelet_coeff.c index 95da5cad72..fbe08f7813 100644 --- a/ext/tarkin/wavelet_coeff.c +++ b/ext/tarkin/wavelet_coeff.c @@ -104,15 +104,15 @@ skip_0coeffs (Wavelet3DBuf * buf, uint32_t runlength = ENTROPY_CODER_RUNLENGTH (&s_stream[i]); if (i == 0) - runlength /= 2; /* sign bits are in this bitplane ... */ + runlength /= 2; /* sign bits are in this bitplane ... */ if (skip > runlength) - skip = runlength; + skip = runlength; if (skip <= 2) - return 0; + return 0; } } - ENTROPY_CODER_SKIP (&s_stream[0], 2 * skip); /* kill sign+significance bits */ + ENTROPY_CODER_SKIP (&s_stream[0], 2 * skip); /* kill sign+significance bits */ for (i = 1; i < TYPE_BITS; i++) ENTROPY_CODER_SKIP (&s_stream[i], skip); @@ -134,11 +134,11 @@ encode_quadrant (const Wavelet3DBuf * buf, for (z = 0; z < f; z++) { for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { - unsigned int index = buf->offset[level][quadrant] - + z * buf->width * buf->height + y * buf->width + x; + unsigned int index = buf->offset[level][quadrant] + + z * buf->width * buf->height + y * buf->width + x; - encode_coeff (significand_bitstream, insignificand_bitstream, - buf->data[index]); + encode_coeff (significand_bitstream, insignificand_bitstream, + buf->data[index]); } } } @@ -194,28 +194,28 @@ decode_quadrant (Wavelet3DBuf * buf, do { x = 0; do { - uint32_t skip; - uint32_t index = buf->offset[level][quadrant] - + z * buf->width * buf->height + y * buf->width + x; + uint32_t skip; + uint32_t index = buf->offset[level][quadrant] + + z * buf->width * buf->height + y * buf->width + x; - buf->data[index] = decode_coeff (s_stream, i_stream); + buf->data[index] = decode_coeff (s_stream, i_stream); - skip = skip_0coeffs (buf, s_stream, i_stream, - (w - x - 1) + (h - y - 1) * w + (f - z - 1) * w * h); - if (skip > 0) { - x += skip; - while (x >= w) { - y++; - x -= w; - while (y >= h) { - z++; - y -= h; - if (z >= f) - return; - } - } - } - x++; + skip = skip_0coeffs (buf, s_stream, i_stream, + (w - x - 1) + (h - y - 1) * w + (f - z - 1) * w * h); + if (skip > 0) { + x += skip; + while (x >= w) { + y++; + x -= w; + while (y >= h) { + z++; + y -= h; + if (z >= f) + return; + } + } + } + x++; } while (x < w); y++; } while (y < h); @@ -285,7 +285,7 @@ decode_coefficients (Wavelet3DBuf * buf, buf->data[i] = decode_coeff (s_stream, i_stream); skip = skip_0coeffs (buf, s_stream, i_stream, - buf->width * buf->height * buf->frames - i); + buf->width * buf->height * buf->frames - i); i += skip; } } @@ -304,10 +304,10 @@ setup_limittabs (ENTROPY_CODER significand_bitstream[], uint32_t byte_count; int i; - assert (limit > 2 * TYPE_BITS * sizeof (uint32_t)); /* limit too small */ + assert (limit > 2 * TYPE_BITS * sizeof (uint32_t)); /* limit too small */ printf ("%s: limit == %u\n", __FUNCTION__, limit); - byte_count = 2 * TYPE_BITS * sizeof (uint32_t); /* 2 binary coded limittabs */ + byte_count = 2 * TYPE_BITS * sizeof (uint32_t); /* 2 binary coded limittabs */ limit -= byte_count; printf ("%s: rem. limit == %u\n", __FUNCTION__, limit); @@ -342,9 +342,9 @@ setup_limittabs (ENTROPY_CODER significand_bitstream[], byte_count += insignificand_limittab[i]; printf ("insignificand_limittab[%i] == %u / %u\n", - i, insignificand_limittab[i], i_bytes); + i, insignificand_limittab[i], i_bytes); printf (" significand_limittab[%i] == %u / %u\n", - i, significand_limittab[i], s_bytes); + i, significand_limittab[i], s_bytes); significand_limit -= significand_limittab[i]; insignificand_limit -= insignificand_limittab[i]; @@ -394,7 +394,7 @@ read_limittabs (uint8_t * bitstream, for (i = 0; i < TYPE_BITS; i++) { insignificand_limittab[i] = *(uint32_t *) bitstream; printf ("insignificand_limittab[%i] == %u\n", i, - insignificand_limittab[i]); + insignificand_limittab[i]); bitstream += 4; } @@ -415,16 +415,16 @@ merge_bitstreams (uint8_t * bitstream, for (i = TYPE_BITS - 1; i >= 0; i--) { memcpy (bitstream, - ENTROPY_CODER_BITSTREAM (&significand_bitstream[i]), - significand_limittab[i]); + ENTROPY_CODER_BITSTREAM (&significand_bitstream[i]), + significand_limittab[i]); bitstream += significand_limittab[i]; } for (i = TYPE_BITS - 1; i >= 0; i--) { memcpy (bitstream, - ENTROPY_CODER_BITSTREAM (&insignificand_bitstream[i]), - insignificand_limittab[i]); + ENTROPY_CODER_BITSTREAM (&insignificand_bitstream[i]), + insignificand_limittab[i]); bitstream += insignificand_limittab[i]; } diff --git a/ext/tarkin/wavelet_xform.c b/ext/tarkin/wavelet_xform.c index fda5f59d7c..c6eed7910a 100644 --- a/ext/tarkin/wavelet_xform.c +++ b/ext/tarkin/wavelet_xform.c @@ -61,13 +61,13 @@ fwd_analyze_2 (const TYPE * x, TYPE * d, int stride, int n) if (n & 1) { for (i = 0; i < k; i++) d[i] = - x[(2 * i + 1) * stride] - (x[2 * i * stride] + x[(2 * i + - 2) * stride]) / 2; + x[(2 * i + 1) * stride] - (x[2 * i * stride] + x[(2 * i + + 2) * stride]) / 2; } else { for (i = 0; i < k - 1; i++) d[i] = - x[(2 * i + 1) * stride] - (x[2 * i * stride] + x[(2 * i + - 2) * stride]) / 2; + x[(2 * i + 1) * stride] - (x[2 * i * stride] + x[(2 * i + + 2) * stride]) / 2; d[k - 1] = x[(n - 1) * stride] - x[(n - 2) * stride]; } } @@ -95,11 +95,11 @@ inv_analyze_2 (TYPE * x, const TYPE * d, int stride, int n) if (n & 1) { for (i = 0; i < k; i++) x[(2 * i + 1) * stride] = - d[i] + (x[2 * i * stride] + x[(2 * i + 2) * stride]) / 2; + d[i] + (x[2 * i * stride] + x[(2 * i + 2) * stride]) / 2; } else { for (i = 0; i < k - 1; i++) x[(2 * i + 1) * stride] = - d[i] + (x[2 * i * stride] + x[(2 * i + 2) * stride]) / 2; + d[i] + (x[2 * i * stride] + x[(2 * i + 2) * stride]) / 2; x[(n - 1) * stride] = d[k - 1] + x[(n - 2) * stride]; } } @@ -129,20 +129,20 @@ fwd_analyze_4 (const TYPE * x, TYPE * d, int stride, int n) if (n & 1) { for (i = 1; i < k - 1; i++) d[i] = x[(2 * i + 1) * stride] - - ((uint32_t) 9 * (x[2 * i * stride] + x[(2 * i + 2) * stride]) - - (x[(2 * i - 2) * stride] + x[(2 * i + 4) * stride])) / 16; + - ((uint32_t) 9 * (x[2 * i * stride] + x[(2 * i + 2) * stride]) + - (x[(2 * i - 2) * stride] + x[(2 * i + 4) * stride])) / 16; if (k > 1) d[k - 1] = - x[(2 * k - 1) * stride] - (x[(2 * k - 2) * stride] + - x[2 * k * stride]) / 2; + x[(2 * k - 1) * stride] - (x[(2 * k - 2) * stride] + + x[2 * k * stride]) / 2; } else { for (i = 1; i < k - 2; i++) d[i] = x[(2 * i + 1) * stride] - - ((uint32_t) 9 * (x[2 * i * stride] + x[(2 * i + 2) * stride]) - - (x[(2 * i - 2) * stride] + x[(2 * i + 4) * stride])) / 16; + - ((uint32_t) 9 * (x[2 * i * stride] + x[(2 * i + 2) * stride]) + - (x[(2 * i - 2) * stride] + x[(2 * i + 4) * stride])) / 16; if (k > 2) d[k - 2] = x[(2 * k - 3) * stride] - (x[(2 * k - 4) * stride] - + x[(2 * k - 2) * stride]) / 2; + + x[(2 * k - 2) * stride]) / 2; if (k > 1) d[k - 1] = x[(n - 1) * stride] - x[(n - 2) * stride]; } @@ -159,7 +159,7 @@ fwd_synthesize_4 (const TYPE * x, TYPE * s, const TYPE * d, int stride, int n) s[stride] = x[2 * stride] + (d[0] + d[1]) / 4; for (i = 2; i < k - 1; i++) s[i * stride] = x[2 * i * stride] - + ((uint32_t) 9 * (d[i - 1] + d[i]) - (d[i - 2] + d[i + 1])) / 32; + + ((uint32_t) 9 * (d[i - 1] + d[i]) - (d[i - 2] + d[i + 1])) / 32; if (k > 2) s[(k - 1) * stride] = x[(2 * k - 2) * stride] + (d[k - 2] + d[k - 1]) / 4; if (n & 1) @@ -177,19 +177,19 @@ inv_analyze_4 (TYPE * x, const TYPE * d, int stride, int n) if (n & 1) { for (i = 1; i < k - 1; i++) x[(2 * i + 1) * stride] = d[i] - + ((uint32_t) 9 * (x[2 * i * stride] + x[(2 * i + 2) * stride]) - - (x[(2 * i - 2) * stride] + x[(2 * i + 4) * stride])) / 16; + + ((uint32_t) 9 * (x[2 * i * stride] + x[(2 * i + 2) * stride]) + - (x[(2 * i - 2) * stride] + x[(2 * i + 4) * stride])) / 16; if (k > 1) x[(2 * k - 1) * stride] = - d[k - 1] + (x[(2 * k - 2) * stride] + x[2 * k * stride]) / 2; + d[k - 1] + (x[(2 * k - 2) * stride] + x[2 * k * stride]) / 2; } else { for (i = 1; i < k - 2; i++) x[(2 * i + 1) * stride] = d[i] - + (9 * (x[2 * i * stride] + x[(2 * i + 2) * stride]) - - (x[(2 * i - 2) * stride] + x[(2 * i + 4) * stride])) / 16; + + (9 * (x[2 * i * stride] + x[(2 * i + 2) * stride]) + - (x[(2 * i - 2) * stride] + x[(2 * i + 4) * stride])) / 16; if (k > 2) x[(2 * k - 3) * stride] = d[k - 2] + (x[(2 * k - 4) * stride] - + x[(2 * k - 2) * stride]) / 2; + + x[(2 * k - 2) * stride]) / 2; if (k > 1) x[(n - 1) * stride] = d[k - 1] + x[(n - 2) * stride]; } @@ -206,7 +206,7 @@ inv_synthesize_4 (TYPE * x, const TYPE * s, const TYPE * d, int stride, int n) x[2 * stride] = s[1] - (d[0] + d[1]) / 4; for (i = 2; i < k - 1; i++) x[2 * i * stride] = s[i] - ((uint32_t) 9 * (d[i - 1] + d[i]) - - (d[i - 2] + d[i + 1])) / 32; + - (d[i - 2] + d[i + 1])) / 32; if (k > 2) x[(2 * k - 2) * stride] = s[k - 1] - (d[k - 2] + d[k - 1]) / 4; if (n & 1) @@ -333,11 +333,11 @@ wavelet_3d_buf_fwd_xform (Wavelet3DBuf * buf, int a_moments, int s_moments) int row, frame; for (frame = 0; frame < f; frame++) { - for (row = 0; row < h; row++) { - TYPE *data = buf->data + (frame * buf->height + row) * buf->width; + for (row = 0; row < h; row++) { + TYPE *data = buf->data + (frame * buf->height + row) * buf->width; - fwd_xform (buf->scratchbuf, data, 1, w, a_moments, s_moments); - } + fwd_xform (buf->scratchbuf, data, 1, w, a_moments, s_moments); + } } } @@ -345,12 +345,12 @@ wavelet_3d_buf_fwd_xform (Wavelet3DBuf * buf, int a_moments, int s_moments) int col, frame; for (frame = 0; frame < f; frame++) { - for (col = 0; col < w; col++) { - TYPE *data = buf->data + frame * buf->width * buf->height + col; + for (col = 0; col < w; col++) { + TYPE *data = buf->data + frame * buf->width * buf->height + col; - fwd_xform (buf->scratchbuf, data, buf->width, h, - a_moments, s_moments); - } + fwd_xform (buf->scratchbuf, data, buf->width, h, + a_moments, s_moments); + } } } @@ -358,12 +358,12 @@ wavelet_3d_buf_fwd_xform (Wavelet3DBuf * buf, int a_moments, int s_moments) int i, j; for (j = 0; j < h; j++) { - for (i = 0; i < w; i++) { - TYPE *data = buf->data + j * buf->width + i; + for (i = 0; i < w; i++) { + TYPE *data = buf->data + j * buf->width + i; - fwd_xform (buf->scratchbuf, data, buf->width * buf->height, f, - a_moments, s_moments); - } + fwd_xform (buf->scratchbuf, data, buf->width * buf->height, f, + a_moments, s_moments); + } } } } @@ -384,12 +384,12 @@ wavelet_3d_buf_inv_xform (Wavelet3DBuf * buf, int a_moments, int s_moments) int i, j; for (j = 0; j < h; j++) { - for (i = 0; i < w; i++) { - TYPE *data = buf->data + j * buf->width + i; + for (i = 0; i < w; i++) { + TYPE *data = buf->data + j * buf->width + i; - inv_xform (buf->scratchbuf, data, buf->width * buf->height, f, - a_moments, s_moments); - } + inv_xform (buf->scratchbuf, data, buf->width * buf->height, f, + a_moments, s_moments); + } } } @@ -397,12 +397,12 @@ wavelet_3d_buf_inv_xform (Wavelet3DBuf * buf, int a_moments, int s_moments) int col, frame; for (frame = 0; frame < f; frame++) { - for (col = 0; col < w; col++) { - TYPE *data = buf->data + frame * buf->width * buf->height + col; + for (col = 0; col < w; col++) { + TYPE *data = buf->data + frame * buf->width * buf->height + col; - inv_xform (buf->scratchbuf, data, buf->width, h, - a_moments, s_moments); - } + inv_xform (buf->scratchbuf, data, buf->width, h, + a_moments, s_moments); + } } } @@ -410,11 +410,11 @@ wavelet_3d_buf_inv_xform (Wavelet3DBuf * buf, int a_moments, int s_moments) int row, frame; for (frame = 0; frame < f; frame++) { - for (row = 0; row < h; row++) { - TYPE *data = buf->data + (frame * buf->height + row) * buf->width; + for (row = 0; row < h; row++) { + TYPE *data = buf->data + (frame * buf->height + row) * buf->width; - inv_xform (buf->scratchbuf, data, 1, w, a_moments, s_moments); - } + inv_xform (buf->scratchbuf, data, 1, w, a_moments, s_moments); + } } } } diff --git a/ext/xine/xine.c b/ext/xine/xine.c index f1dbb3999d..8357ff564e 100644 --- a/ext/xine/xine.c +++ b/ext/xine/xine.c @@ -72,7 +72,7 @@ gst_xine_change_state (GstElement * element) break; case GST_STATE_READY_TO_NULL: if (xine->stream != NULL) - gst_xine_free_stream (xine); + gst_xine_free_stream (xine); break; default: GST_ERROR_OBJECT (element, "invalid state change"); @@ -107,7 +107,7 @@ gst_xine_get_stream (GstXine * xine) xine->audio_driver = klass->create_audio_driver (xine); xine->video_driver = klass->create_video_driver (xine); xine->stream = - xine_stream_new (klass->xine, xine->audio_driver, xine->video_driver); + xine_stream_new (klass->xine, xine->audio_driver, xine->video_driver); /* FIXME: fail gracefully */ g_assert (xine->stream); diff --git a/ext/xine/xineaudiodec.c b/ext/xine/xineaudiodec.c index 869c3b4d80..1d5288bd55 100644 --- a/ext/xine/xineaudiodec.c +++ b/ext/xine/xineaudiodec.c @@ -67,7 +67,8 @@ typedef struct xine_ao_driver_t driver; GstXineAudioDec *xine; gboolean open; -} GstXineAudioDriver; +} +GstXineAudioDriver; static guint32 _driver_get_capabilities (xine_ao_driver_t * driver) @@ -152,19 +153,19 @@ _driver_status (xine_ao_driver_t * driver, xine_stream_t * stream, return 0; structure = gst_caps_get_structure (caps, 0); - *bits = 0; /* FIXME */ + *bits = 0; /* FIXME */ if (!gst_structure_get_int (structure, "rate", &temp)) { - g_assert_not_reached (); /* may never happen with negotiated caps */ + g_assert_not_reached (); /* may never happen with negotiated caps */ return 0; } *rate = temp; if (!gst_structure_get_int (structure, "channels", &temp)) { - g_assert_not_reached (); /* may never happen with negotiated caps */ + g_assert_not_reached (); /* may never happen with negotiated caps */ return 0; } *mode = (temp == 2) ? AO_CAP_MODE_STEREO : AO_CAP_MODE_MONO; if (!gst_structure_get_int (structure, "width", &temp)) { - g_assert_not_reached (); /* may never happen with negotiated caps */ + g_assert_not_reached (); /* may never happen with negotiated caps */ return 0; } if (temp == 8) @@ -233,11 +234,11 @@ GST_BOILERPLATE (GstXineAudioDec, gst_xine_audio_dec, GstXine, GST_TYPE_XINE) static void gst_xine_audio_dec_chain (GstPad * pad, GstData * in); static GstElementStateReturn - gst_xine_audio_dec_change_state (GstElement * element); + gst_xine_audio_dec_change_state (GstElement * element); /* this function handles the link with other plug-ins */ static GstPadLinkReturn - gst_xine_audio_dec_sink_link (GstPad * pad, const GstCaps * caps) + gst_xine_audio_dec_sink_link (GstPad * pad, const GstCaps * caps) { guint temp; GstStructure *structure; @@ -255,7 +256,7 @@ GST_BOILERPLATE (GstXineAudioDec, gst_xine_audio_dec, GstXine, GST_TYPE_XINE) xine->wave.nChannels = temp; if (gst_structure_get_int (structure, "rate", &temp)) xine->wave.nSamplesPerSec = temp; - xine->wave.wBitsPerSample = 16; /* FIXME: how do we figure this thing out? */ + xine->wave.wBitsPerSample = 16; /* FIXME: how do we figure this thing out? */ /* FIXME: fill wave header better */ return GST_PAD_LINK_OK; @@ -304,7 +305,7 @@ gst_xine_audio_dec_chain (GstPad * pad, GstData * in) if (xine->format == 0) { /* no caps yet */ GST_ELEMENT_ERROR (xine, CORE, NEGOTIATION, (NULL), - ("buffer sent before doing caps nego")); + ("buffer sent before doing caps nego")); gst_data_unref (in); return; } @@ -329,7 +330,7 @@ gst_xine_audio_dec_chain (GstPad * pad, GstData * in) /* FIXME: qdm2 only right now */ g_assert (gst_pad_get_negotiated_caps (xine->sinkpad)); structure = - gst_caps_get_structure (gst_pad_get_negotiated_caps (xine->sinkpad), 0); + gst_caps_get_structure (gst_pad_get_negotiated_caps (xine->sinkpad), 0); *((guint32 *) & stsd[56]) = GUINT32_TO_BE (12); memcpy (&stsd[60], "frmaQDM2", 8); *((guint32 *) & stsd[68]) = GUINT32_TO_BE (36); @@ -409,7 +410,7 @@ gst_xine_audio_dec_change_state (GstElement * element) case GST_STATE_NULL_TO_READY: xine->decoder = _load_decoder (xine); if (!xine->decoder) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; break; case GST_STATE_READY_TO_PAUSED: break; @@ -422,7 +423,7 @@ gst_xine_audio_dec_change_state (GstElement * element) case GST_STATE_READY_TO_NULL: xine->setup = FALSE; _x_free_audio_decoder (gst_xine_get_stream (GST_XINE (xine)), - xine->decoder); + xine->decoder); break; default: GST_ERROR_OBJECT (element, "invalid state change"); @@ -439,17 +440,17 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) TRUE, " - "width = (int) 16, " - "depth = (int) 16, " - "rate = (int) [ 1, MAX ], " - "channels = (int) [ 1, 2 ]; " - "audio/x-raw-int, " - "signed = (boolean) FALSE, " - "width = (int) 8, " - "depth = (int) 8, " - "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]") + "endianness = (int) BYTE_ORDER, " + "signed = (boolean) TRUE, " + "width = (int) 16, " + "depth = (int) 16, " + "rate = (int) [ 1, MAX ], " + "channels = (int) [ 1, 2 ]; " + "audio/x-raw-int, " + "signed = (boolean) FALSE, " + "width = (int) 8, " + "depth = (int) 8, " + "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]") ); static void @@ -483,7 +484,7 @@ gst_xine_audio_dec_subclass_init (gpointer g_class, gpointer class_data) while (dec->supported_types[i] != 0) { const gchar *type_str = - gst_xine_get_caps_for_format (dec->supported_types[i]); + gst_xine_get_caps_for_format (dec->supported_types[i]); if (type_str) { gst_caps_append (caps, gst_caps_from_string (type_str)); } @@ -501,14 +502,14 @@ gst_xine_audio_dec_sub_init (GTypeInstance * instance, gpointer g_class) xine->sinkpad = gst_pad_new_from_template (gst_element_class_get_pad_template (klass, - "sink"), "sink"); + "sink"), "sink"); gst_pad_set_link_function (xine->sinkpad, gst_xine_audio_dec_sink_link); gst_pad_set_chain_function (xine->sinkpad, gst_xine_audio_dec_chain); gst_element_add_pad (GST_ELEMENT (xine), xine->sinkpad); xine->srcpad = gst_pad_new_from_template (gst_element_class_get_pad_template (klass, - "src"), "src"); + "src"), "src"); gst_pad_use_explicit_caps (xine->srcpad); gst_element_add_pad (GST_ELEMENT (xine), xine->srcpad); } @@ -545,26 +546,26 @@ gst_xine_audio_dec_init_plugin (GstPlugin * plugin) dec = node->info->special_info; while (dec->supported_types[format] != 0) { const gchar *caps = - gst_xine_get_caps_for_format (dec->supported_types[format]); + gst_xine_get_caps_for_format (dec->supported_types[format]); if (caps) { - gchar *plugin_name = - g_strdup_printf ("xineaudiodec_%s", node->info->id); - gchar *type_name = - g_strdup_printf ("GstXineAudioDec%s", node->info->id); - GType type; + gchar *plugin_name = + g_strdup_printf ("xineaudiodec_%s", node->info->id); + gchar *type_name = + g_strdup_printf ("GstXineAudioDec%s", node->info->id); + GType type; - plugin_info.class_data = node; - type = - g_type_register_static (GST_TYPE_XINE_AUDIO_DEC, type_name, - &plugin_info, 0); - g_free (type_name); - if (!gst_element_register (plugin, plugin_name, - MAX (GST_RANK_MARGINAL, - GST_RANK_MARGINAL * dec->priority / 10 + 1), type)) { - g_free (plugin_name); - return FALSE; - } - g_free (plugin_name); + plugin_info.class_data = node; + type = + g_type_register_static (GST_TYPE_XINE_AUDIO_DEC, type_name, + &plugin_info, 0); + g_free (type_name); + if (!gst_element_register (plugin, plugin_name, + MAX (GST_RANK_MARGINAL, + GST_RANK_MARGINAL * dec->priority / 10 + 1), type)) { + g_free (plugin_name); + return FALSE; + } + g_free (plugin_name); } format++; } diff --git a/ext/xine/xineaudiosink.c b/ext/xine/xineaudiosink.c index 4638526d2c..64c5e6f81e 100644 --- a/ext/xine/xineaudiosink.c +++ b/ext/xine/xineaudiosink.c @@ -48,7 +48,7 @@ struct _GstXineAudioSink GstPad *sinkpad; ao_driver_t *driver; - guint open; /* number of bytes per sample or 0 if driver not open */ + guint open; /* number of bytes per sample or 0 if driver not open */ }; struct _GstXineAudioSinkClass @@ -63,7 +63,7 @@ struct _GstXineAudioSinkClass GST_BOILERPLATE (GstXineAudioSink, gst_xine_audio_sink, GstXine, GST_TYPE_XINE) static GstElementStateReturn - gst_xine_audio_sink_change_state (GstElement * element); + gst_xine_audio_sink_change_state (GstElement * element); static void gst_xine_audio_sink_base_init (gpointer g_class) { @@ -89,7 +89,7 @@ gst_xine_audio_sink_chain (GstPad * pad, GstData * data) GST_XINE_AUDIO_SINK (gst_object_get_parent (GST_OBJECT (pad))); while (xine->driver->write (xine->driver, (guint16 *) GST_BUFFER_DATA (data), - GST_BUFFER_SIZE (data) / xine->open) == 0); + GST_BUFFER_SIZE (data) / xine->open) == 0); gst_data_unref (GST_DATA (data)); } @@ -104,22 +104,22 @@ gst_xine_audio_sink_change_state (GstElement * element) switch (GST_STATE_TRANSITION (element)) { case GST_STATE_NULL_TO_READY: if (driver == NULL) { - xine_audio_port_t *port = - xine_open_audio_driver (GST_XINE_GET_CLASS (xine)->xine, - GST_XINE_AUDIO_SINK_GET_CLASS (xine)->plugin_node->info->id, NULL); + xine_audio_port_t *port = + xine_open_audio_driver (GST_XINE_GET_CLASS (xine)->xine, + GST_XINE_AUDIO_SINK_GET_CLASS (xine)->plugin_node->info->id, NULL); - if (!port) - return GST_STATE_FAILURE; - port->exit (port); - driver = - (audio_driver_class_t *) GST_XINE_AUDIO_SINK_GET_CLASS (xine)-> - plugin_node->plugin_class; - if (driver == NULL) - return GST_STATE_FAILURE; + if (!port) + return GST_STATE_FAILURE; + port->exit (port); + driver = + (audio_driver_class_t *) GST_XINE_AUDIO_SINK_GET_CLASS (xine)-> + plugin_node->plugin_class; + if (driver == NULL) + return GST_STATE_FAILURE; } xine->driver = driver->open_plugin (driver, NULL); if (!xine->driver) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; break; case GST_STATE_READY_TO_PAUSED: break; @@ -129,7 +129,7 @@ gst_xine_audio_sink_change_state (GstElement * element) break; case GST_STATE_PAUSED_TO_READY: if (xine->open != 0) - xine->driver->close (xine->driver); + xine->driver->close (xine->driver); xine->open = 0; break; case GST_STATE_READY_TO_NULL: @@ -169,31 +169,31 @@ _xine_audio_sink_get_caps (GstPad * pad) do { if (capa & AO_CAP_8BITS) { caps = gst_caps_from_string ("audio/x-raw-int, " - "signed = (boolean) FALSE, " - "width = (int) 8, " - "depth = (int) 8, " "rate = (int) [ 8000, 192000 ]"); + "signed = (boolean) FALSE, " + "width = (int) 8, " + "depth = (int) 8, " "rate = (int) [ 8000, 192000 ]"); capa &= ~AO_CAP_8BITS; } else { caps = gst_caps_from_string ("audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) TRUE, " - "width = (int) 16, " - "depth = (int) 16, " "rate = (int) [ 8000, 192000 ]"); + "endianness = (int) BYTE_ORDER, " + "signed = (boolean) TRUE, " + "width = (int) 16, " + "depth = (int) 16, " "rate = (int) [ 8000, 192000 ]"); capa = -1; } switch (channels) { case AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO: - gst_caps_set_simple (caps, "channels", GST_TYPE_INT_RANGE, 1, 2, NULL); - break; + gst_caps_set_simple (caps, "channels", GST_TYPE_INT_RANGE, 1, 2, NULL); + break; case AO_CAP_MODE_MONO: - gst_caps_set_simple (caps, "channels", G_TYPE_INT, 1, NULL); - break; + gst_caps_set_simple (caps, "channels", G_TYPE_INT, 1, NULL); + break; case AO_CAP_MODE_STEREO: - gst_caps_set_simple (caps, "channels", G_TYPE_INT, 2, NULL); - break; + gst_caps_set_simple (caps, "channels", G_TYPE_INT, 2, NULL); + break; default: - g_assert_not_reached (); - break; + g_assert_not_reached (); + break; } gst_caps_append (ret, caps); } while (capa != -1); @@ -229,7 +229,7 @@ _xine_audio_sink_link (GstPad * pad, const GstCaps * caps) if (temp != rate) { /* FIXME? */ GST_WARNING_OBJECT (xine, "rates don't match (requested: %u, got %u)", rate, - temp); + temp); } return GST_PAD_LINK_OK; @@ -241,17 +241,17 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "signed = (boolean) FALSE, " - "width = (int) 8, " - "depth = (int) 8, " - "rate = (int) [ 8000, 192000 ], " - "channels = (int) [1, 2]; " - "audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) TRUE, " - "width = (int) 16, " - "depth = (int) 16, " - "rate = (int) [ 8000, 192000 ], " "channels = (int) [1, 2]") + "signed = (boolean) FALSE, " + "width = (int) 8, " + "depth = (int) 8, " + "rate = (int) [ 8000, 192000 ], " + "channels = (int) [1, 2]; " + "audio/x-raw-int, " + "endianness = (int) BYTE_ORDER, " + "signed = (boolean) TRUE, " + "width = (int) 16, " + "depth = (int) 16, " + "rate = (int) [ 8000, 192000 ], " "channels = (int) [1, 2]") ); static void @@ -286,7 +286,7 @@ gst_xine_audio_sink_sub_init (GTypeInstance * instance, gpointer g_class) xine->sinkpad = gst_pad_new_from_template (gst_element_class_get_pad_template (klass, - "sink"), "sink"); + "sink"), "sink"); gst_pad_set_chain_function (xine->sinkpad, gst_xine_audio_sink_chain); gst_pad_set_getcaps_function (xine->sinkpad, _xine_audio_sink_get_caps); gst_pad_set_link_function (xine->sinkpad, _xine_audio_sink_link); @@ -320,8 +320,8 @@ gst_xine_audio_sink_init_plugin (GstPlugin * plugin) plugin_info.class_data = node; type = - g_type_register_static (GST_TYPE_XINE_AUDIO_SINK, type_name, - &plugin_info, 0); + g_type_register_static (GST_TYPE_XINE_AUDIO_SINK, type_name, + &plugin_info, 0); g_free (type_name); if (!gst_element_register (plugin, plugin_name, GST_RANK_MARGINAL, type)) { g_free (plugin_name); diff --git a/ext/xine/xineinput.c b/ext/xine/xineinput.c index 19a4bbbe9e..35aa1dcabe 100644 --- a/ext/xine/xineinput.c +++ b/ext/xine/xineinput.c @@ -75,7 +75,7 @@ GST_BOILERPLATE (GstXineInput, gst_xine_input, GstXine, GST_TYPE_XINE) static void gst_xine_input_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static GstElementStateReturn - gst_xine_input_change_state (GstElement * element); + gst_xine_input_change_state (GstElement * element); static void gst_xine_input_base_init (gpointer g_class) { @@ -95,7 +95,7 @@ gst_xine_input_class_init (GstXineInputClass * klass) g_object_class_install_property (object, ARG_LOCATION, g_param_spec_string ("location", "location", "location", - NULL, G_PARAM_READWRITE)); + NULL, G_PARAM_READWRITE)); } static void @@ -123,9 +123,9 @@ gst_xine_input_set_property (GObject * object, guint prop_id, switch (prop_id) { case ARG_LOCATION: if (gst_element_get_state (GST_ELEMENT (xine)) != GST_STATE_NULL) - return; + return; if (xine->location) - g_free (xine->location); + g_free (xine->location); xine->location = g_strdup (g_value_get_string (value)); break; default: @@ -150,7 +150,7 @@ gst_xine_input_get_property (GObject * object, guint prop_id, GValue * value, } } -#define BUFFER_SIZE 4096 /* FIXME: what size? */ +#define BUFFER_SIZE 4096 /* FIXME: what size? */ static GstData * gst_xine_input_get (GstPad * pad) { @@ -176,7 +176,7 @@ gst_xine_input_get (GstPad * pad) GST_BUFFER_SIZE (buf) = real_size; if (real_size < 0) { GST_ELEMENT_ERROR (xine, RESOURCE, READ, (NULL), ("error %d reading data", - real_size)); + real_size)); gst_data_unref (GST_DATA (buf)); return NULL; } else if (real_size == 0) { @@ -184,8 +184,8 @@ gst_xine_input_get (GstPad * pad) if (xine->input->get_capabilities (xine->input) & INPUT_CAP_BLOCK) element = - xine->input->read_block (xine->input, - gst_xine_get_stream (GST_XINE (xine))->audio_fifo, xine->blocksize); + xine->input->read_block (xine->input, + gst_xine_get_stream (GST_XINE (xine))->audio_fifo, xine->blocksize); if (element == NULL) { /* FIXME: is this EOS? */ gst_element_set_eos (GST_ELEMENT (xine)); @@ -213,15 +213,15 @@ gst_xine_input_change_state (GstElement * element) switch (GST_STATE_TRANSITION (element)) { case GST_STATE_NULL_TO_READY: xine->input = - input->get_instance (input, gst_xine_get_stream (GST_XINE (xine)), - xine->location); + input->get_instance (input, gst_xine_get_stream (GST_XINE (xine)), + xine->location); if (!xine->input) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; if (xine->input->open (xine->input) == 0) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; xine->blocksize = xine->input->get_blocksize (xine->input); if (xine->blocksize == 0) - xine->blocksize = BUFFER_SIZE; + xine->blocksize = BUFFER_SIZE; break; case GST_STATE_READY_TO_PAUSED: break; @@ -256,10 +256,10 @@ static GstStaticPadTemplate cdda_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) LITTLE_ENDIAN, " - "signed = (boolean) true, " - "width = (int) 16, " - "depth = (int) 16, " "rate = (int) 44100, " "channels = (int) 2") + "endianness = (int) LITTLE_ENDIAN, " + "signed = (boolean) true, " + "width = (int) 16, " + "depth = (int) 16, " "rate = (int) 44100, " "channels = (int) 2") ); static void @@ -285,10 +285,10 @@ gst_xine_input_subclass_init (gpointer g_class, gpointer class_data) /* FIXME: this is pretty hackish, anyone knows a better idea (xine doesn't) */ if (strcmp (input->get_identifier (input), "cdda") == 0) { gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&cdda_template)); + gst_static_pad_template_get (&cdda_template)); } else { gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&any_template)); + gst_static_pad_template_get (&any_template)); } } @@ -300,7 +300,7 @@ gst_xine_input_sub_init (GTypeInstance * instance, gpointer g_class) xine->srcpad = gst_pad_new_from_template (gst_element_class_get_pad_template (klass, - "src"), "src"); + "src"), "src"); gst_pad_set_get_function (xine->srcpad, gst_xine_input_get); gst_element_add_pad (GST_ELEMENT (xine), xine->srcpad); } @@ -332,8 +332,8 @@ gst_xine_input_init_plugin (GstPlugin * plugin) plugin_info.class_data = node; type = - g_type_register_static (GST_TYPE_XINE_INPUT, type_name, &plugin_info, - 0); + g_type_register_static (GST_TYPE_XINE_INPUT, type_name, &plugin_info, + 0); g_free (type_name); if (!gst_element_register (plugin, plugin_name, GST_RANK_MARGINAL, type)) { g_free (plugin_name); diff --git a/ext/xvid/gstxvid.c b/ext/xvid/gstxvid.c index 1e22dbfdc4..d09489ebc4 100644 --- a/ext/xvid/gstxvid.c +++ b/ext/xvid/gstxvid.c @@ -99,30 +99,30 @@ gst_xvid_structure_to_csp (GstStructure * structure, gst_structure_get_fourcc (structure, "format", &fourcc); switch (fourcc) { case GST_MAKE_FOURCC ('I', '4', '2', '0'): - xvid_cs = XVID_CSP_I420; - stride = w; - bpp = 12; - break; + xvid_cs = XVID_CSP_I420; + stride = w; + bpp = 12; + break; case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): - xvid_cs = XVID_CSP_YUY2; - stride = w * 2; - bpp = 16; - break; + xvid_cs = XVID_CSP_YUY2; + stride = w * 2; + bpp = 16; + break; case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - xvid_cs = XVID_CSP_YV12; - stride = w; - bpp = 12; - break; + xvid_cs = XVID_CSP_YV12; + stride = w; + bpp = 12; + break; case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'): - xvid_cs = XVID_CSP_UYVY; - stride = w * 2; - bpp = 16; - break; + xvid_cs = XVID_CSP_UYVY; + stride = w * 2; + bpp = 16; + break; case GST_MAKE_FOURCC ('Y', 'V', 'Y', 'U'): - xvid_cs = XVID_CSP_YVYU; - stride = w * 2; - bpp = 16; - break; + xvid_cs = XVID_CSP_YVYU; + stride = w * 2; + bpp = 16; + break; } } else { gint depth, r_mask; @@ -133,35 +133,35 @@ gst_xvid_structure_to_csp (GstStructure * structure, switch (depth) { case 15: - xvid_cs = XVID_CSP_RGB555; - break; + xvid_cs = XVID_CSP_RGB555; + break; case 16: - xvid_cs = XVID_CSP_RGB565; - break; + xvid_cs = XVID_CSP_RGB565; + break; case 24: - if (bpp == 24) { - xvid_cs = XVID_CSP_BGR; - } else { - switch (r_mask) { - case 0xff000000: - xvid_cs = XVID_CSP_RGBA; - break; + if (bpp == 24) { + xvid_cs = XVID_CSP_BGR; + } else { + switch (r_mask) { + case 0xff000000: + xvid_cs = XVID_CSP_RGBA; + break; #ifdef XVID_CSP_ARGB - case 0x00ff0000: - xvid_cs = XVID_CSP_ARGB; - break; + case 0x00ff0000: + xvid_cs = XVID_CSP_ARGB; + break; #endif - case 0x0000ff00: - xvid_cs = XVID_CSP_BGRA; - break; - case 0x000000ff: - xvid_cs = XVID_CSP_ABGR; - break; - } - } - break; + case 0x0000ff00: + xvid_cs = XVID_CSP_BGRA; + break; + case 0x000000ff: + xvid_cs = XVID_CSP_ABGR; + break; + } + } + break; default: - break; + break; } stride = w * bpp / 8; @@ -191,79 +191,79 @@ gst_xvid_csp_to_caps (gint csp, gint w, gint h, gdouble fps) #endif case XVID_CSP_RGBA:{ gint r_mask = 0, b_mask = 0, g_mask = 0, - endianness = 0, bpp = 0, depth = 0; + endianness = 0, bpp = 0, depth = 0; switch (csp) { - case XVID_CSP_RGB555: - r_mask = GST_VIDEO_RED_MASK_15_INT; - g_mask = GST_VIDEO_GREEN_MASK_15_INT; - b_mask = GST_VIDEO_BLUE_MASK_15_INT; - endianness = G_BYTE_ORDER; - depth = 15; - bpp = 16; - break; - case XVID_CSP_RGB565: - r_mask = GST_VIDEO_RED_MASK_16_INT; - g_mask = GST_VIDEO_GREEN_MASK_16_INT; - b_mask = GST_VIDEO_BLUE_MASK_16_INT; - endianness = G_BYTE_ORDER; - depth = 16; - bpp = 16; - break; - case XVID_CSP_BGR: - r_mask = 0x0000ff; - g_mask = 0x00ff00; - b_mask = 0xff0000; - endianness = G_BIG_ENDIAN; - depth = 24; - bpp = 24; - break; - case XVID_CSP_ABGR: - r_mask = 0x000000ff; - g_mask = 0x0000ff00; - b_mask = 0x00ff0000; - endianness = G_BIG_ENDIAN; - depth = 24; - bpp = 32; - break; - case XVID_CSP_BGRA: - r_mask = 0x0000ff00; - g_mask = 0x00ff0000; - b_mask = 0xff000000; - endianness = G_BIG_ENDIAN; - depth = 24; - bpp = 32; - break; + case XVID_CSP_RGB555: + r_mask = GST_VIDEO_RED_MASK_15_INT; + g_mask = GST_VIDEO_GREEN_MASK_15_INT; + b_mask = GST_VIDEO_BLUE_MASK_15_INT; + endianness = G_BYTE_ORDER; + depth = 15; + bpp = 16; + break; + case XVID_CSP_RGB565: + r_mask = GST_VIDEO_RED_MASK_16_INT; + g_mask = GST_VIDEO_GREEN_MASK_16_INT; + b_mask = GST_VIDEO_BLUE_MASK_16_INT; + endianness = G_BYTE_ORDER; + depth = 16; + bpp = 16; + break; + case XVID_CSP_BGR: + r_mask = 0x0000ff; + g_mask = 0x00ff00; + b_mask = 0xff0000; + endianness = G_BIG_ENDIAN; + depth = 24; + bpp = 24; + break; + case XVID_CSP_ABGR: + r_mask = 0x000000ff; + g_mask = 0x0000ff00; + b_mask = 0x00ff0000; + endianness = G_BIG_ENDIAN; + depth = 24; + bpp = 32; + break; + case XVID_CSP_BGRA: + r_mask = 0x0000ff00; + g_mask = 0x00ff0000; + b_mask = 0xff000000; + endianness = G_BIG_ENDIAN; + depth = 24; + bpp = 32; + break; #ifdef XVID_CSP_ARGB - case XVID_CSP_ARGB: - r_mask = 0x00ff0000; - g_mask = 0x0000ff00; - b_mask = 0x000000ff; - endianness = G_BIG_ENDIAN; - depth = 24; - bpp = 32; - break; + case XVID_CSP_ARGB: + r_mask = 0x00ff0000; + g_mask = 0x0000ff00; + b_mask = 0x000000ff; + endianness = G_BIG_ENDIAN; + depth = 24; + bpp = 32; + break; #endif - case XVID_CSP_RGBA: - r_mask = 0xff000000; - g_mask = 0x00ff0000; - b_mask = 0x0000ff00; - endianness = G_BIG_ENDIAN; - depth = 24; - bpp = 32; - break; + case XVID_CSP_RGBA: + r_mask = 0xff000000; + g_mask = 0x00ff0000; + b_mask = 0x0000ff00; + endianness = G_BIG_ENDIAN; + depth = 24; + bpp = 32; + break; } caps = gst_caps_new_simple ("video/x-raw-rgb", - "width", G_TYPE_INT, w, - "height", G_TYPE_INT, h, - "depth", G_TYPE_INT, depth, - "bpp", G_TYPE_INT, bpp, - "endianness", G_TYPE_INT, endianness, - "red_mask", G_TYPE_INT, r_mask, - "green_mask", G_TYPE_INT, g_mask, - "blue_mask", G_TYPE_INT, b_mask, - "framerate", G_TYPE_DOUBLE, fps, NULL); + "width", G_TYPE_INT, w, + "height", G_TYPE_INT, h, + "depth", G_TYPE_INT, depth, + "bpp", G_TYPE_INT, bpp, + "endianness", G_TYPE_INT, endianness, + "red_mask", G_TYPE_INT, r_mask, + "green_mask", G_TYPE_INT, g_mask, + "blue_mask", G_TYPE_INT, b_mask, + "framerate", G_TYPE_DOUBLE, fps, NULL); break; } @@ -275,28 +275,28 @@ gst_xvid_csp_to_caps (gint csp, gint w, gint h, gdouble fps) guint32 fourcc = 0; switch (csp) { - case XVID_CSP_YUY2: - fourcc = GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'); - break; - case XVID_CSP_YVYU: - fourcc = GST_MAKE_FOURCC ('Y', 'V', 'Y', 'U'); - break; - case XVID_CSP_UYVY: - fourcc = GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'); - break; - case XVID_CSP_I420: - fourcc = GST_MAKE_FOURCC ('I', '4', '2', '0'); - break; - case XVID_CSP_YV12: - fourcc = GST_MAKE_FOURCC ('Y', 'V', '1', '2'); - break; + case XVID_CSP_YUY2: + fourcc = GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'); + break; + case XVID_CSP_YVYU: + fourcc = GST_MAKE_FOURCC ('Y', 'V', 'Y', 'U'); + break; + case XVID_CSP_UYVY: + fourcc = GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'); + break; + case XVID_CSP_I420: + fourcc = GST_MAKE_FOURCC ('I', '4', '2', '0'); + break; + case XVID_CSP_YV12: + fourcc = GST_MAKE_FOURCC ('Y', 'V', '1', '2'); + break; } caps = gst_caps_new_simple ("video/x-raw-yuv", - "width", G_TYPE_INT, w, - "height", G_TYPE_INT, h, - "format", GST_TYPE_FOURCC, fourcc, - "framerate", G_TYPE_DOUBLE, fps, NULL); + "width", G_TYPE_INT, w, + "height", G_TYPE_INT, h, + "format", GST_TYPE_FOURCC, fourcc, + "framerate", G_TYPE_DOUBLE, fps, NULL); break; } } @@ -309,9 +309,9 @@ static gboolean plugin_init (GstPlugin * plugin) { return (gst_element_register (plugin, "xvidenc", - GST_RANK_NONE, GST_TYPE_XVIDENC) && + GST_RANK_NONE, GST_TYPE_XVIDENC) && gst_element_register (plugin, "xviddec", - GST_RANK_SECONDARY, GST_TYPE_XVIDDEC)); + GST_RANK_SECONDARY, GST_TYPE_XVIDDEC)); } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/ext/xvid/gstxviddec.c b/ext/xvid/gstxviddec.c index cab1a027c4..49c9d6efa7 100644 --- a/ext/xvid/gstxviddec.c +++ b/ext/xvid/gstxviddec.c @@ -39,20 +39,20 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-xvid, " - "width = (int) [ 0, MAX ], " - "height = (int) [ 0, MAX ], " "framerate = (double) [ 0, MAX ]") + "width = (int) [ 0, MAX ], " + "height = (int) [ 0, MAX ], " "framerate = (double) [ 0, MAX ]") ); static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ I420, YUY2, YV12, YVYU, UYVY }") - "; " RGB_24_32_STATIC_CAPS (32, 0x00ff0000, 0x0000ff00, - 0x000000ff) "; " RGB_24_32_STATIC_CAPS (32, 0xff000000, 0x00ff0000, - 0x0000ff00) "; " RGB_24_32_STATIC_CAPS (32, 0x0000ff00, 0x00ff0000, - 0xff000000) "; " RGB_24_32_STATIC_CAPS (32, 0x000000ff, 0x0000ff00, - 0x00ff0000) "; " RGB_24_32_STATIC_CAPS (24, 0x0000ff, 0x00ff00, - 0xff0000) "; " GST_VIDEO_CAPS_RGB_15 "; " GST_VIDEO_CAPS_RGB_16) + "; " RGB_24_32_STATIC_CAPS (32, 0x00ff0000, 0x0000ff00, + 0x000000ff) "; " RGB_24_32_STATIC_CAPS (32, 0xff000000, 0x00ff0000, + 0x0000ff00) "; " RGB_24_32_STATIC_CAPS (32, 0x0000ff00, 0x00ff0000, + 0xff000000) "; " RGB_24_32_STATIC_CAPS (32, 0x000000ff, 0x0000ff00, + 0x00ff0000) "; " RGB_24_32_STATIC_CAPS (24, 0x0000ff, 0x00ff00, + 0xff0000) "; " GST_VIDEO_CAPS_RGB_15 "; " GST_VIDEO_CAPS_RGB_16) ); @@ -103,8 +103,9 @@ gst_xviddec_get_type (void) 0, (GInstanceInitFunc) gst_xviddec_init, }; + xviddec_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstXvidDec", &xviddec_info, 0); + "GstXvidDec", &xviddec_info, 0); } return xviddec_type; } @@ -187,9 +188,9 @@ gst_xviddec_setup (GstXvidDec * xviddec) if ((ret = xvid_decore (NULL, XVID_DEC_CREATE, &xdec, NULL)) < 0) { GST_ELEMENT_ERROR (xviddec, LIBRARY, SETTINGS, (NULL), - ("Setting parameters %dx%d@%d failed: %s (%d)", - xviddec->width, xviddec->height, xviddec->csp, - gst_xvid_error (ret), ret)); + ("Setting parameters %dx%d@%d failed: %s (%d)", + xviddec->width, xviddec->height, xviddec->csp, + gst_xvid_error (ret), ret)); return FALSE; } @@ -213,7 +214,7 @@ gst_xviddec_chain (GstPad * pad, GstData * _data) if (!xviddec->handle) { GST_ELEMENT_ERROR (xviddec, CORE, NEGOTIATION, (NULL), - ("format wasn't negotiated before chain function")); + ("format wasn't negotiated before chain function")); gst_buffer_unref (buf); return; } @@ -234,9 +235,9 @@ gst_xviddec_chain (GstPad * pad, GstData * _data) if (xviddec->width == xviddec->stride) { xframe.output.plane[0] = GST_BUFFER_DATA (outbuf); xframe.output.plane[1] = - xframe.output.plane[0] + (xviddec->width * xviddec->height); + xframe.output.plane[0] + (xviddec->width * xviddec->height); xframe.output.plane[2] = - xframe.output.plane[1] + (xviddec->width * xviddec->height / 4); + xframe.output.plane[1] + (xviddec->width * xviddec->height / 4); xframe.output.stride[0] = xviddec->width; xframe.output.stride[1] = xviddec->width / 2; xframe.output.stride[2] = xviddec->width / 2; @@ -247,7 +248,7 @@ gst_xviddec_chain (GstPad * pad, GstData * _data) if ((ret = xvid_decore (xviddec->handle, XVID_DEC_DECODE, &xframe, NULL)) < 0) { GST_ELEMENT_ERROR (xviddec, STREAM, DECODE, (NULL), - ("Error decoding xvid frame: %s (%d)\n", gst_xvid_error (ret), ret)); + ("Error decoding xvid frame: %s (%d)\n", gst_xvid_error (ret), ret)); gst_buffer_unref (buf); gst_buffer_unref (outbuf); return; @@ -289,7 +290,7 @@ gst_xviddec_src_getcaps (GstPad * pad) caps = gst_caps_new_empty (); for (i = 0; csp[i] != 0; i++) { GstCaps *one = gst_xvid_csp_to_caps (csp[i], xviddec->width, - xviddec->height, xviddec->fps); + xviddec->height, xviddec->fps); gst_caps_append (caps, one); } @@ -350,13 +351,13 @@ gst_xviddec_sink_link (GstPad * pad, const GstCaps * vscaps) for (i = 0; i < gst_caps_get_size (vscaps); i++) { csp = gst_xvid_structure_to_csp (gst_caps_get_structure (vscaps, i), - 0, NULL, NULL); + 0, NULL, NULL); new = - gst_xvid_csp_to_caps (csp, xviddec->width, xviddec->height, - xviddec->fps); + gst_xvid_csp_to_caps (csp, xviddec->width, xviddec->height, + xviddec->fps); ret = gst_pad_try_set_caps (xviddec->srcpad, new); if (ret != GST_PAD_LINK_REFUSED) - return ret; + return ret; } return GST_PAD_LINK_REFUSED; @@ -373,7 +374,7 @@ gst_xviddec_change_state (GstElement * element) switch (GST_STATE_PENDING (element)) { case GST_STATE_PAUSED_TO_READY: if (xviddec->handle) { - gst_xviddec_unset (xviddec); + gst_xviddec_unset (xviddec); } break; default: diff --git a/ext/xvid/gstxvidenc.c b/ext/xvid/gstxvidenc.c index 5a9b34bafd..db9d1add34 100644 --- a/ext/xvid/gstxvidenc.c +++ b/ext/xvid/gstxvidenc.c @@ -40,20 +40,20 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ I420, YUY2, YV12, YVYU, UYVY }") - "; " RGB_24_32_STATIC_CAPS (32, 0x00ff0000, 0x0000ff00, - 0x000000ff) "; " RGB_24_32_STATIC_CAPS (32, 0xff000000, 0x00ff0000, - 0x0000ff00) "; " RGB_24_32_STATIC_CAPS (32, 0x0000ff00, 0x00ff0000, - 0xff000000) "; " RGB_24_32_STATIC_CAPS (32, 0x000000ff, 0x0000ff00, - 0x00ff0000) "; " RGB_24_32_STATIC_CAPS (24, 0x0000ff, 0x00ff00, - 0xff0000) "; " GST_VIDEO_CAPS_RGB_15 "; " GST_VIDEO_CAPS_RGB_16) + "; " RGB_24_32_STATIC_CAPS (32, 0x00ff0000, 0x0000ff00, + 0x000000ff) "; " RGB_24_32_STATIC_CAPS (32, 0xff000000, 0x00ff0000, + 0x0000ff00) "; " RGB_24_32_STATIC_CAPS (32, 0x0000ff00, 0x00ff0000, + 0xff000000) "; " RGB_24_32_STATIC_CAPS (32, 0x000000ff, 0x0000ff00, + 0x00ff0000) "; " RGB_24_32_STATIC_CAPS (24, 0x0000ff, 0x00ff00, + 0xff0000) "; " GST_VIDEO_CAPS_RGB_15 "; " GST_VIDEO_CAPS_RGB_16) ); static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-xvid, " - "width = (int) [ 0, MAX ], " - "height = (int) [ 0, MAX ], " "framerate = (double) [ 0.0, MAX ]") + "width = (int) [ 0, MAX ], " + "height = (int) [ 0, MAX ], " "framerate = (double) [ 0.0, MAX ]") ); @@ -111,13 +111,13 @@ gst_xvidenc_profile_get_type (void) {XVID_PROFILE_S_L2, "S_L2", "Simple profile, L2"}, {XVID_PROFILE_S_L3, "S_L3", "Simple profile, L3"}, {XVID_PROFILE_ARTS_L1, "ARTS_L1", - "Advanced real-time simple profile, L1"}, + "Advanced real-time simple profile, L1"}, {XVID_PROFILE_ARTS_L2, "ARTS_L2", - "Advanced real-time simple profile, L2"}, + "Advanced real-time simple profile, L2"}, {XVID_PROFILE_ARTS_L3, "ARTS_L3", - "Advanced real-time simple profile, L3"}, + "Advanced real-time simple profile, L3"}, {XVID_PROFILE_ARTS_L4, "ARTS_L4", - "Advanced real-time simple profile, L4"}, + "Advanced real-time simple profile, L4"}, {XVID_PROFILE_AS_L0, "AS_L0", "Advanced simple profile, L0"}, {XVID_PROFILE_AS_L1, "AS_L1", "Advanced simple profile, L1"}, {XVID_PROFILE_AS_L2, "AS_L2", "Advanced simple profile, L2"}, @@ -127,7 +127,7 @@ gst_xvidenc_profile_get_type (void) }; xvidenc_profile_type = - g_enum_register_static ("GstXvidEncProfiles", xvidenc_profiles); + g_enum_register_static ("GstXvidEncProfiles", xvidenc_profiles); } return xvidenc_profile_type; @@ -150,8 +150,9 @@ gst_xvidenc_get_type (void) 0, (GInstanceInitFunc) gst_xvidenc_init, }; + xvidenc_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstXvidEnc", &xvidenc_info, 0); + "GstXvidEnc", &xvidenc_info, 0); } return xvidenc_type; } @@ -182,22 +183,22 @@ gst_xvidenc_class_init (GstXvidEncClass * klass) /* encoding profile */ g_object_class_install_property (gobject_class, ARG_PROFILE, g_param_spec_enum ("profile", "Profile", "XviD/MPEG-4 encoding profile", - GST_TYPE_XVIDENC_PROFILE, XVID_PROFILE_S_L0, G_PARAM_READWRITE)); + GST_TYPE_XVIDENC_PROFILE, XVID_PROFILE_S_L0, G_PARAM_READWRITE)); /* bitrate */ g_object_class_install_property (gobject_class, ARG_BITRATE, g_param_spec_int ("bitrate", "Bitrate", - "Target video bitrate (kbps)", 0, G_MAXINT, 512, G_PARAM_READWRITE)); + "Target video bitrate (kbps)", 0, G_MAXINT, 512, G_PARAM_READWRITE)); /* keyframe interval */ g_object_class_install_property (gobject_class, ARG_MAXKEYINTERVAL, g_param_spec_int ("max_key_interval", "Max. Key Interval", - "Maximum number of frames between two keyframes", - 0, G_MAXINT, 0, G_PARAM_READWRITE)); + "Maximum number of frames between two keyframes", + 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_BUFSIZE, g_param_spec_ulong ("buffer_size", "Buffer Size", - "Size of the video buffers", 0, G_MAXULONG, 0, G_PARAM_READWRITE)); + "Size of the video buffers", 0, G_MAXULONG, 0, G_PARAM_READWRITE)); gobject_class->set_property = gst_xvidenc_set_property; gobject_class->get_property = gst_xvidenc_get_property; @@ -236,7 +237,7 @@ gst_xvidenc_init (GstXvidEnc * xvidenc) xvidenc->profile = XVID_PROFILE_S_L0; xvidenc->bitrate = 512; xvidenc->max_b_frames = 2; - xvidenc->max_key_interval = -1; /* default - 2*fps */ + xvidenc->max_key_interval = -1; /* default - 2*fps */ xvidenc->buffer_size = 512; /* set xvid handle to NULL */ @@ -281,7 +282,7 @@ gst_xvidenc_setup (GstXvidEnc * xvidenc) if ((ret = xvid_encore (NULL, XVID_ENC_CREATE, &xenc, NULL)) < 0) { GST_ELEMENT_ERROR (xvidenc, LIBRARY, INIT, (NULL), - ("Error setting up xvid encoder: %s (%d)", gst_xvid_error (ret), ret)); + ("Error setting up xvid encoder: %s (%d)", gst_xvid_error (ret), ret)); return FALSE; } @@ -318,9 +319,9 @@ gst_xvidenc_chain (GstPad * pad, GstData * _data) if (xvidenc->width == xvidenc->stride) { xframe.input.plane[0] = GST_BUFFER_DATA (buf); xframe.input.plane[1] = - xframe.input.plane[0] + (xvidenc->width * xvidenc->height); + xframe.input.plane[0] + (xvidenc->width * xvidenc->height); xframe.input.plane[2] = - xframe.input.plane[1] + (xvidenc->width * xvidenc->height / 4); + xframe.input.plane[1] + (xvidenc->width * xvidenc->height / 4); xframe.input.stride[0] = xvidenc->width; xframe.input.stride[1] = xvidenc->width / 2; xframe.input.stride[2] = xvidenc->width / 2; @@ -334,9 +335,9 @@ gst_xvidenc_chain (GstPad * pad, GstData * _data) gst_xvid_init_struct (xstats); if ((ret = xvid_encore (xvidenc->handle, XVID_ENC_ENCODE, - &xframe, &xstats)) < 0) { + &xframe, &xstats)) < 0) { GST_ELEMENT_ERROR (xvidenc, LIBRARY, ENCODE, (NULL), - ("Error encoding xvid frame: %s (%d)", gst_xvid_error (ret), ret)); + ("Error encoding xvid frame: %s (%d)", gst_xvid_error (ret), ret)); gst_buffer_unref (buf); gst_buffer_unref (outbuf); return; @@ -397,13 +398,13 @@ gst_xvidenc_link (GstPad * pad, const GstCaps * vscaps) GstCaps *new_caps; new_caps = gst_caps_new_simple ("video/x-xvid", - "width", G_TYPE_INT, w, - "height", G_TYPE_INT, h, "framerate", G_TYPE_DOUBLE, fps, NULL); + "width", G_TYPE_INT, w, + "height", G_TYPE_INT, h, "framerate", G_TYPE_DOUBLE, fps, NULL); ret = gst_pad_try_set_caps (xvidenc->srcpad, new_caps); if (GST_PAD_LINK_FAILED (ret)) { if (xvidenc->handle) { - xvid_encore (xvidenc->handle, XVID_ENC_DESTROY, NULL, NULL); - xvidenc->handle = NULL; + xvid_encore (xvidenc->handle, XVID_ENC_DESTROY, NULL, NULL); + xvidenc->handle = NULL; } } @@ -482,8 +483,8 @@ gst_xvidenc_change_state (GstElement * element) switch (GST_STATE_PENDING (element)) { case GST_STATE_PAUSED_TO_READY: if (xvidenc->handle) { - xvid_encore (xvidenc->handle, XVID_ENC_DESTROY, NULL, NULL); - xvidenc->handle = NULL; + xvid_encore (xvidenc->handle, XVID_ENC_DESTROY, NULL, NULL); + xvidenc->handle = NULL; } break; default: diff --git a/gst-libs/gst/audio/audio.c b/gst-libs/gst/audio/audio.c index 10a00142e6..ae0571faad 100644 --- a/gst-libs/gst/audio/audio.c +++ b/gst-libs/gst/audio/audio.c @@ -46,7 +46,7 @@ gst_audio_frame_byte_size (GstPad * pad) if (caps == NULL) { /* ERROR: could not get caps of pad */ g_warning ("gstaudio: could not get caps of pad %s:%s\n", - GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); + GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); return 0; } @@ -94,7 +94,7 @@ gst_audio_frame_rate (GstPad * pad) if (caps == NULL) { /* ERROR: could not get caps of pad */ g_warning ("gstaudio: could not get caps of pad %s:%s\n", - GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); + GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); return 0; } else { structure = gst_caps_get_structure (caps, 0); @@ -127,7 +127,7 @@ gst_audio_length (GstPad * pad, GstBuffer * buf) if (caps == NULL) { /* ERROR: could not get caps of pad */ g_warning ("gstaudio: could not get caps of pad %s:%s\n", - GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); + GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); length = 0.0; } else { structure = gst_caps_get_structure (caps, 0); @@ -160,7 +160,7 @@ gst_audio_highest_sample_value (GstPad * pad) caps = GST_PAD_CAPS (pad); if (caps == NULL) { g_warning ("gstaudio: could not get caps of pad %s:%s\n", - GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); + GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); } structure = gst_caps_get_structure (caps, 0); @@ -218,19 +218,19 @@ _gst_audio_structure_set_list (GstStructure * structure, switch (type) { case G_TYPE_INT: - i = va_arg (varargs, int); + i = va_arg (varargs, int); - g_value_init (&list_value, G_TYPE_INT); - g_value_set_int (&list_value, i); - break; + g_value_init (&list_value, G_TYPE_INT); + g_value_set_int (&list_value, i); + break; case G_TYPE_BOOLEAN: - b = va_arg (varargs, gboolean); - g_value_init (&list_value, G_TYPE_BOOLEAN); - g_value_set_boolean (&list_value, b); - break; + b = va_arg (varargs, gboolean); + g_value_init (&list_value, G_TYPE_BOOLEAN); + g_value_set_boolean (&list_value, b); + break; default: - g_warning - ("_gst_audio_structure_set_list: LIST of given type not implemented."); + g_warning + ("_gst_audio_structure_set_list: LIST of given type not implemented."); } g_array_append_val (array, list_value); @@ -244,24 +244,24 @@ gst_audio_structure_set_int (GstStructure * structure, GstAudioFieldFlag flag) { if (flag & GST_AUDIO_FIELD_RATE) gst_structure_set (structure, "rate", GST_TYPE_INT_RANGE, 1, G_MAXINT, - NULL); + NULL); if (flag & GST_AUDIO_FIELD_CHANNELS) gst_structure_set (structure, "channels", GST_TYPE_INT_RANGE, 1, G_MAXINT, - NULL); + NULL); if (flag & GST_AUDIO_FIELD_ENDIANNESS) _gst_audio_structure_set_list (structure, "endianness", G_TYPE_INT, 2, - G_LITTLE_ENDIAN, G_BIG_ENDIAN, NULL); + G_LITTLE_ENDIAN, G_BIG_ENDIAN, NULL); if (flag & GST_AUDIO_FIELD_WIDTH) _gst_audio_structure_set_list (structure, "width", G_TYPE_INT, 3, 8, 16, 32, - NULL); + NULL); if (flag & GST_AUDIO_FIELD_DEPTH) gst_structure_set (structure, "depth", GST_TYPE_INT_RANGE, 1, 32, NULL); if (flag & GST_AUDIO_FIELD_SIGNED) _gst_audio_structure_set_list (structure, "signed", G_TYPE_BOOLEAN, 2, TRUE, - FALSE, NULL); + FALSE, NULL); if (flag & GST_AUDIO_FIELD_BUFFER_FRAMES) gst_structure_set (structure, "buffer-frames", GST_TYPE_INT_RANGE, 1, - G_MAXINT, NULL); + G_MAXINT, NULL); } static gboolean diff --git a/gst-libs/gst/audio/audioclock.c b/gst-libs/gst/audio/audioclock.c index d6d1da45e1..f66f4eba68 100644 --- a/gst-libs/gst/audio/audioclock.c +++ b/gst-libs/gst/audio/audioclock.c @@ -57,8 +57,9 @@ gst_audio_clock_get_type (void) (GInstanceInitFunc) gst_audio_clock_init, NULL }; + clock_type = g_type_register_static (GST_TYPE_SYSTEM_CLOCK, "GstAudioClock", - &clock_info, 0); + &clock_info, 0); } return clock_type; } @@ -162,7 +163,7 @@ gst_audio_clock_update_time (GstAudioClock * aclock, GstClockTime time) entry->func ((GstClock *) aclock, time, entry, entry->user_data); aclock->async_entries = g_slist_delete_link (aclock->async_entries, - aclock->async_entries); + aclock->async_entries); /* do I need to free the entry? */ } } diff --git a/gst-libs/gst/audio/gstaudiofilter.c b/gst-libs/gst/audio/gstaudiofilter.c index ad491bb6ad..179c1d358a 100644 --- a/gst-libs/gst/audio/gstaudiofilter.c +++ b/gst-libs/gst/audio/gstaudiofilter.c @@ -73,8 +73,9 @@ gst_audiofilter_get_type (void) 0, gst_audiofilter_init, }; + audiofilter_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstAudiofilter", &audiofilter_info, G_TYPE_FLAG_ABSTRACT); + "GstAudiofilter", &audiofilter_info, G_TYPE_FLAG_ABSTRACT); } return audiofilter_type; } @@ -141,7 +142,7 @@ gst_audiofilter_link (GstPad * pad, const GstCaps * caps) ret = gst_structure_get_int (structure, "depth", &audiofilter->depth); ret &= gst_structure_get_int (structure, "width", &audiofilter->width); ret &= - gst_structure_get_int (structure, "channels", &audiofilter->channels); + gst_structure_get_int (structure, "channels", &audiofilter->channels); } else if (strcmp (gst_structure_get_name (structure), "audio/x-raw-float") == 0) { @@ -236,7 +237,7 @@ gst_audiofilter_chain (GstPad * pad, GstData * data) (audiofilter_class->filter) (audiofilter, outbuf, inbuf); } else { memcpy (GST_BUFFER_DATA (outbuf), GST_BUFFER_DATA (inbuf), - GST_BUFFER_SIZE (inbuf)); + GST_BUFFER_SIZE (inbuf)); (audiofilter_class->filter_inplace) (audiofilter, outbuf); } @@ -290,11 +291,11 @@ gst_audiofilter_class_add_pad_templates (GstAudiofilterClass * gst_element_class_add_pad_template (element_class, gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, - gst_caps_copy (caps))); + gst_caps_copy (caps))); gst_element_class_add_pad_template (element_class, gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - gst_caps_copy (caps))); + gst_caps_copy (caps))); } static gboolean diff --git a/gst-libs/gst/audio/gstaudiofiltertemplate.c b/gst-libs/gst/audio/gstaudiofiltertemplate.c index 994fdc59d5..f641a6f239 100644 --- a/gst-libs/gst/audio/gstaudiofiltertemplate.c +++ b/gst-libs/gst/audio/gstaudiofiltertemplate.c @@ -107,8 +107,9 @@ gst_audiofilter_template_get_type (void) 0, NULL, }; + audiofilter_template_type = g_type_register_static (GST_TYPE_AUDIOFILTER, - "GstAudiofilterTemplate", &audiofilter_template_info, 0); + "GstAudiofilterTemplate", &audiofilter_template_info, 0); } return audiofilter_template_type; } @@ -147,8 +148,8 @@ gst_audiofilter_template_class_init (gpointer g_class, gpointer class_data) #if 0 g_object_class_install_property (gobject_class, ARG_METHOD, g_param_spec_enum ("method", "method", "method", - GST_TYPE_AUDIOTEMPLATE_METHOD, GST_AUDIOTEMPLATE_METHOD_1, - G_PARAM_READWRITE)); + GST_TYPE_AUDIOTEMPLATE_METHOD, GST_AUDIOTEMPLATE_METHOD_1, + G_PARAM_READWRITE)); #endif gobject_class->set_property = gst_audiofilter_template_set_property; diff --git a/gst-libs/gst/colorbalance/colorbalance.c b/gst-libs/gst/colorbalance/colorbalance.c index fbf1858181..ac6e511ebe 100644 --- a/gst-libs/gst/colorbalance/colorbalance.c +++ b/gst-libs/gst/colorbalance/colorbalance.c @@ -56,9 +56,9 @@ gst_color_balance_get_type (void) }; gst_color_balance_type = g_type_register_static (G_TYPE_INTERFACE, - "GstColorBalance", &gst_color_balance_info, 0); + "GstColorBalance", &gst_color_balance_info, 0); g_type_interface_add_prerequisite (gst_color_balance_type, - GST_TYPE_IMPLEMENTS_INTERFACE); + GST_TYPE_IMPLEMENTS_INTERFACE); } return gst_color_balance_type; @@ -71,12 +71,12 @@ gst_color_balance_class_init (GstColorBalanceClass * klass) if (!initialized) { gst_color_balance_signals[VALUE_CHANGED] = - g_signal_new ("value-changed", - GST_TYPE_COLOR_BALANCE, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstColorBalanceClass, value_changed), - NULL, NULL, - gst_color_balance_marshal_VOID__OBJECT_INT, - G_TYPE_NONE, 2, GST_TYPE_COLOR_BALANCE_CHANNEL, G_TYPE_INT); + g_signal_new ("value-changed", + GST_TYPE_COLOR_BALANCE, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstColorBalanceClass, value_changed), + NULL, NULL, + gst_color_balance_marshal_VOID__OBJECT_INT, + G_TYPE_NONE, 2, GST_TYPE_COLOR_BALANCE_CHANNEL, G_TYPE_INT); initialized = TRUE; } diff --git a/gst-libs/gst/colorbalance/colorbalancechannel.c b/gst-libs/gst/colorbalance/colorbalancechannel.c index 7812ed9303..4fd0ea8887 100644 --- a/gst-libs/gst/colorbalance/colorbalancechannel.c +++ b/gst-libs/gst/colorbalance/colorbalancechannel.c @@ -60,8 +60,8 @@ gst_color_balance_channel_get_type (void) }; gst_color_balance_channel_type = - g_type_register_static (G_TYPE_OBJECT, - "GstColorBalanceChannel", &color_balance_channel_info, 0); + g_type_register_static (G_TYPE_OBJECT, + "GstColorBalanceChannel", &color_balance_channel_info, 0); } return gst_color_balance_channel_type; @@ -78,7 +78,7 @@ gst_color_balance_channel_class_init (GstColorBalanceChannelClass * klass) g_signal_new ("value-changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstColorBalanceChannelClass, - value_changed), + value_changed), NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); object_klass->dispose = gst_color_balance_channel_dispose; diff --git a/gst-libs/gst/gconf/gconf.c b/gst-libs/gst/gconf/gconf.c index 1887b7184d..d68ffe43f9 100644 --- a/gst-libs/gst/gconf/gconf.c +++ b/gst-libs/gst/gconf/gconf.c @@ -31,7 +31,7 @@ #error "GST_GCONF_DIR is not defined !" #endif -static GConfClient *_gst_gconf_client = NULL; /* GConf connection */ +static GConfClient *_gst_gconf_client = NULL; /* GConf connection */ /* internal functions */ @@ -63,13 +63,13 @@ gst_bin_find_unconnected_pad (GstBin * bin, GstPadDirection direction) while (pads) { /* check if the direction matches */ if (GST_PAD_DIRECTION (GST_PAD (pads->data)) == direction) { - if (GST_PAD_PEER (GST_PAD (pads->data)) == NULL) { - /* found it ! */ - pad = GST_PAD (pads->data); - } + if (GST_PAD_PEER (GST_PAD (pads->data)) == NULL) { + /* found it ! */ + pad = GST_PAD (pads->data); + } } if (pad) - break; /* found one already */ + break; /* found one already */ pads = g_list_next (pads); } elements = g_list_next (elements); @@ -149,7 +149,7 @@ gst_gconf_render_bin_from_description (const gchar * description) g_free (desc); if (error) { g_print ("DEBUG: gstgconf: error parsing pipeline %s\n%s\n", - description, error->message); + description, error->message); g_error_free (error); return NULL; } @@ -308,7 +308,7 @@ gst_gconf_get_default_visualization_element (void) if (!ret) g_warning - ("No GConf default visualization plugin key and goom doesn't work"); + ("No GConf default visualization plugin key and goom doesn't work"); else g_print ("GConf visualization plugin not found, using goom\n"); } diff --git a/gst-libs/gst/idct/fastintidct.c b/gst-libs/gst/idct/fastintidct.c index 9bb1436dff..d4caaf3828 100644 --- a/gst-libs/gst/idct/fastintidct.c +++ b/gst-libs/gst/idct/fastintidct.c @@ -45,17 +45,17 @@ /* this code assumes >> to be a two's-complement arithmetic */ /* right shift: (-2)>>1 == -1 , (-3)>>1 == -2 */ -#define W1 2841 /* 2048*sqrt(2)*cos(1*pi/16) */ -#define W2 2676 /* 2048*sqrt(2)*cos(2*pi/16) */ -#define W3 2408 /* 2048*sqrt(2)*cos(3*pi/16) */ -#define W5 1609 /* 2048*sqrt(2)*cos(5*pi/16) */ -#define W6 1108 /* 2048*sqrt(2)*cos(6*pi/16) */ -#define W7 565 /* 2048*sqrt(2)*cos(7*pi/16) */ +#define W1 2841 /* 2048*sqrt(2)*cos(1*pi/16) */ +#define W2 2676 /* 2048*sqrt(2)*cos(2*pi/16) */ +#define W3 2408 /* 2048*sqrt(2)*cos(3*pi/16) */ +#define W5 1609 /* 2048*sqrt(2)*cos(5*pi/16) */ +#define W6 1108 /* 2048*sqrt(2)*cos(6*pi/16) */ +#define W7 565 /* 2048*sqrt(2)*cos(7*pi/16) */ #include "dct.h" /* private data */ -static short iclip[1024]; /* clipping table */ +static short iclip[1024]; /* clipping table */ static short *iclp; /* private prototypes */ @@ -80,13 +80,13 @@ idctrow (blk) /* shortcut */ if (!((x1 = blk[4] << 11) | (x2 = blk[6]) | (x3 = blk[2]) | - (x4 = blk[1]) | (x5 = blk[7]) | (x6 = blk[5]) | (x7 = blk[3]))) { + (x4 = blk[1]) | (x5 = blk[7]) | (x6 = blk[5]) | (x7 = blk[3]))) { blk[0] = blk[1] = blk[2] = blk[3] = blk[4] = blk[5] = blk[6] = blk[7] = - blk[0] << 3; + blk[0] << 3; return; } - x0 = (blk[0] << 11) + 128; /* for proper rounding in the fourth stage */ + x0 = (blk[0] << 11) + 128; /* for proper rounding in the fourth stage */ /* first stage */ x8 = W7 * (x4 + x5); @@ -143,10 +143,10 @@ idctcol (blk) /* shortcut */ if (!((x1 = (blk[8 * 4] << 8)) | (x2 = blk[8 * 6]) | (x3 = blk[8 * 2]) | - (x4 = blk[8 * 1]) | (x5 = blk[8 * 7]) | (x6 = blk[8 * 5]) | (x7 = - blk[8 * 3]))) { + (x4 = blk[8 * 1]) | (x5 = blk[8 * 7]) | (x6 = blk[8 * 5]) | (x7 = + blk[8 * 3]))) { blk[8 * 0] = blk[8 * 1] = blk[8 * 2] = blk[8 * 3] = blk[8 * 4] = - blk[8 * 5] = blk[8 * 6] = blk[8 * 7] = iclp[(blk[8 * 0] + 32) >> 6]; + blk[8 * 5] = blk[8 * 6] = blk[8 * 7] = iclp[(blk[8 * 0] + 32) >> 6]; return; } diff --git a/gst-libs/gst/idct/floatidct.c b/gst-libs/gst/idct/floatidct.c index 0fa1e83009..65e01d407c 100644 --- a/gst-libs/gst/idct/floatidct.c +++ b/gst-libs/gst/idct/floatidct.c @@ -66,7 +66,7 @@ gst_idct_init_float_idct () scale = (freq == 0) ? sqrt (0.125) : 0.5; for (time = 0; time < 8; time++) gst_idct_float_c[freq][time] = - scale * cos ((PI / 8.0) * freq * (time + 0.5)); + scale * cos ((PI / 8.0) * freq * (time + 0.5)); } } @@ -85,7 +85,7 @@ gst_idct_float_idct (block) partial_product = 0.0; for (k = 0; k < 8; k++) - partial_product += gst_idct_float_c[k][j] * block[8 * i + k]; + partial_product += gst_idct_float_c[k][j] * block[8 * i + k]; tmp[8 * i + j] = partial_product; } @@ -98,7 +98,7 @@ gst_idct_float_idct (block) partial_product = 0.0; for (k = 0; k < 8; k++) - partial_product += gst_idct_float_c[k][i] * tmp[8 * k + j]; + partial_product += gst_idct_float_c[k][i] * tmp[8 * k + j]; v = (int) floor (partial_product + 0.5); block[8 * i + j] = (v < -256) ? -256 : ((v > 255) ? 255 : v); diff --git a/gst-libs/gst/idct/ieeetest.c b/gst-libs/gst/idct/ieeetest.c index d26181c1a6..7af101e66e 100644 --- a/gst-libs/gst/idct/ieeetest.c +++ b/gst-libs/gst/idct/ieeetest.c @@ -52,10 +52,10 @@ main (int argc, char **argv) int i, j; double max, total; int method; - DCTELEM block[DCTSIZE2]; /* random source data */ - DCTELEM refcoefs[DCTSIZE2]; /* coefs from reference FDCT */ - DCTELEM refout[DCTSIZE2]; /* output from reference IDCT */ - DCTELEM testout[DCTSIZE2]; /* output from test IDCT */ + DCTELEM block[DCTSIZE2]; /* random source data */ + DCTELEM refcoefs[DCTSIZE2]; /* coefs from reference FDCT */ + DCTELEM refout[DCTSIZE2]; /* output from reference IDCT */ + DCTELEM testout[DCTSIZE2]; /* output from test IDCT */ GstIDCT *idct; guint64 tscstart, tscmin = ~0, tscmax = 0; guint64 tscstop; @@ -96,9 +96,9 @@ main (int argc, char **argv) /* clip */ for (i = 0; i < DCTSIZE2; i++) { if (refcoefs[i] < -2048) - refcoefs[i] = -2048; + refcoefs[i] = -2048; else if (refcoefs[i] > 2047) - refcoefs[i] = 2047; + refcoefs[i] = 2047; } /* perform reference IDCT */ @@ -107,17 +107,17 @@ main (int argc, char **argv) /* clip */ for (i = 0; i < DCTSIZE2; i++) { if (refout[i] < -256) - refout[i] = -256; + refout[i] = -256; else if (refout[i] > 255) - refout[i] = 255; + refout[i] = 255; } /* perform test IDCT */ if (GST_IDCT_TRANSPOSE (idct)) { for (j = 0; j < DCTSIZE; j++) { - for (i = 0; i < DCTSIZE; i++) { - testout[i * DCTSIZE + j] = refcoefs[j * DCTSIZE + i]; - } + for (i = 0; i < DCTSIZE; i++) { + testout[i * DCTSIZE + j] = refcoefs[j * DCTSIZE + i]; + } } } else { memcpy (testout, refcoefs, sizeof (DCTELEM) * DCTSIZE2); @@ -135,9 +135,9 @@ main (int argc, char **argv) /* clip */ for (i = 0; i < DCTSIZE2; i++) { if (testout[i] < -256) - testout[i] = -256; + testout[i] = -256; else if (testout[i] > 255) - testout[i] = 255; + testout[i] = 255; } /* accumulate error stats */ @@ -147,9 +147,9 @@ main (int argc, char **argv) sumerrs[i] += err; sumsqerrs[i] += err * err; if (err < 0) - err = -err; + err = -err; if (maxerr[i] < err) - maxerr[i] = err; + maxerr[i] = err; } if (curiter % 100 == 99) { @@ -290,7 +290,7 @@ dct_init (void) for (b = 0; b < 8; b++) { tmp = cos ((double) ((a + a + 1) * b) * (3.14159265358979323846 / 16.0)); if (b == 0) - tmp /= sqrt (2.0); + tmp /= sqrt (2.0); coslu[a][b] = tmp * 0.5; } } @@ -307,11 +307,11 @@ ref_fdct (DCTELEM block[8][8]) for (u = 0; u < 8; u++) { tmp = 0.0; for (y = 0; y < 8; y++) { - tmp2 = 0.0; - for (x = 0; x < 8; x++) { - tmp2 += (double) block[y][x] * coslu[x][u]; - } - tmp += coslu[y][v] * tmp2; + tmp2 = 0.0; + for (x = 0; x < 8; x++) { + tmp2 += (double) block[y][x] * coslu[x][u]; + } + tmp += coslu[y][v] * tmp2; } res[v][u] = tmp; } @@ -321,9 +321,9 @@ ref_fdct (DCTELEM block[8][8]) for (u = 0; u < 8; u++) { tmp = res[v][u]; if (tmp < 0.0) { - x = -((int) (0.5 - tmp)); + x = -((int) (0.5 - tmp)); } else { - x = (int) (tmp + 0.5); + x = (int) (tmp + 0.5); } block[v][u] = (DCTELEM) x; } @@ -342,11 +342,11 @@ ref_idct (DCTELEM block[8][8]) for (x = 0; x < 8; x++) { tmp = 0.0; for (v = 0; v < 8; v++) { - tmp2 = 0.0; - for (u = 0; u < 8; u++) { - tmp2 += (double) block[v][u] * coslu[x][u]; - } - tmp += coslu[y][v] * tmp2; + tmp2 = 0.0; + for (u = 0; u < 8; u++) { + tmp2 += (double) block[v][u] * coslu[x][u]; + } + tmp += coslu[y][v] * tmp2; } res[y][x] = tmp; } @@ -356,9 +356,9 @@ ref_idct (DCTELEM block[8][8]) for (u = 0; u < 8; u++) { tmp = res[v][u]; if (tmp < 0.0) { - x = -((int) (0.5 - tmp)); + x = -((int) (0.5 - tmp)); } else { - x = (int) (tmp + 0.5); + x = (int) (tmp + 0.5); } block[v][u] = (DCTELEM) x; } diff --git a/gst-libs/gst/idct/intidct.c b/gst-libs/gst/idct/intidct.c index 42f0ac842d..d2945348e1 100644 --- a/gst-libs/gst/idct/intidct.c +++ b/gst-libs/gst/idct/intidct.c @@ -51,7 +51,7 @@ */ #if DCTSIZE != 8 -Sorry, this code only copes with 8 x8 DCTs. /* deliberate syntax err */ +Sorry, this code only copes with 8 x8 DCTs. /* deliberate syntax err */ #endif /* * A 2-D IDCT can be done by 1-D IDCT on each row followed by 1-D IDCT @@ -93,7 +93,7 @@ Sorry, this code only copes with 8 x8 DCTs. /* deliberate syntax err */ #define PASS1_BITS 2 #else #define CONST_BITS 13 -#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ #endif #define ONE ((INT32) 1) #define CONST_SCALE (ONE << CONST_BITS) @@ -106,18 +106,18 @@ Sorry, this code only copes with 8 x8 DCTs. /* deliberate syntax err */ * (With a reasonable C compiler, you can just rely on the FIX() macro...) */ #if CONST_BITS == 13 -#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ -#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ -#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ -#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ -#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ -#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ -#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ -#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ -#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ -#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ -#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ -#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ +#define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ +#define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ +#define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ +#define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ +#define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ +#define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ +#define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ +#define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ +#define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ +#define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ +#define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ +#define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ #else #define FIX_0_298631336 FIX(0.298631336) #define FIX_0_390180644 FIX(0.390180644) @@ -148,14 +148,14 @@ Sorry, this code only copes with 8 x8 DCTs. /* deliberate syntax err */ * NB: for 12-bit samples, a full 32-bit multiplication will be needed. */ #ifdef EIGHT_BIT_SAMPLES -#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ +#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ #define MULTIPLY(var,const) (((INT16) (var)) * ((INT16) (const))) #endif -#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ +#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ #define MULTIPLY(var,const) (((INT16) (var)) * ((INT32) (const))) #endif #endif -#ifndef MULTIPLY /* default definition */ +#ifndef MULTIPLY /* default definition */ #define MULTIPLY(var,const) ((var) * (const)) #endif /* @@ -186,7 +186,7 @@ gst_idct_int_idct (DCTBLOCK data) */ if ((dataptr[1] | dataptr[2] | dataptr[3] | dataptr[4] | - dataptr[5] | dataptr[6] | dataptr[7]) == 0) { + dataptr[5] | dataptr[6] | dataptr[7]) == 0) { /* AC terms all zero */ DCTELEM dcval = (DCTELEM) (dataptr[0] << PASS1_BITS); @@ -199,7 +199,7 @@ gst_idct_int_idct (DCTBLOCK data) dataptr[6] = dcval; dataptr[7] = dcval; - dataptr += DCTSIZE; /* advance pointer to next row */ + dataptr += DCTSIZE; /* advance pointer to next row */ continue; } @@ -234,16 +234,16 @@ gst_idct_int_idct (DCTBLOCK data) z2 = tmp1 + tmp2; z3 = tmp0 + tmp2; z4 = tmp1 + tmp3; - z5 = MULTIPLY (z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + z5 = MULTIPLY (z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ - tmp0 = MULTIPLY (tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp1 = MULTIPLY (tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp2 = MULTIPLY (tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ - tmp3 = MULTIPLY (tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ - z1 = MULTIPLY (z1, -FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - z2 = MULTIPLY (z2, -FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - z3 = MULTIPLY (z3, -FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z4 = MULTIPLY (z4, -FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + tmp0 = MULTIPLY (tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY (tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY (tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY (tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY (z1, -FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY (z2, -FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY (z3, -FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY (z4, -FIX_0_390180644); /* sqrt(2) * (c5-c3) */ z3 += z5; z4 += z5; @@ -264,7 +264,7 @@ gst_idct_int_idct (DCTBLOCK data) dataptr[3] = (DCTELEM) DESCALE (tmp13 + tmp0, CONST_BITS - PASS1_BITS); dataptr[4] = (DCTELEM) DESCALE (tmp13 - tmp0, CONST_BITS - PASS1_BITS); - dataptr += DCTSIZE; /* advance pointer to next row */ + dataptr += DCTSIZE; /* advance pointer to next row */ } /* Pass 2: process columns. */ @@ -283,8 +283,8 @@ gst_idct_int_idct (DCTBLOCK data) #ifndef NO_ZERO_COLUMN_TEST if ((dataptr[DCTSIZE * 1] | dataptr[DCTSIZE * 2] | dataptr[DCTSIZE * 3] | - dataptr[DCTSIZE * 4] | dataptr[DCTSIZE * 5] | dataptr[DCTSIZE * 6] | - dataptr[DCTSIZE * 7]) == 0) { + dataptr[DCTSIZE * 4] | dataptr[DCTSIZE * 5] | dataptr[DCTSIZE * 6] | + dataptr[DCTSIZE * 7]) == 0) { /* AC terms all zero */ DCTELEM dcval = (DCTELEM) DESCALE ((INT32) dataptr[0], PASS1_BITS + 3); @@ -297,7 +297,7 @@ gst_idct_int_idct (DCTBLOCK data) dataptr[DCTSIZE * 6] = dcval; dataptr[DCTSIZE * 7] = dcval; - dataptr++; /* advance pointer to next column */ + dataptr++; /* advance pointer to next column */ continue; } #endif @@ -313,11 +313,11 @@ gst_idct_int_idct (DCTBLOCK data) tmp3 = z1 + MULTIPLY (z2, FIX_0_765366865); tmp0 = - ((INT32) dataptr[DCTSIZE * 0] + - (INT32) dataptr[DCTSIZE * 4]) << CONST_BITS; + ((INT32) dataptr[DCTSIZE * 0] + + (INT32) dataptr[DCTSIZE * 4]) << CONST_BITS; tmp1 = - ((INT32) dataptr[DCTSIZE * 0] - - (INT32) dataptr[DCTSIZE * 4]) << CONST_BITS; + ((INT32) dataptr[DCTSIZE * 0] - + (INT32) dataptr[DCTSIZE * 4]) << CONST_BITS; tmp10 = tmp0 + tmp3; tmp13 = tmp0 - tmp3; @@ -337,16 +337,16 @@ gst_idct_int_idct (DCTBLOCK data) z2 = tmp1 + tmp2; z3 = tmp0 + tmp2; z4 = tmp1 + tmp3; - z5 = MULTIPLY (z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ + z5 = MULTIPLY (z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ - tmp0 = MULTIPLY (tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp1 = MULTIPLY (tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp2 = MULTIPLY (tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ - tmp3 = MULTIPLY (tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ - z1 = MULTIPLY (z1, -FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - z2 = MULTIPLY (z2, -FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - z3 = MULTIPLY (z3, -FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z4 = MULTIPLY (z4, -FIX_0_390180644); /* sqrt(2) * (c5-c3) */ + tmp0 = MULTIPLY (tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY (tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY (tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY (tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY (z1, -FIX_0_899976223); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY (z2, -FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY (z3, -FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY (z4, -FIX_0_390180644); /* sqrt(2) * (c5-c3) */ z3 += z5; z4 += z5; @@ -359,22 +359,22 @@ gst_idct_int_idct (DCTBLOCK data) /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ dataptr[DCTSIZE * 0] = (DCTELEM) DESCALE (tmp10 + tmp3, - CONST_BITS + PASS1_BITS + 3); + CONST_BITS + PASS1_BITS + 3); dataptr[DCTSIZE * 7] = (DCTELEM) DESCALE (tmp10 - tmp3, - CONST_BITS + PASS1_BITS + 3); + CONST_BITS + PASS1_BITS + 3); dataptr[DCTSIZE * 1] = (DCTELEM) DESCALE (tmp11 + tmp2, - CONST_BITS + PASS1_BITS + 3); + CONST_BITS + PASS1_BITS + 3); dataptr[DCTSIZE * 6] = (DCTELEM) DESCALE (tmp11 - tmp2, - CONST_BITS + PASS1_BITS + 3); + CONST_BITS + PASS1_BITS + 3); dataptr[DCTSIZE * 2] = (DCTELEM) DESCALE (tmp12 + tmp1, - CONST_BITS + PASS1_BITS + 3); + CONST_BITS + PASS1_BITS + 3); dataptr[DCTSIZE * 5] = (DCTELEM) DESCALE (tmp12 - tmp1, - CONST_BITS + PASS1_BITS + 3); + CONST_BITS + PASS1_BITS + 3); dataptr[DCTSIZE * 3] = (DCTELEM) DESCALE (tmp13 + tmp0, - CONST_BITS + PASS1_BITS + 3); + CONST_BITS + PASS1_BITS + 3); dataptr[DCTSIZE * 4] = (DCTELEM) DESCALE (tmp13 - tmp0, - CONST_BITS + PASS1_BITS + 3); + CONST_BITS + PASS1_BITS + 3); - dataptr++; /* advance pointer to next column */ + dataptr++; /* advance pointer to next column */ } } diff --git a/gst-libs/gst/idct/mmx32idct.c b/gst-libs/gst/idct/mmx32idct.c index cd191f0c6d..d5bbbdb983 100644 --- a/gst-libs/gst/idct/mmx32idct.c +++ b/gst-libs/gst/idct/mmx32idct.c @@ -117,15 +117,15 @@ qword ptr equ mword ptr */ #endif #include -#define BITS_INV_ACC 4 /*; 4 or 5 for IEEE */ +#define BITS_INV_ACC 4 /*; 4 or 5 for IEEE */ /* 5 yields higher accuracy, but lessens dynamic range on the input matrix */ #define SHIFT_INV_ROW (16 - BITS_INV_ACC) -#define SHIFT_INV_COL (1 + BITS_INV_ACC +14 ) /* changed from Intel's val) */ +#define SHIFT_INV_COL (1 + BITS_INV_ACC +14 ) /* changed from Intel's val) */ /*#define SHIFT_INV_COL (1 + BITS_INV_ACC ) */ #define RND_INV_ROW (1 << (SHIFT_INV_ROW-1)) #define RND_INV_COL (1 << (SHIFT_INV_COL-1)) -#define RND_INV_CORR (RND_INV_COL - 1) /*; correction -1.0 and round */ +#define RND_INV_CORR (RND_INV_COL - 1) /*; correction -1.0 and round */ /*#define RND_INV_ROW (1024 * (6 - BITS_INV_ACC)) //; 1 << (SHIFT_INV_ROW-1) */ /*#define RND_INV_COL (16 * (BITS_INV_ACC - 3)) //; 1 << (SHIFT_INV_COL-1) */ @@ -158,12 +158,12 @@ const static long r_inv_row[2] = { RND_INV_ROW, RND_INV_ROW }; /*const static short ocos_4_16[4] = {23170, 23170, 23170, 23170 }; //cos * (2<<15) + 0.5 */ /*concatenated table, for forward DCT transformation */ -const static short tg_all_16[] = { 13036, 13036, 13036, 13036, /* tg * (2<<16) + 0.5 */ - 27146, 27146, 27146, 27146, /*tg * (2<<16) + 0.5 */ - -21746, -21746, -21746, -21746, /* tg * (2<<16) + 0.5 */ - -19195, -19195, -19195, -19195, /*cos * (2<<16) + 0.5 */ +const static short tg_all_16[] = { 13036, 13036, 13036, 13036, /* tg * (2<<16) + 0.5 */ + 27146, 27146, 27146, 27146, /*tg * (2<<16) + 0.5 */ + -21746, -21746, -21746, -21746, /* tg * (2<<16) + 0.5 */ + -19195, -19195, -19195, -19195, /*cos * (2<<16) + 0.5 */ 23170, 23170, 23170, 23170 -}; /*cos * (2<<15) + 0.5 */ +}; /*cos * (2<<15) + 0.5 */ #define tg_1_16 (tg_all_16 + 0) @@ -233,51 +233,51 @@ IF _MMX ; MMX code ;============================================================================= /*; Table for rows 0,4 - constants are multiplied by cos_4_16 */ -const short tab_i_04[] = { 16384, 16384, 16384, -16384, /* ; movq-> w06 w04 w02 w00 */ - 21407, 8867, 8867, -21407, /* w07 w05 w03 w01 */ - 16384, -16384, 16384, 16384, /*; w14 w12 w10 w08 */ - -8867, 21407, -21407, -8867, /*; w15 w13 w11 w09 */ - 22725, 12873, 19266, -22725, /*; w22 w20 w18 w16 */ - 19266, 4520, -4520, -12873, /*; w23 w21 w19 w17 */ - 12873, 4520, 4520, 19266, /*; w30 w28 w26 w24 */ +const short tab_i_04[] = { 16384, 16384, 16384, -16384, /* ; movq-> w06 w04 w02 w00 */ + 21407, 8867, 8867, -21407, /* w07 w05 w03 w01 */ + 16384, -16384, 16384, 16384, /*; w14 w12 w10 w08 */ + -8867, 21407, -21407, -8867, /*; w15 w13 w11 w09 */ + 22725, 12873, 19266, -22725, /*; w22 w20 w18 w16 */ + 19266, 4520, -4520, -12873, /*; w23 w21 w19 w17 */ + 12873, 4520, 4520, 19266, /*; w30 w28 w26 w24 */ -22725, 19266, -12873, -22725 -}; /*w31 w29 w27 w25 */ +}; /*w31 w29 w27 w25 */ /*; Table for rows 1,7 - constants are multiplied by cos_1_16 */ -const short tab_i_17[] = { 22725, 22725, 22725, -22725, /* ; movq-> w06 w04 w02 w00 */ - 29692, 12299, 12299, -29692, /* ; w07 w05 w03 w01 */ - 22725, -22725, 22725, 22725, /*; w14 w12 w10 w08 */ - -12299, 29692, -29692, -12299, /*; w15 w13 w11 w09 */ - 31521, 17855, 26722, -31521, /*; w22 w20 w18 w16 */ - 26722, 6270, -6270, -17855, /*; w23 w21 w19 w17 */ - 17855, 6270, 6270, 26722, /*; w30 w28 w26 w24 */ +const short tab_i_17[] = { 22725, 22725, 22725, -22725, /* ; movq-> w06 w04 w02 w00 */ + 29692, 12299, 12299, -29692, /* ; w07 w05 w03 w01 */ + 22725, -22725, 22725, 22725, /*; w14 w12 w10 w08 */ + -12299, 29692, -29692, -12299, /*; w15 w13 w11 w09 */ + 31521, 17855, 26722, -31521, /*; w22 w20 w18 w16 */ + 26722, 6270, -6270, -17855, /*; w23 w21 w19 w17 */ + 17855, 6270, 6270, 26722, /*; w30 w28 w26 w24 */ -31521, 26722, -17855, -31521 -}; /* w31 w29 w27 w25 */ +}; /* w31 w29 w27 w25 */ /*; Table for rows 2,6 - constants are multiplied by cos_2_16 */ -const short tab_i_26[] = { 21407, 21407, 21407, -21407, /* ; movq-> w06 w04 w02 w00 */ - 27969, 11585, 11585, -27969, /* ; w07 w05 w03 w01 */ - 21407, -21407, 21407, 21407, /* ; w14 w12 w10 w08 */ - -11585, 27969, -27969, -11585, /* ;w15 w13 w11 w09 */ - 29692, 16819, 25172, -29692, /* ;w22 w20 w18 w16 */ - 25172, 5906, -5906, -16819, /* ;w23 w21 w19 w17 */ - 16819, 5906, 5906, 25172, /* ;w30 w28 w26 w24 */ +const short tab_i_26[] = { 21407, 21407, 21407, -21407, /* ; movq-> w06 w04 w02 w00 */ + 27969, 11585, 11585, -27969, /* ; w07 w05 w03 w01 */ + 21407, -21407, 21407, 21407, /* ; w14 w12 w10 w08 */ + -11585, 27969, -27969, -11585, /* ;w15 w13 w11 w09 */ + 29692, 16819, 25172, -29692, /* ;w22 w20 w18 w16 */ + 25172, 5906, -5906, -16819, /* ;w23 w21 w19 w17 */ + 16819, 5906, 5906, 25172, /* ;w30 w28 w26 w24 */ -29692, 25172, -16819, -29692 -}; /* ;w31 w29 w27 w25 */ +}; /* ;w31 w29 w27 w25 */ /*; Table for rows 3,5 - constants are multiplied by cos_3_16 */ -const short tab_i_35[] = { 19266, 19266, 19266, -19266, /*; movq-> w06 w04 w02 w00 */ - 25172, 10426, 10426, -25172, /*; w07 w05 w03 w01 */ - 19266, -19266, 19266, 19266, /*; w14 w12 w10 w08 */ - -10426, 25172, -25172, -10426, /*; w15 w13 w11 w09 */ - 26722, 15137, 22654, -26722, /*; w22 w20 w18 w16 */ - 22654, 5315, -5315, -15137, /*; w23 w21 w19 w17 */ - 15137, 5315, 5315, 22654, /*; w30 w28 w26 w24 */ +const short tab_i_35[] = { 19266, 19266, 19266, -19266, /*; movq-> w06 w04 w02 w00 */ + 25172, 10426, 10426, -25172, /*; w07 w05 w03 w01 */ + 19266, -19266, 19266, 19266, /*; w14 w12 w10 w08 */ + -10426, 25172, -25172, -10426, /*; w15 w13 w11 w09 */ + 26722, 15137, 22654, -26722, /*; w22 w20 w18 w16 */ + 22654, 5315, -5315, -15137, /*; w23 w21 w19 w17 */ + 15137, 5315, 5315, 22654, /*; w30 w28 w26 w24 */ -26722, 22654, -15137, -26722 -}; /*; w31 w29 w27 w25 */ +}; /*; w31 w29 w27 w25 */ */ /* CONCATENATED TABLE, rows 0,1,2,3,4,5,6,7 (in order ) */ @@ -286,109 +286,109 @@ const short tab_i_35[] = { 19266, 19266, 19266, -19266, /*; movq-> w06 w04 w02 /* */ static const short tab_i_01234567[] = { /*row0, this row is required */ - 16384, 16384, 16384, -16384, /* ; movq-> w06 w04 w02 w00 */ - 21407, 8867, 8867, -21407, /* w07 w05 w03 w01 */ - 16384, -16384, 16384, 16384, /*; w14 w12 w10 w08 */ - -8867, 21407, -21407, -8867, /*; w15 w13 w11 w09 */ - 22725, 12873, 19266, -22725, /*; w22 w20 w18 w16 */ - 19266, 4520, -4520, -12873, /*; w23 w21 w19 w17 */ - 12873, 4520, 4520, 19266, /*; w30 w28 w26 w24 */ - -22725, 19266, -12873, -22725, /*w31 w29 w27 w25 */ + 16384, 16384, 16384, -16384, /* ; movq-> w06 w04 w02 w00 */ + 21407, 8867, 8867, -21407, /* w07 w05 w03 w01 */ + 16384, -16384, 16384, 16384, /*; w14 w12 w10 w08 */ + -8867, 21407, -21407, -8867, /*; w15 w13 w11 w09 */ + 22725, 12873, 19266, -22725, /*; w22 w20 w18 w16 */ + 19266, 4520, -4520, -12873, /*; w23 w21 w19 w17 */ + 12873, 4520, 4520, 19266, /*; w30 w28 w26 w24 */ + -22725, 19266, -12873, -22725, /*w31 w29 w27 w25 */ /* the rest of these rows (1-7), aren't used ! */ /*row1 */ - 22725, 22725, 22725, -22725, /* ; movq-> w06 w04 w02 w00 */ - 29692, 12299, 12299, -29692, /* ; w07 w05 w03 w01 */ - 22725, -22725, 22725, 22725, /*; w14 w12 w10 w08 */ - -12299, 29692, -29692, -12299, /*; w15 w13 w11 w09 */ - 31521, 17855, 26722, -31521, /*; w22 w20 w18 w16 */ - 26722, 6270, -6270, -17855, /*; w23 w21 w19 w17 */ - 17855, 6270, 6270, 26722, /*; w30 w28 w26 w24 */ - -31521, 26722, -17855, -31521, /* w31 w29 w27 w25 */ + 22725, 22725, 22725, -22725, /* ; movq-> w06 w04 w02 w00 */ + 29692, 12299, 12299, -29692, /* ; w07 w05 w03 w01 */ + 22725, -22725, 22725, 22725, /*; w14 w12 w10 w08 */ + -12299, 29692, -29692, -12299, /*; w15 w13 w11 w09 */ + 31521, 17855, 26722, -31521, /*; w22 w20 w18 w16 */ + 26722, 6270, -6270, -17855, /*; w23 w21 w19 w17 */ + 17855, 6270, 6270, 26722, /*; w30 w28 w26 w24 */ + -31521, 26722, -17855, -31521, /* w31 w29 w27 w25 */ /*row2 */ - 21407, 21407, 21407, -21407, /* ; movq-> w06 w04 w02 w00 */ - 27969, 11585, 11585, -27969, /* ; w07 w05 w03 w01 */ - 21407, -21407, 21407, 21407, /* ; w14 w12 w10 w08 */ - -11585, 27969, -27969, -11585, /* ;w15 w13 w11 w09 */ - 29692, 16819, 25172, -29692, /* ;w22 w20 w18 w16 */ - 25172, 5906, -5906, -16819, /* ;w23 w21 w19 w17 */ - 16819, 5906, 5906, 25172, /* ;w30 w28 w26 w24 */ - -29692, 25172, -16819, -29692, /* ;w31 w29 w27 w25 */ + 21407, 21407, 21407, -21407, /* ; movq-> w06 w04 w02 w00 */ + 27969, 11585, 11585, -27969, /* ; w07 w05 w03 w01 */ + 21407, -21407, 21407, 21407, /* ; w14 w12 w10 w08 */ + -11585, 27969, -27969, -11585, /* ;w15 w13 w11 w09 */ + 29692, 16819, 25172, -29692, /* ;w22 w20 w18 w16 */ + 25172, 5906, -5906, -16819, /* ;w23 w21 w19 w17 */ + 16819, 5906, 5906, 25172, /* ;w30 w28 w26 w24 */ + -29692, 25172, -16819, -29692, /* ;w31 w29 w27 w25 */ /*row3 */ - 19266, 19266, 19266, -19266, /*; movq-> w06 w04 w02 w00 */ - 25172, 10426, 10426, -25172, /*; w07 w05 w03 w01 */ - 19266, -19266, 19266, 19266, /*; w14 w12 w10 w08 */ - -10426, 25172, -25172, -10426, /*; w15 w13 w11 w09 */ - 26722, 15137, 22654, -26722, /*; w22 w20 w18 w16 */ - 22654, 5315, -5315, -15137, /*; w23 w21 w19 w17 */ - 15137, 5315, 5315, 22654, /*; w30 w28 w26 w24 */ - -26722, 22654, -15137, -26722, /*; w31 w29 w27 w25 */ + 19266, 19266, 19266, -19266, /*; movq-> w06 w04 w02 w00 */ + 25172, 10426, 10426, -25172, /*; w07 w05 w03 w01 */ + 19266, -19266, 19266, 19266, /*; w14 w12 w10 w08 */ + -10426, 25172, -25172, -10426, /*; w15 w13 w11 w09 */ + 26722, 15137, 22654, -26722, /*; w22 w20 w18 w16 */ + 22654, 5315, -5315, -15137, /*; w23 w21 w19 w17 */ + 15137, 5315, 5315, 22654, /*; w30 w28 w26 w24 */ + -26722, 22654, -15137, -26722, /*; w31 w29 w27 w25 */ /*row4 */ - 16384, 16384, 16384, -16384, /* ; movq-> w06 w04 w02 w00 */ - 21407, 8867, 8867, -21407, /* w07 w05 w03 w01 */ - 16384, -16384, 16384, 16384, /*; w14 w12 w10 w08 */ - -8867, 21407, -21407, -8867, /*; w15 w13 w11 w09 */ - 22725, 12873, 19266, -22725, /*; w22 w20 w18 w16 */ - 19266, 4520, -4520, -12873, /*; w23 w21 w19 w17 */ - 12873, 4520, 4520, 19266, /*; w30 w28 w26 w24 */ - -22725, 19266, -12873, -22725, /*w31 w29 w27 w25 */ + 16384, 16384, 16384, -16384, /* ; movq-> w06 w04 w02 w00 */ + 21407, 8867, 8867, -21407, /* w07 w05 w03 w01 */ + 16384, -16384, 16384, 16384, /*; w14 w12 w10 w08 */ + -8867, 21407, -21407, -8867, /*; w15 w13 w11 w09 */ + 22725, 12873, 19266, -22725, /*; w22 w20 w18 w16 */ + 19266, 4520, -4520, -12873, /*; w23 w21 w19 w17 */ + 12873, 4520, 4520, 19266, /*; w30 w28 w26 w24 */ + -22725, 19266, -12873, -22725, /*w31 w29 w27 w25 */ /*row5 */ - 19266, 19266, 19266, -19266, /*; movq-> w06 w04 w02 w00 */ - 25172, 10426, 10426, -25172, /*; w07 w05 w03 w01 */ - 19266, -19266, 19266, 19266, /*; w14 w12 w10 w08 */ - -10426, 25172, -25172, -10426, /*; w15 w13 w11 w09 */ - 26722, 15137, 22654, -26722, /*; w22 w20 w18 w16 */ - 22654, 5315, -5315, -15137, /*; w23 w21 w19 w17 */ - 15137, 5315, 5315, 22654, /*; w30 w28 w26 w24 */ - -26722, 22654, -15137, -26722, /*; w31 w29 w27 w25 */ + 19266, 19266, 19266, -19266, /*; movq-> w06 w04 w02 w00 */ + 25172, 10426, 10426, -25172, /*; w07 w05 w03 w01 */ + 19266, -19266, 19266, 19266, /*; w14 w12 w10 w08 */ + -10426, 25172, -25172, -10426, /*; w15 w13 w11 w09 */ + 26722, 15137, 22654, -26722, /*; w22 w20 w18 w16 */ + 22654, 5315, -5315, -15137, /*; w23 w21 w19 w17 */ + 15137, 5315, 5315, 22654, /*; w30 w28 w26 w24 */ + -26722, 22654, -15137, -26722, /*; w31 w29 w27 w25 */ /*row6 */ - 21407, 21407, 21407, -21407, /* ; movq-> w06 w04 w02 w00 */ - 27969, 11585, 11585, -27969, /* ; w07 w05 w03 w01 */ - 21407, -21407, 21407, 21407, /* ; w14 w12 w10 w08 */ - -11585, 27969, -27969, -11585, /* ;w15 w13 w11 w09 */ - 29692, 16819, 25172, -29692, /* ;w22 w20 w18 w16 */ - 25172, 5906, -5906, -16819, /* ;w23 w21 w19 w17 */ - 16819, 5906, 5906, 25172, /* ;w30 w28 w26 w24 */ - -29692, 25172, -16819, -29692, /* ;w31 w29 w27 w25 */ + 21407, 21407, 21407, -21407, /* ; movq-> w06 w04 w02 w00 */ + 27969, 11585, 11585, -27969, /* ; w07 w05 w03 w01 */ + 21407, -21407, 21407, 21407, /* ; w14 w12 w10 w08 */ + -11585, 27969, -27969, -11585, /* ;w15 w13 w11 w09 */ + 29692, 16819, 25172, -29692, /* ;w22 w20 w18 w16 */ + 25172, 5906, -5906, -16819, /* ;w23 w21 w19 w17 */ + 16819, 5906, 5906, 25172, /* ;w30 w28 w26 w24 */ + -29692, 25172, -16819, -29692, /* ;w31 w29 w27 w25 */ /*row7 */ - 22725, 22725, 22725, -22725, /* ; movq-> w06 w04 w02 w00 */ - 29692, 12299, 12299, -29692, /* ; w07 w05 w03 w01 */ - 22725, -22725, 22725, 22725, /*; w14 w12 w10 w08 */ - -12299, 29692, -29692, -12299, /*; w15 w13 w11 w09 */ - 31521, 17855, 26722, -31521, /*; w22 w20 w18 w16 */ - 26722, 6270, -6270, -17855, /*; w23 w21 w19 w17 */ - 17855, 6270, 6270, 26722, /*; w30 w28 w26 w24 */ + 22725, 22725, 22725, -22725, /* ; movq-> w06 w04 w02 w00 */ + 29692, 12299, 12299, -29692, /* ; w07 w05 w03 w01 */ + 22725, -22725, 22725, 22725, /*; w14 w12 w10 w08 */ + -12299, 29692, -29692, -12299, /*; w15 w13 w11 w09 */ + 31521, 17855, 26722, -31521, /*; w22 w20 w18 w16 */ + 26722, 6270, -6270, -17855, /*; w23 w21 w19 w17 */ + 17855, 6270, 6270, 26722, /*; w30 w28 w26 w24 */ -31521, 26722, -17855, -31521 -}; /* w31 w29 w27 w25 */ +}; /* w31 w29 w27 w25 */ -#define INP eax /* pointer to (short *blk) */ -#define OUT ecx /* pointer to output (temporary store space qwTemp[]) */ -#define TABLE ebx /* pointer to tab_i_01234567[] */ +#define INP eax /* pointer to (short *blk) */ +#define OUT ecx /* pointer to output (temporary store space qwTemp[]) */ +#define TABLE ebx /* pointer to tab_i_01234567[] */ #define round_inv_row edx #define round_inv_col edx -#define ROW_STRIDE 8 /* for 8x8 matrix transposer */ +#define ROW_STRIDE 8 /* for 8x8 matrix transposer */ /* private variables and functions */ /*temporary storage space, 8x8 of shorts */ - __inline static void idct_mmx32_rows (short *blk); /* transform rows */ -__inline static void idct_mmx32_cols (short *blk); /* transform "columns" */ + __inline static void idct_mmx32_rows (short *blk); /* transform rows */ +__inline static void idct_mmx32_cols (short *blk); /* transform "columns" */ - /* the "column" transform actually transforms rows, it is */ - /* identical to the row-transform except for the ROUNDING */ - /* and SHIFTING coefficients. */ + /* the "column" transform actually transforms rows, it is */ + /* identical to the row-transform except for the ROUNDING */ + /* and SHIFTING coefficients. */ static void idct_mmx32_rows (short *blk) -{ /* transform all 8 rows of 8x8 iDCT block */ +{ /* transform all 8 rows of 8x8 iDCT block */ int x; short qwTemp[64]; short *out = &qwTemp[0]; @@ -402,58 +402,58 @@ idct_mmx32_rows (short *blk) /* */ /* 2) transpose the matrix (which was stored in qwTemp[]) */ /* qwTemp[] -> [8x8 matrix transpose] -> blk[] */ - for (x = 0; x < 8; x++) { /* transform one row per iteration */ - movq_m2r (*(inptr), mm0); /* 0 ; x3 x2 x1 x0 */ - movq_m2r (*(inptr + 4), mm1); /* 1 ; x7 x6 x5 x4 */ - movq_r2r (mm0, mm2); /* 2 ; x3 x2 x1 x0 */ - movq_m2r (*(tab_i_01234567), mm3); /* 3 ; w06 w04 w02 w00 */ - punpcklwd_r2r (mm1, mm0); /* x5 x1 x4 x0 */ + for (x = 0; x < 8; x++) { /* transform one row per iteration */ + movq_m2r (*(inptr), mm0); /* 0 ; x3 x2 x1 x0 */ + movq_m2r (*(inptr + 4), mm1); /* 1 ; x7 x6 x5 x4 */ + movq_r2r (mm0, mm2); /* 2 ; x3 x2 x1 x0 */ + movq_m2r (*(tab_i_01234567), mm3); /* 3 ; w06 w04 w02 w00 */ + punpcklwd_r2r (mm1, mm0); /* x5 x1 x4 x0 */ - /* ---------- */ - movq_r2r (mm0, mm5); /* 5 ; x5 x1 x4 x0 */ - punpckldq_r2r (mm0, mm0); /* x4 x0 x4 x0 */ - movq_m2r (*(tab_i_01234567 + 4), mm4); /* 4 ; w07 w05 w03 w01 */ - punpckhwd_r2r (mm1, mm2); /* 1 ; x7 x3 x6 x2 */ - pmaddwd_r2r (mm0, mm3); /* x4*w06+x0*w04 x4*w02+x0*w00 */ - movq_r2r (mm2, mm6); /* 6 ; x7 x3 x6 x2 */ - movq_m2r (*(tab_i_01234567 + 16), mm1); /* 1 ; w22 w20 w18 w16 */ - punpckldq_r2r (mm2, mm2); /* x6 x2 x6 x2 */ - pmaddwd_r2r (mm2, mm4); /* x6*w07+x2*w05 x6*w03+x2*w01 */ - punpckhdq_r2r (mm5, mm5); /* x5 x1 x5 x1 */ - pmaddwd_m2r (*(tab_i_01234567 + 8), mm0); /* x4*w14+x0*w12 x4*w10+x0*w08 */ - punpckhdq_r2r (mm6, mm6); /* x7 x3 x7 x3 */ - movq_m2r (*(tab_i_01234567 + 20), mm7); /* 7 ; w23 w21 w19 w17 */ - pmaddwd_r2r (mm5, mm1); /* x5*w22+x1*w20 x5*w18+x1*w16 */ - paddd_m2r (*(r_inv_row), mm3); /* +rounder */ - pmaddwd_r2r (mm6, mm7); /* x7*w23+x3*w21 x7*w19+x3*w17 */ - pmaddwd_m2r (*(tab_i_01234567 + 12), mm2); /* x6*w15+x2*w13 x6*w11+x2*w09 */ - paddd_r2r (mm4, mm3); /* 4 ; a1=sum(even1) a0=sum(even0) */ - pmaddwd_m2r (*(tab_i_01234567 + 24), mm5); /* x5*w30+x1*w28 x5*w26+x1*w24 */ - movq_r2r (mm3, mm4); /* 4 ; a1 a0 */ - pmaddwd_m2r (*(tab_i_01234567 + 28), mm6); /* x7*w31+x3*w29 x7*w27+x3*w25 */ - paddd_r2r (mm7, mm1); /* 7 ; b1=sum(odd1) b0=sum(odd0) */ - paddd_m2r (*(r_inv_row), mm0); /* +rounder */ - psubd_r2r (mm1, mm3); /* a1-b1 a0-b0 */ - psrad_i2r (SHIFT_INV_ROW, mm3); /* y6=a1-b1 y7=a0-b0 */ - paddd_r2r (mm4, mm1); /* 4 ; a1+b1 a0+b0 */ - paddd_r2r (mm2, mm0); /* 2 ; a3=sum(even3) a2=sum(even2) */ - psrad_i2r (SHIFT_INV_ROW, mm1); /* y1=a1+b1 y0=a0+b0 */ - paddd_r2r (mm6, mm5); /* 6 ; b3=sum(odd3) b2=sum(odd2) */ - movq_r2r (mm0, mm4); /* 4 ; a3 a2 */ - paddd_r2r (mm5, mm0); /* a3+b3 a2+b2 */ - psubd_r2r (mm5, mm4); /* 5 ; a3-b3 a2-b2 */ - psrad_i2r (SHIFT_INV_ROW, mm4); /* y4=a3-b3 y5=a2-b2 */ - psrad_i2r (SHIFT_INV_ROW, mm0); /* y3=a3+b3 y2=a2+b2 */ - packssdw_r2r (mm3, mm4); /* 3 ; y6 y7 y4 y5 */ - packssdw_r2r (mm0, mm1); /* 0 ; y3 y2 y1 y0 */ - movq_r2r (mm4, mm7); /* 7 ; y6 y7 y4 y5 */ - psrld_i2r (16, mm4); /* 0 y6 0 y4 */ - movq_r2m (mm1, *(out)); /* 1 ; save y3 y2 y1 y0 */ - pslld_i2r (16, mm7); /* y7 0 y5 0 */ - por_r2r (mm4, mm7); /* 4 ; y7 y6 y5 y4 */ + /* ---------- */ + movq_r2r (mm0, mm5); /* 5 ; x5 x1 x4 x0 */ + punpckldq_r2r (mm0, mm0); /* x4 x0 x4 x0 */ + movq_m2r (*(tab_i_01234567 + 4), mm4); /* 4 ; w07 w05 w03 w01 */ + punpckhwd_r2r (mm1, mm2); /* 1 ; x7 x3 x6 x2 */ + pmaddwd_r2r (mm0, mm3); /* x4*w06+x0*w04 x4*w02+x0*w00 */ + movq_r2r (mm2, mm6); /* 6 ; x7 x3 x6 x2 */ + movq_m2r (*(tab_i_01234567 + 16), mm1); /* 1 ; w22 w20 w18 w16 */ + punpckldq_r2r (mm2, mm2); /* x6 x2 x6 x2 */ + pmaddwd_r2r (mm2, mm4); /* x6*w07+x2*w05 x6*w03+x2*w01 */ + punpckhdq_r2r (mm5, mm5); /* x5 x1 x5 x1 */ + pmaddwd_m2r (*(tab_i_01234567 + 8), mm0); /* x4*w14+x0*w12 x4*w10+x0*w08 */ + punpckhdq_r2r (mm6, mm6); /* x7 x3 x7 x3 */ + movq_m2r (*(tab_i_01234567 + 20), mm7); /* 7 ; w23 w21 w19 w17 */ + pmaddwd_r2r (mm5, mm1); /* x5*w22+x1*w20 x5*w18+x1*w16 */ + paddd_m2r (*(r_inv_row), mm3); /* +rounder */ + pmaddwd_r2r (mm6, mm7); /* x7*w23+x3*w21 x7*w19+x3*w17 */ + pmaddwd_m2r (*(tab_i_01234567 + 12), mm2); /* x6*w15+x2*w13 x6*w11+x2*w09 */ + paddd_r2r (mm4, mm3); /* 4 ; a1=sum(even1) a0=sum(even0) */ + pmaddwd_m2r (*(tab_i_01234567 + 24), mm5); /* x5*w30+x1*w28 x5*w26+x1*w24 */ + movq_r2r (mm3, mm4); /* 4 ; a1 a0 */ + pmaddwd_m2r (*(tab_i_01234567 + 28), mm6); /* x7*w31+x3*w29 x7*w27+x3*w25 */ + paddd_r2r (mm7, mm1); /* 7 ; b1=sum(odd1) b0=sum(odd0) */ + paddd_m2r (*(r_inv_row), mm0); /* +rounder */ + psubd_r2r (mm1, mm3); /* a1-b1 a0-b0 */ + psrad_i2r (SHIFT_INV_ROW, mm3); /* y6=a1-b1 y7=a0-b0 */ + paddd_r2r (mm4, mm1); /* 4 ; a1+b1 a0+b0 */ + paddd_r2r (mm2, mm0); /* 2 ; a3=sum(even3) a2=sum(even2) */ + psrad_i2r (SHIFT_INV_ROW, mm1); /* y1=a1+b1 y0=a0+b0 */ + paddd_r2r (mm6, mm5); /* 6 ; b3=sum(odd3) b2=sum(odd2) */ + movq_r2r (mm0, mm4); /* 4 ; a3 a2 */ + paddd_r2r (mm5, mm0); /* a3+b3 a2+b2 */ + psubd_r2r (mm5, mm4); /* 5 ; a3-b3 a2-b2 */ + psrad_i2r (SHIFT_INV_ROW, mm4); /* y4=a3-b3 y5=a2-b2 */ + psrad_i2r (SHIFT_INV_ROW, mm0); /* y3=a3+b3 y2=a2+b2 */ + packssdw_r2r (mm3, mm4); /* 3 ; y6 y7 y4 y5 */ + packssdw_r2r (mm0, mm1); /* 0 ; y3 y2 y1 y0 */ + movq_r2r (mm4, mm7); /* 7 ; y6 y7 y4 y5 */ + psrld_i2r (16, mm4); /* 0 y6 0 y4 */ + movq_r2m (mm1, *(out)); /* 1 ; save y3 y2 y1 y0 */ + pslld_i2r (16, mm7); /* y7 0 y5 0 */ + por_r2r (mm4, mm7); /* 4 ; y7 y6 y5 y4 */ - /* begin processing row 1 */ - movq_r2m (mm7, *(out + 4)); /* 7 ; save y7 y6 y5 y4 */ + /* begin processing row 1 */ + movq_r2m (mm7, *(out + 4)); /* 7 ; save y7 y6 y5 y4 */ inptr += 8; out += 8; } @@ -477,31 +477,31 @@ idct_mmx32_rows (short *blk) out = &qwTemp[0]; movq_m2r (*(out + ROW_STRIDE * 0), mm0); movq_m2r (*(out + ROW_STRIDE * 1), mm1); - movq_r2r (mm0, mm4); /* mm4 = copy of row1[A B C D] */ + movq_r2r (mm0, mm4); /* mm4 = copy of row1[A B C D] */ movq_m2r (*(out + ROW_STRIDE * 2), mm2); - punpcklwd_r2r (mm1, mm0); /* mm0 = [ 0 4 1 5] */ + punpcklwd_r2r (mm1, mm0); /* mm0 = [ 0 4 1 5] */ movq_m2r (*(out + ROW_STRIDE * 3), mm3); - punpckhwd_r2r (mm1, mm4); /* mm4 = [ 2 6 3 7] */ + punpckhwd_r2r (mm1, mm4); /* mm4 = [ 2 6 3 7] */ movq_r2r (mm2, mm6); - punpcklwd_r2r (mm3, mm2); /* mm2 = [ 8 12 9 13] */ - punpckhwd_r2r (mm3, mm6); /* mm6 = 10 14 11 15] */ - movq_r2r (mm0, mm1); /* mm1 = [ 0 4 1 5] */ + punpcklwd_r2r (mm3, mm2); /* mm2 = [ 8 12 9 13] */ + punpckhwd_r2r (mm3, mm6); /* mm6 = 10 14 11 15] */ + movq_r2r (mm0, mm1); /* mm1 = [ 0 4 1 5] */ inptr = blk; - punpckldq_r2r (mm2, mm0); /* final result mm0 = row1 [0 4 8 12] */ - movq_r2r (mm4, mm3); /* mm3 = [ 2 6 3 7] */ - punpckhdq_r2r (mm2, mm1); /* mm1 = final result mm1 = row2 [1 5 9 13] */ - movq_r2m (mm0, *(inptr + ROW_STRIDE * 0)); /* store row 1 */ - punpckldq_r2r (mm6, mm4); /* final result mm4 = row3 [2 6 10 14] */ + punpckldq_r2r (mm2, mm0); /* final result mm0 = row1 [0 4 8 12] */ + movq_r2r (mm4, mm3); /* mm3 = [ 2 6 3 7] */ + punpckhdq_r2r (mm2, mm1); /* mm1 = final result mm1 = row2 [1 5 9 13] */ + movq_r2m (mm0, *(inptr + ROW_STRIDE * 0)); /* store row 1 */ + punpckldq_r2r (mm6, mm4); /* final result mm4 = row3 [2 6 10 14] */ /* begin reading next quadrant (lower-right) */ movq_m2r (*(out + ROW_STRIDE * 4 + 4), mm0); - punpckhdq_r2r (mm6, mm3); /* final result mm3 = row4 [3 7 11 15] */ - movq_r2m (mm4, *(inptr + ROW_STRIDE * 2)); /* store row 3 */ - movq_r2r (mm0, mm4); /* mm4 = copy of row1[A B C D] */ - movq_r2m (mm1, *(inptr + ROW_STRIDE * 1)); /* store row 2 */ + punpckhdq_r2r (mm6, mm3); /* final result mm3 = row4 [3 7 11 15] */ + movq_r2m (mm4, *(inptr + ROW_STRIDE * 2)); /* store row 3 */ + movq_r2r (mm0, mm4); /* mm4 = copy of row1[A B C D] */ + movq_r2m (mm1, *(inptr + ROW_STRIDE * 1)); /* store row 2 */ movq_m2r (*(out + ROW_STRIDE * 5 + 4), mm1); - movq_r2m (mm3, *(inptr + ROW_STRIDE * 3)); /* store row 4 */ - punpcklwd_r2r (mm1, mm0); /* mm0 = [ 0 4 1 5] */ + movq_r2m (mm3, *(inptr + ROW_STRIDE * 3)); /* store row 4 */ + punpcklwd_r2r (mm1, mm0); /* mm0 = [ 0 4 1 5] */ /* 2) transpose lower-right quadrant */ @@ -512,28 +512,28 @@ idct_mmx32_rows (short *blk) movq_m2r (*(out + ROW_STRIDE * 6 + 4), mm2); /* punpcklwd mm0, mm1; // mm0 = [ 0 4 1 5] */ - punpckhwd_r2r (mm1, mm4); /* mm4 = [ 2 6 3 7] */ + punpckhwd_r2r (mm1, mm4); /* mm4 = [ 2 6 3 7] */ movq_m2r (*(out + ROW_STRIDE * 7 + 4), mm3); movq_r2r (mm2, mm6); - punpcklwd_r2r (mm3, mm2); /* mm2 = [ 8 12 9 13] */ - movq_r2r (mm0, mm1); /* mm1 = [ 0 4 1 5] */ - punpckhwd_r2r (mm3, mm6); /* mm6 = 10 14 11 15] */ - movq_r2r (mm4, mm3); /* mm3 = [ 2 6 3 7] */ - punpckldq_r2r (mm2, mm0); /* final result mm0 = row1 [0 4 8 12] */ - punpckhdq_r2r (mm2, mm1); /* mm1 = final result mm1 = row2 [1 5 9 13] */ - ; /* slot */ - movq_r2m (mm0, *(inptr + ROW_STRIDE * 4 + 4)); /* store row 1 */ - punpckldq_r2r (mm6, mm4); /* final result mm4 = row3 [2 6 10 14] */ + punpcklwd_r2r (mm3, mm2); /* mm2 = [ 8 12 9 13] */ + movq_r2r (mm0, mm1); /* mm1 = [ 0 4 1 5] */ + punpckhwd_r2r (mm3, mm6); /* mm6 = 10 14 11 15] */ + movq_r2r (mm4, mm3); /* mm3 = [ 2 6 3 7] */ + punpckldq_r2r (mm2, mm0); /* final result mm0 = row1 [0 4 8 12] */ + punpckhdq_r2r (mm2, mm1); /* mm1 = final result mm1 = row2 [1 5 9 13] */ + ; /* slot */ + movq_r2m (mm0, *(inptr + ROW_STRIDE * 4 + 4)); /* store row 1 */ + punpckldq_r2r (mm6, mm4); /* final result mm4 = row3 [2 6 10 14] */ movq_m2r (*(out + ROW_STRIDE * 4), mm0); - punpckhdq_r2r (mm6, mm3); /* final result mm3 = row4 [3 7 11 15] */ - movq_r2m (mm4, *(inptr + ROW_STRIDE * 6 + 4)); /* store row 3 */ - movq_r2r (mm0, mm4); /* mm4 = copy of row1[A B C D] */ - movq_r2m (mm1, *(inptr + ROW_STRIDE * 5 + 4)); /* store row 2 */ - ; /* slot */ + punpckhdq_r2r (mm6, mm3); /* final result mm3 = row4 [3 7 11 15] */ + movq_r2m (mm4, *(inptr + ROW_STRIDE * 6 + 4)); /* store row 3 */ + movq_r2r (mm0, mm4); /* mm4 = copy of row1[A B C D] */ + movq_r2m (mm1, *(inptr + ROW_STRIDE * 5 + 4)); /* store row 2 */ + ; /* slot */ movq_m2r (*(out + ROW_STRIDE * 5), mm1); - ; /* slot */ - movq_r2m (mm3, *(inptr + ROW_STRIDE * 7 + 4)); /* store row 4 */ - punpcklwd_r2r (mm1, mm0); /* mm0 = [ 0 4 1 5] */ + ; /* slot */ + movq_r2m (mm3, *(inptr + ROW_STRIDE * 7 + 4)); /* store row 4 */ + punpcklwd_r2r (mm1, mm0); /* mm0 = [ 0 4 1 5] */ /* 3) transpose lower-left */ /* movq mm0, qword ptr [OUT + ROW_STRIDE * 4 ] */ @@ -543,28 +543,28 @@ idct_mmx32_rows (short *blk) movq_m2r (*(out + ROW_STRIDE * 6), mm2); /* punpcklwd mm0, mm1; // mm0 = [ 0 4 1 5] */ - punpckhwd_r2r (mm1, mm4); /* mm4 = [ 2 6 3 7] */ + punpckhwd_r2r (mm1, mm4); /* mm4 = [ 2 6 3 7] */ movq_m2r (*(out + ROW_STRIDE * 7), mm3); movq_r2r (mm2, mm6); - punpcklwd_r2r (mm3, mm2); /* mm2 = [ 8 12 9 13] */ - movq_r2r (mm0, mm1); /* mm1 = [ 0 4 1 5] */ - punpckhwd_r2r (mm3, mm6); /* mm6 = 10 14 11 15] */ - movq_r2r (mm4, mm3); /* mm3 = [ 2 6 3 7] */ - punpckldq_r2r (mm2, mm0); /* final result mm0 = row1 [0 4 8 12] */ - punpckhdq_r2r (mm2, mm1); /* mm1 = final result mm1 = row2 [1 5 9 13] */ - ; /*slot */ - movq_r2m (mm0, *(inptr + ROW_STRIDE * 0 + 4)); /* store row 1 */ - punpckldq_r2r (mm6, mm4); /* final result mm4 = row3 [2 6 10 14] */ + punpcklwd_r2r (mm3, mm2); /* mm2 = [ 8 12 9 13] */ + movq_r2r (mm0, mm1); /* mm1 = [ 0 4 1 5] */ + punpckhwd_r2r (mm3, mm6); /* mm6 = 10 14 11 15] */ + movq_r2r (mm4, mm3); /* mm3 = [ 2 6 3 7] */ + punpckldq_r2r (mm2, mm0); /* final result mm0 = row1 [0 4 8 12] */ + punpckhdq_r2r (mm2, mm1); /* mm1 = final result mm1 = row2 [1 5 9 13] */ + ; /*slot */ + movq_r2m (mm0, *(inptr + ROW_STRIDE * 0 + 4)); /* store row 1 */ + punpckldq_r2r (mm6, mm4); /* final result mm4 = row3 [2 6 10 14] */ /* begin reading next quadrant (upper-right) */ movq_m2r (*(out + ROW_STRIDE * 0 + 4), mm0); - punpckhdq_r2r (mm6, mm3); /* final result mm3 = row4 [3 7 11 15] */ - movq_r2m (mm4, *(inptr + ROW_STRIDE * 2 + 4)); /* store row 3 */ - movq_r2r (mm0, mm4); /* mm4 = copy of row1[A B C D] */ - movq_r2m (mm1, *(inptr + ROW_STRIDE * 1 + 4)); /* store row 2 */ + punpckhdq_r2r (mm6, mm3); /* final result mm3 = row4 [3 7 11 15] */ + movq_r2m (mm4, *(inptr + ROW_STRIDE * 2 + 4)); /* store row 3 */ + movq_r2r (mm0, mm4); /* mm4 = copy of row1[A B C D] */ + movq_r2m (mm1, *(inptr + ROW_STRIDE * 1 + 4)); /* store row 2 */ movq_m2r (*(out + ROW_STRIDE * 1 + 4), mm1); - movq_r2m (mm3, *(inptr + ROW_STRIDE * 3 + 4)); /* store row 4 */ - punpcklwd_r2r (mm1, mm0); /* mm0 = [ 0 4 1 5] */ + movq_r2m (mm3, *(inptr + ROW_STRIDE * 3 + 4)); /* store row 4 */ + punpcklwd_r2r (mm1, mm0); /* mm0 = [ 0 4 1 5] */ /* 2) transpose lower-right quadrant */ @@ -575,28 +575,28 @@ idct_mmx32_rows (short *blk) movq_m2r (*(out + ROW_STRIDE * 2 + 4), mm2); /* punpcklwd mm0, mm1; // mm0 = [ 0 4 1 5] */ - punpckhwd_r2r (mm1, mm4); /* mm4 = [ 2 6 3 7] */ + punpckhwd_r2r (mm1, mm4); /* mm4 = [ 2 6 3 7] */ movq_m2r (*(out + ROW_STRIDE * 3 + 4), mm3); movq_r2r (mm2, mm6); - punpcklwd_r2r (mm3, mm2); /* mm2 = [ 8 12 9 13] */ - movq_r2r (mm0, mm1); /* mm1 = [ 0 4 1 5] */ - punpckhwd_r2r (mm3, mm6); /* mm6 = 10 14 11 15] */ - movq_r2r (mm4, mm3); /* mm3 = [ 2 6 3 7] */ - punpckldq_r2r (mm2, mm0); /* final result mm0 = row1 [0 4 8 12] */ - punpckhdq_r2r (mm2, mm1); /* mm1 = final result mm1 = row2 [1 5 9 13] */ - ; /* slot */ - movq_r2m (mm0, *(inptr + ROW_STRIDE * 4)); /* store row 1 */ - punpckldq_r2r (mm6, mm4); /* final result mm4 = row3 [2 6 10 14] */ - movq_r2m (mm1, *(inptr + ROW_STRIDE * 5)); /* store row 2 */ - punpckhdq_r2r (mm6, mm3); /* final result mm3 = row4 [3 7 11 15] */ - movq_r2m (mm4, *(inptr + ROW_STRIDE * 6)); /* store row 3 */ - ; /* slot */ - movq_r2m (mm3, *(inptr + ROW_STRIDE * 7)); /* store row 4 */ - ; /* slot */ + punpcklwd_r2r (mm3, mm2); /* mm2 = [ 8 12 9 13] */ + movq_r2r (mm0, mm1); /* mm1 = [ 0 4 1 5] */ + punpckhwd_r2r (mm3, mm6); /* mm6 = 10 14 11 15] */ + movq_r2r (mm4, mm3); /* mm3 = [ 2 6 3 7] */ + punpckldq_r2r (mm2, mm0); /* final result mm0 = row1 [0 4 8 12] */ + punpckhdq_r2r (mm2, mm1); /* mm1 = final result mm1 = row2 [1 5 9 13] */ + ; /* slot */ + movq_r2m (mm0, *(inptr + ROW_STRIDE * 4)); /* store row 1 */ + punpckldq_r2r (mm6, mm4); /* final result mm4 = row3 [2 6 10 14] */ + movq_r2m (mm1, *(inptr + ROW_STRIDE * 5)); /* store row 2 */ + punpckhdq_r2r (mm6, mm3); /* final result mm3 = row4 [3 7 11 15] */ + movq_r2m (mm4, *(inptr + ROW_STRIDE * 6)); /* store row 3 */ + ; /* slot */ + movq_r2m (mm3, *(inptr + ROW_STRIDE * 7)); /* store row 4 */ + ; /* slot */ } static void idct_mmx32_cols (short *blk) -{ /* transform all 8 cols of 8x8 iDCT block */ +{ /* transform all 8 cols of 8x8 iDCT block */ int x; short *inptr = blk; @@ -612,58 +612,58 @@ idct_mmx32_cols (short *blk) /* */ /* 2) transpose the matrix (which was stored in qwTemp[]) */ /* qwTemp[] -> [8x8 matrix transpose] -> blk[] */ - for (x = 0; x < 8; x++) { /* transform one row per iteration */ - movq_m2r (*(inptr), mm0); /* 0 ; x3 x2 x1 x0 */ - movq_m2r (*(inptr + 4), mm1); /* 1 ; x7 x6 x5 x4 */ - movq_r2r (mm0, mm2); /* 2 ; x3 x2 x1 x0 */ - movq_m2r (*(tab_i_01234567), mm3); /* 3 ; w06 w04 w02 w00 */ - punpcklwd_r2r (mm1, mm0); /* x5 x1 x4 x0 */ + for (x = 0; x < 8; x++) { /* transform one row per iteration */ + movq_m2r (*(inptr), mm0); /* 0 ; x3 x2 x1 x0 */ + movq_m2r (*(inptr + 4), mm1); /* 1 ; x7 x6 x5 x4 */ + movq_r2r (mm0, mm2); /* 2 ; x3 x2 x1 x0 */ + movq_m2r (*(tab_i_01234567), mm3); /* 3 ; w06 w04 w02 w00 */ + punpcklwd_r2r (mm1, mm0); /* x5 x1 x4 x0 */ /* ---------- */ - movq_r2r (mm0, mm5); /* 5 ; x5 x1 x4 x0 */ - punpckldq_r2r (mm0, mm0); /* x4 x0 x4 x0 */ - movq_m2r (*(tab_i_01234567 + 4), mm4); /* 4 ; w07 w05 w03 w01 */ - punpckhwd_r2r (mm1, mm2); /* 1 ; x7 x3 x6 x2 */ - pmaddwd_r2r (mm0, mm3); /* x4*w06+x0*w04 x4*w02+x0*w00 */ - movq_r2r (mm2, mm6); /* 6 ; x7 x3 x6 x2 */ - movq_m2r (*(tab_i_01234567 + 16), mm1); /* 1 ; w22 w20 w18 w16 */ - punpckldq_r2r (mm2, mm2); /* x6 x2 x6 x2 */ - pmaddwd_r2r (mm2, mm4); /* x6*w07+x2*w05 x6*w03+x2*w01 */ - punpckhdq_r2r (mm5, mm5); /* x5 x1 x5 x1 */ - pmaddwd_m2r (*(tab_i_01234567 + 8), mm0); /* x4*w14+x0*w12 x4*w10+x0*w08 */ - punpckhdq_r2r (mm6, mm6); /* x7 x3 x7 x3 */ - movq_m2r (*(tab_i_01234567 + 20), mm7); /* 7 ; w23 w21 w19 w17 */ - pmaddwd_r2r (mm5, mm1); /* x5*w22+x1*w20 x5*w18+x1*w16 */ - paddd_m2r (*(r_inv_col), mm3); /* +rounder */ - pmaddwd_r2r (mm6, mm7); /* x7*w23+x3*w21 x7*w19+x3*w17 */ - pmaddwd_m2r (*(tab_i_01234567 + 12), mm2); /* x6*w15+x2*w13 x6*w11+x2*w09 */ - paddd_r2r (mm4, mm3); /* 4 ; a1=sum(even1) a0=sum(even0) */ - pmaddwd_m2r (*(tab_i_01234567 + 24), mm5); /* x5*w30+x1*w28 x5*w26+x1*w24 */ - movq_r2r (mm3, mm4); /* 4 ; a1 a0 */ - pmaddwd_m2r (*(tab_i_01234567 + 28), mm6); /* x7*w31+x3*w29 x7*w27+x3*w25 */ - paddd_r2r (mm7, mm1); /* 7 ; b1=sum(odd1) b0=sum(odd0) */ - paddd_m2r (*(r_inv_col), mm0); /* +rounder */ - psubd_r2r (mm1, mm3); /* a1-b1 a0-b0 */ - psrad_i2r (SHIFT_INV_COL, mm3); /* y6=a1-b1 y7=a0-b0 */ - paddd_r2r (mm4, mm1); /* 4 ; a1+b1 a0+b0 */ - paddd_r2r (mm2, mm0); /* 2 ; a3=sum(even3) a2=sum(even2) */ - psrad_i2r (SHIFT_INV_COL, mm1); /* y1=a1+b1 y0=a0+b0 */ - paddd_r2r (mm6, mm5); /* 6 ; b3=sum(odd3) b2=sum(odd2) */ - movq_r2r (mm0, mm4); /* 4 ; a3 a2 */ - paddd_r2r (mm5, mm0); /* a3+b3 a2+b2 */ - psubd_r2r (mm5, mm4); /* 5 ; a3-b3 a2-b2 */ - psrad_i2r (SHIFT_INV_COL, mm4); /* y4=a3-b3 y5=a2-b2 */ - psrad_i2r (SHIFT_INV_COL, mm0); /* y3=a3+b3 y2=a2+b2 */ - packssdw_r2r (mm3, mm4); /* 3 ; y6 y7 y4 y5 */ - packssdw_r2r (mm0, mm1); /* 0 ; y3 y2 y1 y0 */ - movq_r2r (mm4, mm7); /* 7 ; y6 y7 y4 y5 */ - psrld_i2r (16, mm4); /* 0 y6 0 y4 */ - movq_r2m (mm1, *(inptr)); /* 1 ; save y3 y2 y1 y0 */ - pslld_i2r (16, mm7); /* y7 0 y5 0 */ - por_r2r (mm4, mm7); /* 4 ; y7 y6 y5 y4 */ + movq_r2r (mm0, mm5); /* 5 ; x5 x1 x4 x0 */ + punpckldq_r2r (mm0, mm0); /* x4 x0 x4 x0 */ + movq_m2r (*(tab_i_01234567 + 4), mm4); /* 4 ; w07 w05 w03 w01 */ + punpckhwd_r2r (mm1, mm2); /* 1 ; x7 x3 x6 x2 */ + pmaddwd_r2r (mm0, mm3); /* x4*w06+x0*w04 x4*w02+x0*w00 */ + movq_r2r (mm2, mm6); /* 6 ; x7 x3 x6 x2 */ + movq_m2r (*(tab_i_01234567 + 16), mm1); /* 1 ; w22 w20 w18 w16 */ + punpckldq_r2r (mm2, mm2); /* x6 x2 x6 x2 */ + pmaddwd_r2r (mm2, mm4); /* x6*w07+x2*w05 x6*w03+x2*w01 */ + punpckhdq_r2r (mm5, mm5); /* x5 x1 x5 x1 */ + pmaddwd_m2r (*(tab_i_01234567 + 8), mm0); /* x4*w14+x0*w12 x4*w10+x0*w08 */ + punpckhdq_r2r (mm6, mm6); /* x7 x3 x7 x3 */ + movq_m2r (*(tab_i_01234567 + 20), mm7); /* 7 ; w23 w21 w19 w17 */ + pmaddwd_r2r (mm5, mm1); /* x5*w22+x1*w20 x5*w18+x1*w16 */ + paddd_m2r (*(r_inv_col), mm3); /* +rounder */ + pmaddwd_r2r (mm6, mm7); /* x7*w23+x3*w21 x7*w19+x3*w17 */ + pmaddwd_m2r (*(tab_i_01234567 + 12), mm2); /* x6*w15+x2*w13 x6*w11+x2*w09 */ + paddd_r2r (mm4, mm3); /* 4 ; a1=sum(even1) a0=sum(even0) */ + pmaddwd_m2r (*(tab_i_01234567 + 24), mm5); /* x5*w30+x1*w28 x5*w26+x1*w24 */ + movq_r2r (mm3, mm4); /* 4 ; a1 a0 */ + pmaddwd_m2r (*(tab_i_01234567 + 28), mm6); /* x7*w31+x3*w29 x7*w27+x3*w25 */ + paddd_r2r (mm7, mm1); /* 7 ; b1=sum(odd1) b0=sum(odd0) */ + paddd_m2r (*(r_inv_col), mm0); /* +rounder */ + psubd_r2r (mm1, mm3); /* a1-b1 a0-b0 */ + psrad_i2r (SHIFT_INV_COL, mm3); /* y6=a1-b1 y7=a0-b0 */ + paddd_r2r (mm4, mm1); /* 4 ; a1+b1 a0+b0 */ + paddd_r2r (mm2, mm0); /* 2 ; a3=sum(even3) a2=sum(even2) */ + psrad_i2r (SHIFT_INV_COL, mm1); /* y1=a1+b1 y0=a0+b0 */ + paddd_r2r (mm6, mm5); /* 6 ; b3=sum(odd3) b2=sum(odd2) */ + movq_r2r (mm0, mm4); /* 4 ; a3 a2 */ + paddd_r2r (mm5, mm0); /* a3+b3 a2+b2 */ + psubd_r2r (mm5, mm4); /* 5 ; a3-b3 a2-b2 */ + psrad_i2r (SHIFT_INV_COL, mm4); /* y4=a3-b3 y5=a2-b2 */ + psrad_i2r (SHIFT_INV_COL, mm0); /* y3=a3+b3 y2=a2+b2 */ + packssdw_r2r (mm3, mm4); /* 3 ; y6 y7 y4 y5 */ + packssdw_r2r (mm0, mm1); /* 0 ; y3 y2 y1 y0 */ + movq_r2r (mm4, mm7); /* 7 ; y6 y7 y4 y5 */ + psrld_i2r (16, mm4); /* 0 y6 0 y4 */ + movq_r2m (mm1, *(inptr)); /* 1 ; save y3 y2 y1 y0 */ + pslld_i2r (16, mm7); /* y7 0 y5 0 */ + por_r2r (mm4, mm7); /* 4 ; y7 y6 y5 y4 */ - /* begin processing row 1 */ - movq_r2m (mm7, *(inptr + 4)); /* 7 ; save y7 y6 y5 y4 */ + /* begin processing row 1 */ + movq_r2m (mm7, *(inptr + 4)); /* 7 ; save y7 y6 y5 y4 */ inptr += 8; } @@ -679,10 +679,12 @@ gst_idct_mmx32_idct (short *blk) { /* 1) iDCT row transformation */ - idct_mmx32_rows (blk); /* 1) transform iDCT row, and transpose */ + idct_mmx32_rows (blk); /* 1) transform iDCT row, and transpose */ /* 2) iDCT column transformation */ - idct_mmx32_cols (blk); /* 2) transform iDCT row, and transpose */ - emms (); /* restore processor state */ + idct_mmx32_cols (blk); /* 2) transform iDCT row, and transpose */ + emms (); /* restore processor state */ /* all done */ -} +} + + diff --git a/gst-libs/gst/media-info/media-info-priv.c b/gst-libs/gst/media-info/media-info-priv.c index fb0122093c..22ac6c45f7 100644 --- a/gst-libs/gst/media-info/media-info-priv.c +++ b/gst-libs/gst/media-info/media-info-priv.c @@ -104,11 +104,11 @@ have_type_callback (GstElement * typefind, guint probability, GstCaps * type, /* FIXME: signal error */ g_warning ("Couldn't create id3tag"); if (!gst_element_link_many (priv->source, priv->decontainer, priv->typefind, - NULL)); + NULL)); g_warning ("Couldn't link in id3tag"); if (gst_element_set_state (priv->pipeline, GST_STATE_PLAYING) - == GST_STATE_FAILURE) + == GST_STATE_FAILURE) g_warning ("Couldn't set to playing"); } #endif @@ -139,8 +139,8 @@ deep_notify_callback (GObject * object, GstObject * origin, GST_DEBUG ("caps: %" GST_PTR_FORMAT, priv->format); } else GST_DEBUG ("ignoring caps on object %s:%s", - gst_object_get_name (gst_object_get_parent (origin)), - gst_object_get_name (origin)); + gst_object_get_name (gst_object_get_parent (origin)), + gst_object_get_name (origin)); } else if (strcmp (pspec->name, "offset") == 0) { /* we REALLY ignore offsets, we hate them */ } @@ -151,7 +151,8 @@ typedef struct { guint meta; guint encoded; -} TagFlagScore; +} +TagFlagScore; static void tag_flag_score (const GstTagList * list, const gchar * tag, gpointer user_data) @@ -323,7 +324,7 @@ gmi_seek_to_track (GstMediaInfo * info, long track) res = gst_pad_send_event (info->priv->decoder_pad, event); if (!res) { g_warning ("seek to logical track on pad %s:%s failed", - GST_DEBUG_PAD_NAME (info->priv->decoder_pad)); + GST_DEBUG_PAD_NAME (info->priv->decoder_pad)); return FALSE; } /* clear structs because of the seek */ @@ -350,37 +351,37 @@ gmi_set_mime (GstMediaInfo * info, const char *mime) if ((strcmp (mime, "application/x-ogg") == 0) || (strcmp (mime, "application/ogg") == 0)) desc = - g_strdup_printf - ("%s name=source ! oggdemux ! vorbisdec name=decoder ! fakesink name=sink", - priv->source_name); + g_strdup_printf + ("%s name=source ! oggdemux ! vorbisdec name=decoder ! fakesink name=sink", + priv->source_name); else if ((strcmp (mime, "audio/mpeg") == 0) || (strcmp (mime, "audio/x-mp3") == 0) || (strcmp (mime, "audio/mp3") == 0) || (strcmp (mime, "application/x-id3") == 0) || (strcmp (mime, "audio/x-id3") == 0)) desc = - g_strdup_printf - ("%s name=source ! id3tag ! mad name=decoder ! audio/x-raw-int ! fakesink name=sink", - priv->source_name); + g_strdup_printf + ("%s name=source ! id3tag ! mad name=decoder ! audio/x-raw-int ! fakesink name=sink", + priv->source_name); else if ((strcmp (mime, "application/x-flac") == 0) || (strcmp (mime, "audio/x-flac") == 0)) desc = - g_strdup_printf - ("%s name=source ! flacdec name=decoder ! audio/x-raw-int ! fakesink name=sink", - priv->source_name); + g_strdup_printf + ("%s name=source ! flacdec name=decoder ! audio/x-raw-int ! fakesink name=sink", + priv->source_name); else if ((strcmp (mime, "audio/wav") == 0) || (strcmp (mime, "audio/x-wav") == 0)) desc = - g_strdup_printf - ("%s ! wavparse name=decoder ! audio/x-raw-int ! fakesink name=sink", - priv->source_name); + g_strdup_printf + ("%s ! wavparse name=decoder ! audio/x-raw-int ! fakesink name=sink", + priv->source_name); else if (strcmp (mime, "audio/x-mod") == 0 || strcmp (mime, "audio/x-s3m") == 0 || strcmp (mime, "audio/x-xm") == 0 || strcmp (mime, "audio/x-it") == 0) desc = - g_strdup_printf - ("%s name=source ! modplug name=decoder ! audio/x-raw-int ! fakesink name=sink", - priv->source_name); + g_strdup_printf + ("%s name=source ! modplug name=decoder ! audio/x-raw-int ! fakesink name=sink", + priv->source_name); else return FALSE; @@ -409,7 +410,7 @@ gmi_set_mime (GstMediaInfo * info, const char *mime) g_assert (GST_IS_PAD (priv->decoder_pad)); GST_DEBUG ("decoder pad: %s:%s", gst_object_get_name (gst_object_get_parent (GST_OBJECT (priv-> - decoder_pad))), gst_pad_get_name (priv->decoder_pad)); + decoder_pad))), gst_pad_get_name (priv->decoder_pad)); /* attach notify handler */ g_signal_connect (G_OBJECT (info->priv->pipeline), "deep_notify", @@ -557,21 +558,21 @@ gmip_find_stream_post (GstMediaInfoPriv * priv) if (res) { switch (format) { - case GST_FORMAT_TIME: - stream->length_time = value; - GST_DEBUG (" total %s: %lld", definition->nick, value); - break; - case GST_FORMAT_DEFAULT: - case GST_FORMAT_BYTES: - break; - default: - /* separation is necessary because track_format doesn't resolve to - * int */ - if (format == track_format) { - stream->length_tracks = value; - GST_DEBUG (" total %s: %lld", definition->nick, value); - } else - GST_DEBUG ("unhandled format %s", definition->nick); + case GST_FORMAT_TIME: + stream->length_time = value; + GST_DEBUG (" total %s: %lld", definition->nick, value); + break; + case GST_FORMAT_DEFAULT: + case GST_FORMAT_BYTES: + break; + default: + /* separation is necessary because track_format doesn't resolve to + * int */ + if (format == track_format) { + stream->length_tracks = value; + GST_DEBUG (" total %s: %lld", definition->nick, value); + } else + GST_DEBUG ("unhandled format %s", definition->nick); } } else GST_DEBUG ("query didn't return result for %s", definition->nick); @@ -597,7 +598,7 @@ gmip_find_stream_post (GstMediaInfoPriv * priv) stream->bitrate = (long) (bits / seconds); } GST_DEBUG ("moving to STATE_METADATA\n"); - priv->state = GST_MEDIA_INFO_STATE_METADATA; /* metadata of first track */ + priv->state = GST_MEDIA_INFO_STATE_METADATA; /* metadata of first track */ return TRUE; } @@ -694,23 +695,23 @@ gmip_find_track_streaminfo_post (GstMediaInfoPriv * priv) gboolean res; res = gst_pad_query (priv->decoder_pad, GST_QUERY_POSITION, - &track_format, &value_start); + &track_format, &value_start); if (res) { format = GST_FORMAT_TIME; track_num = value_start; GST_DEBUG ("we are currently at %ld", track_num); res = gst_pad_convert (priv->decoder_pad, - track_format, track_num, &format, &value_start); + track_format, track_num, &format, &value_start); res &= gst_pad_convert (priv->decoder_pad, - track_format, track_num + 1, &format, &value_end); + track_format, track_num + 1, &format, &value_end); if (res) { - /* substract to get the length */ - GST_DEBUG ("start %lld, end %lld", value_start, value_end); - value_end -= value_start; - /* FIXME: check units; this is in seconds */ + /* substract to get the length */ + GST_DEBUG ("start %lld, end %lld", value_start, value_end); + value_end -= value_start; + /* FIXME: check units; this is in seconds */ - gst_tag_list_add (priv->streaminfo, GST_TAG_MERGE_REPLACE, - GST_TAG_DURATION, (int) (value_end / 1E6), NULL); + gst_tag_list_add (priv->streaminfo, GST_TAG_MERGE_REPLACE, + GST_TAG_DURATION, (int) (value_end / 1E6), NULL); } } } diff --git a/gst-libs/gst/media-info/media-info-test.c b/gst-libs/gst/media-info/media-info-test.c index 67a16cdc23..e0778d9f44 100644 --- a/gst-libs/gst/media-info/media-info-test.c +++ b/gst-libs/gst/media-info/media-info-test.c @@ -18,7 +18,7 @@ print_tag (const GstTagList * list, const gchar * tag, gpointer unused) g_assert (gst_tag_list_get_string_index (list, tag, i, &str)); } else { str = - g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, i)); + g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, i)); } if (i == 0) { diff --git a/gst-libs/gst/media-info/media-info.c b/gst-libs/gst/media-info/media-info.c index 4f99535945..16a6625029 100644 --- a/gst-libs/gst/media-info/media-info.c +++ b/gst-libs/gst/media-info/media-info.c @@ -113,8 +113,9 @@ gst_media_info_get_type (void) (GInstanceInitFunc) gst_media_info_instance_init, NULL }; + gst_media_info_type = g_type_register_static (G_TYPE_OBJECT, - "GstMediaInfo", &gst_media_info_info, 0); + "GstMediaInfo", &gst_media_info_info, 0); } return gst_media_info_type; } @@ -192,7 +193,7 @@ gst_media_info_new (GError ** error) info->priv->error = NULL; } else { g_warning ("Error creating GstMediaInfo object.\n%s", - info->priv->error->message); + info->priv->error->message); g_error_free (info->priv->error); } } @@ -222,7 +223,7 @@ gst_media_info_read_with_idler (GstMediaInfo * info, const char *location, { GstMediaInfoPriv *priv = info->priv; - gmip_reset (info->priv); /* reset all structs */ + gmip_reset (info->priv); /* reset all structs */ priv->location = g_strdup (location); priv->flags = flags; } @@ -251,9 +252,9 @@ gst_media_info_read_idler (GstMediaInfo * info, GstMediaInfoStream ** streamp, case GST_MEDIA_INFO_STATE_NULL: /* make sure we have a source */ if (!priv->source_name) { - *error = g_error_new (GST_MEDIA_INFO_ERROR, 0, - "No source set on media info."); - return FALSE; + *error = g_error_new (GST_MEDIA_INFO_ERROR, 0, + "No source set on media info."); + return FALSE; } /* need to find type */ @@ -266,26 +267,26 @@ gst_media_info_read_idler (GstMediaInfo * info, GstMediaInfoStream ** streamp, GST_LOG ("STATE_TYPEFIND"); if ((priv->type == NULL) && gst_bin_iterate (GST_BIN (priv->pipeline))) { - GST_DEBUG ("iterating while in STATE_TYPEFIND"); - GMI_DEBUG ("?"); - return TRUE; + GST_DEBUG ("iterating while in STATE_TYPEFIND"); + GMI_DEBUG ("?"); + return TRUE; } if (priv->type == NULL) { - g_warning ("Couldn't find type\n"); - return FALSE; + g_warning ("Couldn't find type\n"); + return FALSE; } /* do the state transition */ GST_DEBUG ("doing find_type_post"); gmip_find_type_post (priv); GST_DEBUG ("finding out mime type"); mime = - g_strdup (gst_structure_get_name (gst_caps_get_structure (priv->type, - 0))); + g_strdup (gst_structure_get_name (gst_caps_get_structure (priv->type, + 0))); GST_DEBUG ("found out mime type: %s", mime); if (!gmi_set_mime (info, mime)) { - /* FIXME: pop up error */ - GST_DEBUG ("no decoder pipeline found for mime %s", mime); - return FALSE; + /* FIXME: pop up error */ + GST_DEBUG ("no decoder pipeline found for mime %s", mime); + return FALSE; } priv->stream = gmi_stream_new (); GST_DEBUG ("new stream: %p", priv->stream); @@ -298,12 +299,12 @@ gst_media_info_read_idler (GstMediaInfo * info, GstMediaInfoStream ** streamp, { GST_LOG ("STATE_STREAM"); if ((priv->format == NULL) && gst_bin_iterate (GST_BIN (priv->pipeline))) { - GMI_DEBUG ("?"); - return TRUE; + GMI_DEBUG ("?"); + return TRUE; } if (priv->format == NULL) { - g_warning ("Couldn't find format\n"); - return FALSE; + g_warning ("Couldn't find format\n"); + return FALSE; } /* do state transition; stream -> first track metadata */ priv->current_track_num = 0; @@ -316,21 +317,21 @@ gst_media_info_read_idler (GstMediaInfo * info, GstMediaInfoStream ** streamp, case GST_MEDIA_INFO_STATE_METADATA: { if ((priv->metadata == NULL) && - gst_bin_iterate (GST_BIN (priv->pipeline)) && - priv->metadata_iters < MAX_METADATA_ITERS) { - GMI_DEBUG ("?"); - priv->metadata_iters++; - return TRUE; + gst_bin_iterate (GST_BIN (priv->pipeline)) && + priv->metadata_iters < MAX_METADATA_ITERS) { + GMI_DEBUG ("?"); + priv->metadata_iters++; + return TRUE; } if (priv->metadata_iters == MAX_METADATA_ITERS) - g_print ("iterated a few times, didn't find metadata\n"); + g_print ("iterated a few times, didn't find metadata\n"); if (priv->metadata == NULL) { - /* this is not a permanent failure */ - GST_DEBUG ("Couldn't find metadata"); + /* this is not a permanent failure */ + GST_DEBUG ("Couldn't find metadata"); } GST_DEBUG ("found metadata of track %ld", priv->current_track_num); if (!gmip_find_track_metadata_post (priv)) - return FALSE; + return FALSE; GST_DEBUG ("METADATA: going to STREAMINFO\n"); priv->state = GST_MEDIA_INFO_STATE_STREAMINFO; return gmip_find_track_streaminfo_pre (priv); @@ -338,50 +339,50 @@ gst_media_info_read_idler (GstMediaInfo * info, GstMediaInfoStream ** streamp, case GST_MEDIA_INFO_STATE_STREAMINFO: { if ((priv->streaminfo == NULL) && - gst_bin_iterate (GST_BIN (priv->pipeline))) { - GMI_DEBUG ("?"); - return TRUE; + gst_bin_iterate (GST_BIN (priv->pipeline))) { + GMI_DEBUG ("?"); + return TRUE; } if (priv->streaminfo == NULL) { - /* this is not a permanent failure */ - GST_DEBUG ("Couldn't find streaminfo"); + /* this is not a permanent failure */ + GST_DEBUG ("Couldn't find streaminfo"); } else - GST_DEBUG ("found streaminfo of track %ld", priv->current_track_num); + GST_DEBUG ("found streaminfo of track %ld", priv->current_track_num); if (!gmip_find_track_streaminfo_post (priv)) - return FALSE; + return FALSE; priv->state = GST_MEDIA_INFO_STATE_FORMAT; return gmip_find_track_format_pre (priv); } case GST_MEDIA_INFO_STATE_FORMAT: { if ((priv->format == NULL) && gst_bin_iterate (GST_BIN (priv->pipeline))) { - GMI_DEBUG ("?"); - return TRUE; + GMI_DEBUG ("?"); + return TRUE; } if (priv->format == NULL) { - g_warning ("Couldn't find format\n"); - return FALSE; + g_warning ("Couldn't find format\n"); + return FALSE; } GST_DEBUG ("found format of track %ld", priv->current_track_num); if (!gmip_find_track_format_post (priv)) - return FALSE; + return FALSE; /* save the track info */ priv->stream->tracks = g_list_append (priv->stream->tracks, - priv->current_track); + priv->current_track); /* these alloc'd data types have been handed off */ priv->current_track = NULL; priv->location = NULL; /* now see if we need to seek to a next track or not */ priv->current_track_num++; if (priv->current_track_num < priv->stream->length_tracks) { - gmi_seek_to_track (info, priv->current_track_num); - priv->current_track = gmi_track_new (); - if (!gmip_find_track_metadata_pre (priv)) { - g_free (priv->current_track); - return FALSE; - } - priv->state = GST_MEDIA_INFO_STATE_METADATA; - return TRUE; + gmi_seek_to_track (info, priv->current_track_num); + priv->current_track = gmi_track_new (); + if (!gmip_find_track_metadata_pre (priv)) { + g_free (priv->current_track); + return FALSE; + } + priv->state = GST_MEDIA_INFO_STATE_METADATA; + return TRUE; } priv->state = GST_MEDIA_INFO_STATE_DONE; gmi_clear_decoder (info); diff --git a/gst-libs/gst/mixer/mixer.c b/gst-libs/gst/mixer/mixer.c index a9034f608c..1db3d6a3ca 100644 --- a/gst-libs/gst/mixer/mixer.c +++ b/gst-libs/gst/mixer/mixer.c @@ -57,9 +57,9 @@ gst_mixer_get_type (void) }; gst_mixer_type = g_type_register_static (G_TYPE_INTERFACE, - "GstMixer", &gst_mixer_info, 0); + "GstMixer", &gst_mixer_info, 0); g_type_interface_add_prerequisite (gst_mixer_type, - GST_TYPE_IMPLEMENTS_INTERFACE); + GST_TYPE_IMPLEMENTS_INTERFACE); } return gst_mixer_type; @@ -72,26 +72,26 @@ gst_mixer_class_init (GstMixerClass * klass) if (!initialized) { gst_mixer_signals[RECORD_TOGGLED] = - g_signal_new ("record-toggled", - GST_TYPE_MIXER, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstMixerClass, record_toggled), - NULL, NULL, - gst_mixer_marshal_VOID__OBJECT_BOOLEAN, G_TYPE_NONE, 2, - GST_TYPE_MIXER_TRACK, G_TYPE_BOOLEAN); + g_signal_new ("record-toggled", + GST_TYPE_MIXER, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstMixerClass, record_toggled), + NULL, NULL, + gst_mixer_marshal_VOID__OBJECT_BOOLEAN, G_TYPE_NONE, 2, + GST_TYPE_MIXER_TRACK, G_TYPE_BOOLEAN); gst_mixer_signals[MUTE_TOGGLED] = - g_signal_new ("mute-toggled", - GST_TYPE_MIXER, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstMixerClass, mute_toggled), - NULL, NULL, - gst_mixer_marshal_VOID__OBJECT_BOOLEAN, G_TYPE_NONE, 2, - GST_TYPE_MIXER_TRACK, G_TYPE_BOOLEAN); + g_signal_new ("mute-toggled", + GST_TYPE_MIXER, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstMixerClass, mute_toggled), + NULL, NULL, + gst_mixer_marshal_VOID__OBJECT_BOOLEAN, G_TYPE_NONE, 2, + GST_TYPE_MIXER_TRACK, G_TYPE_BOOLEAN); gst_mixer_signals[VOLUME_CHANGED] = - g_signal_new ("volume-changed", - GST_TYPE_MIXER, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstMixerClass, volume_changed), - NULL, NULL, - gst_mixer_marshal_VOID__OBJECT_POINTER, G_TYPE_NONE, 2, - GST_TYPE_MIXER_TRACK, G_TYPE_POINTER); + g_signal_new ("volume-changed", + GST_TYPE_MIXER, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstMixerClass, volume_changed), + NULL, NULL, + gst_mixer_marshal_VOID__OBJECT_POINTER, G_TYPE_NONE, 2, + GST_TYPE_MIXER_TRACK, G_TYPE_POINTER); initialized = TRUE; } diff --git a/gst-libs/gst/mixer/mixertrack.c b/gst-libs/gst/mixer/mixertrack.c index af52aec8cb..ae8976f156 100644 --- a/gst-libs/gst/mixer/mixertrack.c +++ b/gst-libs/gst/mixer/mixertrack.c @@ -61,8 +61,8 @@ gst_mixer_track_get_type (void) }; gst_mixer_track_type = - g_type_register_static (G_TYPE_OBJECT, - "GstMixerTrack", &mixer_track_info, 0); + g_type_register_static (G_TYPE_OBJECT, + "GstMixerTrack", &mixer_track_info, 0); } return gst_mixer_track_type; @@ -79,21 +79,21 @@ gst_mixer_track_class_init (GstMixerTrackClass * klass) g_signal_new ("record_toggled", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstMixerTrackClass, - record_toggled), + record_toggled), NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); signals[SIGNAL_MUTE_TOGGLED] = g_signal_new ("mute_toggled", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstMixerTrackClass, - mute_toggled), + mute_toggled), NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); signals[SIGNAL_VOLUME_CHANGED] = g_signal_new ("volume_changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstMixerTrackClass, - volume_changed), + volume_changed), NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); diff --git a/gst-libs/gst/navigation/navigation.c b/gst-libs/gst/navigation/navigation.c index 35ae2ba5fe..32510ffaef 100644 --- a/gst-libs/gst/navigation/navigation.c +++ b/gst-libs/gst/navigation/navigation.c @@ -46,7 +46,7 @@ gst_navigation_get_type (void) }; gst_navigation_type = g_type_register_static (G_TYPE_INTERFACE, - "GstNavigation", &gst_navigation_info, 0); + "GstNavigation", &gst_navigation_info, 0); } return gst_navigation_type; @@ -75,7 +75,7 @@ gst_navigation_send_key_event (GstNavigation * navigation, const char *event, { gst_navigation_send_event (navigation, gst_structure_new ("application/x-gst-navigation", "event", G_TYPE_STRING, - event, "key", G_TYPE_STRING, key, NULL)); + event, "key", G_TYPE_STRING, key, NULL)); } void @@ -84,6 +84,6 @@ gst_navigation_send_mouse_event (GstNavigation * navigation, const char *event, { gst_navigation_send_event (navigation, gst_structure_new ("application/x-gst-navigation", "event", G_TYPE_STRING, - event, "button", G_TYPE_INT, button, "pointer_x", G_TYPE_DOUBLE, x, - "pointer_y", G_TYPE_DOUBLE, y, NULL)); + event, "button", G_TYPE_INT, button, "pointer_x", G_TYPE_DOUBLE, x, + "pointer_y", G_TYPE_DOUBLE, y, NULL)); } diff --git a/gst-libs/gst/play/play.c b/gst-libs/gst/play/play.c index 01ba1f6388..ba24eb865a 100644 --- a/gst-libs/gst/play/play.c +++ b/gst-libs/gst/play/play.c @@ -45,8 +45,8 @@ struct _GstPlayPrivate gint get_length_attempt; - gint tick_unblock_remaining; /* how many msecs left - to unblock due to seeking */ + gint tick_unblock_remaining; /* how many msecs left + to unblock due to seeking */ guint tick_id; guint length_id; @@ -171,7 +171,7 @@ gst_play_pipeline_setup (GstPlay * play, GError ** error) /* Make sure we convert audio to the needed format */ GST_PLAY_MAKE_OR_ERROR (audioconvert, "audioconvert", "audioconvert", - error); + error); g_hash_table_insert (play->priv->elements, "audioconvert", audioconvert); /* Duplicate audio signal to audio sink and visualization thread */ @@ -183,7 +183,7 @@ gst_play_pipeline_setup (GstPlay * play, GError ** error) g_hash_table_insert (play->priv->elements, "tee", tee); gst_bin_add_many (GST_BIN (work_thread), source, autoplugger, audioconvert, - tee, NULL); + tee, NULL); if (!gst_element_link_many (source, autoplugger, audioconvert, tee, NULL)) GST_PLAY_ERROR_RETURN (error, "Could not link source thread elements"); @@ -194,13 +194,13 @@ gst_play_pipeline_setup (GstPlay * play, GError ** error) identity_cs = gst_element_factory_make ("ffcolorspace", "identity_cs"); if (!GST_IS_ELEMENT (identity_cs)) { identity_cs = - gst_element_factory_make ("ffmpegcolorspace", "identity_cs"); + gst_element_factory_make ("ffmpegcolorspace", "identity_cs"); if (!GST_IS_ELEMENT (identity_cs)) { - identity_cs = gst_element_factory_make ("colorspace", "identity_cs"); - if (!GST_IS_ELEMENT (identity_cs)) { - gst_play_error_plugin ("colorspace", error); - return FALSE; - } + identity_cs = gst_element_factory_make ("colorspace", "identity_cs"); + if (!GST_IS_ELEMENT (identity_cs)) { + gst_play_error_plugin ("colorspace", error); + return FALSE; + } } } g_hash_table_insert (play->priv->elements, "identity_cs", identity_cs); @@ -232,11 +232,11 @@ gst_play_pipeline_setup (GstPlay * play, GError ** error) if (!GST_IS_ELEMENT (vis_cs)) { vis_cs = gst_element_factory_make ("ffmpegcolorspace", "vis_cs"); if (!GST_IS_ELEMENT (vis_cs)) { - vis_cs = gst_element_factory_make ("colorspace", "vis_cs"); - if (!GST_IS_ELEMENT (vis_cs)) { - gst_play_error_plugin ("colorspace", error); - return FALSE; - } + vis_cs = gst_element_factory_make ("colorspace", "vis_cs"); + if (!GST_IS_ELEMENT (vis_cs)) { + gst_play_error_plugin ("colorspace", error); + return FALSE; + } } } @@ -245,9 +245,9 @@ gst_play_pipeline_setup (GstPlay * play, GError ** error) gst_bin_add_many (GST_BIN (vis_bin), vis_queue, vis_element, vis_cs, NULL); if (!gst_element_link_many (vis_queue, vis_element, vis_cs, NULL)) GST_PLAY_ERROR_RETURN (error, - "Could not link visualisation thread elements"); + "Could not link visualisation thread elements"); gst_element_add_ghost_pad (vis_bin, gst_element_get_pad (vis_cs, "src"), - "src"); + "src"); } /* Creating our video output bin */ { @@ -267,18 +267,18 @@ gst_play_pipeline_setup (GstPlay * play, GError ** error) if (!GST_IS_ELEMENT (video_cs)) { video_cs = gst_element_factory_make ("ffmpegcolorspace", "video_cs"); if (!GST_IS_ELEMENT (video_cs)) { - video_cs = gst_element_factory_make ("colorspace", "video_cs"); - if (!GST_IS_ELEMENT (video_cs)) { - gst_play_error_plugin ("colorspace", error); - return FALSE; - } + video_cs = gst_element_factory_make ("colorspace", "video_cs"); + if (!GST_IS_ELEMENT (video_cs)) { + gst_play_error_plugin ("colorspace", error); + return FALSE; + } } } g_hash_table_insert (play->priv->elements, "video_cs", video_cs); /* Software colorbalance */ GST_PLAY_MAKE_OR_ERROR (video_balance, "videobalance", "video_balance", - error); + error); g_hash_table_insert (play->priv->elements, "video_balance", video_balance); /* Colorspace conversion */ @@ -286,11 +286,11 @@ gst_play_pipeline_setup (GstPlay * play, GError ** error) if (!GST_IS_ELEMENT (balance_cs)) { balance_cs = gst_element_factory_make ("ffmpegcolorspace", "balance_cs"); if (!GST_IS_ELEMENT (balance_cs)) { - balance_cs = gst_element_factory_make ("colorspace", "balance_cs"); - if (!GST_IS_ELEMENT (balance_cs)) { - gst_play_error_plugin ("colorspace", error); - return FALSE; - } + balance_cs = gst_element_factory_make ("colorspace", "balance_cs"); + if (!GST_IS_ELEMENT (balance_cs)) { + gst_play_error_plugin ("colorspace", error); + return FALSE; + } } } g_hash_table_insert (play->priv->elements, "balance_cs", balance_cs); @@ -299,38 +299,38 @@ gst_play_pipeline_setup (GstPlay * play, GError ** error) GST_PLAY_MAKE_OR_ERROR (video_scaler, "videoscale", "video_scaler", error); g_hash_table_insert (play->priv->elements, "video_scaler", video_scaler); g_signal_connect (gst_element_get_pad (video_scaler, "src"), "fixate", - G_CALLBACK (gst_play_video_fixate), play); + G_CALLBACK (gst_play_video_fixate), play); /* Placeholder for future video sink bin */ GST_PLAY_MAKE_OR_ERROR (video_sink, "fakesink", "video_sink", error); g_hash_table_insert (play->priv->elements, "video_sink", video_sink); gst_bin_add_many (GST_BIN (video_thread), video_queue, video_switch, - video_cs, video_balance, balance_cs, video_scaler, video_sink, NULL); + video_cs, video_balance, balance_cs, video_scaler, video_sink, NULL); /* break down linking so we can figure out what might be failing */ if (!gst_element_link (video_queue, video_switch)) GST_PLAY_ERROR_RETURN (error, - "Could not link video output thread (queue and switch)"); + "Could not link video output thread (queue and switch)"); if (!gst_element_link (video_switch, video_cs)) GST_PLAY_ERROR_RETURN (error, - "Could not link video output thread (switch and cs)"); + "Could not link video output thread (switch and cs)"); if (!gst_element_link (video_cs, video_balance)) GST_PLAY_ERROR_RETURN (error, - "Could not link video output thread (cs and balance)"); + "Could not link video output thread (cs and balance)"); if (!gst_element_link (video_balance, balance_cs)) GST_PLAY_ERROR_RETURN (error, - "Could not link video output thread (balance and balance_cs)"); + "Could not link video output thread (balance and balance_cs)"); if (!gst_element_link (balance_cs, video_scaler)) GST_PLAY_ERROR_RETURN (error, - "Could not link video output thread (balance_cs and scaler)"); + "Could not link video output thread (balance_cs and scaler)"); if (!gst_element_link (video_scaler, video_sink)) GST_PLAY_ERROR_RETURN (error, - "Could not link video output thread (balance_cs and scaler)"); + "Could not link video output thread (balance_cs and scaler)"); gst_element_add_ghost_pad (video_thread, gst_element_get_pad (video_queue, - "sink"), "sink"); + "sink"), "sink"); if (!gst_element_link (identity_cs, video_thread)) GST_PLAY_ERROR_RETURN (error, - "Could not link video output thread elements"); + "Could not link video output thread elements"); } /* Creating our audio output bin { queue ! fakesink } */ @@ -347,19 +347,19 @@ gst_play_pipeline_setup (GstPlay * play, GError ** error) GST_PLAY_MAKE_OR_ERROR (volume, "volume", "volume", error); g_hash_table_insert (play->priv->elements, "volume", volume); g_signal_connect (gst_element_get_pad (volume, "src"), "fixate", - G_CALLBACK (gst_play_audio_fixate), play); + G_CALLBACK (gst_play_audio_fixate), play); /* Placeholder for future audio sink bin */ GST_PLAY_MAKE_OR_ERROR (audio_sink, "fakesink", "audio_sink", error); g_hash_table_insert (play->priv->elements, "audio_sink", audio_sink); gst_bin_add_many (GST_BIN (audio_thread), audio_queue, volume, audio_sink, - NULL); + NULL); if (!gst_element_link_many (audio_queue, volume, audio_sink, NULL)) GST_PLAY_ERROR_RETURN (error, - "Could not link audio output thread elements"); + "Could not link audio output thread elements"); gst_element_add_ghost_pad (audio_thread, gst_element_get_pad (audio_queue, - "sink"), "sink"); + "sink"), "sink"); gst_pad_link (tee_pad2, gst_element_get_pad (audio_queue, "sink")); } @@ -408,7 +408,7 @@ gst_play_tick_callback (GstPlay * play) if (q) g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK], - 0, play->priv->time_nanos); + 0, play->priv->time_nanos); if (GST_STATE (GST_ELEMENT (play)) == GST_STATE_PLAYING) return TRUE; @@ -443,15 +443,15 @@ gst_play_get_length_callback (GstPlay * play) /* Audio first and then Video */ if (GST_IS_ELEMENT (audio_sink_element)) q = gst_element_query (audio_sink_element, GST_QUERY_TOTAL, &format, - &value); + &value); if ((!q) && (GST_IS_ELEMENT (video_sink_element))) q = gst_element_query (video_sink_element, GST_QUERY_TOTAL, &format, - &value); + &value); if (q) { play->priv->length_nanos = value; g_signal_emit (G_OBJECT (play), gst_play_signals[STREAM_LENGTH], - 0, play->priv->length_nanos); + 0, play->priv->length_nanos); play->priv->length_id = 0; return FALSE; } @@ -487,7 +487,7 @@ gst_play_video_fixate (GstPad * pad, const GstCaps * caps, gpointer user_data) return newcaps; } if (gst_caps_structure_fixate_field_nearest_double (structure, "framerate", - 30.0)) { + 30.0)) { return newcaps; } @@ -545,7 +545,7 @@ gst_play_state_change (GstElement * element, GstElementState old, } play->priv->tick_id = g_timeout_add (TICK_INTERVAL_MSEC, - (GSourceFunc) gst_play_tick_callback, play); + (GSourceFunc) gst_play_tick_callback, play); play->priv->get_length_attempt = 0; @@ -555,7 +555,7 @@ gst_play_state_change (GstElement * element, GstElementState old, } play->priv->length_id = g_timeout_add (TICK_INTERVAL_MSEC, - (GSourceFunc) gst_play_get_length_callback, play); + (GSourceFunc) gst_play_get_length_callback, play); } else { if (play->priv->tick_id) { g_source_remove (play->priv->tick_id); @@ -632,7 +632,7 @@ gst_play_init (GstPlay * play) if (!gst_play_pipeline_setup (play, &play->priv->error)) { g_warning ("libgstplay: failed initializing pipeline, error: %s", - play->priv->error->message); + play->priv->error->message); } } @@ -793,10 +793,10 @@ gst_play_seek_to_time (GstPlay * play, gint64 time_nanos) play->priv->tick_unblock_remaining = 500; s = gst_element_seek (video_seek_element, GST_FORMAT_TIME | - GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH, time_nanos); + GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH, time_nanos); if (!s) { s = gst_element_seek (audio_seek_element, GST_FORMAT_TIME | - GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH, time_nanos); + GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH, time_nanos); } if (s) { @@ -804,11 +804,11 @@ gst_play_seek_to_time (GstPlay * play, gint64 time_nanos) gboolean q = FALSE; q = gst_element_query (audio_sink_element, GST_QUERY_POSITION, &format, - &(play->priv->time_nanos)); + &(play->priv->time_nanos)); if (q) - g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK], - 0, play->priv->time_nanos); + g_signal_emit (G_OBJECT (play), gst_play_signals[TIME_TICK], + 0, play->priv->time_nanos); } } @@ -907,10 +907,10 @@ gst_play_set_video_sink (GstPlay * play, GstElement * video_sink) GST_PLAY_SINK_TYPE_VIDEO); if (GST_IS_ELEMENT (video_sink_element)) { g_hash_table_replace (play->priv->elements, "video_sink_element", - video_sink_element); + video_sink_element); if (GST_IS_X_OVERLAY (video_sink_element)) { g_signal_connect (G_OBJECT (video_sink_element), - "desired_size_changed", G_CALLBACK (gst_play_have_video_size), play); + "desired_size_changed", G_CALLBACK (gst_play_have_video_size), play); } } @@ -966,7 +966,7 @@ gst_play_set_audio_sink (GstPlay * play, GstElement * audio_sink) GST_PLAY_SINK_TYPE_AUDIO); if (GST_IS_ELEMENT (audio_sink_element)) { g_hash_table_replace (play->priv->elements, "audio_sink_element", - audio_sink_element); + audio_sink_element); } gst_element_set_state (audio_sink, GST_STATE (GST_ELEMENT (play))); @@ -1114,7 +1114,7 @@ gst_play_connect_visualization (GstPlay * play, gboolean connect) /* Adding, linking */ play->priv->handoff_hid = g_signal_connect (G_OBJECT (identity), - "handoff", G_CALLBACK (gst_play_identity_handoff), play); + "handoff", G_CALLBACK (gst_play_identity_handoff), play); gst_bin_add (GST_BIN (video_thread), vis_bin); gst_pad_link (tee_pad1, vis_queue_pad); gst_element_link (vis_bin, video_switch); @@ -1168,64 +1168,64 @@ gst_play_get_sink_element (GstPlay * play, if (GST_IS_BIN (element)) { element = gst_play_get_sink_element (play, element, sink_type); if (GST_IS_ELEMENT (element)) - return element; + return element; } else { pads = gst_element_get_pad_list (element); has_src = FALSE; has_correct_type = FALSE; while (pads) { - /* check for src pad */ - if (GST_PAD_DIRECTION (GST_PAD (pads->data)) == GST_PAD_SRC) { - has_src = TRUE; - break; - } else { - /* If not a src pad checking caps */ - GstCaps *caps; - GstStructure *structure; - gboolean has_video_cap = FALSE; - gboolean has_audio_cap = FALSE; + /* check for src pad */ + if (GST_PAD_DIRECTION (GST_PAD (pads->data)) == GST_PAD_SRC) { + has_src = TRUE; + break; + } else { + /* If not a src pad checking caps */ + GstCaps *caps; + GstStructure *structure; + gboolean has_video_cap = FALSE; + gboolean has_audio_cap = FALSE; - caps = gst_pad_get_caps (GST_PAD (pads->data)); - structure = gst_caps_get_structure (caps, 0); + caps = gst_pad_get_caps (GST_PAD (pads->data)); + structure = gst_caps_get_structure (caps, 0); - if (strcmp (gst_structure_get_name (structure), - "audio/x-raw-int") == 0) { - has_audio_cap = TRUE; - } + if (strcmp (gst_structure_get_name (structure), + "audio/x-raw-int") == 0) { + has_audio_cap = TRUE; + } - if (strcmp (gst_structure_get_name (structure), - "video/x-raw-yuv") == 0 || - strcmp (gst_structure_get_name (structure), - "video/x-raw-rgb") == 0) { - has_video_cap = TRUE; - } + if (strcmp (gst_structure_get_name (structure), + "video/x-raw-yuv") == 0 || + strcmp (gst_structure_get_name (structure), + "video/x-raw-rgb") == 0) { + has_video_cap = TRUE; + } - gst_caps_free (caps); + gst_caps_free (caps); - switch (sink_type) { - case GST_PLAY_SINK_TYPE_AUDIO: - if (has_audio_cap) - has_correct_type = TRUE; - break; - case GST_PLAY_SINK_TYPE_VIDEO: - if (has_video_cap) - has_correct_type = TRUE; - break; - case GST_PLAY_SINK_TYPE_ANY: - if ((has_video_cap) || (has_audio_cap)) - has_correct_type = TRUE; - break; - default: - has_correct_type = FALSE; - } - } + switch (sink_type) { + case GST_PLAY_SINK_TYPE_AUDIO: + if (has_audio_cap) + has_correct_type = TRUE; + break; + case GST_PLAY_SINK_TYPE_VIDEO: + if (has_video_cap) + has_correct_type = TRUE; + break; + case GST_PLAY_SINK_TYPE_ANY: + if ((has_video_cap) || (has_audio_cap)) + has_correct_type = TRUE; + break; + default: + has_correct_type = FALSE; + } + } - pads = g_list_next (pads); + pads = g_list_next (pads); } if ((!has_src) && (has_correct_type)) - return element; + return element; } elements = g_list_next (elements); @@ -1247,7 +1247,7 @@ gst_play_new (GError ** error) play->priv->error = NULL; } else { g_warning ("Error creating GstPlay object.\n%s", - play->priv->error->message); + play->priv->error->message); g_error_free (play->priv->error); } } @@ -1280,7 +1280,7 @@ gst_play_get_type (void) }; play_type = g_type_register_static (GST_TYPE_PIPELINE, "GstPlay", - &play_info, 0); + &play_info, 0); } return play_type; diff --git a/gst-libs/gst/propertyprobe/propertyprobe.c b/gst-libs/gst/propertyprobe/propertyprobe.c index 05dd3f8fdc..730151e977 100644 --- a/gst-libs/gst/propertyprobe/propertyprobe.c +++ b/gst-libs/gst/propertyprobe/propertyprobe.c @@ -56,8 +56,8 @@ gst_property_probe_get_type (void) }; gst_property_probe_type = - g_type_register_static (G_TYPE_INTERFACE, - "GstPropertyProbe", &gst_property_probe_info, 0); + g_type_register_static (G_TYPE_INTERFACE, + "GstPropertyProbe", &gst_property_probe_info, 0); } return gst_property_probe_type; @@ -70,10 +70,10 @@ gst_property_probe_iface_init (GstPropertyProbeInterface * iface) if (!initialized) { gst_property_probe_signals[SIGNAL_PROBE_NEEDED] = - g_signal_new ("probe-needed", G_TYPE_FROM_CLASS (iface), - G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstPropertyProbeInterface, - probe_needed), NULL, NULL, g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); + g_signal_new ("probe-needed", G_TYPE_FROM_CLASS (iface), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstPropertyProbeInterface, + probe_needed), NULL, NULL, g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); initialized = TRUE; } diff --git a/gst-libs/gst/resample/dtos.c b/gst-libs/gst/resample/dtos.c index 98e8f6a6d1..f1e2278e2e 100644 --- a/gst-libs/gst/resample/dtos.c +++ b/gst-libs/gst/resample/dtos.c @@ -108,7 +108,8 @@ static union { int i[4]; float f[4]; -} av_tmp __attribute__ ((__aligned__ (16))); +} +av_tmp __attribute__ ((__aligned__ (16))); void conv_double_short_altivec (double *dest, short *src, int n) @@ -122,7 +123,7 @@ conv_double_short_altivec (double *dest, short *src, int n) av_tmp.i[3] = src[3]; asm (" lvx 0,0,%0\n" " vcfsx 1,0,0\n" " stvx 1,0,%0\n": :"r" (&av_tmp) - ); + ); dest[0] = av_tmp.f[0]; dest[1] = av_tmp.f[1]; diff --git a/gst-libs/gst/resample/resample.c b/gst-libs/gst/resample/resample.c index cd409d239b..cc413e2409 100644 --- a/gst-libs/gst/resample/resample.c +++ b/gst-libs/gst/resample/resample.c @@ -100,33 +100,33 @@ gst_resample_reinit (gst_resample_t * r) switch (r->method) { default: case GST_RESAMPLE_NEAREST: - r->scale = gst_resample_nearest_s16; - break; + r->scale = gst_resample_nearest_s16; + break; case GST_RESAMPLE_BILINEAR: - r->scale = gst_resample_bilinear_s16; - break; + r->scale = gst_resample_bilinear_s16; + break; case GST_RESAMPLE_SINC_SLOW: - r->scale = gst_resample_sinc_s16; - break; + r->scale = gst_resample_sinc_s16; + break; case GST_RESAMPLE_SINC: - r->scale = gst_resample_sinc_ft_s16; - break; + r->scale = gst_resample_sinc_ft_s16; + break; } } else if (r->format == GST_RESAMPLE_FLOAT) { switch (r->method) { default: case GST_RESAMPLE_NEAREST: - r->scale = gst_resample_nearest_float; - break; + r->scale = gst_resample_nearest_float; + break; case GST_RESAMPLE_BILINEAR: - r->scale = gst_resample_bilinear_float; - break; + r->scale = gst_resample_bilinear_float; + break; case GST_RESAMPLE_SINC_SLOW: - r->scale = gst_resample_sinc_float; - break; + r->scale = gst_resample_sinc_float; + break; case GST_RESAMPLE_SINC: - r->scale = gst_resample_sinc_ft_float; - break; + r->scale = gst_resample_sinc_ft_float; + break; } } else { fprintf (stderr, "gst_resample: Unexpected format \"%d\"\n", r->format); @@ -170,9 +170,9 @@ gst_resample_scale (gst_resample_t * r, void *i_buf, unsigned int i_size) if (r->verbose) { printf ("gst_resample_scale: i_buf=%p i_size=%d\n", i_buf, i_size); printf ("gst_resample_scale: i_samples=%d o_samples=%d i_inc=%g o_buf=%p\n", - r->i_samples, r->o_samples, r->i_inc, r->o_buf); + r->i_samples, r->o_samples, r->i_inc, r->o_buf); printf ("gst_resample_scale: i_start=%g i_end=%g o_start=%g\n", - r->i_start, r->i_end, r->o_start); + r->i_start, r->i_end, r->o_start); } if ((r->filter_length + r->i_samples) * sizeof (double) * 2 > r->buffer_len) { @@ -191,20 +191,20 @@ gst_resample_scale (gst_resample_t * r, void *i_buf, unsigned int i_size) if (r->format == GST_RESAMPLE_S16) { if (r->channels == 2) { conv_double_short (r->buffer + r->filter_length * sizeof (double) * 2, - r->i_buf, r->i_samples * 2); + r->i_buf, r->i_samples * 2); } else { conv_double_short_dstr (r->buffer + - r->filter_length * sizeof (double) * 2, r->i_buf, r->i_samples, - sizeof (double) * 2); + r->filter_length * sizeof (double) * 2, r->i_buf, r->i_samples, + sizeof (double) * 2); } } else if (r->format == GST_RESAMPLE_FLOAT) { if (r->channels == 2) { conv_double_float (r->buffer + r->filter_length * sizeof (double) * 2, - r->i_buf, r->i_samples * 2); + r->i_buf, r->i_samples * 2); } else { conv_double_float_dstr (r->buffer + - r->filter_length * sizeof (double) * 2, r->i_buf, r->i_samples, - sizeof (double) * 2); + r->filter_length * sizeof (double) * 2, r->i_buf, r->i_samples, + sizeof (double) * 2); } } @@ -358,15 +358,15 @@ gst_resample_sinc_slow_s16 (gst_resample_t * r) c0 = 0; c1 = 0; for (j = 0; j < r->filter_length; j++) { - weight = (x == 0) ? 1 : (sinx / x); + weight = (x == 0) ? 1 : (sinx / x); /*printf("j %d sin %g cos %g\n",j,sinx,cosx); */ /*printf("j %d sin %g x %g sinc %g\n",j,sinx,x,weight); */ - c0 += weight * GETBUF ((start + j), 0); - c1 += weight * GETBUF ((start + j), 1); - t = cosx * cosd - sinx * sind; - sinx = cosx * sind + sinx * cosd; - cosx = t; - x += d; + c0 += weight * GETBUF ((start + j), 0); + c1 += weight * GETBUF ((start + j), 1); + t = cosx * cosd - sinx * sind; + sinx = cosx * sind + sinx * cosd; + cosx = t; + x += d; } o_ptr[0] = rint (c0); o_ptr[1] = rint (c1); @@ -494,7 +494,7 @@ gst_resample_sinc_ft_s16 (gst_resample_t * r) double scale; int n = 4; - scale = r->i_inc; /* cutoff at 22050 */ + scale = r->i_inc; /* cutoff at 22050 */ /*scale = 1.0; // cutoff at 24000 */ /*scale = r->i_inc * 0.5; // cutoff at 11025 */ @@ -546,7 +546,7 @@ gst_resample_sinc_ft_s16 (gst_resample_t * r) } #else functable_fir2 (ft, - &c0, &c1, x, n, ptr + (start + r->filter_length) * 2, r->filter_length); + &c0, &c1, x, n, ptr + (start + r->filter_length) * 2, r->filter_length); c0 *= scale; c1 *= scale; #endif @@ -566,7 +566,7 @@ gst_resample_sinc_ft_s16 (gst_resample_t * r) conv_short_double (r->o_buf, out_tmp, 2 * r->o_samples); } else { conv_short_double_sstr (r->o_buf, out_tmp, r->o_samples, - 2 * sizeof (double)); + 2 * sizeof (double)); } } @@ -711,15 +711,15 @@ gst_resample_sinc_slow_float (gst_resample_t * r) c0 = 0; c1 = 0; for (j = 0; j < r->filter_length; j++) { - weight = (x == 0) ? 1 : (sinx / x); + weight = (x == 0) ? 1 : (sinx / x); /*printf("j %d sin %g cos %g\n",j,sinx,cosx); */ /*printf("j %d sin %g x %g sinc %g\n",j,sinx,x,weight); */ - c0 += weight * GETBUF ((start + j), 0); - c1 += weight * GETBUF ((start + j), 1); - t = cosx * cosd - sinx * sind; - sinx = cosx * sind + sinx * cosd; - cosx = t; - x += d; + c0 += weight * GETBUF ((start + j), 0); + c1 += weight * GETBUF ((start + j), 1); + t = cosx * cosd - sinx * sind; + sinx = cosx * sind + sinx * cosd; + cosx = t; + x += d; } o_ptr[0] = c0; o_ptr[1] = c1; @@ -806,7 +806,7 @@ gst_resample_sinc_ft_float (gst_resample_t * r) double scale; int n = 4; - scale = r->i_inc; /* cutoff at 22050 */ + scale = r->i_inc; /* cutoff at 22050 */ /*scale = 1.0; // cutoff at 24000 */ /*scale = r->i_inc * 0.5; // cutoff at 11025 */ @@ -858,7 +858,7 @@ gst_resample_sinc_ft_float (gst_resample_t * r) } #else functable_fir2 (ft, - &c0, &c1, x, n, ptr + (start + r->filter_length) * 2, r->filter_length); + &c0, &c1, x, n, ptr + (start + r->filter_length) * 2, r->filter_length); c0 *= scale; c1 *= scale; #endif @@ -878,7 +878,7 @@ gst_resample_sinc_ft_float (gst_resample_t * r) conv_float_double (r->o_buf, out_tmp, 2 * r->o_samples); } else { conv_float_double_sstr (r->o_buf, out_tmp, r->o_samples, - 2 * sizeof (double)); + 2 * sizeof (double)); } } diff --git a/gst-libs/gst/resample/test.c b/gst-libs/gst/resample/test.c index 152d12a6f1..d6785aef82 100644 --- a/gst-libs/gst/resample/test.c +++ b/gst-libs/gst/resample/test.c @@ -123,7 +123,7 @@ test_res1 (void) f = AMP * test_func ((double) i / O_RATE); /*f = rint(AMP*test_func((double)i/O_RATE)); */ fprintf (out, "%d %d %d %g %g\n", i, - o_buf[2 * i + 0], o_buf[2 * i + 1], f, o_buf[2 * i + 0] - f); + o_buf[2 * i + 0], o_buf[2 * i + 1], f, o_buf[2 * i + 0] - f); } sum10k = 0; @@ -206,7 +206,7 @@ test_res3 (void) for (i = 0; i < 1000 * n; i++) { x = -50.0 + 0.1 / n * i; f1 = functable_sinc (NULL, t->scale * x) * - functable_window_std (NULL, t->scale2 * x); + functable_window_std (NULL, t->scale2 * x); f2 = functable_eval (t, x); fprintf (out, "%d %g %g %g\n", i, f1, f2, f2 - f1); } @@ -224,7 +224,7 @@ sinc_poly (double x) return 1 - x2 * INV3FAC + x2 * x2 * INV5FAC - x2 * x2 * x2 * INV7FAC; /*+ x2 * x2 * x2 * x2 * INV9FAC */ - /*- x2 * x2 * x2 * x2 * x2 * INV11FAC; */ + /*- x2 * x2 * x2 * x2 * x2 * INV11FAC; */ } void diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c index b51b4fb500..042651a9ea 100644 --- a/gst-libs/gst/riff/riff-media.c +++ b/gst-libs/gst/riff/riff-media.c @@ -35,175 +35,175 @@ gst_riff_create_video_caps (guint32 codec_fcc, switch (codec_fcc) { case GST_MAKE_FOURCC ('I', '4', '2', '0'): caps = gst_caps_new_simple ("video/x-raw-yuv", - "format", GST_TYPE_FOURCC, codec_fcc, NULL); + "format", GST_TYPE_FOURCC, codec_fcc, NULL); if (codec_name) - *codec_name = g_strdup ("Raw, uncompressed I420"); + *codec_name = g_strdup ("Raw, uncompressed I420"); break; case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): caps = gst_caps_new_simple ("video/x-raw-yuv", - "format", GST_TYPE_FOURCC, codec_fcc, NULL); + "format", GST_TYPE_FOURCC, codec_fcc, NULL); if (codec_name) - *codec_name = g_strdup ("Raw, uncompressed YUV 4:2:2"); + *codec_name = g_strdup ("Raw, uncompressed YUV 4:2:2"); break; - case GST_MAKE_FOURCC ('M', 'J', 'P', 'G'): /* YUY2 MJPEG */ + case GST_MAKE_FOURCC ('M', 'J', 'P', 'G'): /* YUY2 MJPEG */ caps = gst_caps_new_simple ("video/x-jpeg", NULL); if (codec_name) - *codec_name = g_strdup ("Motion JPEG"); + *codec_name = g_strdup ("Motion JPEG"); break; - case GST_MAKE_FOURCC ('J', 'P', 'E', 'G'): /* generic (mostly RGB) MJPEG */ + case GST_MAKE_FOURCC ('J', 'P', 'E', 'G'): /* generic (mostly RGB) MJPEG */ caps = gst_caps_new_simple ("video/x-jpeg", NULL); if (codec_name) - *codec_name = g_strdup ("JPEG Still Image"); + *codec_name = g_strdup ("JPEG Still Image"); break; - case GST_MAKE_FOURCC ('P', 'I', 'X', 'L'): /* Miro/Pinnacle fourccs */ - case GST_MAKE_FOURCC ('V', 'I', 'X', 'L'): /* Miro/Pinnacle fourccs */ + case GST_MAKE_FOURCC ('P', 'I', 'X', 'L'): /* Miro/Pinnacle fourccs */ + case GST_MAKE_FOURCC ('V', 'I', 'X', 'L'): /* Miro/Pinnacle fourccs */ caps = gst_caps_new_simple ("video/x-jpeg", NULL); if (codec_name) - *codec_name = g_strdup ("Miro/Pinnacle Video XL"); + *codec_name = g_strdup ("Miro/Pinnacle Video XL"); break; case GST_MAKE_FOURCC ('H', 'F', 'Y', 'U'): caps = gst_caps_new_simple ("video/x-huffyuv", NULL); if (codec_name) - *codec_name = g_strdup ("Huffman Lossless Codec"); + *codec_name = g_strdup ("Huffman Lossless Codec"); break; case GST_MAKE_FOURCC ('M', 'P', 'E', 'G'): case GST_MAKE_FOURCC ('M', 'P', 'G', 'I'): caps = gst_caps_new_simple ("video/mpeg", - "systemstream", G_TYPE_BOOLEAN, FALSE, - "mpegversion", G_TYPE_BOOLEAN, 1, NULL); + "systemstream", G_TYPE_BOOLEAN, FALSE, + "mpegversion", G_TYPE_BOOLEAN, 1, NULL); if (codec_name) - *codec_name = g_strdup ("MPEG video"); + *codec_name = g_strdup ("MPEG video"); break; case GST_MAKE_FOURCC ('H', '2', '6', '3'): caps = gst_caps_new_simple ("video/x-h263", NULL); if (codec_name) - *codec_name = g_strdup ("ITU H.26n"); + *codec_name = g_strdup ("ITU H.26n"); break; case GST_MAKE_FOURCC ('i', '2', '6', '3'): caps = gst_caps_new_simple ("video/x-h263", NULL); if (codec_name) - *codec_name = g_strdup ("ITU H.263"); + *codec_name = g_strdup ("ITU H.263"); break; case GST_MAKE_FOURCC ('L', '2', '6', '3'): caps = gst_caps_new_simple ("video/x-h263", NULL); if (codec_name) - *codec_name = g_strdup ("Lead H.263"); + *codec_name = g_strdup ("Lead H.263"); break; case GST_MAKE_FOURCC ('M', '2', '6', '3'): caps = gst_caps_new_simple ("video/x-h263", NULL); if (codec_name) - *codec_name = g_strdup ("Microsoft H.263"); + *codec_name = g_strdup ("Microsoft H.263"); break; case GST_MAKE_FOURCC ('V', 'D', 'O', 'W'): caps = gst_caps_new_simple ("video/x-h263", NULL); if (codec_name) - *codec_name = g_strdup ("VDOLive"); + *codec_name = g_strdup ("VDOLive"); break; case GST_MAKE_FOURCC ('V', 'I', 'V', 'O'): caps = gst_caps_new_simple ("video/x-h263", NULL); if (codec_name) - *codec_name = g_strdup ("Vivo H.263"); + *codec_name = g_strdup ("Vivo H.263"); break; case GST_MAKE_FOURCC ('x', '2', '6', '3'): caps = gst_caps_new_simple ("video/x-h263", NULL); if (codec_name) - *codec_name = g_strdup ("Xirlink H.263"); + *codec_name = g_strdup ("Xirlink H.263"); break; case GST_MAKE_FOURCC ('D', 'I', 'V', '3'): caps = gst_caps_new_simple ("video/x-divx", - "divxversion", G_TYPE_INT, 3, NULL); + "divxversion", G_TYPE_INT, 3, NULL); if (codec_name) - *codec_name = g_strdup ("DivX MPEG-4 Version 3"); + *codec_name = g_strdup ("DivX MPEG-4 Version 3"); break; case GST_MAKE_FOURCC ('D', 'I', 'V', '4'): caps = gst_caps_new_simple ("video/x-divx", - "divxversion", G_TYPE_INT, 4, NULL); + "divxversion", G_TYPE_INT, 4, NULL); if (codec_name) - *codec_name = g_strdup ("DivX MPEG-4 Version 4"); + *codec_name = g_strdup ("DivX MPEG-4 Version 4"); break; case GST_MAKE_FOURCC ('d', 'i', 'v', 'x'): case GST_MAKE_FOURCC ('D', 'I', 'V', 'X'): case GST_MAKE_FOURCC ('D', 'X', '5', '0'): case GST_MAKE_FOURCC ('D', 'I', 'V', '5'): caps = gst_caps_new_simple ("video/x-divx", - "divxversion", G_TYPE_INT, 5, NULL); + "divxversion", G_TYPE_INT, 5, NULL); if (codec_name) - *codec_name = g_strdup ("DivX MPEG-4 Version 5"); + *codec_name = g_strdup ("DivX MPEG-4 Version 5"); break; case GST_MAKE_FOURCC ('X', 'V', 'I', 'D'): case GST_MAKE_FOURCC ('x', 'v', 'i', 'd'): caps = gst_caps_new_simple ("video/x-xvid", NULL); if (codec_name) - *codec_name = g_strdup ("XVID MPEG-4"); + *codec_name = g_strdup ("XVID MPEG-4"); break; case GST_MAKE_FOURCC ('M', 'P', 'G', '4'): caps = gst_caps_new_simple ("video/x-msmpeg", - "msmpegversion", G_TYPE_INT, 41, NULL); + "msmpegversion", G_TYPE_INT, 41, NULL); if (codec_name) - *codec_name = g_strdup ("Microsoft MPEG-4 4.1"); + *codec_name = g_strdup ("Microsoft MPEG-4 4.1"); break; case GST_MAKE_FOURCC ('M', 'P', '4', '2'): caps = gst_caps_new_simple ("video/x-msmpeg", - "msmpegversion", G_TYPE_INT, 42, NULL); + "msmpegversion", G_TYPE_INT, 42, NULL); if (codec_name) - *codec_name = g_strdup ("Microsoft MPEG-4 4.2"); + *codec_name = g_strdup ("Microsoft MPEG-4 4.2"); break; case GST_MAKE_FOURCC ('M', 'P', '4', '3'): caps = gst_caps_new_simple ("video/x-msmpeg", - "msmpegversion", G_TYPE_INT, 43, NULL); + "msmpegversion", G_TYPE_INT, 43, NULL); if (codec_name) - *codec_name = g_strdup ("Microsoft MPEG-4 4.3"); + *codec_name = g_strdup ("Microsoft MPEG-4 4.3"); break; case GST_MAKE_FOURCC ('3', 'I', 'V', '1'): case GST_MAKE_FOURCC ('3', 'I', 'V', '2'): caps = gst_caps_new_simple ("video/x-3ivx", NULL); if (codec_name) - *codec_name = g_strdup ("3ivx"); + *codec_name = g_strdup ("3ivx"); break; case GST_MAKE_FOURCC ('D', 'V', 'S', 'D'): case GST_MAKE_FOURCC ('d', 'v', 's', 'd'): caps = gst_caps_new_simple ("video/x-dv", - "systemstream", G_TYPE_BOOLEAN, FALSE, NULL); + "systemstream", G_TYPE_BOOLEAN, FALSE, NULL); if (codec_name) - *codec_name = g_strdup ("Generic DV"); + *codec_name = g_strdup ("Generic DV"); break; case GST_MAKE_FOURCC ('W', 'M', 'V', '1'): caps = gst_caps_new_simple ("video/x-wmv", - "wmvversion", G_TYPE_INT, 1, NULL); + "wmvversion", G_TYPE_INT, 1, NULL); if (codec_name) - *codec_name = g_strdup ("Windows Media Video 7"); + *codec_name = g_strdup ("Windows Media Video 7"); break; case GST_MAKE_FOURCC ('W', 'M', 'V', '2'): caps = gst_caps_new_simple ("video/x-wmv", - "wmvversion", G_TYPE_INT, 2, NULL); + "wmvversion", G_TYPE_INT, 2, NULL); if (codec_name) - *codec_name = g_strdup ("Windows Media Video 8"); + *codec_name = g_strdup ("Windows Media Video 8"); break; case GST_MAKE_FOURCC ('W', 'M', 'V', '3'): caps = gst_caps_new_simple ("video/x-wmv", - "wmvversion", G_TYPE_INT, 3, NULL); + "wmvversion", G_TYPE_INT, 3, NULL); if (codec_name) - *codec_name = g_strdup ("Windows Media Video 9"); + *codec_name = g_strdup ("Windows Media Video 9"); break; default: GST_WARNING ("Unkown video fourcc " GST_FOURCC_FORMAT, - GST_FOURCC_ARGS (codec_fcc)); + GST_FOURCC_ARGS (codec_fcc)); return NULL; } @@ -213,17 +213,17 @@ gst_riff_create_video_caps (guint32 codec_fcc, gst_caps_set_simple (caps, "framerate", G_TYPE_DOUBLE, fps, NULL); } else { gst_caps_set_simple (caps, - "framerate", GST_TYPE_DOUBLE_RANGE, 0., G_MAXDOUBLE, NULL); + "framerate", GST_TYPE_DOUBLE_RANGE, 0., G_MAXDOUBLE, NULL); } if (strf != NULL) { gst_caps_set_simple (caps, - "width", G_TYPE_INT, strf->width, - "height", G_TYPE_INT, strf->height, NULL); + "width", G_TYPE_INT, strf->width, + "height", G_TYPE_INT, strf->height, NULL); } else { gst_caps_set_simple (caps, - "width", GST_TYPE_INT_RANGE, 16, 4096, - "height", GST_TYPE_INT_RANGE, 16, 4096, NULL); + "width", GST_TYPE_INT_RANGE, 16, 4096, + "height", GST_TYPE_INT_RANGE, 16, 4096, NULL); } return caps; @@ -236,75 +236,75 @@ gst_riff_create_audio_caps (guint16 codec_id, GstCaps *caps = NULL; switch (codec_id) { - case GST_RIFF_WAVE_FORMAT_MPEGL3: /* mp3 */ + case GST_RIFF_WAVE_FORMAT_MPEGL3: /* mp3 */ caps = gst_caps_new_simple ("audio/mpeg", - "mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 3, NULL); + "mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 3, NULL); if (codec_name) - *codec_name = g_strdup ("MPEG 1 layer 3"); + *codec_name = g_strdup ("MPEG 1 layer 3"); break; - case GST_RIFF_WAVE_FORMAT_MPEGL12: /* mp1 or mp2 */ + case GST_RIFF_WAVE_FORMAT_MPEGL12: /* mp1 or mp2 */ caps = gst_caps_new_simple ("audio/mpeg", - "mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 2, NULL); + "mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 2, NULL); if (codec_name) - *codec_name = g_strdup ("MPEG 1 layer 2"); + *codec_name = g_strdup ("MPEG 1 layer 2"); break; - case GST_RIFF_WAVE_FORMAT_PCM: /* PCM/wav */ + case GST_RIFF_WAVE_FORMAT_PCM: /* PCM/wav */ if (strf != NULL) { - gint ba = GUINT16_FROM_LE (strf->blockalign); - gint ch = GUINT16_FROM_LE (strf->channels); - gint ws = GUINT16_FROM_LE (strf->size); + gint ba = GUINT16_FROM_LE (strf->blockalign); + gint ch = GUINT16_FROM_LE (strf->channels); + gint ws = GUINT16_FROM_LE (strf->size); - caps = gst_caps_new_simple ("audio/x-raw-int", - "endianness", G_TYPE_INT, G_LITTLE_ENDIAN, - "width", G_TYPE_INT, (int) (ba * 8 / ch), - "depth", G_TYPE_INT, ws, "signed", G_TYPE_BOOLEAN, ws != 8, NULL); + caps = gst_caps_new_simple ("audio/x-raw-int", + "endianness", G_TYPE_INT, G_LITTLE_ENDIAN, + "width", G_TYPE_INT, (int) (ba * 8 / ch), + "depth", G_TYPE_INT, ws, "signed", G_TYPE_BOOLEAN, ws != 8, NULL); } else { - caps = gst_caps_from_string ("audio/x-raw-int, " - "endianness = (int) LITTLE_ENDIAN, " - "signed = (boolean) { true, false }, " - "width = (int) { 8, 16 }, " "height = (int) { 8, 16 }"); + caps = gst_caps_from_string ("audio/x-raw-int, " + "endianness = (int) LITTLE_ENDIAN, " + "signed = (boolean) { true, false }, " + "width = (int) { 8, 16 }, " "height = (int) { 8, 16 }"); } if (codec_name) - *codec_name = g_strdup ("PCM WAV"); + *codec_name = g_strdup ("PCM WAV"); break; case GST_RIFF_WAVE_FORMAT_MULAW: if (strf != NULL && strf->size != 8) { - GST_WARNING ("invalid depth (%d) of mulaw audio, overwriting.", - strf->size); + GST_WARNING ("invalid depth (%d) of mulaw audio, overwriting.", + strf->size); } caps = gst_caps_new_simple ("audio/x-mulaw", NULL); if (codec_name) - *codec_name = g_strdup ("Mulaw"); + *codec_name = g_strdup ("Mulaw"); break; case GST_RIFF_WAVE_FORMAT_ALAW: if (strf != NULL && strf->size != 8) { - GST_WARNING ("invalid depth (%d) of alaw audio, overwriting.", - strf->size); + GST_WARNING ("invalid depth (%d) of alaw audio, overwriting.", + strf->size); } caps = gst_caps_new_simple ("audio/x-alaw", NULL); if (codec_name) - *codec_name = g_strdup ("Alaw"); + *codec_name = g_strdup ("Alaw"); break; - case GST_RIFF_WAVE_FORMAT_VORBIS1: /* ogg/vorbis mode 1 */ - case GST_RIFF_WAVE_FORMAT_VORBIS2: /* ogg/vorbis mode 2 */ - case GST_RIFF_WAVE_FORMAT_VORBIS3: /* ogg/vorbis mode 3 */ - case GST_RIFF_WAVE_FORMAT_VORBIS1PLUS: /* ogg/vorbis mode 1+ */ - case GST_RIFF_WAVE_FORMAT_VORBIS2PLUS: /* ogg/vorbis mode 2+ */ - case GST_RIFF_WAVE_FORMAT_VORBIS3PLUS: /* ogg/vorbis mode 3+ */ + case GST_RIFF_WAVE_FORMAT_VORBIS1: /* ogg/vorbis mode 1 */ + case GST_RIFF_WAVE_FORMAT_VORBIS2: /* ogg/vorbis mode 2 */ + case GST_RIFF_WAVE_FORMAT_VORBIS3: /* ogg/vorbis mode 3 */ + case GST_RIFF_WAVE_FORMAT_VORBIS1PLUS: /* ogg/vorbis mode 1+ */ + case GST_RIFF_WAVE_FORMAT_VORBIS2PLUS: /* ogg/vorbis mode 2+ */ + case GST_RIFF_WAVE_FORMAT_VORBIS3PLUS: /* ogg/vorbis mode 3+ */ caps = gst_caps_new_simple ("audio/x-vorbis", NULL); if (codec_name) - *codec_name = g_strdup ("Vorbis"); + *codec_name = g_strdup ("Vorbis"); break; case GST_RIFF_WAVE_FORMAT_A52: caps = gst_caps_new_simple ("audio/x-ac3", NULL); if (codec_name) - *codec_name = g_strdup ("AC3"); + *codec_name = g_strdup ("AC3"); break; default: @@ -314,12 +314,12 @@ gst_riff_create_audio_caps (guint16 codec_id, if (strf != NULL) { gst_caps_set_simple (caps, - "rate", G_TYPE_INT, strf->rate, - "channels", G_TYPE_INT, strf->channels, NULL); + "rate", G_TYPE_INT, strf->rate, + "channels", G_TYPE_INT, strf->channels, NULL); } else { gst_caps_set_simple (caps, - "rate", GST_TYPE_INT_RANGE, 8000, 96000, - "channels", GST_TYPE_INT_RANGE, 1, 2, NULL); + "rate", GST_TYPE_INT_RANGE, 8000, 96000, + "channels", GST_TYPE_INT_RANGE, 1, 2, NULL); } return caps; @@ -336,13 +336,13 @@ gst_riff_create_iavs_caps (guint32 codec_fcc, case GST_MAKE_FOURCC ('D', 'V', 'S', 'D'): case GST_MAKE_FOURCC ('d', 'v', 's', 'd'): caps = gst_caps_new_simple ("video/x-dv", - "systemstream", G_TYPE_BOOLEAN, TRUE, NULL); + "systemstream", G_TYPE_BOOLEAN, TRUE, NULL); if (codec_name) - *codec_name = g_strdup ("Generic DV"); + *codec_name = g_strdup ("Generic DV"); default: GST_WARNING ("Unkown IAVS fourcc " GST_FOURCC_FORMAT, - GST_FOURCC_ARGS (codec_fcc)); + GST_FOURCC_ARGS (codec_fcc)); return NULL; } diff --git a/gst-libs/gst/riff/riff-read.c b/gst-libs/gst/riff/riff-read.c index c8c5b634ec..0eed6242b4 100644 --- a/gst-libs/gst/riff/riff-read.c +++ b/gst-libs/gst/riff/riff-read.c @@ -61,8 +61,8 @@ gst_riff_read_get_type (void) }; gst_riff_read_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstRiffRead", - &gst_riff_read_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstRiffRead", + &gst_riff_read_info, 0); } return gst_riff_read_type; @@ -94,16 +94,16 @@ gst_riff_read_change_state (GstElement * element) switch (GST_STATE_TRANSITION (element)) { case GST_STATE_READY_TO_PAUSED: if (!riff->sinkpad) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; riff->bs = gst_bytestream_new (riff->sinkpad); break; case GST_STATE_PAUSED_TO_READY: gst_bytestream_destroy (riff->bs); while (riff->level) { - GstRiffLevel *level = riff->level->data; + GstRiffLevel *level = riff->level->data; - riff->level = g_list_remove (riff->level, level); - g_free (level); + riff->level = g_list_remove (riff->level, level); + g_free (level); } break; default: @@ -165,7 +165,7 @@ gst_riff_peek_head (GstRiffRead * riff, if (GST_IS_EVENT (event)) { gst_pad_event_default (riff->sinkpad, event); if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) - return FALSE; + return FALSE; } else { GST_ELEMENT_ERROR (riff, RESOURCE, READ, (NULL), (NULL)); return FALSE; @@ -257,7 +257,7 @@ gst_riff_read_seek (GstRiffRead * riff, guint64 offset) } else if (GST_EVENT_TYPE (event) != GST_EVENT_DISCONTINUOUS) { gst_pad_event_default (riff->sinkpad, event); if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) - return NULL; + return NULL; event = NULL; } } @@ -341,7 +341,7 @@ gst_riff_read_skip (GstRiffRead * riff) /* no */ if (!(event = gst_riff_read_seek (riff, - gst_bytestream_tell (riff->bs) + length))) + gst_bytestream_tell (riff->bs) + length))) return FALSE; gst_event_unref (event); @@ -407,7 +407,7 @@ gst_riff_read_strh (GstRiffRead * riff, gst_riff_strh ** header) } if (GST_BUFFER_SIZE (buf) < sizeof (gst_riff_strh)) { g_warning ("Too small strh (%d available, %d needed)", - GST_BUFFER_SIZE (buf), (int) sizeof (gst_riff_strh)); + GST_BUFFER_SIZE (buf), (int) sizeof (gst_riff_strh)); gst_buffer_unref (buf); return FALSE; } @@ -474,7 +474,7 @@ gst_riff_read_strf_vids (GstRiffRead * riff, gst_riff_strf_vids ** header) } if (GST_BUFFER_SIZE (buf) < sizeof (gst_riff_strf_vids)) { g_warning ("Too small strf_vids (%d available, %d needed)", - GST_BUFFER_SIZE (buf), (int) sizeof (gst_riff_strf_vids)); + GST_BUFFER_SIZE (buf), (int) sizeof (gst_riff_strf_vids)); gst_buffer_unref (buf); return FALSE; } @@ -498,7 +498,7 @@ gst_riff_read_strf_vids (GstRiffRead * riff, gst_riff_strf_vids ** header) /* size checking */ if (strf->size > GST_BUFFER_SIZE (buf)) { g_warning ("strf_vids header gave %d bytes data, only %d available", - strf->size, GST_BUFFER_SIZE (buf)); + strf->size, GST_BUFFER_SIZE (buf)); strf->size = GST_BUFFER_SIZE (buf); } @@ -541,7 +541,7 @@ gst_riff_read_strf_auds (GstRiffRead * riff, gst_riff_strf_auds ** header) } if (GST_BUFFER_SIZE (buf) < sizeof (gst_riff_strf_auds)) { g_warning ("Too small strf_auds (%d available, %d needed)", - GST_BUFFER_SIZE (buf), (int) sizeof (gst_riff_strf_auds)); + GST_BUFFER_SIZE (buf), (int) sizeof (gst_riff_strf_auds)); gst_buffer_unref (buf); return FALSE; } @@ -564,7 +564,7 @@ gst_riff_read_strf_auds (GstRiffRead * riff, gst_riff_strf_auds ** header) GST_INFO (" rate %d", strf->rate); GST_INFO (" av_bps %d", strf->av_bps); GST_INFO (" blockalign %d", strf->blockalign); - GST_INFO (" size %d", strf->size); /* wordsize, not extrasize! */ + GST_INFO (" size %d", strf->size); /* wordsize, not extrasize! */ gst_buffer_unref (buf); @@ -590,7 +590,7 @@ gst_riff_read_strf_iavs (GstRiffRead * riff, gst_riff_strf_iavs ** header) } if (GST_BUFFER_SIZE (buf) < sizeof (gst_riff_strf_iavs)) { g_warning ("Too small strf_iavs (%d available, %d needed)", - GST_BUFFER_SIZE (buf), (int) sizeof (gst_riff_strf_iavs)); + GST_BUFFER_SIZE (buf), (int) sizeof (gst_riff_strf_iavs)); gst_buffer_unref (buf); return FALSE; } @@ -694,102 +694,103 @@ gst_riff_read_info (GstRiffRead * riff) /* find out the type of metadata */ switch (tag) { case GST_RIFF_INFO_IARL: - type = GST_TAG_LOCATION; - break; + type = GST_TAG_LOCATION; + break; case GST_RIFF_INFO_IART: - type = GST_TAG_ARTIST; - break; + type = GST_TAG_ARTIST; + break; case GST_RIFF_INFO_ICMS: - type = NULL; /*"Commissioner"; */ - break; + type = NULL; /*"Commissioner"; */ + break; case GST_RIFF_INFO_ICMT: - type = GST_TAG_COMMENT; - break; + type = GST_TAG_COMMENT; + break; case GST_RIFF_INFO_ICOP: - type = GST_TAG_COPYRIGHT; - break; + type = GST_TAG_COPYRIGHT; + break; case GST_RIFF_INFO_ICRD: - type = GST_TAG_DATE; - break; + type = GST_TAG_DATE; + break; case GST_RIFF_INFO_ICRP: - type = NULL; /*"Cropped"; */ - break; + type = NULL; /*"Cropped"; */ + break; case GST_RIFF_INFO_IDIM: - type = NULL; /*"Dimensions"; */ - break; + type = NULL; /*"Dimensions"; */ + break; case GST_RIFF_INFO_IDPI: - type = NULL; /*"Dots per Inch"; */ - break; + type = NULL; /*"Dots per Inch"; */ + break; case GST_RIFF_INFO_IENG: - type = NULL; /*"Engineer"; */ - break; + type = NULL; /*"Engineer"; */ + break; case GST_RIFF_INFO_IGNR: - type = GST_TAG_GENRE; - break; + type = GST_TAG_GENRE; + break; case GST_RIFF_INFO_IKEY: - type = NULL; /*"Keywords"; */ ; - break; + type = NULL; /*"Keywords"; */ ; + break; case GST_RIFF_INFO_ILGT: - type = NULL; /*"Lightness"; */ - break; + type = NULL; /*"Lightness"; */ + break; case GST_RIFF_INFO_IMED: - type = NULL; /*"Medium"; */ - break; + type = NULL; /*"Medium"; */ + break; case GST_RIFF_INFO_INAM: - type = GST_TAG_TITLE; - break; + type = GST_TAG_TITLE; + break; case GST_RIFF_INFO_IPLT: - type = NULL; /*"Palette"; */ - break; + type = NULL; /*"Palette"; */ + break; case GST_RIFF_INFO_IPRD: - type = NULL; /*"Product"; */ - break; + type = NULL; /*"Product"; */ + break; case GST_RIFF_INFO_ISBJ: - type = NULL; /*"Subject"; */ - break; + type = NULL; /*"Subject"; */ + break; case GST_RIFF_INFO_ISFT: - type = GST_TAG_ENCODER; - break; + type = GST_TAG_ENCODER; + break; case GST_RIFF_INFO_ISHP: - type = NULL; /*"Sharpness"; */ - break; + type = NULL; /*"Sharpness"; */ + break; case GST_RIFF_INFO_ISRC: - type = GST_TAG_ISRC; - break; + type = GST_TAG_ISRC; + break; case GST_RIFF_INFO_ISRF: - type = NULL; /*"Source Form"; */ - break; + type = NULL; /*"Source Form"; */ + break; case GST_RIFF_INFO_ITCH: - type = NULL; /*"Technician"; */ - break; + type = NULL; /*"Technician"; */ + break; default: - type = NULL; - GST_WARNING ("Unknown INFO (metadata) tag entry " GST_FOURCC_FORMAT, - GST_FOURCC_ARGS (tag)); - break; + type = NULL; + GST_WARNING ("Unknown INFO (metadata) tag entry " GST_FOURCC_FORMAT, + GST_FOURCC_ARGS (tag)); + break; } if (type) { name = NULL; if (!gst_riff_read_ascii (riff, &tag, &name)) { - return FALSE; + return FALSE; } if (name && name[0] != '\0') { - GValue src = { 0 } - , dest = { - 0}; - GType dest_type = gst_tag_get_type (type); + GValue src = { 0 } + , dest = + { + 0}; + GType dest_type = gst_tag_get_type (type); - have_tags = TRUE; - g_value_init (&src, G_TYPE_STRING); - g_value_set_string (&src, name); - g_value_init (&dest, dest_type); - g_value_transform (&src, &dest); - g_value_unset (&src); - gst_tag_list_add_values (taglist, GST_TAG_MERGE_APPEND, - type, &dest, NULL); - g_value_unset (&dest); + have_tags = TRUE; + g_value_init (&src, G_TYPE_STRING); + g_value_set_string (&src, name); + g_value_init (&dest, dest_type); + g_value_transform (&src, &dest); + g_value_unset (&src); + gst_tag_list_add_values (taglist, GST_TAG_MERGE_APPEND, + type, &dest, NULL); + g_value_unset (&dest); } g_free (name); } else { @@ -804,10 +805,10 @@ gst_riff_read_info (GstRiffRead * riff) /* let the world know about this wonderful thing */ for (padlist = gst_element_get_pad_list (element); - padlist != NULL; padlist = padlist->next) { + padlist != NULL; padlist = padlist->next) { if (GST_PAD_IS_SRC (padlist->data) && GST_PAD_IS_USABLE (padlist->data)) { - gst_event_ref (event); - gst_pad_push (GST_PAD (padlist->data), GST_DATA (event)); + gst_event_ref (event); + gst_pad_push (GST_PAD (padlist->data), GST_DATA (event)); } } gst_event_unref (event); diff --git a/gst-libs/gst/tuner/tuner.c b/gst-libs/gst/tuner/tuner.c index fd1c354f00..5bfe1ae7b1 100644 --- a/gst-libs/gst/tuner/tuner.c +++ b/gst-libs/gst/tuner/tuner.c @@ -60,9 +60,9 @@ gst_tuner_get_type (void) }; gst_tuner_type = g_type_register_static (G_TYPE_INTERFACE, - "GstTuner", &gst_tuner_info, 0); + "GstTuner", &gst_tuner_info, 0); g_type_interface_add_prerequisite (gst_tuner_type, - GST_TYPE_IMPLEMENTS_INTERFACE); + GST_TYPE_IMPLEMENTS_INTERFACE); } return gst_tuner_type; @@ -75,32 +75,32 @@ gst_tuner_class_init (GstTunerClass * klass) if (!initialized) { gst_tuner_signals[NORM_CHANGED] = - g_signal_new ("norm-changed", - GST_TYPE_TUNER, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstTunerClass, norm_changed), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GST_TYPE_TUNER_NORM); + g_signal_new ("norm-changed", + GST_TYPE_TUNER, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstTunerClass, norm_changed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GST_TYPE_TUNER_NORM); gst_tuner_signals[CHANNEL_CHANGED] = - g_signal_new ("channel-changed", - GST_TYPE_TUNER, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstTunerClass, channel_changed), - NULL, NULL, - g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, - GST_TYPE_TUNER_CHANNEL); + g_signal_new ("channel-changed", + GST_TYPE_TUNER, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstTunerClass, channel_changed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, + GST_TYPE_TUNER_CHANNEL); gst_tuner_signals[FREQUENCY_CHANGED] = - g_signal_new ("frequency-changed", - GST_TYPE_TUNER, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstTunerClass, frequency_changed), - NULL, NULL, - gst_tuner_marshal_VOID__OBJECT_ULONG, G_TYPE_NONE, 2, - GST_TYPE_TUNER_CHANNEL, G_TYPE_ULONG); + g_signal_new ("frequency-changed", + GST_TYPE_TUNER, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstTunerClass, frequency_changed), + NULL, NULL, + gst_tuner_marshal_VOID__OBJECT_ULONG, G_TYPE_NONE, 2, + GST_TYPE_TUNER_CHANNEL, G_TYPE_ULONG); gst_tuner_signals[SIGNAL_CHANGED] = - g_signal_new ("signal-changed", - GST_TYPE_TUNER, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstTunerClass, signal_changed), - NULL, NULL, - gst_tuner_marshal_VOID__OBJECT_INT, G_TYPE_NONE, 2, - GST_TYPE_TUNER_CHANNEL, G_TYPE_INT); + g_signal_new ("signal-changed", + GST_TYPE_TUNER, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstTunerClass, signal_changed), + NULL, NULL, + gst_tuner_marshal_VOID__OBJECT_INT, G_TYPE_NONE, 2, + GST_TYPE_TUNER_CHANNEL, G_TYPE_INT); initialized = TRUE; } @@ -262,7 +262,7 @@ gst_tuner_set_frequency (GstTuner * tuner, GstTunerClass *klass = GST_TUNER_GET_CLASS (tuner); g_return_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel, - GST_TUNER_CHANNEL_FREQUENCY)); + GST_TUNER_CHANNEL_FREQUENCY)); if (klass->set_frequency) { klass->set_frequency (tuner, channel, frequency); @@ -286,7 +286,7 @@ gst_tuner_get_frequency (GstTuner * tuner, GstTunerChannel * channel) GstTunerClass *klass = GST_TUNER_GET_CLASS (tuner); g_return_val_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel, - GST_TUNER_CHANNEL_FREQUENCY), 0); + GST_TUNER_CHANNEL_FREQUENCY), 0); if (klass->get_frequency) { return klass->get_frequency (tuner, channel); @@ -315,7 +315,7 @@ gst_tuner_signal_strength (GstTuner * tuner, GstTunerChannel * channel) GstTunerClass *klass = GST_TUNER_GET_CLASS (tuner); g_return_val_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel, - GST_TUNER_CHANNEL_FREQUENCY), 0); + GST_TUNER_CHANNEL_FREQUENCY), 0); if (klass->signal_strength) { return klass->signal_strength (tuner, channel); diff --git a/gst-libs/gst/tuner/tunerchannel.c b/gst-libs/gst/tuner/tunerchannel.c index af93f56842..de0be2e433 100644 --- a/gst-libs/gst/tuner/tunerchannel.c +++ b/gst-libs/gst/tuner/tunerchannel.c @@ -60,8 +60,8 @@ gst_tuner_channel_get_type (void) }; gst_tuner_channel_type = - g_type_register_static (G_TYPE_OBJECT, - "GstTunerChannel", &tuner_channel_info, 0); + g_type_register_static (G_TYPE_OBJECT, + "GstTunerChannel", &tuner_channel_info, 0); } return gst_tuner_channel_type; @@ -78,13 +78,13 @@ gst_tuner_channel_class_init (GstTunerChannelClass * klass) g_signal_new ("frequency-changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstTunerChannelClass, - frequency_changed), + frequency_changed), NULL, NULL, g_cclosure_marshal_VOID__ULONG, G_TYPE_NONE, 1, G_TYPE_ULONG); signals[SIGNAL_SIGNAL_CHANGED] = g_signal_new ("signal-changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstTunerChannelClass, - signal_changed), + signal_changed), NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); object_klass->dispose = gst_tuner_channel_dispose; diff --git a/gst-libs/gst/tuner/tunernorm.c b/gst-libs/gst/tuner/tunernorm.c index 41927d2b1e..8fb98db7d4 100644 --- a/gst-libs/gst/tuner/tunernorm.c +++ b/gst-libs/gst/tuner/tunernorm.c @@ -59,8 +59,8 @@ gst_tuner_norm_get_type (void) }; gst_tuner_norm_type = - g_type_register_static (G_TYPE_OBJECT, - "GstTunerNorm", &tuner_norm_info, 0); + g_type_register_static (G_TYPE_OBJECT, + "GstTunerNorm", &tuner_norm_info, 0); } return gst_tuner_norm_type; diff --git a/gst-libs/gst/video/gstvideosink.c b/gst-libs/gst/video/gstvideosink.c index 2acf7e573f..45ed37268c 100644 --- a/gst-libs/gst/video/gstvideosink.c +++ b/gst-libs/gst/video/gstvideosink.c @@ -83,7 +83,7 @@ gst_videosink_get_type (void) }; videosink_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstVideoSink", &videosink_info, 0); + "GstVideoSink", &videosink_info, 0); } return videosink_type; diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c index 8fed1e76b7..6e942112b5 100644 --- a/gst-libs/gst/video/video.c +++ b/gst-libs/gst/video/video.c @@ -37,14 +37,14 @@ gst_video_frame_rate (GstPad * pad) caps = GST_PAD_CAPS (pad); if (caps == NULL) { g_warning ("gstvideo: failed to get caps of pad %s:%s", - GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); + GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); return 0.; } structure = gst_caps_get_structure (caps, 0); if (!gst_structure_get_double (structure, "framerate", &fps)) { g_warning ("gstvideo: failed to get framerate property of pad %s:%s", - GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); + GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); return 0.; } @@ -69,7 +69,7 @@ gst_video_get_size (GstPad * pad, gint * width, gint * height) if (caps == NULL) { g_warning ("gstvideo: failed to get caps of pad %s:%s", - GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); + GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); return FALSE; } @@ -79,7 +79,7 @@ gst_video_get_size (GstPad * pad, gint * width, gint * height) if (!ret) { g_warning ("gstvideo: failed to get size properties on pad %s:%s", - GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); + GST_ELEMENT_NAME (gst_pad_get_parent (pad)), GST_PAD_NAME (pad)); return FALSE; } diff --git a/gst-libs/gst/xoverlay/xoverlay.c b/gst-libs/gst/xoverlay/xoverlay.c index c1014eb179..f4d1e1cf1d 100644 --- a/gst-libs/gst/xoverlay/xoverlay.c +++ b/gst-libs/gst/xoverlay/xoverlay.c @@ -55,9 +55,9 @@ gst_x_overlay_get_type (void) }; gst_x_overlay_type = g_type_register_static (G_TYPE_INTERFACE, - "GstXOverlay", &gst_x_overlay_info, 0); + "GstXOverlay", &gst_x_overlay_info, 0); g_type_interface_add_prerequisite (gst_x_overlay_type, - GST_TYPE_IMPLEMENTS_INTERFACE); + GST_TYPE_IMPLEMENTS_INTERFACE); } return gst_x_overlay_type; @@ -76,16 +76,16 @@ gst_x_overlay_base_init (gpointer g_class) if (!initialized) { gst_x_overlay_signals[HAVE_XWINDOW_ID] = - g_signal_new ("have-xwindow-id", - GST_TYPE_X_OVERLAY, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstXOverlayClass, have_xwindow_id), - NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); + g_signal_new ("have-xwindow-id", + GST_TYPE_X_OVERLAY, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstXOverlayClass, have_xwindow_id), + NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); gst_x_overlay_signals[DESIRED_SIZE] = - g_signal_new ("desired-size-changed", - GST_TYPE_X_OVERLAY, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstXOverlayClass, desired_size), - NULL, NULL, - gst_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); + g_signal_new ("desired-size-changed", + GST_TYPE_X_OVERLAY, G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstXOverlayClass, desired_size), + NULL, NULL, + gst_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); initialized = TRUE; } @@ -155,7 +155,7 @@ gst_x_overlay_get_desired_size (GstXOverlay * overlay, guint * width, /* this ensures that elements don't need to check width and height for NULL but apps may use NULL */ klass->get_desired_size (overlay, width ? width : &width_tmp, - height ? height : &height_tmp); + height ? height : &height_tmp); } else { if (width) *width = 0; diff --git a/gst-libs/gst/xwindowlistener/xwindowlistener.c b/gst-libs/gst/xwindowlistener/xwindowlistener.c index dc289854d5..63cfdd2d94 100644 --- a/gst-libs/gst/xwindowlistener/xwindowlistener.c +++ b/gst-libs/gst/xwindowlistener/xwindowlistener.c @@ -57,8 +57,8 @@ gst_x_window_listener_get_type (void) }; x_window_listener_type = - g_type_register_static (G_TYPE_OBJECT, - "GstXWindowListener", &x_window_listener_info, 0); + g_type_register_static (G_TYPE_OBJECT, + "GstXWindowListener", &x_window_listener_info, 0); } return x_window_listener_type; @@ -183,7 +183,7 @@ gst_xwin_refresh (gpointer data) if (!xwin->ov_move && xwin->ov_map && xwin->ov_visibility == VisibilityUnobscured) { g_mutex_unlock (xwin->main_lock); - return FALSE; /* skip */ + return FALSE; /* skip */ } if (xwin->ov_map && xwin->ov_visibility != VisibilityFullyObscured) { @@ -307,17 +307,17 @@ gst_xwin_window (GstXWindowListener * xwin) if (xwin->ov_conf) { xwin->set_window_func (xwin->private_data, - xwin->x, xwin->y, xwin->w, xwin->h, xwin->clips, xwin->num_clips); + xwin->x, xwin->y, xwin->w, xwin->h, xwin->clips, xwin->num_clips); if (!xwin->ov_visible) - gst_xwin_set_overlay (xwin, TRUE); + gst_xwin_set_overlay (xwin, TRUE); g_mutex_lock (xwin->main_lock); if (xwin->ov_refresh_id) - g_source_remove (xwin->ov_refresh_id); + g_source_remove (xwin->ov_refresh_id); xwin->ov_refresh_id = - g_timeout_add (200, (GSourceFunc) gst_xwin_refresh, (gpointer) xwin); + g_timeout_add (200, (GSourceFunc) gst_xwin_refresh, (gpointer) xwin); xwin->ov_conf = FALSE; @@ -331,9 +331,9 @@ gst_xwin_window (GstXWindowListener * xwin) g_mutex_lock (xwin->main_lock); if (xwin->ov_refresh_id) - g_source_remove (xwin->ov_refresh_id); + g_source_remove (xwin->ov_refresh_id); xwin->ov_refresh_id = - g_timeout_add (200, (GSourceFunc) gst_xwin_refresh, (gpointer) xwin); + g_timeout_add (200, (GSourceFunc) gst_xwin_refresh, (gpointer) xwin); xwin->ov_conf = FALSE; @@ -355,7 +355,7 @@ gst_xwin_configure (GstXWindowListener * xwin) * in the main thread instead of here. */ if (!xwin->ov_conf_id) xwin->ov_conf_id = - g_idle_add ((GSourceFunc) gst_rec_xoverlay_window, (gpointer) xwin); + g_idle_add ((GSourceFunc) gst_rec_xoverlay_window, (gpointer) xwin); #endif gst_xwin_window ((gpointer) xwin); @@ -473,89 +473,89 @@ gst_xwin_thread (gpointer data) break; if ((event.type == ConfigureNotify && - event.xconfigure.window == xwin->xwindow_id) || - (event.type == MapNotify && - event.xmap.window == xwin->xwindow_id) || - (event.type == UnmapNotify && - event.xunmap.window == xwin->xwindow_id)) { + event.xconfigure.window == xwin->xwindow_id) || + (event.type == MapNotify && + event.xmap.window == xwin->xwindow_id) || + (event.type == UnmapNotify && + event.xunmap.window == xwin->xwindow_id)) { /* the 'parent' window, i.e. the widget provided by client */ switch (event.type) { - case MapNotify: - xwin->ov_map = TRUE; - xwin->ov_conf = TRUE; - gst_xwin_configure (xwin); - break; + case MapNotify: + xwin->ov_map = TRUE; + xwin->ov_conf = TRUE; + gst_xwin_configure (xwin); + break; - case UnmapNotify: - xwin->ov_map = FALSE; - xwin->ov_conf = TRUE; - gst_xwin_configure (xwin); - break; + case UnmapNotify: + xwin->ov_map = FALSE; + xwin->ov_conf = TRUE; + gst_xwin_configure (xwin); + break; - case ConfigureNotify: - gst_xwin_resize (xwin); - break; + case ConfigureNotify: + gst_xwin_resize (xwin); + break; - default: - /* nothing */ - break; + default: + /* nothing */ + break; } } else if (event.xany.window == xwin->child) { /* our own private window */ switch (event.type) { - case Expose: - if (!event.xexpose.count) { - if (xwin->ov_refresh) { - xwin->ov_refresh = FALSE; - } else { - xwin->ov_conf = TRUE; - gst_xwin_configure (xwin); - } - } - break; + case Expose: + if (!event.xexpose.count) { + if (xwin->ov_refresh) { + xwin->ov_refresh = FALSE; + } else { + xwin->ov_conf = TRUE; + gst_xwin_configure (xwin); + } + } + break; - case VisibilityNotify: - xwin->ov_visibility = event.xvisibility.state; - if (xwin->ov_refresh) { - if (event.xvisibility.state != VisibilityFullyObscured) - xwin->ov_refresh = FALSE; - } else { - xwin->ov_conf = TRUE; - gst_xwin_configure (xwin); - } - break; + case VisibilityNotify: + xwin->ov_visibility = event.xvisibility.state; + if (xwin->ov_refresh) { + if (event.xvisibility.state != VisibilityFullyObscured) + xwin->ov_refresh = FALSE; + } else { + xwin->ov_conf = TRUE; + gst_xwin_configure (xwin); + } + break; - default: - /* nothing */ - break; + default: + /* nothing */ + break; } } else { /* root window */ switch (event.type) { - case MapNotify: - case UnmapNotify: - /* are we still visible? */ - if (!xwin->ov_refresh) { - XWindowAttributes attr; - gboolean on; + case MapNotify: + case UnmapNotify: + /* are we still visible? */ + if (!xwin->ov_refresh) { + XWindowAttributes attr; + gboolean on; - XGetWindowAttributes (xwin->display, xwin->xwindow_id, &attr); - on = (attr.map_state == IsViewable); - xwin->ov_wmmap = on; - xwin->ov_conf = TRUE; - gst_xwin_configure (xwin); - } - break; + XGetWindowAttributes (xwin->display, xwin->xwindow_id, &attr); + on = (attr.map_state == IsViewable); + xwin->ov_wmmap = on; + xwin->ov_conf = TRUE; + gst_xwin_configure (xwin); + } + break; - case ConfigureNotify: - if (!xwin->ov_refresh) { - gst_xwin_resize (xwin); - } - break; + case ConfigureNotify: + if (!xwin->ov_refresh) { + gst_xwin_resize (xwin); + } + break; - default: - /* nothing */ - break; + default: + /* nothing */ + break; } } } diff --git a/gst/cdxaparse/gstcdxaparse.c b/gst/cdxaparse/gstcdxaparse.c index 3241db24a9..595191b7f8 100644 --- a/gst/cdxaparse/gstcdxaparse.c +++ b/gst/cdxaparse/gstcdxaparse.c @@ -102,9 +102,10 @@ gst_cdxa_parse_get_type (void) 0, (GInstanceInitFunc) gst_cdxa_parse_init, }; + cdxa_parse_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstCDXAParse", - &cdxa_parse_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstCDXAParse", + &cdxa_parse_info, 0); } return cdxa_parse_type; } @@ -202,7 +203,8 @@ typedef struct gchar CDXA_tag[4]; gchar fmt_tag[4]; guint32 fmt_size; -} CDXAParseHeader; +} +CDXAParseHeader; /* A sectors is 2352 bytes long and is composed of: @@ -245,7 +247,7 @@ gst_cdxa_parse_loop (GstElement * element) /* get the data size */ got_bytes = - gst_bytestream_peek_bytes (cdxa_parse->bs, (guint8 **) & buf, 4); + gst_bytestream_peek_bytes (cdxa_parse->bs, (guint8 **) & buf, 4); if (got_bytes < 4) return; cdxa_parse->data_size = GUINT32_FROM_LE (*((guint32 *) buf)); @@ -315,7 +317,7 @@ plugin_init (GstPlugin * plugin) return FALSE; if (!gst_element_register (plugin, "cdxaparse", GST_RANK_NONE, - GST_TYPE_CDXA_PARSE)) + GST_TYPE_CDXA_PARSE)) return FALSE; return TRUE; diff --git a/gst/chart/gstchart.c b/gst/chart/gstchart.c index 2183279526..6b5eb45649 100644 --- a/gst/chart/gstchart.c +++ b/gst/chart/gstchart.c @@ -50,9 +50,9 @@ struct _GstChart gint height; gint samplerate; - gdouble framerate; /* desired frame rate */ - gint samples_between_frames; /* number of samples between start of successive frames */ - gint samples_since_last_frame; /* number of samples between start of successive frames */ + gdouble framerate; /* desired frame rate */ + gint samples_between_frames; /* number of samples between start of successive frames */ + gint samples_since_last_frame; /* number of samples between start of successive frames */ }; struct _GstChartClass @@ -94,11 +94,11 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) TRUE, " - "width = (int) 16, " - "depth = (int) 16, " - "rate = (int) [ 8000, 96000 ], " "channels = (int) 1") + "endianness = (int) BYTE_ORDER, " + "signed = (boolean) TRUE, " + "width = (int) 16, " + "depth = (int) 16, " + "rate = (int) [ 8000, 96000 ], " "channels = (int) 1") ); static void gst_chart_base_init (gpointer g_class); @@ -136,6 +136,7 @@ gst_chart_get_type (void) 0, (GInstanceInitFunc) gst_chart_init, }; + type = g_type_register_static (GST_TYPE_ELEMENT, "GstChart", &info, 0); } return type; @@ -194,8 +195,8 @@ gst_chart_init (GstChart * chart) chart->height = 128; chart->samplerate = -1; - chart->framerate = 25; /* desired frame rate */ - chart->samples_between_frames = 0; /* number of samples between start of successive frames */ + chart->framerate = 25; /* desired frame rate */ + chart->samples_between_frames = 0; /* number of samples between start of successive frames */ chart->samples_since_last_frame = 0; } @@ -264,29 +265,29 @@ draw_chart_16bpp (guchar * output, gint width, gint height, if (h1 < height / 2) { while (pos < colstart + h1 * width) { - *pos = 0x0000; - pos += width; + *pos = 0x0000; + pos += width; } while (pos < colstart + height / 2 * width) { - *pos = 0x07e0; - pos += width; + *pos = 0x07e0; + pos += width; } while (pos < colstart + height * width) { - *pos = 0x0000; - pos += width; + *pos = 0x0000; + pos += width; } } else { while (pos < colstart + height / 2 * width) { - *pos = 0x0000; - pos += width; + *pos = 0x0000; + pos += width; } while (pos < colstart + h1 * width) { - *pos = 0x07e0; - pos += width; + *pos = 0x07e0; + pos += width; } while (pos < colstart + height * width) { - *pos = 0x0000; - pos += width; + *pos = 0x0000; + pos += width; } } } @@ -333,12 +334,12 @@ gst_chart_chain (GstPad * pad, GstData * _data) GST_BUFFER_SIZE (bufout) = sizeout; GST_BUFFER_DATA (bufout) = dataout; GST_DEBUG ("CHART: made new buffer: size %d, width %d, height %d", - sizeout, chart->width, chart->height); + sizeout, chart->width, chart->height); /* take data and draw to new buffer */ /* FIXME: call different routines for different properties */ draw_chart_16bpp (dataout, chart->width, chart->height, (gint16 *) datain, - samples_in); + samples_in); gst_buffer_unref (bufin); diff --git a/gst/colorspace/gstcolorspace.c b/gst/colorspace/gstcolorspace.c index 8ec6fe8aa3..fb7f8db0bf 100644 --- a/gst/colorspace/gstcolorspace.c +++ b/gst/colorspace/gstcolorspace.c @@ -62,7 +62,7 @@ static GstStaticPadTemplate gst_colorspace_src_template = GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB "; " - GST_VIDEO_CAPS_BGRx "; " GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_RGB_16) + GST_VIDEO_CAPS_BGRx "; " GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_RGB_16) ); /* Stereo signals and args */ @@ -132,125 +132,125 @@ colorspace_setup_converter (GstColorspace * space, GstCaps * from_caps, gst_structure_get_int (from_struct, "bpp", &from_bpp); switch (to_space) { - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): #ifdef HAVE_HERMES - { - gint to_bpp; + { + gint to_bpp; - gst_structure_get_int (to_struct, "bpp", &to_bpp); + gst_structure_get_int (to_struct, "bpp", &to_bpp); - gst_structure_get_int (from_struct, "red_mask", &space->source.r); - gst_structure_get_int (from_struct, "green_mask", &space->source.g); - gst_structure_get_int (from_struct, "blue_mask", &space->source.b); - space->source.a = 0; - space->srcbpp = space->source.bits = from_bpp; - space->source.indexed = 0; - space->source.has_colorkey = 0; + gst_structure_get_int (from_struct, "red_mask", &space->source.r); + gst_structure_get_int (from_struct, "green_mask", &space->source.g); + gst_structure_get_int (from_struct, "blue_mask", &space->source.b); + space->source.a = 0; + space->srcbpp = space->source.bits = from_bpp; + space->source.indexed = 0; + space->source.has_colorkey = 0; - GST_INFO ("source red mask %08x", space->source.r); - GST_INFO ("source green mask %08x", space->source.g); - GST_INFO ("source blue mask %08x", space->source.b); - GST_INFO ("source bpp %08x", space->srcbpp); + GST_INFO ("source red mask %08x", space->source.r); + GST_INFO ("source green mask %08x", space->source.g); + GST_INFO ("source blue mask %08x", space->source.b); + GST_INFO ("source bpp %08x", space->srcbpp); - gst_structure_get_int (to_struct, "red_mask", &space->dest.r); - gst_structure_get_int (to_struct, "green_mask", &space->dest.g); - gst_structure_get_int (to_struct, "blue_mask", &space->dest.b); - space->dest.a = 0; - space->destbpp = space->dest.bits = to_bpp; - space->dest.indexed = 0; - space->dest.has_colorkey = 0; + gst_structure_get_int (to_struct, "red_mask", &space->dest.r); + gst_structure_get_int (to_struct, "green_mask", &space->dest.g); + gst_structure_get_int (to_struct, "blue_mask", &space->dest.b); + space->dest.a = 0; + space->destbpp = space->dest.bits = to_bpp; + space->dest.indexed = 0; + space->dest.has_colorkey = 0; - GST_INFO ("dest red mask %08x", space->dest.r); - GST_INFO ("dest green mask %08x", space->dest.g); - GST_INFO ("dest blue mask %08x", space->dest.b); - GST_INFO ("dest bpp %08x", space->destbpp); + GST_INFO ("dest red mask %08x", space->dest.r); + GST_INFO ("dest green mask %08x", space->dest.g); + GST_INFO ("dest blue mask %08x", space->dest.b); + GST_INFO ("dest bpp %08x", space->destbpp); - if (!Hermes_ConverterRequest (space->h_handle, &space->source, - &space->dest)) { - g_warning ("Hermes: could not get converter\n"); - return FALSE; - } - GST_INFO ("converter set up"); - space->type = GST_COLORSPACE_HERMES; - return TRUE; - } + if (!Hermes_ConverterRequest (space->h_handle, &space->source, + &space->dest)) { + g_warning ("Hermes: could not get converter\n"); + return FALSE; + } + GST_INFO ("converter set up"); + space->type = GST_COLORSPACE_HERMES; + return TRUE; + } #else - g_warning ("colorspace: compiled without hermes!"); - return FALSE; + g_warning ("colorspace: compiled without hermes!"); + return FALSE; #endif - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - if (from_bpp == 32) { - space->type = GST_COLORSPACE_RGB32_YV12; - space->destbpp = 12; - return TRUE; - } - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - if (from_bpp == 32) { - space->type = GST_COLORSPACE_RGB32_I420; - space->destbpp = 12; - return TRUE; - } - case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): - GST_INFO ("colorspace: RGB to YUV with bpp %d not implemented!!", - from_bpp); - return FALSE; + case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): + if (from_bpp == 32) { + space->type = GST_COLORSPACE_RGB32_YV12; + space->destbpp = 12; + return TRUE; + } + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + if (from_bpp == 32) { + space->type = GST_COLORSPACE_RGB32_I420; + space->destbpp = 12; + return TRUE; + } + case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): + GST_INFO ("colorspace: RGB to YUV with bpp %d not implemented!!", + from_bpp); + return FALSE; } break; } case GST_MAKE_FOURCC ('I', '4', '2', '0'): switch (to_space) { - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): - GST_INFO ("colorspace: YUV to RGB"); + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + GST_INFO ("colorspace: YUV to RGB"); - gst_structure_get_int (to_struct, "bpp", &space->destbpp); - space->converter = - gst_colorspace_yuv2rgb_get_converter (from_caps, to_caps); - space->type = GST_COLORSPACE_YUV_RGB; - return TRUE; - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - space->type = GST_COLORSPACE_NONE; - space->destbpp = 12; - return TRUE; - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - space->type = GST_COLORSPACE_420_SWAP; - space->destbpp = 12; - return TRUE; + gst_structure_get_int (to_struct, "bpp", &space->destbpp); + space->converter = + gst_colorspace_yuv2rgb_get_converter (from_caps, to_caps); + space->type = GST_COLORSPACE_YUV_RGB; + return TRUE; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + space->type = GST_COLORSPACE_NONE; + space->destbpp = 12; + return TRUE; + case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): + space->type = GST_COLORSPACE_420_SWAP; + space->destbpp = 12; + return TRUE; } break; case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): switch (to_space) { - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - space->type = GST_COLORSPACE_YUY2_I420; - space->destbpp = 12; - return TRUE; - case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): - space->type = GST_COLORSPACE_NONE; - space->destbpp = 16; - return TRUE; - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): - GST_INFO ("colorspace: YUY2 to RGB not implemented!!"); - return FALSE; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + space->type = GST_COLORSPACE_YUY2_I420; + space->destbpp = 12; + return TRUE; + case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): + space->type = GST_COLORSPACE_NONE; + space->destbpp = 16; + return TRUE; + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + GST_INFO ("colorspace: YUY2 to RGB not implemented!!"); + return FALSE; } break; case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): switch (to_space) { - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): - GST_INFO ("colorspace: YV12 to RGB"); + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + GST_INFO ("colorspace: YV12 to RGB"); - gst_structure_get_int (to_struct, "bpp", &space->destbpp); - space->converter = - gst_colorspace_yuv2rgb_get_converter (from_caps, to_caps); - space->type = GST_COLORSPACE_YUV_RGB; - return TRUE; - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - space->type = GST_COLORSPACE_420_SWAP; - space->destbpp = 12; - return TRUE; - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - space->type = GST_COLORSPACE_NONE; - space->destbpp = 12; - return TRUE; + gst_structure_get_int (to_struct, "bpp", &space->destbpp); + space->converter = + gst_colorspace_yuv2rgb_get_converter (from_caps, to_caps); + space->type = GST_COLORSPACE_YUV_RGB; + return TRUE; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + space->type = GST_COLORSPACE_420_SWAP; + space->destbpp = 12; + return TRUE; + case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): + space->type = GST_COLORSPACE_NONE; + space->destbpp = 12; + return TRUE; } break; } @@ -317,7 +317,7 @@ gst_colorspace_get_format (const GstCaps * caps) GstCaps *fcaps; fcaps = - gst_caps_copy (gst_static_caps_get (&gst_colorspace_formats[i].caps)); + gst_caps_copy (gst_static_caps_get (&gst_colorspace_formats[i].caps)); icaps = gst_caps_intersect (caps, fcaps); if (!gst_caps_is_empty (icaps)) { @@ -417,8 +417,8 @@ gst_colorspace_link (GstPad * pad, const GstCaps * caps) othercaps = gst_caps_copy (gst_pad_get_negotiated_caps (otherpad)); gst_caps_set_simple (othercaps, - "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, fps, NULL); + "width", G_TYPE_INT, width, + "height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, fps, NULL); link_ret = gst_pad_try_set_caps (otherpad, othercaps); if (link_ret != GST_PAD_LINK_OK) { @@ -434,15 +434,15 @@ gst_colorspace_link (GstPad * pad, const GstCaps * caps) if (gst_pad_is_negotiated (otherpad)) { space->converter_index = - gst_colorspace_get_converter (space->sink_format_index, - space->src_format_index); + gst_colorspace_get_converter (space->sink_format_index, + space->src_format_index); g_print ("using index %d\n", space->converter_index); space->sink_size = gst_colorspace_format_get_size (space->sink_format_index, - width, height); + width, height); space->src_size = gst_colorspace_format_get_size (space->src_format_index, - width, height); + width, height); space->width = width; space->height = height; space->fps = fps; @@ -474,9 +474,10 @@ gst_colorspace_get_type (void) 0, (GInstanceInitFunc) gst_colorspace_init, }; + colorspace_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstColorspace", - &colorspace_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstColorspace", + &colorspace_info, 0); } return colorspace_type; } @@ -621,7 +622,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "colorspace", GST_RANK_PRIMARY, - GST_TYPE_COLORSPACE)) + GST_TYPE_COLORSPACE)) return FALSE; return TRUE; diff --git a/gst/colorspace/yuv2rgb.c b/gst/colorspace/yuv2rgb.c index 37eaa628e0..290f07bc2a 100644 --- a/gst/colorspace/yuv2rgb.c +++ b/gst/colorspace/yuv2rgb.c @@ -231,9 +231,9 @@ gst_colorspace_I420_to_bgr32_mmx (GstColorspace * space, unsigned char *src, size = space->width * space->height; - gst_colorspace_yuv_to_bgr32_mmx (NULL, src, /* Y component */ - src + size, /* cr component */ - src + size + (size >> 2), /* cb component */ + gst_colorspace_yuv_to_bgr32_mmx (NULL, src, /* Y component */ + src + size, /* cr component */ + src + size + (size >> 2), /* cb component */ dest, space->height, space->width); } @@ -248,9 +248,9 @@ gst_colorspace_I420_to_bgr16_mmx (GstColorspace * space, unsigned char *src, size = space->width * space->height; - gst_colorspace_yuv_to_bgr16_mmx (NULL, src, /* Y component */ - src + size, /* cr component */ - src + size + (size >> 2), /* cb component */ + gst_colorspace_yuv_to_bgr16_mmx (NULL, src, /* Y component */ + src + size, /* cr component */ + src + size + (size >> 2), /* cb component */ dest, space->height, space->width); GST_DEBUG ("gst_colorspace_I420_to_bgr16_mmx done"); @@ -266,9 +266,9 @@ gst_colorspace_YV12_to_bgr32_mmx (GstColorspace * space, unsigned char *src, size = space->width * space->height; - gst_colorspace_yuv_to_bgr32_mmx (NULL, src, /* Y component */ - src + size + (size >> 2), /* cb component */ - src + size, /* cr component */ + gst_colorspace_yuv_to_bgr32_mmx (NULL, src, /* Y component */ + src + size + (size >> 2), /* cb component */ + src + size, /* cr component */ dest, space->height, space->width); } @@ -283,9 +283,9 @@ gst_colorspace_YV12_to_bgr16_mmx (GstColorspace * space, unsigned char *src, size = space->width * space->height; - gst_colorspace_yuv_to_bgr16_mmx (NULL, src, /* Y component */ - src + size + (size >> 2), /* cb component */ - src + size, /* cr component */ + gst_colorspace_yuv_to_bgr16_mmx (NULL, src, /* Y component */ + src + size + (size >> 2), /* cb component */ + src + size, /* cr component */ dest, space->height, space->width); GST_DEBUG ("gst_colorspace_YV12_to_bgr16_mmx done"); @@ -500,7 +500,7 @@ gst_colorspace_yuv_to_rgb32 (GstColorspace * space, dest[x * 4 + 0] = 0; dest[x * 3 + 1] = CLAMP (Y[x] + V_r_tab[V[x / 2]], 0, 255); dest[x * 3 + 2] = - CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255); + CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255); dest[x * 3 + 3] = CLAMP (Y[x] + U_b_tab[U[x / 2]], 0, 255); } Y += src_rowstride; @@ -527,7 +527,7 @@ gst_colorspace_yuv_to_rgb24 (GstColorspace * space, for (x = 0; x < width; x++) { dest[x * 3 + 0] = CLAMP (Y[x] + V_r_tab[V[x / 2]], 0, 255); dest[x * 3 + 1] = - CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255); + CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255); dest[x * 3 + 2] = CLAMP (Y[x] + U_b_tab[U[x / 2]], 0, 255); } Y += src_rowstride; @@ -557,7 +557,7 @@ gst_colorspace_yuv_to_rgb16 (GstColorspace * space, g = CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255); b = CLAMP (Y[x] + U_b_tab[U[x / 2]], 0, 255); *(unsigned short *) (dest + x * 2) = - ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); + ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); } Y += src_rowstride; dest += dest_rowstride; @@ -569,10 +569,10 @@ gst_colorspace_yuv_to_rgb16 (GstColorspace * space, } #ifdef HAVE_LIBMMX -static mmx_t MMX_80w = (mmx_t) (long long) 0x0080008000800080LL; /*dd 00080 0080h, 000800080h */ +static mmx_t MMX_80w = (mmx_t) (long long) 0x0080008000800080LL; /*dd 00080 0080h, 000800080h */ -static mmx_t MMX_00FFw = (mmx_t) (long long) 0x00ff00ff00ff00ffLL; /*dd 000FF 00FFh, 000FF00FFh */ -static mmx_t MMX_FF00w = (mmx_t) (long long) 0xff00ff00ff00ff00LL; /*dd 000FF 00FFh, 000FF00FFh */ +static mmx_t MMX_00FFw = (mmx_t) (long long) 0x00ff00ff00ff00ffLL; /*dd 000FF 00FFh, 000FF00FFh */ +static mmx_t MMX_FF00w = (mmx_t) (long long) 0xff00ff00ff00ff00LL; /*dd 000FF 00FFh, 000FF00FFh */ static mmx_t MMX32_Vredcoeff = (mmx_t) (long long) 0x0059005900590059LL; static mmx_t MMX32_Ubluecoeff = (mmx_t) (long long) 0x0072007200720072LL; @@ -589,7 +589,7 @@ gst_colorspace_yuv_to_bgr32_mmx (tables, lum, cr, cb, out, rows, cols) int cols, rows; { - guint32 *row1 = (guint32 *) out; /* 32 bit target */ + guint32 *row1 = (guint32 *) out; /* 32 bit target */ int cols4 = cols >> 2; int y, x; @@ -598,108 +598,108 @@ gst_colorspace_yuv_to_bgr32_mmx (tables, lum, cr, cb, out, rows, cols) for (x = cols4; x; x--) { /* create Cr (result in mm1) */ - movd_m2r (*(mmx_t *) cb, mm1); /* 0 0 0 0 v3 v2 v1 v0 */ - pxor_r2r (mm7, mm7); /* 00 00 00 00 00 00 00 00 */ - movd_m2r (*(mmx_t *) lum, mm2); /* 0 0 0 0 l3 l2 l1 l0 */ - punpcklbw_r2r (mm7, mm1); /* 0 v3 0 v2 00 v1 00 v0 */ - punpckldq_r2r (mm1, mm1); /* 00 v1 00 v0 00 v1 00 v0 */ - psubw_m2r (MMX_80w, mm1); /* mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 */ + movd_m2r (*(mmx_t *) cb, mm1); /* 0 0 0 0 v3 v2 v1 v0 */ + pxor_r2r (mm7, mm7); /* 00 00 00 00 00 00 00 00 */ + movd_m2r (*(mmx_t *) lum, mm2); /* 0 0 0 0 l3 l2 l1 l0 */ + punpcklbw_r2r (mm7, mm1); /* 0 v3 0 v2 00 v1 00 v0 */ + punpckldq_r2r (mm1, mm1); /* 00 v1 00 v0 00 v1 00 v0 */ + psubw_m2r (MMX_80w, mm1); /* mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 */ /* create Cr_g (result in mm0) */ - movq_r2r (mm1, mm0); /* r1 r1 r0 r0 r1 r1 r0 r0 */ - pmullw_m2r (MMX32_Vgrncoeff, mm0); /* red*-46dec=0.7136*64 */ - pmullw_m2r (MMX32_Vredcoeff, mm1); /* red*89dec=1.4013*64 */ - psraw_i2r (6, mm0); /* red=red/64 */ - psraw_i2r (6, mm1); /* red=red/64 */ + movq_r2r (mm1, mm0); /* r1 r1 r0 r0 r1 r1 r0 r0 */ + pmullw_m2r (MMX32_Vgrncoeff, mm0); /* red*-46dec=0.7136*64 */ + pmullw_m2r (MMX32_Vredcoeff, mm1); /* red*89dec=1.4013*64 */ + psraw_i2r (6, mm0); /* red=red/64 */ + psraw_i2r (6, mm1); /* red=red/64 */ /* create L1 L2 (result in mm2,mm4) */ /* L2=lum+cols */ - movq_m2r (*(mmx_t *) (lum + cols), mm3); /* 0 0 0 0 L3 L2 L1 L0 */ - punpckldq_r2r (mm3, mm2); /* L3 L2 L1 L0 l3 l2 l1 l0 */ - movq_r2r (mm2, mm4); /* L3 L2 L1 L0 l3 l2 l1 l0 */ - pand_m2r (MMX_FF00w, mm2); /* L3 0 L1 0 l3 0 l1 0 */ - pand_m2r (MMX_00FFw, mm4); /* 0 L2 0 L0 0 l2 0 l0 */ - psrlw_i2r (8, mm2); /* 0 L3 0 L1 0 l3 0 l1 */ + movq_m2r (*(mmx_t *) (lum + cols), mm3); /* 0 0 0 0 L3 L2 L1 L0 */ + punpckldq_r2r (mm3, mm2); /* L3 L2 L1 L0 l3 l2 l1 l0 */ + movq_r2r (mm2, mm4); /* L3 L2 L1 L0 l3 l2 l1 l0 */ + pand_m2r (MMX_FF00w, mm2); /* L3 0 L1 0 l3 0 l1 0 */ + pand_m2r (MMX_00FFw, mm4); /* 0 L2 0 L0 0 l2 0 l0 */ + psrlw_i2r (8, mm2); /* 0 L3 0 L1 0 l3 0 l1 */ /* create R (result in mm6) */ - movq_r2r (mm2, mm5); /* 0 L3 0 L1 0 l3 0 l1 */ - movq_r2r (mm4, mm6); /* 0 L2 0 L0 0 l2 0 l0 */ - paddsw_r2r (mm1, mm5); /* lum1+red:x R3 x R1 x r3 x r1 */ - paddsw_r2r (mm1, mm6); /* lum1+red:x R2 x R0 x r2 x r0 */ - packuswb_r2r (mm5, mm5); /* R3 R1 r3 r1 R3 R1 r3 r1 */ - packuswb_r2r (mm6, mm6); /* R2 R0 r2 r0 R2 R0 r2 r0 */ - pxor_r2r (mm7, mm7); /* 00 00 00 00 00 00 00 00 */ - punpcklbw_r2r (mm5, mm6); /* R3 R2 R1 R0 r3 r2 r1 r0 */ + movq_r2r (mm2, mm5); /* 0 L3 0 L1 0 l3 0 l1 */ + movq_r2r (mm4, mm6); /* 0 L2 0 L0 0 l2 0 l0 */ + paddsw_r2r (mm1, mm5); /* lum1+red:x R3 x R1 x r3 x r1 */ + paddsw_r2r (mm1, mm6); /* lum1+red:x R2 x R0 x r2 x r0 */ + packuswb_r2r (mm5, mm5); /* R3 R1 r3 r1 R3 R1 r3 r1 */ + packuswb_r2r (mm6, mm6); /* R2 R0 r2 r0 R2 R0 r2 r0 */ + pxor_r2r (mm7, mm7); /* 00 00 00 00 00 00 00 00 */ + punpcklbw_r2r (mm5, mm6); /* R3 R2 R1 R0 r3 r2 r1 r0 */ /* create Cb (result in mm1) */ - movd_m2r (*(mmx_t *) cr, mm1); /* 0 0 0 0 u3 u2 u1 u0 */ - punpcklbw_r2r (mm7, mm1); /* 0 u3 0 u2 00 u1 00 u0 */ - punpckldq_r2r (mm1, mm1); /* 00 u1 00 u0 00 u1 00 u0 */ - psubw_m2r (MMX_80w, mm1); /* mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 */ + movd_m2r (*(mmx_t *) cr, mm1); /* 0 0 0 0 u3 u2 u1 u0 */ + punpcklbw_r2r (mm7, mm1); /* 0 u3 0 u2 00 u1 00 u0 */ + punpckldq_r2r (mm1, mm1); /* 00 u1 00 u0 00 u1 00 u0 */ + psubw_m2r (MMX_80w, mm1); /* mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 */ /* create Cb_g (result in mm5) */ - movq_r2r (mm1, mm5); /* u1 u1 u0 u0 u1 u1 u0 u0 */ - pmullw_m2r (MMX32_Ugrncoeff, mm5); /* blue*-109dec=1.7129*64 */ - pmullw_m2r (MMX32_Ubluecoeff, mm1); /* blue*114dec=1.78125*64 */ - psraw_i2r (6, mm5); /* blue=red/64 */ - psraw_i2r (6, mm1); /* blue=blue/64 */ + movq_r2r (mm1, mm5); /* u1 u1 u0 u0 u1 u1 u0 u0 */ + pmullw_m2r (MMX32_Ugrncoeff, mm5); /* blue*-109dec=1.7129*64 */ + pmullw_m2r (MMX32_Ubluecoeff, mm1); /* blue*114dec=1.78125*64 */ + psraw_i2r (6, mm5); /* blue=red/64 */ + psraw_i2r (6, mm1); /* blue=blue/64 */ /* create G (result in mm7) */ - movq_r2r (mm2, mm3); /* 0 L3 0 L1 0 l3 0 l1 */ - movq_r2r (mm4, mm7); /* 0 L2 0 L0 0 l2 0 l1 */ - paddsw_r2r (mm5, mm3); /* lum1+Cb_g:x G3t x G1t x g3t x g1t */ - paddsw_r2r (mm5, mm7); /* lum1+Cb_g:x G2t x G0t x g2t x g0t */ - paddsw_r2r (mm0, mm3); /* lum1+Cr_g:x G3 x G1 x g3 x g1 */ - paddsw_r2r (mm0, mm7); /* lum1+blue:x G2 x G0 x g2 x g0 */ - packuswb_r2r (mm3, mm3); /* G3 G1 g3 g1 G3 G1 g3 g1 */ - packuswb_r2r (mm7, mm7); /* G2 G0 g2 g0 G2 G0 g2 g0 */ - punpcklbw_r2r (mm3, mm7); /* G3 G2 G1 G0 g3 g2 g1 g0 */ + movq_r2r (mm2, mm3); /* 0 L3 0 L1 0 l3 0 l1 */ + movq_r2r (mm4, mm7); /* 0 L2 0 L0 0 l2 0 l1 */ + paddsw_r2r (mm5, mm3); /* lum1+Cb_g:x G3t x G1t x g3t x g1t */ + paddsw_r2r (mm5, mm7); /* lum1+Cb_g:x G2t x G0t x g2t x g0t */ + paddsw_r2r (mm0, mm3); /* lum1+Cr_g:x G3 x G1 x g3 x g1 */ + paddsw_r2r (mm0, mm7); /* lum1+blue:x G2 x G0 x g2 x g0 */ + packuswb_r2r (mm3, mm3); /* G3 G1 g3 g1 G3 G1 g3 g1 */ + packuswb_r2r (mm7, mm7); /* G2 G0 g2 g0 G2 G0 g2 g0 */ + punpcklbw_r2r (mm3, mm7); /* G3 G2 G1 G0 g3 g2 g1 g0 */ /* create B (result in mm5) */ - movq_r2r (mm2, mm3); /* 0 L3 0 L1 0 l3 0 l1 */ - movq_r2r (mm4, mm5); /* 0 L2 0 L0 0 l2 0 l1 */ - paddsw_r2r (mm1, mm3); /* lum1+blue:x B3 x B1 x b3 x b1 */ - paddsw_r2r (mm1, mm5); /* lum1+blue:x B2 x B0 x b2 x b0 */ - packuswb_r2r (mm3, mm3); /* B3 B1 b3 b1 B3 B1 b3 b1 */ - packuswb_r2r (mm5, mm5); /* B2 B0 b2 b0 B2 B0 b2 b0 */ - punpcklbw_r2r (mm3, mm5); /* B3 B2 B1 B0 b3 b2 b1 b0 */ + movq_r2r (mm2, mm3); /* 0 L3 0 L1 0 l3 0 l1 */ + movq_r2r (mm4, mm5); /* 0 L2 0 L0 0 l2 0 l1 */ + paddsw_r2r (mm1, mm3); /* lum1+blue:x B3 x B1 x b3 x b1 */ + paddsw_r2r (mm1, mm5); /* lum1+blue:x B2 x B0 x b2 x b0 */ + packuswb_r2r (mm3, mm3); /* B3 B1 b3 b1 B3 B1 b3 b1 */ + packuswb_r2r (mm5, mm5); /* B2 B0 b2 b0 B2 B0 b2 b0 */ + punpcklbw_r2r (mm3, mm5); /* B3 B2 B1 B0 b3 b2 b1 b0 */ /* fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */ - pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ - pxor_r2r (mm4, mm4); /* 0 0 0 0 0 0 0 0 */ - movq_r2r (mm6, mm1); /* R3 R2 R1 R0 r3 r2 r1 r0 */ - movq_r2r (mm5, mm3); /* B3 B2 B1 B0 b3 b2 b1 b0 */ + pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ + pxor_r2r (mm4, mm4); /* 0 0 0 0 0 0 0 0 */ + movq_r2r (mm6, mm1); /* R3 R2 R1 R0 r3 r2 r1 r0 */ + movq_r2r (mm5, mm3); /* B3 B2 B1 B0 b3 b2 b1 b0 */ /* process lower lum */ - punpcklbw_r2r (mm4, mm1); /* 0 r3 0 r2 0 r1 0 r0 */ - punpcklbw_r2r (mm4, mm3); /* 0 b3 0 b2 0 b1 0 b0 */ - movq_r2r (mm1, mm2); /* 0 r3 0 r2 0 r1 0 r0 */ - movq_r2r (mm3, mm0); /* 0 b3 0 b2 0 b1 0 b0 */ - punpcklwd_r2r (mm1, mm3); /* 0 r1 0 b1 0 r0 0 b0 */ - punpckhwd_r2r (mm2, mm0); /* 0 r3 0 b3 0 r2 0 b2 */ + punpcklbw_r2r (mm4, mm1); /* 0 r3 0 r2 0 r1 0 r0 */ + punpcklbw_r2r (mm4, mm3); /* 0 b3 0 b2 0 b1 0 b0 */ + movq_r2r (mm1, mm2); /* 0 r3 0 r2 0 r1 0 r0 */ + movq_r2r (mm3, mm0); /* 0 b3 0 b2 0 b1 0 b0 */ + punpcklwd_r2r (mm1, mm3); /* 0 r1 0 b1 0 r0 0 b0 */ + punpckhwd_r2r (mm2, mm0); /* 0 r3 0 b3 0 r2 0 b2 */ - pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ - movq_r2r (mm7, mm1); /* G3 G2 G1 G0 g3 g2 g1 g0 */ - punpcklbw_r2r (mm1, mm2); /* g3 0 g2 0 g1 0 g0 0 */ - punpcklwd_r2r (mm4, mm2); /* 0 0 g1 0 0 0 g0 0 */ - por_r2r (mm3, mm2); /* 0 r1 g1 b1 0 r0 g0 b0 */ - movq_r2m (mm2, *(mmx_t *) row1); /* wrote out ! row1 */ + pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ + movq_r2r (mm7, mm1); /* G3 G2 G1 G0 g3 g2 g1 g0 */ + punpcklbw_r2r (mm1, mm2); /* g3 0 g2 0 g1 0 g0 0 */ + punpcklwd_r2r (mm4, mm2); /* 0 0 g1 0 0 0 g0 0 */ + por_r2r (mm3, mm2); /* 0 r1 g1 b1 0 r0 g0 b0 */ + movq_r2m (mm2, *(mmx_t *) row1); /* wrote out ! row1 */ - pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ - punpcklbw_r2r (mm1, mm4); /* g3 0 g2 0 g1 0 g0 0 */ - punpckhwd_r2r (mm2, mm4); /* 0 0 g3 0 0 0 g2 0 */ - por_r2r (mm0, mm4); /* 0 r3 g3 b3 0 r2 g2 b2 */ - movq_r2m (mm4, *(mmx_t *) (row1 + 2)); /* wrote out ! row1 */ + pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ + punpcklbw_r2r (mm1, mm4); /* g3 0 g2 0 g1 0 g0 0 */ + punpckhwd_r2r (mm2, mm4); /* 0 0 g3 0 0 0 g2 0 */ + por_r2r (mm0, mm4); /* 0 r3 g3 b3 0 r2 g2 b2 */ + movq_r2m (mm4, *(mmx_t *) (row1 + 2)); /* wrote out ! row1 */ /* fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */ /* this can be done "destructive" */ - pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ - punpckhbw_r2r (mm2, mm6); /* 0 R3 0 R2 0 R1 0 R0 */ - punpckhbw_r2r (mm1, mm5); /* G3 B3 G2 B2 G1 B1 G0 B0 */ - movq_r2r (mm5, mm1); /* G3 B3 G2 B2 G1 B1 G0 B0 */ - punpcklwd_r2r (mm6, mm1); /* 0 R1 G1 B1 0 R0 G0 B0 */ - movq_r2m (mm1, *(mmx_t *) (row1 + cols)); /* wrote out ! row2 */ - punpckhwd_r2r (mm6, mm5); /* 0 R3 G3 B3 0 R2 G2 B2 */ - movq_r2m (mm5, *(mmx_t *) (row1 + cols + 2)); /* wrote out ! row2 */ + pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ + punpckhbw_r2r (mm2, mm6); /* 0 R3 0 R2 0 R1 0 R0 */ + punpckhbw_r2r (mm1, mm5); /* G3 B3 G2 B2 G1 B1 G0 B0 */ + movq_r2r (mm5, mm1); /* G3 B3 G2 B2 G1 B1 G0 B0 */ + punpcklwd_r2r (mm6, mm1); /* 0 R1 G1 B1 0 R0 G0 B0 */ + movq_r2m (mm1, *(mmx_t *) (row1 + cols)); /* wrote out ! row2 */ + punpckhwd_r2r (mm6, mm5); /* 0 R3 G3 B3 0 R2 G2 B2 */ + movq_r2m (mm5, *(mmx_t *) (row1 + cols + 2)); /* wrote out ! row2 */ lum += 4; cr += 2; diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c index 8b174e39a4..93a2bdb2a0 100644 --- a/gst/deinterlace/gstdeinterlace.c +++ b/gst/deinterlace/gstdeinterlace.c @@ -99,9 +99,10 @@ gst_deinterlace_get_type (void) 0, (GInstanceInitFunc) gst_deinterlace_init, }; + deinterlace_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstDeInterlace", - &deinterlace_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstDeInterlace", + &deinterlace_info, 0); } return deinterlace_type; } @@ -130,10 +131,10 @@ gst_deinterlace_class_init (GstDeInterlaceClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DI_ONLY, g_param_spec_boolean ("di_area_only", "di_area_only", "di_area_only", TRUE, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BLEND, g_param_spec_boolean ("blend", "blend", "blend", TRUE, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_THRESHOLD, g_param_spec_int ("threshold", "threshold", "threshold", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_EDGE_DETECT, g_param_spec_int ("edge_detect", "edge_detect", "edge_detect", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DI_ONLY, g_param_spec_boolean ("di_area_only", "di_area_only", "di_area_only", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BLEND, g_param_spec_boolean ("blend", "blend", "blend", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_THRESHOLD, g_param_spec_int ("threshold", "threshold", "threshold", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_EDGE_DETECT, g_param_spec_int ("edge_detect", "edge_detect", "edge_detect", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = gst_deinterlace_set_property; gobject_class->get_property = gst_deinterlace_get_property; @@ -227,7 +228,7 @@ gst_deinterlace_chain (GstPad * pad, GstData * _data) memcpy (filter->src, yuvptr, filter->picsize); - y_dst = yuvptr; /* dst y pointer */ + y_dst = yuvptr; /* dst y pointer */ /* we should not change u,v because one u, v value stands for */ /* 2 pixels per 2 lines = 4 pixel and we don't want to change */ /* the color of */ @@ -241,7 +242,7 @@ gst_deinterlace_chain (GstPad * pad, GstData * _data) iEdgeDetect = 180; iEdgeDetect = iEdgeDetect * iEdgeDetect; - y1 = 0; /* Avoid compiler warning. The value is not used. */ + y1 = 0; /* Avoid compiler warning. The value is not used. */ for (x = 0; x < width; x++) { psrc3 = y_src + x; y3 = *psrc3; @@ -257,49 +258,49 @@ gst_deinterlace_chain (GstPad * pad, GstData * _data) y1 = y2; y2 = y3; if (y < height - 1) { - y3 = *psrc3; + y3 = *psrc3; } else { - y3 = y1; + y3 = y1; } iInterlaceValue0 = iInterlaceValue1; iInterlaceValue1 = iInterlaceValue2; if (y < height) - iInterlaceValue2 = ((y1 - y2) * (y3 - y2) - - ((iEdgeDetect * (y1 - y3) * (y1 - y3)) >> 12)) * 10; + iInterlaceValue2 = ((y1 - y2) * (y3 - y2) - + ((iEdgeDetect * (y1 - y3) * (y1 - y3)) >> 12)) * 10; else - iInterlaceValue2 = 0; + iInterlaceValue2 = 0; if (y > 0) { - if (iInterlaceValue0 + 2 * iInterlaceValue1 + iInterlaceValue2 > - iThreshold) { - if (bBlend) { - *pdst1 = (unsigned char) ((y0 + 2 * y1 + y2) >> 2); - } else { - /* this method seems to work better than blending if the */ - /* quality is pretty bad and the half pics don't fit together */ - if ((y % 2) == 1) { /* if odd simply copy the value */ - *pdst1 = *psrc1; - /**pdst1 = 0; // FIXME this is for adjusting an initial iThreshold */ - } else { /* even interpolate the even line (upper + lower)/2 */ - *pdst1 = (unsigned char) ((y0 + y2) >> 1); - /**pdst1 = 0; // FIXME this is for adjusting an initial iThreshold */ - } - } - } else { - /* so we went below the treshold and therefore we don't have to */ - /* change anything */ - if (bShowDeinterlacedAreaOnly) { - /* this is for testing to see how we should tune the treshhold */ - /* and shows as the things that haven't change because the */ - /* threshhold was to low?? (or shows that everything is ok :-) */ - *pdst1 = 0; /* blank the point and so the interlac area */ - } else { - *pdst1 = *psrc1; - } - } - pdst1 = pdst1 + y_line; + if (iInterlaceValue0 + 2 * iInterlaceValue1 + iInterlaceValue2 > + iThreshold) { + if (bBlend) { + *pdst1 = (unsigned char) ((y0 + 2 * y1 + y2) >> 2); + } else { + /* this method seems to work better than blending if the */ + /* quality is pretty bad and the half pics don't fit together */ + if ((y % 2) == 1) { /* if odd simply copy the value */ + *pdst1 = *psrc1; + /**pdst1 = 0; // FIXME this is for adjusting an initial iThreshold */ + } else { /* even interpolate the even line (upper + lower)/2 */ + *pdst1 = (unsigned char) ((y0 + y2) >> 1); + /**pdst1 = 0; // FIXME this is for adjusting an initial iThreshold */ + } + } + } else { + /* so we went below the treshold and therefore we don't have to */ + /* change anything */ + if (bShowDeinterlacedAreaOnly) { + /* this is for testing to see how we should tune the treshhold */ + /* and shows as the things that haven't change because the */ + /* threshhold was to low?? (or shows that everything is ok :-) */ + *pdst1 = 0; /* blank the point and so the interlac area */ + } else { + *pdst1 = *psrc1; + } + } + pdst1 = pdst1 + y_line; } } } @@ -370,7 +371,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "deinterlace", GST_RANK_NONE, - gst_deinterlace_get_type ())) + gst_deinterlace_get_type ())) return FALSE; return TRUE; diff --git a/gst/festival/gstfestival.c b/gst/festival/gstfestival.c index 977455bda3..a7b6dad038 100644 --- a/gst/festival/gstfestival.c +++ b/gst/festival/gstfestival.c @@ -107,10 +107,10 @@ GST_STATIC_PAD_TEMPLATE ("festival_src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) TRUE, " - "width = (int) 16, " - "depth = (int) 16, " "rate = (int) 16000, " "channels = (int) 1") + "endianness = (int) BYTE_ORDER, " + "signed = (boolean) TRUE, " + "width = (int) 16, " + "depth = (int) 16, " "rate = (int) 16000, " "channels = (int) 1") ); /* Festival signals and args */ @@ -147,9 +147,10 @@ gst_festival_get_type (void) 0, (GInstanceInitFunc) gst_festival_init, }; + festival_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstFestival", &festival_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstFestival", &festival_info, + 0); } return festival_type; } @@ -241,12 +242,12 @@ gst_festival_chain (GstPad * pad, GstData * _data) for (n = 0; n < 3;) n += read (festival->info->server_fd, ack + n, 3 - n); ack[3] = '\0'; - if (strcmp (ack, "WV\n") == 0) /* receive a waveform */ + if (strcmp (ack, "WV\n") == 0) /* receive a waveform */ wavefile = - socket_receive_file_to_buff (festival->info->server_fd, &filesize); - else if (strcmp (ack, "LP\n") == 0) /* receive an s-expr */ + socket_receive_file_to_buff (festival->info->server_fd, &filesize); + else if (strcmp (ack, "LP\n") == 0) /* receive an s-expr */ client_accept_s_expr (festival->info->server_fd); - else if (strcmp (ack, "ER\n") == 0) { /* server got an error */ + else if (strcmp (ack, "ER\n") == 0) { /* server got an error */ fprintf (stderr, "festival_client: server returned error\n"); break; } @@ -337,7 +338,7 @@ socket_receive_file_to_buff (int fd, int *size) /* Festival key stuff technique, but long winded I know, sorry */ /* but will receive any file without closeing the stream or */ /* using OOB data */ - static const char *file_stuff_key = "ft_StUfF_key"; /* must == Festival's key */ + static const char *file_stuff_key = "ft_StUfF_key"; /* must == Festival's key */ char *buff; int bufflen; int n, k, i; @@ -350,7 +351,7 @@ socket_receive_file_to_buff (int fd, int *size) for (k = 0; file_stuff_key[k] != '\0';) { n = read (fd, &c, 1); if (n == 0) - break; /* hit stream eof before end of file */ + break; /* hit stream eof before end of file */ if ((*size) + k + 1 >= bufflen) { /* +1 so you can add a NULL if you want */ bufflen += bufflen / 4; @@ -361,12 +362,12 @@ socket_receive_file_to_buff (int fd, int *size) else if ((c == 'X') && (file_stuff_key[k + 1] == '\0')) { /* It looked like the key but wasn't */ for (i = 0; i < k; i++, (*size)++) - buff[*size] = file_stuff_key[i]; + buff[*size] = file_stuff_key[i]; k = 0; /* omit the stuffed 'X' */ } else { for (i = 0; i < k; i++, (*size)++) - buff[*size] = file_stuff_key[i]; + buff[*size] = file_stuff_key[i]; k = 0; buff[*size] = c; (*size)++; @@ -419,7 +420,7 @@ gst_festival_change_state (GstElement * element) } else { if (!GST_FLAG_IS_SET (element, GST_FESTIVAL_OPEN)) { if (!gst_festival_open (GST_FESTIVAL (element))) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; } } @@ -433,7 +434,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "festival", GST_RANK_NONE, - GST_TYPE_FESTIVAL)) + GST_TYPE_FESTIVAL)) return FALSE; return TRUE; diff --git a/gst/filter/gstbpwsinc.c b/gst/filter/gstbpwsinc.c index a848cc26cf..ba0f2d67f6 100644 --- a/gst/filter/gstbpwsinc.c +++ b/gst/filter/gstbpwsinc.c @@ -35,8 +35,8 @@ #endif #include #include "gstfilter.h" -#include /* M_PI */ -#include /* memmove */ +#include /* M_PI */ +#include /* memmove */ /* elementfactory information */ static GstElementDetails gst_bpwsinc_details = GST_ELEMENT_DETAILS ("BPWSinc", @@ -80,10 +80,10 @@ struct _GstBPWSinc double frequency; double lower_frequency, upper_frequency; - int wing_size; /* length of a "wing" of the filter; - actual length is 2 * wing_size + 1 */ + int wing_size; /* length of a "wing" of the filter; + actual length is 2 * wing_size + 1 */ - gfloat *residue; /* buffer for left-over samples from previous buffer */ + gfloat *residue; /* buffer for left-over samples from previous buffer */ double *kernel; }; @@ -125,7 +125,7 @@ gst_bpwsinc_get_type (void) }; bpwsinc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstBPWSinc", - &bpwsinc_info, 0); + &bpwsinc_info, 0); } return bpwsinc_type; } @@ -157,16 +157,16 @@ gst_bpwsinc_class_init (GstBPWSincClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOWER_FREQUENCY, g_param_spec_double ("lower-frequency", "Lower Frequency", - "Cut-off lower frequency (relative to sample rate)", - 0.0, 0.5, 0, G_PARAM_READWRITE)); + "Cut-off lower frequency (relative to sample rate)", + 0.0, 0.5, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_UPPER_FREQUENCY, g_param_spec_double ("upper-frequency", "Upper Frequency", - "Cut-off upper frequency (relative to sample rate)", - 0.0, 0.5, 0, G_PARAM_READWRITE)); + "Cut-off upper frequency (relative to sample rate)", + 0.0, 0.5, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LENGTH, g_param_spec_int ("length", "Length", - "N such that the filter length = 2N + 1", - 1, G_MAXINT, 1, G_PARAM_READWRITE)); + "N such that the filter length = 2N + 1", + 1, G_MAXINT, 1, G_PARAM_READWRITE)); gobject_class->set_property = gst_bpwsinc_set_property; gobject_class->get_property = gst_bpwsinc_get_property; @@ -213,17 +213,17 @@ gst_bpwsinc_sink_connect (GstPad * pad, const GstCaps * caps) len = filter->wing_size; /* fill the lp kernel */ GST_DEBUG ("bpwsinc: initializing LP kernel of length %d with cut-off %f", - len * 2 + 1, filter->lower_frequency); + len * 2 + 1, filter->lower_frequency); kernel_lp = (double *) g_malloc (sizeof (double) * (2 * len + 1)); for (i = 0; i <= len * 2; ++i) { if (i == len) - kernel_lp[i] = 2 * M_PI * filter->lower_frequency; + kernel_lp[i] = 2 * M_PI * filter->lower_frequency; else - kernel_lp[i] = sin (2 * M_PI * filter->lower_frequency * (i - len)) - / (i - len); + kernel_lp[i] = sin (2 * M_PI * filter->lower_frequency * (i - len)) + / (i - len); /* Blackman windowing */ kernel_lp[i] *= (0.42 - 0.5 * cos (M_PI * i / len) - + 0.08 * cos (2 * M_PI * i / len)); + + 0.08 * cos (2 * M_PI * i / len)); } /* normalize for unity gain at DC @@ -236,17 +236,17 @@ gst_bpwsinc_sink_connect (GstPad * pad, const GstCaps * caps) /* fill the hp kernel */ GST_DEBUG ("bpwsinc: initializing HP kernel of length %d with cut-off %f", - len * 2 + 1, filter->upper_frequency); + len * 2 + 1, filter->upper_frequency); kernel_hp = (double *) g_malloc (sizeof (double) * (2 * len + 1)); for (i = 0; i <= len * 2; ++i) { if (i == len) - kernel_hp[i] = 2 * M_PI * filter->upper_frequency; + kernel_hp[i] = 2 * M_PI * filter->upper_frequency; else - kernel_hp[i] = sin (2 * M_PI * filter->upper_frequency * (i - len)) - / (i - len); + kernel_hp[i] = sin (2 * M_PI * filter->upper_frequency * (i - len)) + / (i - len); /* Blackman windowing */ kernel_hp[i] *= (0.42 - 0.5 * cos (M_PI * i / len) - + 0.08 * cos (2 * M_PI * i / len)); + + 0.08 * cos (2 * M_PI * i / len)); } /* normalize for unity gain at DC diff --git a/gst/filter/gstfilter.c b/gst/filter/gstfilter.c index f723ae6337..0fbc9609ca 100644 --- a/gst/filter/gstfilter.c +++ b/gst/filter/gstfilter.c @@ -59,7 +59,7 @@ plugin_init (GstPlugin * plugin) while (_elements[i].name) { if (!gst_element_register (plugin, _elements[i].name, GST_RANK_NONE, - _elements[i].type ())) + _elements[i].type ())) return FALSE; i++; diff --git a/gst/filter/gstiir.c b/gst/filter/gstiir.c index 5e44f3d0fd..2f69ae6a98 100644 --- a/gst/filter/gstiir.c +++ b/gst/filter/gstiir.c @@ -109,7 +109,7 @@ gst_iir_get_type (void) }; iir_type = g_type_register_static (GST_TYPE_ELEMENT, "GstIIR", - &iir_info, 0); + &iir_info, 0); } return iir_type; } @@ -141,16 +141,16 @@ gst_iir_class_init (GstIIRClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_A, g_param_spec_double ("A", "A", "A filter coefficient", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); + -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_B, g_param_spec_double ("B", "B", "B filter coefficient", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); + -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_GAIN, g_param_spec_double ("gain", "Gain", "Filter gain", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); + -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STAGES, g_param_spec_int ("stages", "Stages", "Number of filter stages", - 1, G_MAXINT, 1, G_PARAM_READWRITE)); + 1, G_MAXINT, 1, G_PARAM_READWRITE)); gobject_class->set_property = gst_iir_set_property; gobject_class->get_property = gst_iir_get_property; @@ -173,7 +173,7 @@ gst_iir_init (GstIIR * filter) filter->A = 0.0; filter->B = 0.0; - filter->gain = 1.0; /* unity gain as default */ + filter->gain = 1.0; /* unity gain as default */ filter->stages = 1; filter->state = NULL; } @@ -192,7 +192,7 @@ gst_iir_sink_connect (GstPad * pad, const GstCaps * caps) /* FIXME: remember to free it */ filter->state = (IIR_state *) g_malloc (sizeof (IIR_state)); IIR_init (filter->state, filter->stages, - filter->gain, &(filter->A), &(filter->B)); + filter->gain, &(filter->A), &(filter->B)); } return set_retval; diff --git a/gst/filter/gstlpwsinc.c b/gst/filter/gstlpwsinc.c index 0ce33b32c1..285c2edb9e 100644 --- a/gst/filter/gstlpwsinc.c +++ b/gst/filter/gstlpwsinc.c @@ -35,8 +35,8 @@ #endif #include #include "gstfilter.h" -#include /* M_PI */ -#include /* memmove */ +#include /* M_PI */ +#include /* memmove */ static GstElementDetails gst_lpwsinc_details = GST_ELEMENT_DETAILS ("LPWSinc", "Filter/Effect/Audio", @@ -77,10 +77,10 @@ struct _GstLPWSinc GstPad *sinkpad, *srcpad; double frequency; - int wing_size; /* length of a "wing" of the filter; - actual length is 2 * wing_size + 1 */ + int wing_size; /* length of a "wing" of the filter; + actual length is 2 * wing_size + 1 */ - gfloat *residue; /* buffer for left-over samples from previous buffer */ + gfloat *residue; /* buffer for left-over samples from previous buffer */ double *kernel; }; @@ -122,7 +122,7 @@ gst_lpwsinc_get_type (void) }; lpwsinc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstLPWSinc", - &lpwsinc_info, 0); + &lpwsinc_info, 0); } return lpwsinc_type; } @@ -154,12 +154,12 @@ gst_lpwsinc_class_init (GstLPWSincClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FREQUENCY, g_param_spec_double ("frequency", "Frequency", - "Cut-off Frequency relative to sample rate)", - 0.0, 0.5, 0, G_PARAM_READWRITE)); + "Cut-off Frequency relative to sample rate)", + 0.0, 0.5, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LENGTH, g_param_spec_int ("length", "Length", - "N such that the filter length = 2N + 1", - 1, G_MAXINT, 1, G_PARAM_READWRITE)); + "N such that the filter length = 2N + 1", + 1, G_MAXINT, 1, G_PARAM_READWRITE)); gobject_class->set_property = gst_lpwsinc_set_property; gobject_class->get_property = gst_lpwsinc_get_property; @@ -210,10 +210,10 @@ gst_lpwsinc_sink_connect (GstPad * pad, const GstCaps * caps) for (i = 0; i <= len * 2; ++i) { if (i == len) - filter->kernel[i] = 2 * M_PI * filter->frequency; + filter->kernel[i] = 2 * M_PI * filter->frequency; else - filter->kernel[i] = sin (2 * M_PI * filter->frequency * (i - len)) - / (i - len); + filter->kernel[i] = sin (2 * M_PI * filter->frequency * (i - len)) + / (i - len); /* windowing */ filter->kernel[i] *= (0.54 - 0.46 * cos (M_PI * i / len)); } diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c index a84ce2d268..b269496258 100644 --- a/gst/flx/gstflxdec.c +++ b/gst/flx/gstflxdec.c @@ -103,8 +103,9 @@ gst_flxdec_get_type (void) 0, (GInstanceInitFunc) gst_flxdec_init, }; + flxdec_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstFlxDec", &flxdec_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstFlxDec", &flxdec_info, 0); } return flxdec_type; } @@ -172,44 +173,44 @@ flx_decode_chunks (GstFlxDec * flxdec, gulong count, gchar * data, gchar * dest) switch (hdr->id) { case FLX_COLOR64: - flx_decode_color (flxdec, data, dest, 2); - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + flx_decode_color (flxdec, data, dest, 2); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; case FLX_COLOR256: - flx_decode_color (flxdec, data, dest, 0); - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + flx_decode_color (flxdec, data, dest, 0); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; case FLX_BRUN: - flx_decode_brun (flxdec, data, dest); - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + flx_decode_brun (flxdec, data, dest); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; case FLX_LC: - flx_decode_delta_fli (flxdec, data, dest); - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + flx_decode_delta_fli (flxdec, data, dest); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; case FLX_SS2: - flx_decode_delta_flc (flxdec, data, dest); - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + flx_decode_delta_flc (flxdec, data, dest); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; case FLX_BLACK: - memset (dest, 0, flxdec->size); - break; + memset (dest, 0, flxdec->size); + break; case FLX_MINI: - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; default: - g_print ("GstFlxDec: Unimplented chunk type: 0x%02x size: %d\n", - hdr->id, hdr->size); - g_print ("GstFlxDec: Skipping...\n"); - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + g_print ("GstFlxDec: Unimplented chunk type: 0x%02x size: %d\n", + hdr->id, hdr->size); + g_print ("GstFlxDec: Skipping...\n"); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; } } } @@ -266,20 +267,20 @@ flx_decode_brun (GstFlxDec * flxdec, guchar * data, guchar * dest) count = *data++; if (count > 0x7f) { - /* literal run */ - count = 0x100 - count; - row -= count; + /* literal run */ + count = 0x100 - count; + row -= count; - while (count--) - *dest++ = *data++; + while (count--) + *dest++ = *data++; } else { - /* replicate run */ - row -= count; - x = *data++; + /* replicate run */ + row -= count; + x = *data++; - while (count--) - *dest++ = x; + while (count--) + *dest++ = x; } } } @@ -320,17 +321,17 @@ flx_decode_delta_fli (GstFlxDec * flxdec, guchar * data, guchar * dest) count = *data++; if (count > 0x7f) { - /* literal run */ - count = 0x100 - count; - x = *data++; + /* literal run */ + count = 0x100 - count; + x = *data++; - while (count--) - *dest++ = x; + while (count--) + *dest++ = x; } else { - /* replicate run */ - while (count--) - *dest++ = *data++; + /* replicate run */ + while (count--) + *dest++ = *data++; } } start_p += flxdec->hdr.width; @@ -365,13 +366,13 @@ flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) while ((opcode = (data[0] + (data[1] << 8))) & 0xc000) { data += 2; if ((opcode & 0xc000) == 0xc000) { - /* skip count */ - start_l += (0x10000 - opcode); - dest += flxdec->hdr.width * (0x10000 - opcode); + /* skip count */ + start_l += (0x10000 - opcode); + dest += flxdec->hdr.width * (0x10000 - opcode); } else { - /* last pixel */ - dest += flxdec->hdr.width; - *dest++ = (opcode & 0xff); + /* last pixel */ + dest += flxdec->hdr.width; + *dest++ = (opcode & 0xff); } } data += 2; @@ -385,19 +386,19 @@ flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) count = *data++; if (count > 0x7f) { - /* replicate word run */ - count = 0x100 - count; - while (count--) { - *dest++ = data[0]; - *dest++ = data[1]; - } - data += 2; + /* replicate word run */ + count = 0x100 - count; + while (count--) { + *dest++ = data[0]; + *dest++ = data[1]; + } + data += 2; } else { - /* literal word run */ - while (count--) { - *dest++ = *data++; - *dest++ = *data++; - } + /* literal word run */ + while (count--) { + *dest++ = *data++; + *dest++ = *data++; + } } } lines--; @@ -462,9 +463,9 @@ gst_flxdec_loop (GstElement * element) /* check header */ if (flxh->type != FLX_MAGICHDR_FLI && - flxh->type != FLX_MAGICHDR_FLC && flxh->type != FLX_MAGICHDR_FLX) { + flxh->type != FLX_MAGICHDR_FLC && flxh->type != FLX_MAGICHDR_FLX) { GST_ELEMENT_ERROR (element, STREAM, WRONG_TYPE, (NULL), - ("not a flx file (type %d)\n", flxh->type)); + ("not a flx file (type %d)\n", flxh->type)); return; } @@ -486,13 +487,13 @@ gst_flxdec_loop (GstElement * element) caps = gst_caps_from_string (GST_VIDEO_CAPS_xRGB_HOST_ENDIAN); gst_caps_set_simple (caps, - "width", G_TYPE_INT, flxh->width, - "height", G_TYPE_INT, flxh->height, - "framerate", G_TYPE_DOUBLE, GST_SECOND / flxdec->frame_time, NULL); + "width", G_TYPE_INT, flxh->width, + "height", G_TYPE_INT, flxh->height, + "framerate", G_TYPE_DOUBLE, GST_SECOND / flxdec->frame_time, NULL); if (flxh->depth <= 8) flxdec->converter = - flx_colorspace_converter_new (flxh->width, flxh->height); + flx_colorspace_converter_new (flxh->width, flxh->height); if (flxh->type == FLX_MAGICHDR_FLC || flxh->type == FLX_MAGICHDR_FLX) { g_print ("GstFlxDec: (FLC) aspect_dx : %d\n", flxh->aspect_dx); @@ -523,41 +524,41 @@ gst_flxdec_loop (GstElement * element) switch (flxfh->id) { case FLX_FRAME_TYPE: - buf = flx_get_data (flxdec, flxfh->size - FlxFrameChunkSize); + buf = flx_get_data (flxdec, flxfh->size - FlxFrameChunkSize); - chunk = GST_BUFFER_DATA (buf); + chunk = GST_BUFFER_DATA (buf); - if (((FlxFrameType *) chunk)->chunks == 0) - break; + if (((FlxFrameType *) chunk)->chunks == 0) + break; - /* create 32 bits output frame */ - out = gst_buffer_new (); - GST_BUFFER_DATA (out) = g_malloc (flxdec->size * 4); - GST_BUFFER_SIZE (out) = flxdec->size * 4; + /* create 32 bits output frame */ + out = gst_buffer_new (); + GST_BUFFER_DATA (out) = g_malloc (flxdec->size * 4); + GST_BUFFER_SIZE (out) = flxdec->size * 4; - /* decode chunks */ - flx_decode_chunks (flxdec, - ((FlxFrameType *) chunk)->chunks, - GST_BUFFER_DATA (buf) + FlxFrameTypeSize, - GST_BUFFER_DATA (flxdec->frame)); + /* decode chunks */ + flx_decode_chunks (flxdec, + ((FlxFrameType *) chunk)->chunks, + GST_BUFFER_DATA (buf) + FlxFrameTypeSize, + GST_BUFFER_DATA (flxdec->frame)); - /* destroy input buffer */ - gst_buffer_unref (buf); + /* destroy input buffer */ + gst_buffer_unref (buf); - /* save copy of the current frame for possible delta. */ - memcpy (GST_BUFFER_DATA (flxdec->delta), - GST_BUFFER_DATA (flxdec->frame), GST_BUFFER_SIZE (flxdec->delta)); + /* save copy of the current frame for possible delta. */ + memcpy (GST_BUFFER_DATA (flxdec->delta), + GST_BUFFER_DATA (flxdec->frame), GST_BUFFER_SIZE (flxdec->delta)); - /* convert current frame. */ - flx_colorspace_convert (flxdec->converter, - GST_BUFFER_DATA (flxdec->frame), GST_BUFFER_DATA (out)); + /* convert current frame. */ + flx_colorspace_convert (flxdec->converter, + GST_BUFFER_DATA (flxdec->frame), GST_BUFFER_DATA (out)); - GST_BUFFER_TIMESTAMP (out) = flxdec->next_time; - flxdec->next_time += flxdec->frame_time; + GST_BUFFER_TIMESTAMP (out) = flxdec->next_time; + flxdec->next_time += flxdec->frame_time; - gst_pad_push (flxdec->srcpad, GST_DATA (out)); + gst_pad_push (flxdec->srcpad, GST_DATA (out)); - break; + break; } /* destroy header buffer */ diff --git a/gst/mixmatrix/mixmatrix.c b/gst/mixmatrix/mixmatrix.c index f7095e2782..d8dd5ca591 100644 --- a/gst/mixmatrix/mixmatrix.c +++ b/gst/mixmatrix/mixmatrix.c @@ -142,9 +142,10 @@ gst_mixmatrix_get_type (void) 0, (GInstanceInitFunc) gst_mixmatrix_init, }; + mixmatrix_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstMixMatrix", - &mixmatrix_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstMixMatrix", + &mixmatrix_info, 0); } return mixmatrix_type; } @@ -181,15 +182,15 @@ gst_mixmatrix_class_init (GstMixMatrixClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SINKPADS, g_param_spec_int ("sinkpads", "Sink Pads", - "Number of sink pads in matrix", 0, G_MAXINT, 8, G_PARAM_READABLE)); + "Number of sink pads in matrix", 0, G_MAXINT, 8, G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SRCPADS, g_param_spec_int ("srcpads", "Src Pads", "Number of src pads in matrix", - 0, G_MAXINT, 8, G_PARAM_READABLE)); + 0, G_MAXINT, 8, G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MATRIXPTR, g_param_spec_pointer ("matrixptr", "Matrix Pointer", - "Pointer to gfloat mix matrix", G_PARAM_READABLE)); + "Pointer to gfloat mix matrix", G_PARAM_READABLE)); gobject_class->set_property = gst_mixmatrix_set_property; gobject_class->get_property = gst_mixmatrix_get_property; @@ -271,17 +272,17 @@ mixmatrix_resize (GstMixMatrix * mix, int sinkpads, int srcpads) // check the sinkpads list if (sinkresize) { mix->sinkpads = - (GstPad **) grow_ptrlist ((void **) mix->sinkpads, mix->sinkpadalloc, - sinkpads); + (GstPad **) grow_ptrlist ((void **) mix->sinkpads, mix->sinkpadalloc, + sinkpads); mix->sinkbs = - (GstByteStream **) grow_ptrlist ((void **) mix->sinkbs, - mix->sinkpadalloc, sinkpads); + (GstByteStream **) grow_ptrlist ((void **) mix->sinkbs, + mix->sinkpadalloc, sinkpads); } // check the srcpads list if (srcresize) { mix->srcpads = - (GstPad **) grow_ptrlist ((void **) mix->srcpads, mix->srcpadalloc, - srcpads); + (GstPad **) grow_ptrlist ((void **) mix->srcpads, mix->srcpadalloc, + srcpads); } // now resize the matrix if either has changed if (sinkresize || srcresize) { @@ -293,8 +294,8 @@ mixmatrix_resize (GstMixMatrix * mix, int sinkpads, int srcpads) // otherwise we have to copy line by line } else { for (i = 0; i < mix->srcpadalloc; i++) - memcpy (newmatrix[i], mix->matrix[i], - sizeof (gfloat) * mix->srcpadalloc); + memcpy (newmatrix[i], mix->matrix[i], + sizeof (gfloat) * mix->srcpadalloc); } // would signal here! @@ -343,9 +344,9 @@ gst_mixmatrix_connect (GstPad * pad, const GstCaps * caps) for (i = 0; i < mix->srcpadalloc; i++) { if (mix->srcpads[i]) { if (GST_PAD_CAPS (mix->srcpads[i]) == NULL) { - if (gst_pad_try_set_caps (mix->srcpads[i], caps) <= 0) { - return GST_PAD_LINK_REFUSED; - } + if (gst_pad_try_set_caps (mix->srcpads[i], caps) <= 0) { + return GST_PAD_LINK_REFUSED; + } } } } @@ -377,11 +378,11 @@ gst_mixmatrix_request_new_pad (GstElement * element, GstPadTemplate * templ, // determine if it's bigger than the current size if (padnum >= mix->sinkpadalloc) mixmatrix_resize (mix, ROUND_UP (padnum, mix->grpsize), - mix->sinkpadalloc); + mix->sinkpadalloc); pad = - gst_pad_new_from_template (gst_static_pad_template_get - (&mixmatrix_sink_template), name); + gst_pad_new_from_template (gst_static_pad_template_get + (&mixmatrix_sink_template), name); GST_PAD_ELEMENT_PRIVATE (pad) = GINT_TO_POINTER (padnum); gst_element_add_pad (GST_ELEMENT (mix), pad); // g_signal_connect(G_OBJECT(pad), "unlink", G_CALLBACK(sink_unlinked), mix); @@ -404,8 +405,8 @@ gst_mixmatrix_request_new_pad (GstElement * element, GstPadTemplate * templ, mixmatrix_resize (mix, ROUND_UP (padnum, mix->grpsize), mix->srcpadalloc); pad = - gst_pad_new_from_template (gst_static_pad_template_get - (&mixmatrix_src_template), name); + gst_pad_new_from_template (gst_static_pad_template_get + (&mixmatrix_src_template), name); GST_PAD_ELEMENT_PRIVATE (pad) = GINT_TO_POINTER (padnum); gst_element_add_pad (GST_ELEMENT (mix), pad); // g_signal_connect(G_OBJECT(pad), "unlink", G_CALLBACK(sink_unlinked), mix); @@ -450,7 +451,7 @@ gst_mixmatrix_loop (GstElement * element) infloats[i] = (gfloat *) GST_BUFFER_DATA (inbufs[i]); // loop through each src pad for (j = 0; j < mix->srcpadalloc; j++) { - if (mix->srcpads[j] != NULL) { + if (mix->srcpads[j] != NULL) { /* { int z; @@ -461,12 +462,12 @@ gst_mixmatrix_loop (GstElement * element) } fprintf(stderr,"attempting to get gain for %dx%d\n",i,j); */ - gain = mix->matrix[i][j]; + gain = mix->matrix[i][j]; // fprintf(stderr,"%d->%d=%0.2f ",i,j,gain); - for (k = 0; k < mix->outsize; k++) { - outfloats[j][k] += infloats[i][k] * gain; - } - } + for (k = 0; k < mix->outsize; k++) { + outfloats[j][k] += infloats[i][k] * gain; + } + } } } } diff --git a/gst/modplug/gstmodplug.cc b/gst/modplug/gstmodplug.cc index bcd7808c13..e69c1c8b41 100644 --- a/gst/modplug/gstmodplug.cc +++ b/gst/modplug/gstmodplug.cc @@ -75,9 +75,9 @@ static GstStaticPadTemplate modplug_src_template_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("audio/x-raw-int, " "endianness = (int) BYTE_ORDER, " "signed = (boolean) TRUE, " "width = (int) 16, " "depth = (int) 16, " "rate = (int) { 8000, 11025, 22050, 44100 }, " /* FIXME? */ - "channels = (int) [ 1, 2 ]; " "audio/x-raw-int, " "signed = (boolean) FALSE, " "width = (int) 8, " "depth = (int) 8, " "rate = (int) { 8000, 11025, 22050, 44100 }, " /* FIXME? */ - "channels = (int) [ 1, 2 ]") + GST_STATIC_CAPS ("audio/x-raw-int, " "endianness = (int) BYTE_ORDER, " "signed = (boolean) TRUE, " "width = (int) 16, " "depth = (int) 16, " "rate = (int) { 8000, 11025, 22050, 44100 }, " /* FIXME? */ + "channels = (int) [ 1, 2 ]; " "audio/x-raw-int, " "signed = (boolean) FALSE, " "width = (int) 8, " "depth = (int) 8, " "rate = (int) { 8000, 11025, 22050, 44100 }, " /* FIXME? */ + "channels = (int) [ 1, 2 ]") ); static GstStaticPadTemplate modplug_sink_template_factory = @@ -133,9 +133,10 @@ gst_modplug_get_type (void) (GInstanceInitFunc) gst_modplug_init, NULL }; + modplug_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstModPlug", &modplug_info, - (GTypeFlags) 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstModPlug", &modplug_info, + (GTypeFlags) 0); } return modplug_type; } @@ -165,51 +166,51 @@ gst_modplug_class_init (GstModPlugClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SONGNAME, g_param_spec_string ("songname", "Songname", "The song name", - "", G_PARAM_READABLE)); + "", G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_REVERB, g_param_spec_boolean ("reverb", "reverb", "reverb", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + FALSE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_REVERB_DEPTH, g_param_spec_int ("reverb_depth", "reverb_depth", "reverb_depth", - 0, 100, 30, (GParamFlags) G_PARAM_READWRITE)); + 0, 100, 30, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_REVERB_DELAY, g_param_spec_int ("reverb_delay", "reverb_delay", "reverb_delay", - 0, 200, 100, (GParamFlags) G_PARAM_READWRITE)); + 0, 200, 100, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MEGABASS, g_param_spec_boolean ("megabass", "megabass", "megabass", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + FALSE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MEGABASS_AMOUNT, g_param_spec_int ("megabass_amount", "megabass_amount", "megabass_amount", - 0, 100, 40, (GParamFlags) G_PARAM_READWRITE)); + 0, 100, 40, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MEGABASS_RANGE, g_param_spec_int ("megabass_range", "megabass_range", "megabass_range", - 0, 100, 30, (GParamFlags) G_PARAM_READWRITE)); + 0, 100, 30, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SURROUND, g_param_spec_boolean ("surround", "surround", "surround", - TRUE, (GParamFlags) G_PARAM_READWRITE)); + TRUE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SURROUND_DEPTH, g_param_spec_int ("surround_depth", "surround_depth", "surround_depth", - 0, 100, 20, (GParamFlags) G_PARAM_READWRITE)); + 0, 100, 20, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SURROUND_DELAY, g_param_spec_int ("surround_delay", "surround_delay", "surround_delay", - 0, 40, 20, (GParamFlags) G_PARAM_READWRITE)); + 0, 40, 20, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_OVERSAMP, g_param_spec_boolean ("oversamp", "oversamp", "oversamp", - TRUE, (GParamFlags) G_PARAM_READWRITE)); + TRUE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NOISE_REDUCTION, g_param_spec_boolean ("noise_reduction", "noise_reduction", - "noise_reduction", TRUE, (GParamFlags) G_PARAM_READWRITE)); + "noise_reduction", TRUE, (GParamFlags) G_PARAM_READWRITE)); gobject_class->set_property = gst_modplug_set_property; gobject_class->get_property = gst_modplug_get_property; @@ -233,8 +234,7 @@ gst_modplug_init (GstModPlug * modplug) gst_pad_set_event_function (modplug->srcpad, (GstPadEventFunction) GST_DEBUG_FUNCPTR (gst_modplug_src_event)); gst_pad_set_query_function (modplug->srcpad, gst_modplug_src_query); - gst_pad_set_query_type_function (modplug->srcpad, - (GstPadQueryTypeFunction) + gst_pad_set_query_type_function (modplug->srcpad, (GstPadQueryTypeFunction) GST_DEBUG_FUNCPTR (gst_modplug_get_query_types)); gst_pad_set_formats_function (modplug->srcpad, (GstPadFormatsFunction) GST_DEBUG_FUNCPTR (gst_modplug_get_formats)); @@ -269,10 +269,10 @@ gst_modplug_setup (GstModPlug * modplug) { if (modplug->_16bit) modplug->mSoundFile->SetWaveConfig (modplug->frequency, 16, - modplug->channel); + modplug->channel); else modplug->mSoundFile->SetWaveConfig (modplug->frequency, 8, - modplug->channel); + modplug->channel); modplug->mSoundFile->SetWaveConfigEx (modplug->surround, !modplug->oversamp, modplug->reverb, true, modplug->megabass, modplug->noise_reduction, true); @@ -280,15 +280,15 @@ gst_modplug_setup (GstModPlug * modplug) if (modplug->surround) modplug->mSoundFile->SetSurroundParameters (modplug->surround_depth, - modplug->surround_delay); + modplug->surround_delay); if (modplug->megabass) modplug->mSoundFile->SetXBassParameters (modplug->megabass_amount, - modplug->megabass_range); + modplug->megabass_range); if (modplug->reverb) modplug->mSoundFile->SetReverbParameters (modplug->reverb_depth, - modplug->reverb_delay); + modplug->reverb_delay); } @@ -336,23 +336,23 @@ gst_modplug_src_query (GstPad * pad, GstQueryType type, switch (type) { case GST_QUERY_TOTAL: switch (*format) { - case GST_FORMAT_TIME: - *value = (gint64) modplug->mSoundFile->GetSongTime () * GST_SECOND; - break; - default: - res = FALSE; - break; + case GST_FORMAT_TIME: + *value = (gint64) modplug->mSoundFile->GetSongTime () * GST_SECOND; + break; + default: + res = FALSE; + break; } break; case GST_QUERY_POSITION: switch (*format) { - default: - tmp = - ((float) (modplug->mSoundFile->GetSongTime () * - modplug->mSoundFile->GetCurrentPos ()) / - (float) modplug->mSoundFile->GetMaxPosition ()); - *value = (gint64) (tmp * GST_SECOND); - break; + default: + tmp = + ((float) (modplug->mSoundFile->GetSongTime () * + modplug->mSoundFile->GetCurrentPos ()) / + (float) modplug->mSoundFile->GetMaxPosition ()); + *value = (gint64) (tmp * GST_SECOND); + break; } default: break; @@ -503,10 +503,10 @@ gst_modplug_handle_event (GstModPlug * modplug) break; case GST_EVENT_DISCONTINUOUS: if (gst_event_discont_get_value (event, GST_FORMAT_BYTES, &value)) { - if (remaining == value) { - gst_event_unref (event); - break; - } + if (remaining == value) { + gst_event_unref (event); + break; + } } gst_bytestream_flush_fast (modplug->bs, remaining); default: @@ -568,12 +568,12 @@ gst_modplug_loop (GstElement * element) modplug->song_size = gst_bytestream_length (modplug->bs); got = - gst_bytestream_peek_bytes (modplug->bs, &modplug->buffer_in, - modplug->song_size); + gst_bytestream_peek_bytes (modplug->bs, &modplug->buffer_in, + modplug->song_size); if (got < modplug->song_size) { - gst_modplug_handle_event (modplug); - return; + gst_modplug_handle_event (modplug); + return; } modplug->state = MODPLUG_STATE_LOAD_TUNE; } @@ -583,7 +583,7 @@ gst_modplug_loop (GstElement * element) modplug->mSoundFile = new CSoundFile; if (!GST_PAD_CAPS (modplug->srcpad) && - GST_PAD_LINK_FAILED (gst_pad_renegotiate (modplug->srcpad))) { + GST_PAD_LINK_FAILED (gst_pad_renegotiate (modplug->srcpad))) { GST_ELEMENT_ERROR (modplug, CORE, NEGOTIATION, (NULL), (NULL)); return; } @@ -624,14 +624,14 @@ gst_modplug_loop (GstElement * element) GstFormat format = GST_FORMAT_TIME; if (gst_modplug_src_query (modplug->srcpad, GST_QUERY_POSITION, &format, - &value)) { - discont = - gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME, value, - GST_FORMAT_UNDEFINED); - modplug->timestamp = value; + &value)) { + discont = + gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME, value, + GST_FORMAT_UNDEFINED); + modplug->timestamp = value; } else { - modplug->timestamp = GST_CLOCK_TIME_NONE; - discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_UNDEFINED); + modplug->timestamp = GST_CLOCK_TIME_NONE; + discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_UNDEFINED); } gst_pad_push (modplug->srcpad, GST_DATA (discont)); modplug->need_discont = FALSE; @@ -642,19 +642,19 @@ gst_modplug_loop (GstElement * element) buffer_out = gst_buffer_new (); GST_BUFFER_DATA (buffer_out) = - (guchar *) g_memdup (modplug->audiobuffer, modplug->length); + (guchar *) g_memdup (modplug->audiobuffer, modplug->length); GST_BUFFER_SIZE (buffer_out) = modplug->length; GST_BUFFER_TIMESTAMP (buffer_out) = modplug->timestamp; if (GST_CLOCK_TIME_IS_VALID (modplug->timestamp)) { - GST_BUFFER_DURATION (buffer_out) = - modplug->length * GST_SECOND / modplug->frequency / - modplug->channel / (modplug->_16bit ? 2 : 1); - modplug->timestamp += GST_BUFFER_DURATION (buffer_out); + GST_BUFFER_DURATION (buffer_out) = + modplug->length * GST_SECOND / modplug->frequency / + modplug->channel / (modplug->_16bit ? 2 : 1); + modplug->timestamp += GST_BUFFER_DURATION (buffer_out); } if (GST_PAD_IS_USABLE (modplug->srcpad)) - gst_pad_push (modplug->srcpad, GST_DATA (buffer_out)); + gst_pad_push (modplug->srcpad, GST_DATA (buffer_out)); } else if (GST_PAD_IS_LINKED (modplug->srcpad)) { /* FIXME, hack, pull final EOS from peer */ gst_bytestream_flush (modplug->bs, 1); @@ -691,11 +691,11 @@ gst_modplug_change_state (GstElement * element) gst_bytestream_destroy (modplug->bs); modplug->bs = NULL; if (modplug->opened) { - modplug->mSoundFile->Destroy (); - modplug->opened = FALSE; + modplug->mSoundFile->Destroy (); + modplug->opened = FALSE; } if (modplug->audiobuffer) - g_free (modplug->audiobuffer); + g_free (modplug->audiobuffer); modplug->buffer_in = NULL; modplug->audiobuffer = NULL; modplug->state = MODPLUG_STATE_NEED_TUNE; diff --git a/gst/mpeg1sys/buffer.c b/gst/mpeg1sys/buffer.c index ceb67d0749..6bfcbc0662 100644 --- a/gst/mpeg1sys/buffer.c +++ b/gst/mpeg1sys/buffer.c @@ -139,7 +139,7 @@ mpeg1mux_buffer_queue (Mpeg1MuxBuffer * mb, GstBuffer * buf) } else { mb->buffer = g_realloc (mb->buffer, mb->length + GST_BUFFER_SIZE (buf)); memcpy (mb->buffer + mb->length, GST_BUFFER_DATA (buf), - GST_BUFFER_SIZE (buf)); + GST_BUFFER_SIZE (buf)); mb->length += GST_BUFFER_SIZE (buf); } @@ -169,7 +169,7 @@ mpeg1mux_buffer_update_queued (Mpeg1MuxBuffer * mb, guint64 scr) queued_list = g_list_first (mb->queued_list); } else { GST_DEBUG ("queued in buffer %ld, %" G_GUINT64_FORMAT, - tc->original_length, tc->DTS); + tc->original_length, tc->DTS); total_queued += tc->original_length; queued_list = g_list_next (queued_list); } @@ -208,18 +208,18 @@ mpeg1mux_buffer_shrink (Mpeg1MuxBuffer * mb, gulong size) consumed += tc->length; while (size >= consumed) { GST_DEBUG ("removing timecode: %" G_GUINT64_FORMAT " %" G_GUINT64_FORMAT - " %lu %lu", tc->DTS, tc->PTS, tc->length, consumed); + " %lu %lu", tc->DTS, tc->PTS, tc->length, consumed); mb->timecode_list = g_list_remove_link (mb->timecode_list, timecode_list); mb->queued_list = g_list_append (mb->queued_list, tc); timecode_list = g_list_first (mb->timecode_list); tc = (Mpeg1MuxTimecode *) timecode_list->data; consumed += tc->length; GST_DEBUG ("next timecode: %" G_GUINT64_FORMAT " %" G_GUINT64_FORMAT - " %lu %lu", tc->DTS, tc->PTS, tc->length, consumed); + " %lu %lu", tc->DTS, tc->PTS, tc->length, consumed); } mb->new_frame = TRUE; GST_DEBUG ("leftover frame size from %lu to %lu ", tc->length, - consumed - size); + consumed - size); tc->length = consumed - size; } @@ -275,17 +275,17 @@ mpeg1mux_buffer_update_video_info (Mpeg1MuxBuffer * mb) mb->info.video.picture_rate = gst_getbits4 (&gb); mb->info.video.bit_rate = gst_getbits18 (&gb); if (gst_getbits1 (&gb) != 1) { - g_print ("mpeg1mux::update_video_info: marker bit error\n"); + g_print ("mpeg1mux::update_video_info: marker bit error\n"); } mb->info.video.vbv_buffer_size = gst_getbits10 (&gb); mb->info.video.CSPF = gst_getbits1 (&gb); mb->info.video.secs_per_frame = - 1. / picture_rates[mb->info.video.picture_rate]; + 1. / picture_rates[mb->info.video.picture_rate]; mb->info.video.decoding_order = 0; mb->info.video.group_order = 0; GST_DEBUG ("mpeg1mux::update_video_info: secs per frame %g", - mb->info.video.secs_per_frame); + mb->info.video.secs_per_frame); } else { g_print ("mpeg1mux::update_video_info: Invalid MPEG Video header\n"); } @@ -298,82 +298,82 @@ mpeg1mux_buffer_update_video_info (Mpeg1MuxBuffer * mb) offset++; /* if it's zero, increment the zero count */ if (byte == 0) { - sync_zeros++; - /*GST_DEBUG ("mpeg1mux::update_video_info: found zero #%d at %lu",sync_zeros,offset-1); */ + sync_zeros++; + /*GST_DEBUG ("mpeg1mux::update_video_info: found zero #%d at %lu",sync_zeros,offset-1); */ } /* if it's a one and we have two previous zeros, we have sync */ else if ((byte == 1) && (sync_zeros >= 2)) { - GST_DEBUG ("mpeg1mux::update_video_info: synced at %lu", offset - 1); - have_sync = TRUE; - sync_zeros = 0; + GST_DEBUG ("mpeg1mux::update_video_info: synced at %lu", offset - 1); + have_sync = TRUE; + sync_zeros = 0; } /* if it's anything else, we've lost it completely */ else - sync_zeros = 0; + sync_zeros = 0; /* then snag the chunk ID */ } else if (id == 0) { id = *(data + offset); GST_DEBUG ("mpeg1mux::update_video_info: got id 0x%02lX", id); id = (SYNCWORD_START << 8) + id; switch (id) { - case SEQUENCE_HEADER: - GST_DEBUG ("mpeg1mux::update_video_info: sequence header"); - break; - case GROUP_START: - GST_DEBUG ("mpeg1mux::update_video_info: group start"); - mb->info.video.group_order = 0; - break; - case PICTURE_START: - /* skip the first access unit */ - if (mb->info.video.decoding_order != 0) { - Mpeg1MuxTimecode *tc; + case SEQUENCE_HEADER: + GST_DEBUG ("mpeg1mux::update_video_info: sequence header"); + break; + case GROUP_START: + GST_DEBUG ("mpeg1mux::update_video_info: group start"); + mb->info.video.group_order = 0; + break; + case PICTURE_START: + /* skip the first access unit */ + if (mb->info.video.decoding_order != 0) { + Mpeg1MuxTimecode *tc; - GST_DEBUG ("mpeg1mux::update_video_info: PTS %" G_GUINT64_FORMAT - ", DTS %" G_GUINT64_FORMAT ", length %lu", - mb->info.video.current_PTS, mb->info.video.current_DTS, - offset - mb->current_start - 3); + GST_DEBUG ("mpeg1mux::update_video_info: PTS %" G_GUINT64_FORMAT + ", DTS %" G_GUINT64_FORMAT ", length %lu", + mb->info.video.current_PTS, mb->info.video.current_DTS, + offset - mb->current_start - 3); - tc = (Mpeg1MuxTimecode *) g_malloc (sizeof (Mpeg1MuxTimecode)); - tc->length = offset - mb->current_start - 3; - tc->original_length = tc->length; - tc->frame_type = mb->info.video.current_type; - tc->DTS = mb->info.video.current_DTS; - tc->PTS = mb->info.video.current_PTS; + tc = (Mpeg1MuxTimecode *) g_malloc (sizeof (Mpeg1MuxTimecode)); + tc->length = offset - mb->current_start - 3; + tc->original_length = tc->length; + tc->frame_type = mb->info.video.current_type; + tc->DTS = mb->info.video.current_DTS; + tc->PTS = mb->info.video.current_PTS; - mb->timecode_list = g_list_append (mb->timecode_list, tc); + mb->timecode_list = g_list_append (mb->timecode_list, tc); - if (mb->info.video.decoding_order == 0) { - mb->next_frame_time = tc->DTS; - } + if (mb->info.video.decoding_order == 0) { + mb->next_frame_time = tc->DTS; + } - mb->current_start = offset - 3; - } + mb->current_start = offset - 3; + } - temp = (*(data + offset + 1) << 8) + *(data + offset + 2); - temporal_reference = (temp & 0xffc0) >> 6; - mb->info.video.current_type = (temp & 0x0038) >> 3; - GST_DEBUG - ("mpeg1mux::update_video_info: picture start temporal_ref:%d type:%s Frame", - temporal_reference, - picture_types[mb->info.video.current_type - 1]); + temp = (*(data + offset + 1) << 8) + *(data + offset + 2); + temporal_reference = (temp & 0xffc0) >> 6; + mb->info.video.current_type = (temp & 0x0038) >> 3; + GST_DEBUG + ("mpeg1mux::update_video_info: picture start temporal_ref:%d type:%s Frame", + temporal_reference, + picture_types[mb->info.video.current_type - 1]); - mb->info.video.current_DTS = - mb->info.video.decoding_order * mb->info.video.secs_per_frame * - CLOCKS; - mb->info.video.current_PTS = - (temporal_reference - mb->info.video.group_order + 1 + - mb->info.video.decoding_order) * mb->info.video.secs_per_frame * - CLOCKS; + mb->info.video.current_DTS = + mb->info.video.decoding_order * mb->info.video.secs_per_frame * + CLOCKS; + mb->info.video.current_PTS = + (temporal_reference - mb->info.video.group_order + 1 + + mb->info.video.decoding_order) * mb->info.video.secs_per_frame * + CLOCKS; - mb->info.video.decoding_order++; - mb->info.video.group_order++; + mb->info.video.decoding_order++; + mb->info.video.group_order++; - offset++; - break; - case SEQUENCE_END: - GST_DEBUG ("mpeg1mux::update_video_info: sequence end"); - break; + offset++; + break; + case SEQUENCE_END: + GST_DEBUG ("mpeg1mux::update_video_info: sequence end"); + break; } /* prepare for next sync */ offset++; @@ -411,30 +411,30 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) mb->info.audio.layer = 4 - layer_index; lsf = (id & (1 << 20)) ? ((id & (1 << 19)) ? 0 : 1) : 1; mb->info.audio.bit_rate = - bitrate_index[lsf][mb->info.audio.layer - 1][((id >> 12) & 0xf)]; + bitrate_index[lsf][mb->info.audio.layer - 1][((id >> 12) & 0xf)]; samplerate_index = (id >> 10) & 0x3; padding = (id >> 9) & 0x1; if (mb->info.audio.layer == 1) { - bpf = mb->info.audio.bit_rate * 12000; - bpf /= frequency[samplerate_index]; - bpf = ((bpf + padding) << 2); + bpf = mb->info.audio.bit_rate * 12000; + bpf /= frequency[samplerate_index]; + bpf = ((bpf + padding) << 2); } else { - bpf = mb->info.audio.bit_rate * 144000; - bpf /= frequency[samplerate_index]; - bpf += padding; + bpf = mb->info.audio.bit_rate * 144000; + bpf /= frequency[samplerate_index]; + bpf += padding; } mb->info.audio.framesize = bpf; GST_DEBUG ("mpeg1mux::update_audio_info: samples per second %d", - samplerate_index); + samplerate_index); gst_getbits_init (&gb, NULL, NULL); gst_getbits_newbuf (&gb, data, mb->length); gst_flushbitsn (&gb, 12); if (gst_getbits1 (&gb) != 1) { - g_print ("mpeg1mux::update_audio_info: marker bit error\n"); + g_print ("mpeg1mux::update_audio_info: marker bit error\n"); } gst_flushbitsn (&gb, 2); mb->info.audio.protection = gst_getbits1 (&gb); @@ -450,15 +450,15 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) GST_DEBUG ("mpeg1mux::update_audio_info: layer %d", mb->info.audio.layer); GST_DEBUG ("mpeg1mux::update_audio_info: bit_rate %d", - mb->info.audio.bit_rate); + mb->info.audio.bit_rate); GST_DEBUG ("mpeg1mux::update_audio_info: frequency %d", - mb->info.audio.frequency); + mb->info.audio.frequency); mb->info.audio.samples_per_second = - (double) dfrequency[mb->info.audio.frequency]; + (double) dfrequency[mb->info.audio.frequency]; GST_DEBUG ("mpeg1mux::update_audio_info: samples per second %g", - mb->info.audio.samples_per_second); + mb->info.audio.samples_per_second); mb->info.audio.decoding_order = 0; @@ -468,11 +468,11 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) tc->frame_type = FRAME_TYPE_AUDIO; mb->info.audio.current_PTS = - mb->info.audio.decoding_order * samples[mb->info.audio.layer] / - mb->info.audio.samples_per_second * 90. + startup_delay; + mb->info.audio.decoding_order * samples[mb->info.audio.layer] / + mb->info.audio.samples_per_second * 90. + startup_delay; GST_DEBUG ("mpeg1mux::update_audio_info: PTS %" G_GUINT64_FORMAT - ", length %u", mb->info.audio.current_PTS, mb->info.audio.framesize); + ", length %u", mb->info.audio.current_PTS, mb->info.audio.framesize); tc->PTS = mb->info.audio.current_PTS; tc->DTS = mb->info.audio.current_PTS; mb->timecode_list = g_list_append (mb->timecode_list, tc); @@ -493,7 +493,7 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) mb->info.audio.layer = 4 - layer_index; lsf = (id & (1 << 20)) ? ((id & (1 << 19)) ? 0 : 1) : 1; mb->info.audio.bit_rate = - bitrate_index[lsf][mb->info.audio.layer - 1][((id >> 12) & 0xf)]; + bitrate_index[lsf][mb->info.audio.layer - 1][((id >> 12) & 0xf)]; samplerate_index = (id >> 10) & 0x3; padding = (id >> 9) & 0x1; @@ -514,16 +514,16 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) mb->current_start = offset + bpf; mb->info.audio.samples_per_second = - (double) dfrequency[mb->info.audio.frequency]; + (double) dfrequency[mb->info.audio.frequency]; mb->info.audio.current_PTS = - (mb->info.audio.decoding_order * samples[mb->info.audio.layer]) / - mb->info.audio.samples_per_second * 90.; + (mb->info.audio.decoding_order * samples[mb->info.audio.layer]) / + mb->info.audio.samples_per_second * 90.; tc->DTS = tc->PTS = mb->info.audio.current_PTS; GST_DEBUG ("mpeg1mux::update_audio_info: PTS %" G_GUINT64_FORMAT ", %" - G_GUINT64_FORMAT " length %lu", mb->info.audio.current_PTS, tc->PTS, - tc->length); + G_GUINT64_FORMAT " length %lu", mb->info.audio.current_PTS, tc->PTS, + tc->length); mb->timecode_list = g_list_append (mb->timecode_list, tc); mb->info.audio.decoding_order++; diff --git a/gst/mpeg1sys/gstmpeg1systemencode.c b/gst/mpeg1sys/gstmpeg1systemencode.c index a071f0c4b5..c8698430ea 100644 --- a/gst/mpeg1sys/gstmpeg1systemencode.c +++ b/gst/mpeg1sys/gstmpeg1systemencode.c @@ -61,7 +61,7 @@ GST_STATIC_PAD_TEMPLATE ("video_%d", GST_PAD_SINK, GST_PAD_REQUEST, GST_STATIC_CAPS ("video/mpeg, " - "mpegversion = (int) 1, " "systemstream = (boolean) FALSE") + "mpegversion = (int) 1, " "systemstream = (boolean) FALSE") ); static GstStaticPadTemplate audio_sink_factory = @@ -69,7 +69,7 @@ GST_STATIC_PAD_TEMPLATE ("audio_%d", GST_PAD_SINK, GST_PAD_REQUEST, GST_STATIC_CAPS ("audio/mpeg, " - "mpegversion = (int) 1, " "layer = (int) [ 1, 2 ] ") + "mpegversion = (int) 1, " "layer = (int) [ 1, 2 ] ") ); static void gst_system_encode_class_init (GstMPEG1SystemEncodeClass * klass); @@ -107,9 +107,10 @@ gst_mpeg1_system_encode_get_type (void) (GInstanceInitFunc) gst_system_encode_init, NULL }; + system_encode_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstMPEG1SystemEncode", - &system_encode_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstMPEG1SystemEncode", + &system_encode_info, 0); } return system_encode_type; } @@ -194,7 +195,7 @@ gst_system_encode_request_new_pad (GstElement * element, GstPadTemplate * templ, g_print ("%s\n", name); newpad = gst_pad_new_from_template (templ, name); gst_pad_set_element_private (newpad, - GINT_TO_POINTER (system_encode->num_audio_pads)); + GINT_TO_POINTER (system_encode->num_audio_pads)); system_encode->audio_pad[system_encode->num_audio_pads] = newpad; system_encode->num_audio_pads++; @@ -204,7 +205,7 @@ gst_system_encode_request_new_pad (GstElement * element, GstPadTemplate * templ, g_print ("%s\n", name); newpad = gst_pad_new_from_template (templ, name); gst_pad_set_element_private (newpad, - GINT_TO_POINTER (system_encode->num_video_pads)); + GINT_TO_POINTER (system_encode->num_video_pads)); system_encode->video_pad[system_encode->num_video_pads] = newpad; system_encode->num_video_pads++; @@ -233,13 +234,13 @@ gst_system_encode_pick_streams (GList * mta, if (system_encode->which_streams & STREAMS_VIDEO) { if (system_encode->video_buffer->next_frame_time < - lowest - system_encode->video_delay) { + lowest - system_encode->video_delay) { lowest = system_encode->video_buffer->next_frame_time; } } if (system_encode->which_streams & STREAMS_AUDIO) { if (system_encode->audio_buffer->next_frame_time < - lowest - system_encode->audio_delay) { + lowest - system_encode->audio_delay) { lowest = system_encode->audio_buffer->next_frame_time; } } @@ -263,25 +264,25 @@ gst_system_encode_have_data (GstMPEG1SystemEncode * system_encode) if (system_encode->which_streams == (STREAMS_VIDEO | STREAMS_AUDIO)) { if (MPEG1MUX_BUFFER_QUEUED (system_encode->audio_buffer) > 2 && - MPEG1MUX_BUFFER_SPACE (system_encode->audio_buffer) > - system_encode->packet_size * 2 - && MPEG1MUX_BUFFER_QUEUED (system_encode->video_buffer) > 2 - && MPEG1MUX_BUFFER_SPACE (system_encode->video_buffer) > - system_encode->packet_size * 2) { + MPEG1MUX_BUFFER_SPACE (system_encode->audio_buffer) > + system_encode->packet_size * 2 + && MPEG1MUX_BUFFER_QUEUED (system_encode->video_buffer) > 2 + && MPEG1MUX_BUFFER_SPACE (system_encode->video_buffer) > + system_encode->packet_size * 2) { return TRUE; } } if (system_encode->which_streams == STREAMS_VIDEO) { if (MPEG1MUX_BUFFER_QUEUED (system_encode->video_buffer) > 2 && - MPEG1MUX_BUFFER_SPACE (system_encode->video_buffer) > - system_encode->packet_size * 2) { + MPEG1MUX_BUFFER_SPACE (system_encode->video_buffer) > + system_encode->packet_size * 2) { return TRUE; } } if (system_encode->which_streams == STREAMS_VIDEO) { if (MPEG1MUX_BUFFER_QUEUED (system_encode->audio_buffer) > 2 && - MPEG1MUX_BUFFER_SPACE (system_encode->audio_buffer) > - system_encode->packet_size * 2) { + MPEG1MUX_BUFFER_SPACE (system_encode->audio_buffer) > + system_encode->packet_size * 2) { return TRUE; } } @@ -321,12 +322,12 @@ gst_system_setup_multiplex (GstMPEG1SystemEncode * system_encode) if (system_encode->which_streams & STREAMS_VIDEO) { system_encode->video_rate = - system_encode->video_buffer->info.video.bit_rate * 50; + system_encode->video_buffer->info.video.bit_rate * 50; } else system_encode->video_rate = 0; if (system_encode->which_streams & STREAMS_AUDIO) system_encode->audio_rate = - system_encode->audio_buffer->info.audio.bit_rate * 128; + system_encode->audio_buffer->info.audio.bit_rate * 128; else system_encode->audio_rate = 0; @@ -335,11 +336,11 @@ gst_system_setup_multiplex (GstMPEG1SystemEncode * system_encode) system_encode->dmux_rate = ceil ((double) (system_encode->data_rate) * ((double) (system_encode->packet_size) / - (double) (system_encode->min_packet_data) + - ((double) (system_encode->packet_size) / - (double) (system_encode->max_packet_data) * - (double) (system_encode->packets_per_pack - - 1.))) / (double) (system_encode->packets_per_pack)); + (double) (system_encode->min_packet_data) + + ((double) (system_encode->packet_size) / + (double) (system_encode->max_packet_data) * + (double) (system_encode->packets_per_pack - + 1.))) / (double) (system_encode->packets_per_pack)); system_encode->data_rate = ceil (system_encode->dmux_rate / 50.) * 50; GST_DEBUG @@ -363,9 +364,9 @@ gst_system_setup_multiplex (GstMPEG1SystemEncode * system_encode) system_encode->delay = ((double) system_encode->sectors_delay + ceil ((double) video_tc->length / - (double) system_encode->min_packet_data) + + (double) system_encode->min_packet_data) + ceil ((double) video_tc->length / - (double) system_encode->min_packet_data)) * + (double) system_encode->min_packet_data)) * (double) system_encode->packet_size / system_encode->dmux_rate * (double) CLOCKS; @@ -406,15 +407,15 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) if (system_encode->mta == NULL) { system_encode->mta = - gst_system_encode_pick_streams (system_encode->mta, system_encode); + gst_system_encode_pick_streams (system_encode->mta, system_encode); } if (system_encode->mta == NULL) break; system_encode->SCR = - (guint64) (system_encode->bytes_output + - LAST_SCR_BYTE_IN_PACK) * CLOCKS / system_encode->dmux_rate; + (guint64) (system_encode->bytes_output + + LAST_SCR_BYTE_IN_PACK) * CLOCKS / system_encode->dmux_rate; streams = g_list_first (system_encode->mta); @@ -422,11 +423,11 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) if (system_encode->current_pack == system_encode->packets_per_pack) { create_pack (system_encode->pack, system_encode->SCR, - system_encode->mux_rate); + system_encode->mux_rate); create_sys_header (system_encode->sys_header, system_encode->mux_rate, 1, - 1, 1, 1, 1, 1, AUDIO_STR_0, 0, system_encode->audio_buffer_size / 128, - VIDEO_STR_0, 1, system_encode->video_buffer_size / 1024, - system_encode->which_streams); + 1, 1, 1, 1, 1, AUDIO_STR_0, 0, system_encode->audio_buffer_size / 128, + VIDEO_STR_0, 1, system_encode->video_buffer_size / 1024, + system_encode->which_streams); system_encode->current_pack = 0; pack = system_encode->pack; sys_header = system_encode->sys_header; @@ -440,11 +441,11 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) if (mb->new_frame) { GST_DEBUG ("system_encode::multiplex: new frame"); if (tc->frame_type == FRAME_TYPE_AUDIO - || tc->frame_type == FRAME_TYPE_IFRAME - || tc->frame_type == FRAME_TYPE_PFRAME) { - timestamps = TIMESTAMPS_PTS; + || tc->frame_type == FRAME_TYPE_IFRAME + || tc->frame_type == FRAME_TYPE_PFRAME) { + timestamps = TIMESTAMPS_PTS; } else { - timestamps = TIMESTAMPS_PTS_DTS; + timestamps = TIMESTAMPS_PTS_DTS; } } else { timestamps = TIMESTAMPS_NO; @@ -452,7 +453,7 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) if (tc->frame_type != FRAME_TYPE_AUDIO) { if (tc->PTS < system_encode->startup_delay) - system_encode->startup_delay = tc->PTS; + system_encode->startup_delay = tc->PTS; } if (tc->frame_type == FRAME_TYPE_AUDIO) { @@ -475,27 +476,27 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) /* write the pack/packet here */ create_sector (system_encode->sector, pack, sys_header, - system_encode->packet_size, - MPEG1MUX_BUFFER_DATA (mb), mb->stream_id, buffer_scale, - buffer_size, TRUE, PTS, DTS, - timestamps, system_encode->which_streams); + system_encode->packet_size, + MPEG1MUX_BUFFER_DATA (mb), mb->stream_id, buffer_scale, + buffer_size, TRUE, PTS, DTS, + timestamps, system_encode->which_streams); /* update mta */ system_encode->mta = - gst_system_encode_update_mta (system_encode, system_encode->mta, - system_encode->sector->length_of_packet_data); + gst_system_encode_update_mta (system_encode, system_encode->mta, + system_encode->sector->length_of_packet_data); } else { /* write a padding packet */ create_sector (system_encode->sector, pack, sys_header, - system_encode->packet_size, NULL, PADDING_STR, 0, - 0, FALSE, 0, 0, TIMESTAMPS_NO, system_encode->which_streams); + system_encode->packet_size, NULL, PADDING_STR, 0, + 0, FALSE, 0, 0, TIMESTAMPS_NO, system_encode->which_streams); } outbuf = gst_buffer_new (); GST_BUFFER_DATA (outbuf) = - g_malloc (system_encode->sector->length_of_sector); + g_malloc (system_encode->sector->length_of_sector); GST_BUFFER_SIZE (outbuf) = system_encode->sector->length_of_sector; memcpy (GST_BUFFER_DATA (outbuf), system_encode->sector->buf, - system_encode->sector->length_of_sector); + system_encode->sector->length_of_sector); system_encode->bytes_output += GST_BUFFER_SIZE (outbuf); gst_pad_push (system_encode->srcpad, GST_DATA (outbuf)); @@ -535,15 +536,15 @@ gst_system_encode_chain (GstPad * pad, GstData * _data) if (strncmp (padname, "audio_", 6) == 0) { channel = atoi (&padname[6]); GST_DEBUG - ("gst_system_encode_chain: got audio buffer in from audio channel %02d", - channel); + ("gst_system_encode_chain: got audio buffer in from audio channel %02d", + channel); mpeg1mux_buffer_queue (system_encode->audio_buffer, buf); } else if (strncmp (padname, "video_", 6) == 0) { channel = atoi (&padname[6]); GST_DEBUG - ("gst_system_encode_chain: got video buffer in from video channel %02d", - channel); + ("gst_system_encode_chain: got video buffer in from video channel %02d", + channel); mpeg1mux_buffer_queue (system_encode->video_buffer, buf); diff --git a/gst/mpeg1sys/systems.c b/gst/mpeg1sys/systems.c index 20e7bd9010..c0541c5ba6 100644 --- a/gst/mpeg1sys/systems.c +++ b/gst/mpeg1sys/systems.c @@ -124,7 +124,7 @@ create_sector (sector, pack, sys_header, if (buffers) { *(index++) = (unsigned char) (0x40 | - (buffer_scale << 5) | (buffer_size >> 8)); + (buffer_scale << 5) | (buffer_size >> 8)); *(index++) = (unsigned char) (buffer_size & 0xff); } @@ -164,9 +164,9 @@ create_sector (sector, pack, sys_header, if (tmp != i) { packet_size -= (i - tmp); *(size_offset++) = - (unsigned char) ((packet_size - PACKET_HEADER_SIZE) >> 8); + (unsigned char) ((packet_size - PACKET_HEADER_SIZE) >> 8); *(size_offset++) = - (unsigned char) ((packet_size - PACKET_HEADER_SIZE) & 0xff); + (unsigned char) ((packet_size - PACKET_HEADER_SIZE) & 0xff); /* zero byte stuffing in the last Packet of a stream */ /* we don't need this any more, since we shortenend the packet */ @@ -281,14 +281,14 @@ create_sys_header (sys_header, rate_bound, audio_bound, if (which_streams & STREAMS_AUDIO) { *(index++) = stream1; *(index++) = (unsigned char) (0xc0 | - (buffer1_scale << 5) | (buffer1_size >> 8)); + (buffer1_scale << 5) | (buffer1_size >> 8)); *(index++) = (unsigned char) (buffer1_size & 0xff); } if (which_streams & STREAMS_VIDEO) { *(index++) = stream2; *(index++) = (unsigned char) (0xc0 | - (buffer2_scale << 5) | (buffer2_size >> 8)); + (buffer2_scale << 5) | (buffer2_size >> 8)); *(index++) = (unsigned char) (buffer2_size & 0xff); } diff --git a/gst/mpeg1videoparse/gstmp1videoparse.c b/gst/mpeg1videoparse/gstmp1videoparse.c index e1b5b0898d..6c666274dc 100644 --- a/gst/mpeg1videoparse/gstmp1videoparse.c +++ b/gst/mpeg1videoparse/gstmp1videoparse.c @@ -46,19 +46,19 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/mpeg, " - "mpegversion = (int) 1, " - "systemstream = (boolean) false, " - "width = (int) [ 16, 4096 ], " - "height = (int) [ 16, 4096 ], " - "pixel_width = (int) [ 1, 255 ], " - "pixel_height = (int) [ 1, 255 ], " "framerate = (double) [ 0, MAX ]") + "mpegversion = (int) 1, " + "systemstream = (boolean) false, " + "width = (int) [ 16, 4096 ], " + "height = (int) [ 16, 4096 ], " + "pixel_width = (int) [ 1, 255 ], " + "pixel_height = (int) [ 1, 255 ], " "framerate = (double) [ 0, MAX ]") ); static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/mpeg, " - "mpegversion = (int) 1, " "systemstream = (boolean) false") + "mpegversion = (int) 1, " "systemstream = (boolean) false") ); /* Mp1VideoParse signals and args */ @@ -106,9 +106,10 @@ mp1videoparse_get_type (void) 0, (GInstanceInitFunc) gst_mp1videoparse_init, }; + mp1videoparse_type = - g_type_register_static (GST_TYPE_ELEMENT, "Mp1VideoParse", - &mp1videoparse_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "Mp1VideoParse", + &mp1videoparse_info, 0); } return mp1videoparse_type; } @@ -181,9 +182,9 @@ mp1videoparse_parse_seq (Mp1VideoParse * mp1videoparse, GstBuffer * buf) fps_idx = (n & 0x0000000f) >> 0; if (fps_idx >= 9 || fps_idx <= 0) - fps_idx = 3; /* well, we need a default */ + fps_idx = 3; /* well, we need a default */ if (asr_idx >= 15 || asr_idx <= 0) - asr_idx = 1; /* no aspect ratio */ + asr_idx = 1; /* no aspect ratio */ if (asr_table[asr_idx] != mp1videoparse->asr || fps_table[fps_idx] != mp1videoparse->fps || @@ -200,12 +201,12 @@ mp1videoparse_parse_seq (Mp1VideoParse * mp1videoparse, GstBuffer * buf) p_h = (asr_table[asr_idx] > 1.0) ? (100 * asr_table[asr_idx]) : 1; caps = gst_caps_new_simple ("video/mpeg", - "systemstream", G_TYPE_BOOLEAN, FALSE, - "mpegversion", G_TYPE_INT, 1, - "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, - "framerate", G_TYPE_DOUBLE, fps_table[fps_idx], - "pixel_width", G_TYPE_INT, p_w, "pixel_height", G_TYPE_INT, p_h, NULL); + "systemstream", G_TYPE_BOOLEAN, FALSE, + "mpegversion", G_TYPE_INT, 1, + "width", G_TYPE_INT, width, + "height", G_TYPE_INT, height, + "framerate", G_TYPE_DOUBLE, fps_table[fps_idx], + "pixel_width", G_TYPE_INT, p_w, "pixel_height", G_TYPE_INT, p_h, NULL); GST_DEBUG ("New mpeg1videoparse caps: " GST_PTR_FORMAT, caps); @@ -220,7 +221,7 @@ mp1videoparse_valid_sync (Mp1VideoParse * mp1videoparse, guint32 head, switch (head) { case SEQ_START_CODE:{ GstBuffer *subbuf = gst_buffer_create_sub (buf, 4, - GST_BUFFER_SIZE (buf) - 4); + GST_BUFFER_SIZE (buf) - 4); mp1videoparse_parse_seq (mp1videoparse, subbuf); gst_buffer_unref (subbuf); @@ -233,7 +234,7 @@ mp1videoparse_valid_sync (Mp1VideoParse * mp1videoparse, guint32 head, return TRUE; default: if (head >= SLICE_MIN_START_CODE && head <= SLICE_MAX_START_CODE) - return TRUE; + return TRUE; } return FALSE; @@ -259,10 +260,10 @@ mp1videoparse_find_next_gop (Mp1VideoParse * mp1videoparse, GstBuffer * buf) have_sync = TRUE; } else if (have_sync) { if (byte == (SEQ_START_CODE & 0xff) || byte == (GOP_START_CODE & 0xff)) { - return offset - 4; + return offset - 4; } else { - sync_zeros = 0; - have_sync = FALSE; + sync_zeros = 0; + have_sync = FALSE; } } else { sync_zeros = 0; @@ -277,10 +278,10 @@ gst_mp1videoparse_time_code (guchar * gop, gfloat fps) { guint32 data = GUINT32_FROM_BE (*(guint32 *) gop); - return ((((data & 0xfc000000) >> 26) * 3600 * GST_SECOND) + /* hours */ - (((data & 0x03f00000) >> 20) * 60 * GST_SECOND) + /* minutes */ - (((data & 0x0007e000) >> 13) * GST_SECOND) + /* seconds */ - (((data & 0x00001f80) >> 7) * GST_SECOND / fps)); /* frames */ + return ((((data & 0xfc000000) >> 26) * 3600 * GST_SECOND) + /* hours */ + (((data & 0x03f00000) >> 20) * 60 * GST_SECOND) + /* minutes */ + (((data & 0x0007e000) >> 13) * GST_SECOND) + /* seconds */ + (((data & 0x00001f80) >> 7) * GST_SECOND / fps)); /* frames */ } static void @@ -334,17 +335,17 @@ gst_mp1videoparse_real_chain (Mp1VideoParse * mp1videoparse, GstBuffer * buf, switch (GST_EVENT_TYPE (event)) { case GST_EVENT_FLUSH: case GST_EVENT_DISCONTINUOUS: - gst_mp1videoparse_flush (mp1videoparse); - break; + gst_mp1videoparse_flush (mp1videoparse); + break; case GST_EVENT_EOS: - gst_mp1videoparse_flush (mp1videoparse); - gst_event_ref (event); - gst_pad_push (outpad, GST_DATA (event)); - gst_element_set_eos (GST_ELEMENT (mp1videoparse)); - break; + gst_mp1videoparse_flush (mp1videoparse); + gst_event_ref (event); + gst_pad_push (outpad, GST_DATA (event)); + gst_element_set_eos (GST_ELEMENT (mp1videoparse)); + break; default: - GST_DEBUG ("Unhandled event type %d", GST_EVENT_TYPE (event)); - break; + GST_DEBUG ("Unhandled event type %d", GST_EVENT_TYPE (event)); + break; } gst_event_unref (event); @@ -382,43 +383,43 @@ gst_mp1videoparse_real_chain (Mp1VideoParse * mp1videoparse, GstBuffer * buf, GST_DEBUG ("mp1videoparse: head is %08x", (unsigned int) head); if (!mp1videoparse_valid_sync (mp1videoparse, head, - mp1videoparse->partialbuf) || mp1videoparse->need_resync) { + mp1videoparse->partialbuf) || mp1videoparse->need_resync) { sync_pos = - mp1videoparse_find_next_gop (mp1videoparse, - mp1videoparse->partialbuf); + mp1videoparse_find_next_gop (mp1videoparse, + mp1videoparse->partialbuf); if (sync_pos >= 0) { - mp1videoparse->need_resync = FALSE; - GST_DEBUG ("mp1videoparse: found new gop at %d", sync_pos); + mp1videoparse->need_resync = FALSE; + GST_DEBUG ("mp1videoparse: found new gop at %d", sync_pos); - if (sync_pos != 0) { - temp = - gst_buffer_create_sub (mp1videoparse->partialbuf, sync_pos, - size - sync_pos); - g_assert (temp != NULL); - gst_buffer_unref (mp1videoparse->partialbuf); - mp1videoparse->partialbuf = temp; - data = GST_BUFFER_DATA (mp1videoparse->partialbuf); - size = GST_BUFFER_SIZE (mp1videoparse->partialbuf); - offset = 0; - } + if (sync_pos != 0) { + temp = + gst_buffer_create_sub (mp1videoparse->partialbuf, sync_pos, + size - sync_pos); + g_assert (temp != NULL); + gst_buffer_unref (mp1videoparse->partialbuf); + mp1videoparse->partialbuf = temp; + data = GST_BUFFER_DATA (mp1videoparse->partialbuf); + size = GST_BUFFER_SIZE (mp1videoparse->partialbuf); + offset = 0; + } - head = GUINT32_FROM_BE (*((guint32 *) data)); - /* re-call this function so that if we hadn't already, we can - * now read the sequence header and parse video properties, - * set caps, stream data, be happy, bla, bla, bla... */ - if (!mp1videoparse_valid_sync (mp1videoparse, head, - mp1videoparse->partialbuf)) - g_error ("Found sync but no valid sync point at pos 0x0"); + head = GUINT32_FROM_BE (*((guint32 *) data)); + /* re-call this function so that if we hadn't already, we can + * now read the sequence header and parse video properties, + * set caps, stream data, be happy, bla, bla, bla... */ + if (!mp1videoparse_valid_sync (mp1videoparse, head, + mp1videoparse->partialbuf)) + g_error ("Found sync but no valid sync point at pos 0x0"); } else { - GST_DEBUG ("mp1videoparse: could not sync"); - gst_buffer_unref (mp1videoparse->partialbuf); - mp1videoparse->partialbuf = NULL; - return; + GST_DEBUG ("mp1videoparse: could not sync"); + gst_buffer_unref (mp1videoparse->partialbuf); + mp1videoparse->partialbuf = NULL; + return; } } if (mp1videoparse->picture_in_buffer == 1 && - time_stamp != GST_CLOCK_TIME_NONE) { + time_stamp != GST_CLOCK_TIME_NONE) { mp1videoparse->last_pts = time_stamp; } @@ -430,56 +431,56 @@ gst_mp1videoparse_real_chain (Mp1VideoParse * mp1videoparse, GstBuffer * buf, while (offset < size - 1) { sync_byte = *(data + offset); if (sync_byte == 0) { - sync_state++; + sync_state++; } else if ((sync_byte == 1) && (sync_state >= 2)) { - GST_DEBUG ("mp1videoparse: code 0x000001%02x", data[offset + 1]); - if (data[offset + 1] == (PICTURE_START_CODE & 0xff)) { - mp1videoparse->picture_in_buffer++; - if (mp1videoparse->picture_in_buffer == 1) { - if (time_stamp != GST_CLOCK_TIME_NONE) { - mp1videoparse->last_pts = time_stamp; - } - sync_state = 0; - } else if (mp1videoparse->picture_in_buffer == 2) { - have_sync = TRUE; - break; - } else { - GST_DEBUG ("mp1videoparse: %d in buffer", - mp1videoparse->picture_in_buffer); - g_assert_not_reached (); - } - } - /* A new sequence (or GOP) is a valid sync too. Note that the - * sequence header should be put in the next buffer, not here. */ - else if (data[offset + 1] == (SEQ_START_CODE & 0xFF) || - data[offset + 1] == (GOP_START_CODE & 0xFF)) { - if (mp1videoparse->picture_in_buffer == 0 && - data[offset + 1] == (GOP_START_CODE & 0xFF)) { - mp1videoparse->last_pts = gst_mp1videoparse_time_code (&data[2], - mp1videoparse->fps); - } else if (mp1videoparse->picture_in_buffer == 1) { - have_sync = TRUE; - break; - } else { - g_assert (mp1videoparse->picture_in_buffer == 0); - } - } - /* end-of-sequence is a valid sync point and should be included - * in the current picture, not the next. */ - else if (data[offset + 1] == (SEQ_END_CODE & 0xFF)) { - if (mp1videoparse->picture_in_buffer == 1) { - offset += 4; - have_sync = TRUE; - break; - } else { - g_assert (mp1videoparse->picture_in_buffer == 0); - } - } else - sync_state = 0; + GST_DEBUG ("mp1videoparse: code 0x000001%02x", data[offset + 1]); + if (data[offset + 1] == (PICTURE_START_CODE & 0xff)) { + mp1videoparse->picture_in_buffer++; + if (mp1videoparse->picture_in_buffer == 1) { + if (time_stamp != GST_CLOCK_TIME_NONE) { + mp1videoparse->last_pts = time_stamp; + } + sync_state = 0; + } else if (mp1videoparse->picture_in_buffer == 2) { + have_sync = TRUE; + break; + } else { + GST_DEBUG ("mp1videoparse: %d in buffer", + mp1videoparse->picture_in_buffer); + g_assert_not_reached (); + } + } + /* A new sequence (or GOP) is a valid sync too. Note that the + * sequence header should be put in the next buffer, not here. */ + else if (data[offset + 1] == (SEQ_START_CODE & 0xFF) || + data[offset + 1] == (GOP_START_CODE & 0xFF)) { + if (mp1videoparse->picture_in_buffer == 0 && + data[offset + 1] == (GOP_START_CODE & 0xFF)) { + mp1videoparse->last_pts = gst_mp1videoparse_time_code (&data[2], + mp1videoparse->fps); + } else if (mp1videoparse->picture_in_buffer == 1) { + have_sync = TRUE; + break; + } else { + g_assert (mp1videoparse->picture_in_buffer == 0); + } + } + /* end-of-sequence is a valid sync point and should be included + * in the current picture, not the next. */ + else if (data[offset + 1] == (SEQ_END_CODE & 0xFF)) { + if (mp1videoparse->picture_in_buffer == 1) { + offset += 4; + have_sync = TRUE; + break; + } else { + g_assert (mp1videoparse->picture_in_buffer == 0); + } + } else + sync_state = 0; } /* something else... */ else - sync_state = 0; + sync_state = 0; /* go down the buffer */ offset++; } @@ -487,7 +488,7 @@ gst_mp1videoparse_real_chain (Mp1VideoParse * mp1videoparse, GstBuffer * buf, if (have_sync) { offset -= 2; GST_DEBUG ("mp1videoparse: synced at %ld code 0x000001%02x", offset, - data[offset + 3]); + data[offset + 3]); outbuf = gst_buffer_create_sub (mp1videoparse->partialbuf, 0, offset + 4); g_assert (outbuf != NULL); @@ -496,31 +497,31 @@ gst_mp1videoparse_real_chain (Mp1VideoParse * mp1videoparse, GstBuffer * buf, mp1videoparse->last_pts += GST_BUFFER_DURATION (outbuf); if (mp1videoparse->in_flush) { - /* FIXME, send a flush event here */ - mp1videoparse->in_flush = FALSE; + /* FIXME, send a flush event here */ + mp1videoparse->in_flush = FALSE; } if (GST_PAD_CAPS (outpad) != NULL) { - GST_DEBUG ("mp1videoparse: pushing %d bytes %" G_GUINT64_FORMAT, - GST_BUFFER_SIZE (outbuf), GST_BUFFER_TIMESTAMP (outbuf)); - gst_pad_push (outpad, GST_DATA (outbuf)); - GST_DEBUG ("mp1videoparse: pushing done"); + GST_DEBUG ("mp1videoparse: pushing %d bytes %" G_GUINT64_FORMAT, + GST_BUFFER_SIZE (outbuf), GST_BUFFER_TIMESTAMP (outbuf)); + gst_pad_push (outpad, GST_DATA (outbuf)); + GST_DEBUG ("mp1videoparse: pushing done"); } else { - GST_DEBUG ("No capsnego yet, delaying buffer push"); - gst_buffer_unref (outbuf); + GST_DEBUG ("No capsnego yet, delaying buffer push"); + gst_buffer_unref (outbuf); } mp1videoparse->picture_in_buffer = 0; temp = - gst_buffer_create_sub (mp1videoparse->partialbuf, offset, - size - offset); + gst_buffer_create_sub (mp1videoparse->partialbuf, offset, + size - offset); gst_buffer_unref (mp1videoparse->partialbuf); mp1videoparse->partialbuf = temp; offset = 0; } else { if (time_stamp != GST_CLOCK_TIME_NONE) { - mp1videoparse->last_pts = time_stamp; - break; + mp1videoparse->last_pts = time_stamp; + break; } } } while (1); diff --git a/gst/mpeg2sub/gstmpeg2subt.c b/gst/mpeg2sub/gstmpeg2subt.c index 65047297d0..dbfb5d5ca5 100644 --- a/gst/mpeg2sub/gstmpeg2subt.c +++ b/gst/mpeg2sub/gstmpeg2subt.c @@ -104,9 +104,10 @@ gst_mpeg2subt_get_type (void) 0, (GInstanceInitFunc) gst_mpeg2subt_init, }; + mpeg2subt_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstMpeg2Subt", - &mpeg2subt_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstMpeg2Subt", + &mpeg2subt_info, 0); } return mpeg2subt_type; } @@ -128,7 +129,7 @@ gst_mpeg2subt_class_init (GstMpeg2SubtClass * klass) gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SKIP, g_param_spec_int ("skip", "skip", "skip", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SKIP, g_param_spec_int ("skip", "skip", "skip", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ parent_class = g_type_class_ref (GST_TYPE_ELEMENT); @@ -193,68 +194,68 @@ gst_mpeg2subt_parse_header (GstMpeg2Subt * mpeg2subt) while (i < mpeg2subt->packet_size) { dummy = buffer[i]; switch (dummy) { - case 0x01: /* null packet ? */ - i++; - break; - case 0x02: /* 02 ff (ff) is the end of the packet */ - i = mpeg2subt->packet_size; - break; - case 0x03: /* palette */ - mpeg2subt->color[0] = yuv_color[buffer[i + 1] >> 4]; - mpeg2subt->color[1] = yuv_color[buffer[i + 1] & 0xf]; - mpeg2subt->color[2] = yuv_color[buffer[i + 2] >> 4]; - mpeg2subt->color[3] = yuv_color[buffer[i + 2] & 0xf]; - mpeg2subt->color[4] = yuv_color[0xf]; - GST_DEBUG ("mpeg2subt: colors %d %d %d %d", mpeg2subt->color[0], - mpeg2subt->color[1], mpeg2subt->color[2], mpeg2subt->color[3]); - i += 3; - break; - case 0x04: /* transparency palette */ - mpeg2subt->trans[3] = buffer[i + 1] >> 4; - mpeg2subt->trans[2] = buffer[i + 1] & 0xf; - mpeg2subt->trans[1] = buffer[i + 2] >> 4; - mpeg2subt->trans[0] = buffer[i + 2] & 0xf; - GST_DEBUG ("mpeg2subt: transparency %d %d %d %d", mpeg2subt->trans[0], - mpeg2subt->trans[1], mpeg2subt->trans[2], mpeg2subt->trans[3]); - i += 3; - break; - case 0x05: /* image coordinates */ - mpeg2subt->width = 1 + (((buffer[i + 2] & 0x0f) << 8) + buffer[i + 3]) - - ((((unsigned int) buffer[i + 1]) << 4) + (buffer[i + 2] >> 4)); - mpeg2subt->height = 1 + (((buffer[i + 5] & 0x0f) << 8) + buffer[i + 6]) - - ((((unsigned int) buffer[i + 4]) << 4) + (buffer[i + 5] >> 4)); - i += 7; - break; - case 0x06: /* image 1 / image 2 offsets */ - mpeg2subt->offset[0] = - (((unsigned int) buffer[i + 1]) << 8) + buffer[i + 2]; - mpeg2subt->offset[1] = - (((unsigned int) buffer[i + 3]) << 8) + buffer[i + 4]; - i += 5; - break; - case 0xff: /* "ff xx yy zz uu" with 'zz uu' == start of control packet - * xx and yy are the end time in 90th/sec - */ - mpeg2subt->duration = - (((buffer[i + 1] << 8) + buffer[i + 2]) * 25) / 90; + case 0x01: /* null packet ? */ + i++; + break; + case 0x02: /* 02 ff (ff) is the end of the packet */ + i = mpeg2subt->packet_size; + break; + case 0x03: /* palette */ + mpeg2subt->color[0] = yuv_color[buffer[i + 1] >> 4]; + mpeg2subt->color[1] = yuv_color[buffer[i + 1] & 0xf]; + mpeg2subt->color[2] = yuv_color[buffer[i + 2] >> 4]; + mpeg2subt->color[3] = yuv_color[buffer[i + 2] & 0xf]; + mpeg2subt->color[4] = yuv_color[0xf]; + GST_DEBUG ("mpeg2subt: colors %d %d %d %d", mpeg2subt->color[0], + mpeg2subt->color[1], mpeg2subt->color[2], mpeg2subt->color[3]); + i += 3; + break; + case 0x04: /* transparency palette */ + mpeg2subt->trans[3] = buffer[i + 1] >> 4; + mpeg2subt->trans[2] = buffer[i + 1] & 0xf; + mpeg2subt->trans[1] = buffer[i + 2] >> 4; + mpeg2subt->trans[0] = buffer[i + 2] & 0xf; + GST_DEBUG ("mpeg2subt: transparency %d %d %d %d", mpeg2subt->trans[0], + mpeg2subt->trans[1], mpeg2subt->trans[2], mpeg2subt->trans[3]); + i += 3; + break; + case 0x05: /* image coordinates */ + mpeg2subt->width = 1 + (((buffer[i + 2] & 0x0f) << 8) + buffer[i + 3]) + - ((((unsigned int) buffer[i + 1]) << 4) + (buffer[i + 2] >> 4)); + mpeg2subt->height = 1 + (((buffer[i + 5] & 0x0f) << 8) + buffer[i + 6]) + - ((((unsigned int) buffer[i + 4]) << 4) + (buffer[i + 5] >> 4)); + i += 7; + break; + case 0x06: /* image 1 / image 2 offsets */ + mpeg2subt->offset[0] = + (((unsigned int) buffer[i + 1]) << 8) + buffer[i + 2]; + mpeg2subt->offset[1] = + (((unsigned int) buffer[i + 3]) << 8) + buffer[i + 4]; + i += 5; + break; + case 0xff: /* "ff xx yy zz uu" with 'zz uu' == start of control packet + * xx and yy are the end time in 90th/sec + */ + mpeg2subt->duration = + (((buffer[i + 1] << 8) + buffer[i + 2]) * 25) / 90; - GST_DEBUG ("duration %d", mpeg2subt->duration); + GST_DEBUG ("duration %d", mpeg2subt->duration); - if ((buffer[i + 3] != buffer[mpeg2subt->data_size + 2]) - || (buffer[i + 4] != buffer[mpeg2subt->data_size + 3])) { - g_print - ("mpeg2subt: invalid control header (%.2x%.2x != %.2x%.2x) !\n", - buffer[i + 3], buffer[i + 4], buffer[mpeg2subt->data_size + 2], - buffer[mpeg2subt->data_size + 3]); + if ((buffer[i + 3] != buffer[mpeg2subt->data_size + 2]) + || (buffer[i + 4] != buffer[mpeg2subt->data_size + 3])) { + g_print + ("mpeg2subt: invalid control header (%.2x%.2x != %.2x%.2x) !\n", + buffer[i + 3], buffer[i + 4], buffer[mpeg2subt->data_size + 2], + buffer[mpeg2subt->data_size + 3]); /* FIXME */ /* exit(1); */ - } - i += 5; - break; + } + i += 5; + break; default: - g_print ("mpeg2subt: invalid sequence in control header (%.2x) !\n", - dummy); - break; + g_print ("mpeg2subt: invalid sequence in control header (%.2x) !\n", + dummy); + break; } } } @@ -298,46 +299,46 @@ gst_mpeg2subt_merge_title (GstMpeg2Subt * mpeg2subt, GstBuffer * buf) gint length, colorid; code = get_nibble (); - if (code >= 0x4) { /* 4 .. f */ + if (code >= 0x4) { /* 4 .. f */ found_code: length = code >> 2; colorid = code & 3; while (length--) - if (x++ < width) { - if (mpeg2subt->trans[colorid] != 0x0) { - *target++ = mpeg2subt->color[colorid]; - } else - target++; - } + if (x++ < width) { + if (mpeg2subt->trans[colorid] != 0x0) { + *target++ = mpeg2subt->color[colorid]; + } else + target++; + } if (x >= width) { - if (!aligned) - get_nibble (); - goto next_line; + if (!aligned) + get_nibble (); + goto next_line; } continue; } code = (code << 4) + get_nibble (); - if (code >= 0x10) /* 1x .. 3x */ + if (code >= 0x10) /* 1x .. 3x */ goto found_code; code = (code << 4) + get_nibble (); - if (code >= 0x40) /* 04x .. 0fx */ + if (code >= 0x40) /* 04x .. 0fx */ goto found_code; code = (code << 4) + get_nibble (); - if (code >= 0x100) /* 01xx .. 03xx */ + if (code >= 0x100) /* 01xx .. 03xx */ goto found_code; /* 00xx - should only happen for 00 00 */ if (!aligned) - code = (code << 4) + get_nibble (); /* 0 0x xx */ + code = (code << 4) + get_nibble (); /* 0 0x xx */ if (code) { g_print - ("mpeg2subt: got unknown code 00%x (offset %x side %x, x=%d, y=%d)\n", - code, mpeg2subt->offset[id], id, x, y); + ("mpeg2subt: got unknown code 00%x (offset %x side %x, x=%d, y=%d)\n", + code, mpeg2subt->offset[id], id, x, y); goto next_line; } next_line: @@ -395,7 +396,7 @@ gst_mpeg2subt_chain_subtitle (GstPad * pad, GstData * _data) if (mpeg2subt->packet_size == size) { GST_DEBUG ("mpeg2subt: subtitle packet size %d, current size %ld", - mpeg2subt->packet_size, size); + mpeg2subt->packet_size, size); mpeg2subt->data_size = GUINT16_FROM_BE (*(guint16 *) (data + 2)); diff --git a/gst/mpegaudioparse/gstmpegaudioparse.c b/gst/mpegaudioparse/gstmpegaudioparse.c index 1e77bf42f9..4e5b9b004e 100644 --- a/gst/mpegaudioparse/gstmpegaudioparse.c +++ b/gst/mpegaudioparse/gstmpegaudioparse.c @@ -36,9 +36,9 @@ static GstStaticPadTemplate mp3_src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/mpeg, " - "mpegversion = (int) 1, " - "layer = (int) [ 1, 3 ], " - "rate = (int) [ 8000, 48000], " "channels = (int) [ 1, 2 ]") + "mpegversion = (int) 1, " + "layer = (int) [ 1, 3 ], " + "rate = (int) [ 8000, 48000], " "channels = (int) [ 1, 2 ]") ); static GstStaticPadTemplate mp3_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", @@ -98,8 +98,9 @@ gst_mp3parse_get_type (void) 0, (GInstanceInitFunc) gst_mp3parse_init, }; + mp3parse_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstMPEGAudioParse", &mp3parse_info, 0); + "GstMPEGAudioParse", &mp3parse_info, 0); } return mp3parse_type; } @@ -238,8 +239,8 @@ gst_mp3parse_class_init (GstMPEGAudioParseClass * klass) gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SKIP, g_param_spec_int ("skip", "skip", "skip", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BIT_RATE, g_param_spec_int ("bitrate", "Bitrate", "Bit Rate", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SKIP, g_param_spec_int ("skip", "skip", "skip", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BIT_RATE, g_param_spec_int ("bitrate", "Bitrate", "Bit Rate", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */ parent_class = g_type_class_ref (GST_TYPE_ELEMENT); @@ -354,89 +355,89 @@ gst_mp3parse_chain (GstPad * pad, GstData * _data) * the frames are not independently coded. ********************************************************************************/ if (mp3parse->in_flush) { - guint32 header2; + guint32 header2; - if ((size - offset) < (bpf + 4)) { - if (mp3parse->in_flush) - break; - } - /* wait until we have the the entire current frame as well as the next frame header */ - header2 = GUINT32_FROM_BE (*((guint32 *) (data + offset + bpf))); - GST_DEBUG ("mp3parse: header=%08X, header2=%08X, bpf=%d", - (unsigned int) header, (unsigned int) header2, bpf); + if ((size - offset) < (bpf + 4)) { + if (mp3parse->in_flush) + break; + } + /* wait until we have the the entire current frame as well as the next frame header */ + header2 = GUINT32_FROM_BE (*((guint32 *) (data + offset + bpf))); + GST_DEBUG ("mp3parse: header=%08X, header2=%08X, bpf=%d", + (unsigned int) header, (unsigned int) header2, bpf); /* mask the bits which are allowed to differ between frames */ #define HDRMASK ~((0xF << 12) /* bitrate */ | \ (0x1 << 9) /* padding */ | \ - (0x3 << 4)) /*mode extension */ + (0x3 << 4)) /*mode extension */ - if ((header2 & HDRMASK) != (header & HDRMASK)) { /* require 2 matching headers in a row */ - GST_DEBUG - ("mp3parse: next header doesn't match (header=%08X, header2=%08X, bpf=%d)", - (unsigned int) header, (unsigned int) header2, bpf); - offset++; /* This frame is invalid. Start looking for a valid frame at the next position in the stream */ - continue; - } + if ((header2 & HDRMASK) != (header & HDRMASK)) { /* require 2 matching headers in a row */ + GST_DEBUG + ("mp3parse: next header doesn't match (header=%08X, header2=%08X, bpf=%d)", + (unsigned int) header, (unsigned int) header2, bpf); + offset++; /* This frame is invalid. Start looking for a valid frame at the next position in the stream */ + continue; + } } /* if we don't have the whole frame... */ if ((size - offset) < bpf) { - GST_DEBUG ("mp3parse: partial buffer needed %ld < %d ", (size - offset), - bpf); - break; + GST_DEBUG ("mp3parse: partial buffer needed %ld < %d ", (size - offset), + bpf); + break; } else { - guint bitrate, layer, rate, channels; + guint bitrate, layer, rate, channels; - if (!mp3_type_frame_length_from_header (header, &layer, - &channels, &bitrate, &rate)) { - g_error ("Header failed internal error"); - } - if (channels != mp3parse->channels || - rate != mp3parse->rate || - layer != mp3parse->layer || bitrate != mp3parse->bit_rate) { - GstCaps *caps = mp3_caps_create (layer, channels, bitrate, rate); + if (!mp3_type_frame_length_from_header (header, &layer, + &channels, &bitrate, &rate)) { + g_error ("Header failed internal error"); + } + if (channels != mp3parse->channels || + rate != mp3parse->rate || + layer != mp3parse->layer || bitrate != mp3parse->bit_rate) { + GstCaps *caps = mp3_caps_create (layer, channels, bitrate, rate); - gst_pad_set_explicit_caps (mp3parse->srcpad, caps); + gst_pad_set_explicit_caps (mp3parse->srcpad, caps); - mp3parse->channels = channels; - mp3parse->layer = layer; - mp3parse->rate = rate; - mp3parse->bit_rate = bitrate; - } + mp3parse->channels = channels; + mp3parse->layer = layer; + mp3parse->rate = rate; + mp3parse->bit_rate = bitrate; + } - outbuf = gst_buffer_create_sub (mp3parse->partialbuf, offset, bpf); + outbuf = gst_buffer_create_sub (mp3parse->partialbuf, offset, bpf); - offset += bpf; - if (mp3parse->skip == 0) { - GST_DEBUG ("mp3parse: pushing buffer of %d bytes", - GST_BUFFER_SIZE (outbuf)); - if (mp3parse->in_flush) { - /* FIXME do some sort of flush event */ - mp3parse->in_flush = FALSE; - } - GST_BUFFER_TIMESTAMP (outbuf) = last_ts; - GST_BUFFER_DURATION (outbuf) = - 8 * (GST_SECOND / 1000) * GST_BUFFER_SIZE (outbuf) / - mp3parse->bit_rate; + offset += bpf; + if (mp3parse->skip == 0) { + GST_DEBUG ("mp3parse: pushing buffer of %d bytes", + GST_BUFFER_SIZE (outbuf)); + if (mp3parse->in_flush) { + /* FIXME do some sort of flush event */ + mp3parse->in_flush = FALSE; + } + GST_BUFFER_TIMESTAMP (outbuf) = last_ts; + GST_BUFFER_DURATION (outbuf) = + 8 * (GST_SECOND / 1000) * GST_BUFFER_SIZE (outbuf) / + mp3parse->bit_rate; - if (GST_PAD_CAPS (mp3parse->srcpad) != NULL) { - gst_pad_push (mp3parse->srcpad, GST_DATA (outbuf)); - } else { - GST_DEBUG ("No capsnego yet, delaying buffer push"); - gst_buffer_unref (outbuf); - } - } else { - GST_DEBUG ("mp3parse: skipping buffer of %d bytes", - GST_BUFFER_SIZE (outbuf)); - gst_buffer_unref (outbuf); - mp3parse->skip--; - } + if (GST_PAD_CAPS (mp3parse->srcpad) != NULL) { + gst_pad_push (mp3parse->srcpad, GST_DATA (outbuf)); + } else { + GST_DEBUG ("No capsnego yet, delaying buffer push"); + gst_buffer_unref (outbuf); + } + } else { + GST_DEBUG ("mp3parse: skipping buffer of %d bytes", + GST_BUFFER_SIZE (outbuf)); + gst_buffer_unref (outbuf); + mp3parse->skip--; + } } } else { offset++; if (!mp3parse->in_flush) - GST_DEBUG ("mp3parse: *** wrong header, skipping byte (FIXME?)"); + GST_DEBUG ("mp3parse: *** wrong header, skipping byte (FIXME?)"); } } /* if we have processed this block and there are still */ @@ -445,7 +446,7 @@ gst_mp3parse_chain (GstPad * pad, GstData * _data) glong remainder = (size - offset); GST_DEBUG ("mp3parse: partial buffer needed %ld for trailing bytes", - remainder); + remainder); outbuf = gst_buffer_create_sub (mp3parse->partialbuf, offset, remainder); gst_buffer_unref (mp3parse->partialbuf); @@ -462,7 +463,7 @@ bpf_from_header (GstMPEGAudioParse * parse, unsigned long header) guint bitrate, layer, rate, channels, length; if (!(length = mp3_type_frame_length_from_header (header, &layer, - &channels, &bitrate, &rate))) { + &channels, &bitrate, &rate))) { return 0; } diff --git a/gst/overlay/gstoverlay.c b/gst/overlay/gstoverlay.c index cf787e8735..8efabe0656 100644 --- a/gst/overlay/gstoverlay.c +++ b/gst/overlay/gstoverlay.c @@ -105,9 +105,10 @@ gst_overlay_get_type (void) 0, (GInstanceInitFunc) gst_overlay_init, }; + overlay_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstOverlay", &overlay_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstOverlay", &overlay_info, + 0); } return overlay_type; } @@ -155,18 +156,18 @@ gst_overlay_getcaps (GstPad * pad) if (overlay->width && overlay->height) { caps = GST_STATIC_CAPS ("overlay_sink2", - "video/raw", - "format", GST_TYPE_FOURCC (GST_MAKE_FOURCC ('I', '4', '2', '0')), - "width", G_TYPE_INT (overlay->width), - "height", G_TYPE_INT (overlay->height) - ); + "video/raw", + "format", GST_TYPE_FOURCC (GST_MAKE_FOURCC ('I', '4', '2', '0')), + "width", G_TYPE_INT (overlay->width), + "height", G_TYPE_INT (overlay->height) + ); } else { caps = GST_STATIC_CAPS ("overlay_sink2", - "video/raw", - "format", GST_TYPE_FOURCC (GST_MAKE_FOURCC ('I', '4', '2', '0')), - "width", G_TYPE_INT_RANGE (0, 4096), - "height", G_TYPE_INT_RANGE (0, 4096) - ); + "video/raw", + "format", GST_TYPE_FOURCC (GST_MAKE_FOURCC ('I', '4', '2', '0')), + "width", G_TYPE_INT_RANGE (0, 4096), + "height", G_TYPE_INT_RANGE (0, 4096) + ); } return caps; @@ -246,22 +247,22 @@ gst_overlay_blend_i420 (guint8 * out, guint8 * in1, guint8 * in2, guint8 * in3, for (j = 0; j < width; j++) { mask = in3[i * width + j]; out[i * width + j] = ((in1[i * width + j] * mask) + - (in2[i * width + j] * (255 - mask))) >> 8; + (in2[i * width + j] * (255 - mask))) >> 8; } } for (i = 0; i < height / 2; i++) { for (j = 0; j < width / 2; j++) { mask = - (in3[(i * 2) * width + (j * 2)] + in3[(i * 2 + 1) * width + (j * 2)] + - in3[(i * 2) * width + (j * 2 + 1)] + in3[(i * 2 + 1) * width + - (j * 2 + 1)]) / 4; + (in3[(i * 2) * width + (j * 2)] + in3[(i * 2 + 1) * width + (j * 2)] + + in3[(i * 2) * width + (j * 2 + 1)] + in3[(i * 2 + 1) * width + + (j * 2 + 1)]) / 4; outu[i * width2 + j] = - ((in1u[i * width2 + j] * mask) + (in2u[i * width2 + j] * (255 - - mask))) >> 8; + ((in1u[i * width2 + j] * mask) + (in2u[i * width2 + j] * (255 - + mask))) >> 8; outv[i * width2 + j] = - ((in1v[i * width2 + j] * mask) + (in2v[i * width2 + j] * (255 - - mask))) >> 8; + ((in1v[i * width2 + j] * mask) + (in2v[i * width2 + j] * (255 - + mask))) >> 8; } } } diff --git a/gst/passthrough/gstpassthrough.c b/gst/passthrough/gstpassthrough.c index 37fecf7870..355a501335 100644 --- a/gst/passthrough/gstpassthrough.c +++ b/gst/passthrough/gstpassthrough.c @@ -56,7 +56,7 @@ static GstStaticPadTemplate passthrough_sink_template = GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) + GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) ); static GstStaticPadTemplate passthrough_src_template = @@ -64,7 +64,7 @@ static GstStaticPadTemplate passthrough_src_template = GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) + GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) ); static void passthrough_class_init (GstPassthroughClass * klass); @@ -118,17 +118,17 @@ passthrough_connect_sink (GstPad * pad, const GstCaps * caps) if (!filter->silent) { g_print ("Passthrough : channels %d, rate %d\n", filter->channels, - filter->rate); + filter->rate); g_print - ("Passthrough : format int, bit width %d, endianness %d, signed %s\n", - filter->width, filter->endianness, filter->is_signed ? "yes" : "no"); + ("Passthrough : format int, bit width %d, endianness %d, signed %s\n", + filter->width, filter->endianness, filter->is_signed ? "yes" : "no"); } } else if (strcmp (mimetype, "audio/x-raw-float") == 0) { filter->format = GST_PASSTHROUGH_FORMAT_FLOAT; if (!filter->silent) { g_print ("Passthrough : channels %d, rate %d\n", filter->channels, - filter->rate); + filter->rate); g_print ("Passthrough : format float, width %d\n", filter->width); } } @@ -153,9 +153,10 @@ gst_passthrough_get_type (void) 0, (GInstanceInitFunc) passthrough_init, }; + passthrough_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstPassthrough", - &passthrough_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstPassthrough", + &passthrough_info, 0); } return passthrough_type; } @@ -183,7 +184,7 @@ passthrough_class_init (GstPassthroughClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT, g_param_spec_boolean ("silent", "silent", "silent", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT, g_param_spec_boolean ("silent", "silent", "silent", TRUE, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = passthrough_set_property; gobject_class->get_property = passthrough_get_property; @@ -228,13 +229,13 @@ passthrough_chain (GstPad * pad, GstData * _data) int_data = (gint16 *) GST_BUFFER_DATA (buf); switch (filter->width) { - case 16: - passthrough_fast_16bit_chain (int_data, GST_BUFFER_SIZE (buf) / 2); - break; - case 8: - passthrough_fast_8bit_chain ((gint8 *) int_data, - GST_BUFFER_SIZE (buf)); - break; + case 16: + passthrough_fast_16bit_chain (int_data, GST_BUFFER_SIZE (buf) / 2); + break; + case 8: + passthrough_fast_8bit_chain ((gint8 *) int_data, + GST_BUFFER_SIZE (buf)); + break; } break; @@ -242,7 +243,7 @@ passthrough_chain (GstPad * pad, GstData * _data) float_data = (gfloat *) GST_BUFFER_DATA (buf); passthrough_fast_float_chain (float_data, - GST_BUFFER_SIZE (buf) / sizeof (gfloat)); + GST_BUFFER_SIZE (buf) / sizeof (gfloat)); break; } @@ -254,13 +255,13 @@ static void inline passthrough_fast_float_chain (gfloat * data, guint num_samples) #include "filter.func" static void inline - passthrough_fast_16bit_chain (gint16 * data, guint num_samples) + passthrough_fast_16bit_chain (gint16 * data, guint num_samples) #include "filter.func" static void inline - passthrough_fast_8bit_chain (gint8 * data, guint num_samples) + passthrough_fast_8bit_chain (gint8 * data, guint num_samples) #include "filter.func" static void - passthrough_set_property (GObject * object, guint prop_id, + passthrough_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstPassthrough *filter; diff --git a/gst/playondemand/demo-mp3.c b/gst/playondemand/demo-mp3.c index 907f7379b5..efae8ebf9e 100644 --- a/gst/playondemand/demo-mp3.c +++ b/gst/playondemand/demo-mp3.c @@ -22,7 +22,7 @@ played (GstElement * pod, gpointer data) g_print ("Played beat at %02u, beats are ", (guint) (gst_clock_get_time (element_clock) / GST_SECOND * - (GTK_ADJUSTMENT (speed_adj))->value) % NUM_BEATS); + (GTK_ADJUSTMENT (speed_adj))->value) % NUM_BEATS); for (i = 0; i <= NUM_BEATS / 32; i++) g_print ("%08x ", beats[i]); @@ -120,7 +120,7 @@ setup_gui (void) for (i = 0; i < NUM_BEATS; i++) beat_button[i] = - gtk_toggle_button_new_with_label (g_strdup_printf ("%2d", i + 1)); + gtk_toggle_button_new_with_label (g_strdup_printf ("%2d", i + 1)); speed_adj = gtk_adjustment_new (1, 0.0, 10.0, 0.1, 1.0, 0.0); speed_scale = gtk_hscale_new (GTK_ADJUSTMENT (speed_adj)); @@ -156,7 +156,7 @@ setup_gui (void) NULL); for (i = 0; i < NUM_BEATS; i++) g_signal_connect (G_OBJECT (beat_button[i]), "toggled", G_CALLBACK (beat), - GUINT_TO_POINTER (i)); + GUINT_TO_POINTER (i)); /* show the gui. */ gtk_widget_show_all (window); diff --git a/gst/playondemand/gstplayondemand.c b/gst/playondemand/gstplayondemand.c index b3d8d90936..5a2b8be66d 100644 --- a/gst/playondemand/gstplayondemand.c +++ b/gst/playondemand/gstplayondemand.c @@ -32,9 +32,9 @@ * way beyond what a real computer can actually keep track of, but hey ... */ /* some default values */ -#define GST_POD_MAX_PLAYS 100 /* maximum simultaneous plays */ -#define GST_POD_BUFFER_TIME 5.0 /* buffer length in seconds */ -#define GST_POD_TICK_RATE 1e-6 /* ticks per second */ +#define GST_POD_MAX_PLAYS 100 /* maximum simultaneous plays */ +#define GST_POD_BUFFER_TIME 5.0 /* buffer length in seconds */ +#define GST_POD_TICK_RATE 1e-6 /* ticks per second */ /* buffer pool fallback values ... use if no buffer pool is available */ #define GST_POD_BUFPOOL_SIZE 4096 @@ -54,7 +54,7 @@ static GstStaticPadTemplate play_on_demand_sink_template = GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) + GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) ); static GstStaticPadTemplate play_on_demand_src_template = @@ -62,7 +62,7 @@ static GstStaticPadTemplate play_on_demand_src_template = GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) + GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) ); @@ -109,8 +109,9 @@ gst_play_on_demand_get_type (void) 0, (GInstanceInitFunc) play_on_demand_init, }; + play_on_demand_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstPlayOnDemand", &play_on_demand_info, 0); + "GstPlayOnDemand", &play_on_demand_info, 0); } return play_on_demand_type; } @@ -203,33 +204,33 @@ play_on_demand_class_init (GstPlayOnDemandClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MUTE, g_param_spec_boolean ("mute", "Silence output", "Do not output any sound", - FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BUFFER_TIME, g_param_spec_float ("buffer-time", "Buffer length in seconds", - "Number of seconds of audio the buffer holds", 0.0, G_MAXFLOAT, - GST_POD_BUFFER_TIME, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + "Number of seconds of audio the buffer holds", 0.0, G_MAXFLOAT, + GST_POD_BUFFER_TIME, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MAX_PLAYS, g_param_spec_uint ("max-plays", "Maximum simultaneous playbacks", - "Maximum allowed number of simultaneous plays from the buffer", 1, - G_MAXUINT, GST_POD_MAX_PLAYS, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + "Maximum allowed number of simultaneous plays from the buffer", 1, + G_MAXUINT, GST_POD_MAX_PLAYS, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_TICK_RATE, g_param_spec_float ("tick-rate", "Tick rate (ticks/second)", - "The rate of musical ticks, the smallest time unit in a song", 0, - G_MAXFLOAT, GST_POD_TICK_RATE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + "The rate of musical ticks, the smallest time unit in a song", 0, + G_MAXFLOAT, GST_POD_TICK_RATE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_TOTAL_TICKS, g_param_spec_uint ("total-ticks", "Total number of ticks", - "Total number of ticks in the tick array", 1, G_MAXUINT, 1, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + "Total number of ticks in the tick array", 1, G_MAXUINT, 1, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_TICKS, g_param_spec_pointer ("ticks", "Ticks to play sample on", - "An array of ticks (musical times) at which to play the sample", - G_PARAM_READWRITE)); + "An array of ticks (musical times) at which to play the sample", + G_PARAM_READWRITE)); } static void @@ -282,7 +283,7 @@ play_on_demand_set_property (GObject * object, guint prop_id, /* clear out now-invalid play pointers */ for (i = 0; i < filter->max_plays; i++) - filter->plays[i] = G_MAXUINT; + filter->plays[i] = G_MAXUINT; break; case PROP_MAX_PLAYS: @@ -291,9 +292,9 @@ play_on_demand_set_property (GObject * object, guint prop_id, new_plays = g_new (guint, new_size); for (i = 0; i < min_size; i++) - new_plays[i] = filter->plays[i]; + new_plays[i] = filter->plays[i]; for (i = min_size; i < new_size; i++) - new_plays[i] = G_MAXUINT; + new_plays[i] = G_MAXUINT; g_free (filter->plays); filter->plays = new_plays; @@ -306,13 +307,13 @@ play_on_demand_set_property (GObject * object, guint prop_id, case PROP_TOTAL_TICKS: new_size = g_value_get_uint (value); min_size = - (new_size < filter->total_ticks) ? new_size : filter->total_ticks; + (new_size < filter->total_ticks) ? new_size : filter->total_ticks; new_ticks = g_new (guint32, new_size / 32 + 1); for (i = 0; i <= min_size / 32; i++) - new_ticks[i] = filter->ticks[i]; + new_ticks[i] = filter->ticks[i]; for (i = min_size / 32 + 1; i <= new_size / 32; i++) - new_ticks[i] = 0; + new_ticks[i] = 0; g_free (filter->ticks); filter->ticks = new_ticks; @@ -322,8 +323,8 @@ play_on_demand_set_property (GObject * object, guint prop_id, case PROP_TICKS: new_ticks = (guint *) g_value_get_pointer (value); if (new_ticks) { - g_free (filter->ticks); - filter->ticks = new_ticks; + g_free (filter->ticks); + filter->ticks = new_ticks; } break; default: @@ -415,10 +416,10 @@ play_on_demand_add_play_pointer (GstPlayOnDemand * filter, guint pos) if (filter->rate && ((filter->buffer_time * filter->rate) > pos)) { for (i = 0; i < filter->max_plays; i++) { if (filter->plays[i] == G_MAXUINT) { - filter->plays[i] = pos; - /* emit a signal to indicate a sample being played */ - g_signal_emit (filter, gst_pod_filter_signals[PLAYED_SIGNAL], 0); - break; + filter->plays[i] = pos; + /* emit a signal to indicate a sample being played */ + g_signal_emit (filter, gst_pod_filter_signals[PLAYED_SIGNAL], 0); + break; } } } diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index f7914e24e2..ad1e32320d 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -173,9 +173,10 @@ gst_qtdemux_get_type (void) NULL, NULL, sizeof (GstQTDemux), 0, (GInstanceInitFunc) gst_qtdemux_init, }; + qtdemux_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstQTDemux", &qtdemux_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstQTDemux", &qtdemux_info, + 0); } return qtdemux_type; } @@ -254,35 +255,35 @@ gst_qtdemux_src_convert (GstPad * pad, GstFormat src_format, gint64 src_value, switch (src_format) { case GST_FORMAT_TIME: switch (*dest_format) { - case GST_FORMAT_BYTES: - *dest_value = src_value * 1; /* FIXME */ - break; - case GST_FORMAT_DEFAULT: - *dest_value = src_value * 1; /* FIXME */ - break; - default: - res = FALSE; - break; + case GST_FORMAT_BYTES: + *dest_value = src_value * 1; /* FIXME */ + break; + case GST_FORMAT_DEFAULT: + *dest_value = src_value * 1; /* FIXME */ + break; + default: + res = FALSE; + break; } break; case GST_FORMAT_BYTES: switch (*dest_format) { - case GST_FORMAT_TIME: - *dest_value = src_value * 1; /* FIXME */ - break; - default: - res = FALSE; - break; + case GST_FORMAT_TIME: + *dest_value = src_value * 1; /* FIXME */ + break; + default: + res = FALSE; + break; } break; case GST_FORMAT_DEFAULT: switch (*dest_format) { - case GST_FORMAT_TIME: - *dest_value = src_value * 1; /* FIXME */ - break; - default: - res = FALSE; - break; + case GST_FORMAT_TIME: + *dest_value = src_value * 1; /* FIXME */ + break; + default: + res = FALSE; + break; } break; default: @@ -326,34 +327,34 @@ gst_qtdemux_handle_src_query (GstPad * pad, GstQueryType type, switch (type) { case GST_QUERY_TOTAL: switch (*format) { - case GST_FORMAT_TIME: - *value = 0; /* FIXME */ - break; - case GST_FORMAT_BYTES: - *value = 0; /* FIXME */ - break; - case GST_FORMAT_DEFAULT: - *value = 0; /* FIXME */ - break; - default: - res = FALSE; - break; + case GST_FORMAT_TIME: + *value = 0; /* FIXME */ + break; + case GST_FORMAT_BYTES: + *value = 0; /* FIXME */ + break; + case GST_FORMAT_DEFAULT: + *value = 0; /* FIXME */ + break; + default: + res = FALSE; + break; } break; case GST_QUERY_POSITION: switch (*format) { - case GST_FORMAT_TIME: - *value = 0; /* FIXME */ - break; - case GST_FORMAT_BYTES: - *value = 0; /* FIXME */ - break; - case GST_FORMAT_DEFAULT: - *value = 0; /* FIXME */ - break; - default: - res = FALSE; - break; + case GST_FORMAT_TIME: + *value = 0; /* FIXME */ + break; + case GST_FORMAT_BYTES: + *value = 0; /* FIXME */ + break; + case GST_FORMAT_DEFAULT: + *value = 0; /* FIXME */ + break; + default: + res = FALSE; + break; } break; default: @@ -376,19 +377,19 @@ gst_qtdemux_handle_src_event (GstPad * pad, GstEvent * event) GST_DEBUG ("seek format %d", GST_EVENT_SEEK_FORMAT (event)); switch (GST_EVENT_SEEK_FORMAT (event)) { - case GST_FORMAT_BYTES: - case GST_FORMAT_DEFAULT: - case GST_FORMAT_TIME: - { - gint64 desired_offset = GST_EVENT_SEEK_OFFSET (event); + case GST_FORMAT_BYTES: + case GST_FORMAT_DEFAULT: + case GST_FORMAT_TIME: + { + gint64 desired_offset = GST_EVENT_SEEK_OFFSET (event); - GST_DEBUG ("seeking to %" G_GINT64_FORMAT, desired_offset); + GST_DEBUG ("seeking to %" G_GINT64_FORMAT, desired_offset); - res = FALSE; - } - default: - res = FALSE; - break; + res = FALSE; + } + default: + res = FALSE; + break; } default: res = FALSE; @@ -509,14 +510,14 @@ gst_qtdemux_loop_header (GstElement * element) case QTDEMUX_STATE_HEADER: { do { - ret = gst_bytestream_peek_bytes (qtdemux->bs, &data, 16); - if (ret < 16) { - if (!gst_qtdemux_handle_sink_event (qtdemux)) { - return; - } - } else { - break; - } + ret = gst_bytestream_peek_bytes (qtdemux->bs, &data, 16); + if (ret < 16) { + if (!gst_qtdemux_handle_sink_event (qtdemux)) { + return; + } + } else { + break; + } } while (1); length = GUINT32_FROM_BE (*(guint32 *) data); @@ -525,58 +526,58 @@ gst_qtdemux_loop_header (GstElement * element) GST_DEBUG ("fourcc " GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc)); if (length == 0) { - length = gst_bytestream_length (qtdemux->bs) - cur_offset; + length = gst_bytestream_length (qtdemux->bs) - cur_offset; } if (length == 1) { - guint32 length1, length2; + guint32 length1, length2; - length1 = GUINT32_FROM_BE (*(guint32 *) (data + 8)); - GST_DEBUG ("length1 %08x", length1); - length2 = GUINT32_FROM_BE (*(guint32 *) (data + 12)); - GST_DEBUG ("length2 %08x", length2); + length1 = GUINT32_FROM_BE (*(guint32 *) (data + 8)); + GST_DEBUG ("length1 %08x", length1); + length2 = GUINT32_FROM_BE (*(guint32 *) (data + 12)); + GST_DEBUG ("length2 %08x", length2); - length = length2; + length = length2; } switch (fourcc) { - case GST_MAKE_FOURCC ('m', 'd', 'a', 't'): - case GST_MAKE_FOURCC ('f', 'r', 'e', 'e'): - case GST_MAKE_FOURCC ('w', 'i', 'd', 'e'): - case GST_MAKE_FOURCC ('P', 'I', 'C', 'T'): - case GST_MAKE_FOURCC ('p', 'n', 'o', 't'): - break; - case GST_MAKE_FOURCC ('m', 'o', 'o', 'v'): - { - GstBuffer *moov; + case GST_MAKE_FOURCC ('m', 'd', 'a', 't'): + case GST_MAKE_FOURCC ('f', 'r', 'e', 'e'): + case GST_MAKE_FOURCC ('w', 'i', 'd', 'e'): + case GST_MAKE_FOURCC ('P', 'I', 'C', 'T'): + case GST_MAKE_FOURCC ('p', 'n', 'o', 't'): + break; + case GST_MAKE_FOURCC ('m', 'o', 'o', 'v'): + { + GstBuffer *moov; - do { - ret = gst_bytestream_read (qtdemux->bs, &moov, length); - if (ret < length) { - GST_DEBUG ("read failed (%d < %d)", ret, length); - if (!gst_qtdemux_handle_sink_event (qtdemux)) { - return; - } - } else { - break; - } - } while (1); + do { + ret = gst_bytestream_read (qtdemux->bs, &moov, length); + if (ret < length) { + GST_DEBUG ("read failed (%d < %d)", ret, length); + if (!gst_qtdemux_handle_sink_event (qtdemux)) { + return; + } + } else { + break; + } + } while (1); - qtdemux_parse_moov (qtdemux, GST_BUFFER_DATA (moov), length); - if (1) - qtdemux_node_dump (qtdemux, qtdemux->moov_node); - qtdemux_parse_tree (qtdemux); - qtdemux->state = QTDEMUX_STATE_MOVIE; - break; - } - default: - { - GST_LOG ("unknown %08x '" GST_FOURCC_FORMAT "' at %d\n", - fourcc, GST_FOURCC_ARGS (fourcc), cur_offset); - break; - } + qtdemux_parse_moov (qtdemux, GST_BUFFER_DATA (moov), length); + if (1) + qtdemux_node_dump (qtdemux, qtdemux->moov_node); + qtdemux_parse_tree (qtdemux); + qtdemux->state = QTDEMUX_STATE_MOVIE; + break; + } + default: + { + GST_LOG ("unknown %08x '" GST_FOURCC_FORMAT "' at %d\n", + fourcc, GST_FOURCC_ARGS (fourcc), cur_offset); + break; + } } ret = gst_bytestream_seek (qtdemux->bs, cur_offset + length, - GST_SEEK_METHOD_SET); + GST_SEEK_METHOD_SET); qtdemux->offset = cur_offset + length; GST_DEBUG ("seek returned %d\n", ret); break; @@ -586,14 +587,14 @@ gst_qtdemux_loop_header (GstElement * element) guint8 *data; do { - ret = gst_bytestream_peek_bytes (qtdemux->bs, &data, 1); - if (ret < 1) { - if (!gst_qtdemux_handle_sink_event (qtdemux)) { - return; - } - } else { - break; - } + ret = gst_bytestream_peek_bytes (qtdemux->bs, &data, 1); + if (ret < 1) { + if (!gst_qtdemux_handle_sink_event (qtdemux)) { + return; + } + } else { + break; + } } while (TRUE); gst_element_set_eos (element); @@ -612,25 +613,25 @@ gst_qtdemux_loop_header (GstElement * element) min_time = G_MAXUINT64; for (i = 0; i < qtdemux->n_streams; i++) { - stream = qtdemux->streams[i]; + stream = qtdemux->streams[i]; - if (stream->sample_index < stream->n_samples && - stream->samples[stream->sample_index].timestamp < min_time) { - min_time = stream->samples[stream->sample_index].timestamp; - index = i; - } + if (stream->sample_index < stream->n_samples && + stream->samples[stream->sample_index].timestamp < min_time) { + min_time = stream->samples[stream->sample_index].timestamp; + index = i; + } } if (index == -1) { - for (i = 0; i < qtdemux->n_streams; i++) { - gst_pad_push (qtdemux->streams[i]->pad, - GST_DATA (gst_event_new (GST_EVENT_EOS))); - } - ret = gst_bytestream_seek (qtdemux->bs, 0, GST_SEEK_METHOD_END); - GST_DEBUG ("seek returned %d", ret); + for (i = 0; i < qtdemux->n_streams; i++) { + gst_pad_push (qtdemux->streams[i]->pad, + GST_DATA (gst_event_new (GST_EVENT_EOS))); + } + ret = gst_bytestream_seek (qtdemux->bs, 0, GST_SEEK_METHOD_END); + GST_DEBUG ("seek returned %d", ret); - qtdemux->state = QTDEMUX_STATE_SEEKING_EOS; - return; + qtdemux->state = QTDEMUX_STATE_SEEKING_EOS; + return; } stream = qtdemux->streams[index]; @@ -639,53 +640,53 @@ gst_qtdemux_loop_header (GstElement * element) size = stream->samples[stream->sample_index].size; GST_INFO - ("pushing from stream %d, sample_index=%d offset=%d size=%d timestamp=%lld", - index, stream->sample_index, offset, size, - stream->samples[stream->sample_index].timestamp); + ("pushing from stream %d, sample_index=%d offset=%d size=%d timestamp=%lld", + index, stream->sample_index, offset, size, + stream->samples[stream->sample_index].timestamp); cur_offset = gst_bytestream_tell (qtdemux->bs); if (offset != cur_offset) { - GST_DEBUG ("seeking to offset %d", offset); - GST_LOG ("seeking to offset %d\n", offset); - ret = gst_bytestream_seek (qtdemux->bs, offset, GST_SEEK_METHOD_SET); - GST_DEBUG ("seek returned %d", ret); - return; + GST_DEBUG ("seeking to offset %d", offset); + GST_LOG ("seeking to offset %d\n", offset); + ret = gst_bytestream_seek (qtdemux->bs, offset, GST_SEEK_METHOD_SET); + GST_DEBUG ("seek returned %d", ret); + return; } GST_DEBUG ("reading %d bytes\n", size); buf = NULL; do { - ret = gst_bytestream_read (qtdemux->bs, &buf, size); - if (ret < size) { - GST_DEBUG ("read failed (%d < %d)", ret, size); - if (!gst_qtdemux_handle_sink_event (qtdemux)) { - return; - } - } else { - break; - } + ret = gst_bytestream_read (qtdemux->bs, &buf, size); + if (ret < size) { + GST_DEBUG ("read failed (%d < %d)", ret, size); + if (!gst_qtdemux_handle_sink_event (qtdemux)) { + return; + } + } else { + break; + } } while (TRUE); if (buf) { - /* hum... */ - if (stream->subtype == GST_MAKE_FOURCC ('v', 'i', 'd', 'e')) { - float fps = - 1. * GST_SECOND / stream->samples[stream->sample_index].duration; - if (fps != stream->fps) { - gst_caps_set_simple (stream->caps, "framerate", G_TYPE_DOUBLE, fps, - NULL); - stream->fps = fps; - gst_pad_set_explicit_caps (stream->pad, stream->caps); - } - } + /* hum... */ + if (stream->subtype == GST_MAKE_FOURCC ('v', 'i', 'd', 'e')) { + float fps = + 1. * GST_SECOND / stream->samples[stream->sample_index].duration; + if (fps != stream->fps) { + gst_caps_set_simple (stream->caps, "framerate", G_TYPE_DOUBLE, fps, + NULL); + stream->fps = fps; + gst_pad_set_explicit_caps (stream->pad, stream->caps); + } + } - GST_BUFFER_TIMESTAMP (buf) = - stream->samples[stream->sample_index].timestamp; - GST_BUFFER_DURATION (buf) = - stream->samples[stream->sample_index].duration; - gst_pad_push (stream->pad, GST_DATA (buf)); + GST_BUFFER_TIMESTAMP (buf) = + stream->samples[stream->sample_index].timestamp; + GST_BUFFER_DURATION (buf) = + stream->samples[stream->sample_index].duration; + gst_pad_push (stream->pad, GST_DATA (buf)); - GST_DEBUG ("pushing buffer on %" GST_PTR_FORMAT, stream->pad); + GST_DEBUG ("pushing buffer on %" GST_PTR_FORMAT, stream->pad); } stream->sample_index++; break; @@ -704,28 +705,28 @@ gst_qtdemux_add_stream (GstQTDemux * qtdemux, QtDemuxStream * stream) gchar *name = g_strdup_printf ("video_%02d", qtdemux->n_video_streams); stream->pad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_qtdemux_videosrc_template), name); + gst_pad_new_from_template (gst_static_pad_template_get + (&gst_qtdemux_videosrc_template), name); g_free (name); stream->fps = 1. * GST_SECOND / stream->samples[0].duration; if (stream->caps) { gst_caps_set_simple (stream->caps, - "width", G_TYPE_INT, stream->width, - "height", G_TYPE_INT, stream->height, - "framerate", G_TYPE_DOUBLE, stream->fps, NULL); + "width", G_TYPE_INT, stream->width, + "height", G_TYPE_INT, stream->height, + "framerate", G_TYPE_DOUBLE, stream->fps, NULL); } qtdemux->n_video_streams++; } else { gchar *name = g_strdup_printf ("audio_%02d", qtdemux->n_audio_streams); stream->pad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_qtdemux_audiosrc_template), name); + gst_pad_new_from_template (gst_static_pad_template_get + (&gst_qtdemux_audiosrc_template), name); g_free (name); if (stream->caps) { gst_caps_set_simple (stream->caps, - "rate", G_TYPE_INT, (int) stream->rate, - "channels", G_TYPE_INT, stream->n_channels, NULL); + "rate", G_TYPE_INT, (int) stream->rate, + "channels", G_TYPE_INT, stream->n_channels, NULL); } qtdemux->n_audio_streams++; } @@ -819,7 +820,7 @@ QtNodeType qt_node_types[] = { qtdemux_dump_mvhd}, {FOURCC_clip, "clipping", QT_CONTAINER,}, {FOURCC_trak, "track", QT_CONTAINER,}, - {FOURCC_udta, "user data", 0,}, /* special container */ + {FOURCC_udta, "user data", 0,}, /* special container */ {FOURCC_ctab, "color table", 0,}, {FOURCC_tkhd, "track header", 0, qtdemux_dump_tkhd}, @@ -832,7 +833,7 @@ QtNodeType qt_node_types[] = { {FOURCC_load, "track load settings", 0,}, {FOURCC_tref, "track reference", QT_CONTAINER,}, {FOURCC_imap, "track input map", QT_CONTAINER,}, - {FOURCC___in, "track input", 0,}, /* special container */ + {FOURCC___in, "track input", 0,}, /* special container */ {FOURCC___ty, "input type", 0,}, {FOURCC_mdia, "media", QT_CONTAINER}, {FOURCC_mdhd, "media header", 0, @@ -940,7 +941,7 @@ qtdemux_parse_moov (GstQTDemux * qtdemux, void *buffer, int length) cmvd = qtdemux_tree_get_child_by_type (cmov, FOURCC_cmvd); if (QTDEMUX_FOURCC_GET (dcom->data + 8) == GST_MAKE_FOURCC ('z', 'l', 'i', - 'b')) { + 'b')) { int uncompressed_length; int compressed_length; void *buf; @@ -950,7 +951,7 @@ qtdemux_parse_moov (GstQTDemux * qtdemux, void *buffer, int length) GST_LOG ("length = %d\n", uncompressed_length); buf = qtdemux_inflate (cmvd->data + 12, compressed_length, - uncompressed_length); + uncompressed_length); qtdemux->moov_node_compressed = qtdemux->moov_node; qtdemux->moov_node = g_node_new (buf); @@ -990,8 +991,8 @@ qtdemux_parse (GstQTDemux * qtdemux, GNode * node, void *buffer, int length) GNode *child; if (buf + 8 >= end) { - /* FIXME: get annoyed */ - GST_LOG ("buffer overrun\n"); + /* FIXME: get annoyed */ + GST_LOG ("buffer overrun\n"); } len = QTDEMUX_GUINT32_GET (buf); @@ -1011,24 +1012,24 @@ qtdemux_parse (GstQTDemux * qtdemux, GNode * node, void *buffer, int length) GST_LOG ("length = %d\n", uncompressed_length); buf = - qtdemux_inflate (buffer + 12, node_length - 12, uncompressed_length); + qtdemux_inflate (buffer + 12, node_length - 12, uncompressed_length); end = buf + uncompressed_length; while (buf < end) { - GNode *child; - guint32 len; + GNode *child; + guint32 len; - if (buf + 8 >= end) { - /* FIXME: get annoyed */ - GST_LOG ("buffer overrun\n"); - } - len = QTDEMUX_GUINT32_GET (buf); + if (buf + 8 >= end) { + /* FIXME: get annoyed */ + GST_LOG ("buffer overrun\n"); + } + len = QTDEMUX_GUINT32_GET (buf); - child = g_node_new (buf); - g_node_append (node, child); - qtdemux_parse (qtdemux, child, buf, len); + child = g_node_new (buf); + g_node_append (node, child); + qtdemux_parse (qtdemux, child, buf, len); - buf += len; + buf += len; } } #endif @@ -1150,11 +1151,11 @@ qtdemux_dump_elst (GstQTDemux * qtdemux, void *buffer, int depth) n = QTDEMUX_GUINT32_GET (buffer + 12); for (i = 0; i < n; i++) { GST_LOG ("%*s track dur: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + 16 + i * 12)); + QTDEMUX_GUINT32_GET (buffer + 16 + i * 12)); GST_LOG ("%*s media time: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + 20 + i * 12)); + QTDEMUX_GUINT32_GET (buffer + 20 + i * 12)); GST_LOG ("%*s media rate: %g\n", depth, "", - QTDEMUX_FP32_GET (buffer + 24 + i * 12)); + QTDEMUX_FP32_GET (buffer + 24 + i * 12)); } } @@ -1222,9 +1223,9 @@ qtdemux_dump_dref (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s size: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); GST_LOG ("%*s type: " GST_FOURCC_FORMAT "\n", depth, "", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (buffer + offset + 4))); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (buffer + offset + 4))); offset += QTDEMUX_GUINT32_GET (buffer + offset); } } @@ -1244,39 +1245,39 @@ qtdemux_dump_stsd (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s size: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); GST_LOG ("%*s type: " GST_FOURCC_FORMAT "\n", depth, "", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (buffer + offset + 4))); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (buffer + offset + 4))); GST_LOG ("%*s data reference:%d\n", depth, "", - QTDEMUX_GUINT16_GET (buffer + offset + 14)); + QTDEMUX_GUINT16_GET (buffer + offset + 14)); GST_LOG ("%*s version/rev.: %08x\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 16)); + QTDEMUX_GUINT32_GET (buffer + offset + 16)); GST_LOG ("%*s vendor: " GST_FOURCC_FORMAT "\n", depth, "", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (buffer + offset + 20))); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (buffer + offset + 20))); GST_LOG ("%*s temporal qual: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 24)); + QTDEMUX_GUINT32_GET (buffer + offset + 24)); GST_LOG ("%*s spatial qual: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 28)); + QTDEMUX_GUINT32_GET (buffer + offset + 28)); GST_LOG ("%*s width: %u\n", depth, "", - QTDEMUX_GUINT16_GET (buffer + offset + 32)); + QTDEMUX_GUINT16_GET (buffer + offset + 32)); GST_LOG ("%*s height: %u\n", depth, "", - QTDEMUX_GUINT16_GET (buffer + offset + 34)); + QTDEMUX_GUINT16_GET (buffer + offset + 34)); GST_LOG ("%*s horiz. resol: %g\n", depth, "", - QTDEMUX_FP32_GET (buffer + offset + 36)); + QTDEMUX_FP32_GET (buffer + offset + 36)); GST_LOG ("%*s vert. resol.: %g\n", depth, "", - QTDEMUX_FP32_GET (buffer + offset + 40)); + QTDEMUX_FP32_GET (buffer + offset + 40)); GST_LOG ("%*s data size: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 44)); + QTDEMUX_GUINT32_GET (buffer + offset + 44)); GST_LOG ("%*s frame count: %u\n", depth, "", - QTDEMUX_GUINT16_GET (buffer + offset + 48)); + QTDEMUX_GUINT16_GET (buffer + offset + 48)); GST_LOG ("%*s compressor: %*s\n", depth, "", - QTDEMUX_GUINT8_GET (buffer + offset + 49), - (char *) (buffer + offset + 51)); + QTDEMUX_GUINT8_GET (buffer + offset + 49), + (char *) (buffer + offset + 51)); GST_LOG ("%*s depth: %u\n", depth, "", - QTDEMUX_GUINT16_GET (buffer + offset + 82)); + QTDEMUX_GUINT16_GET (buffer + offset + 82)); GST_LOG ("%*s color table ID:%u\n", depth, "", - QTDEMUX_GUINT16_GET (buffer + offset + 84)); + QTDEMUX_GUINT16_GET (buffer + offset + 84)); offset += QTDEMUX_GUINT32_GET (buffer + offset); } @@ -1297,9 +1298,9 @@ qtdemux_dump_stts (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s count: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); GST_LOG ("%*s duration: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 4)); + QTDEMUX_GUINT32_GET (buffer + offset + 4)); offset += 8; } @@ -1320,7 +1321,7 @@ qtdemux_dump_stss (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s sample: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); offset += 4; } @@ -1341,11 +1342,11 @@ qtdemux_dump_stsc (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s first chunk: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); GST_LOG ("%*s sample per ch: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 4)); + QTDEMUX_GUINT32_GET (buffer + offset + 4)); GST_LOG ("%*s sample desc id:%08x\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 8)); + QTDEMUX_GUINT32_GET (buffer + offset + 8)); offset += 12; } @@ -1366,12 +1367,12 @@ qtdemux_dump_stsz (GstQTDemux * qtdemux, void *buffer, int depth) sample_size = QTDEMUX_GUINT32_GET (buffer + 12); if (sample_size == 0) { GST_LOG ("%*s n entries: %d\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + 16)); + QTDEMUX_GUINT32_GET (buffer + 16)); n = QTDEMUX_GUINT32_GET (buffer + 16); offset = 20; for (i = 0; i < n; i++) { GST_LOG ("%*s sample size: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); offset += 4; } @@ -1393,7 +1394,7 @@ qtdemux_dump_stco (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s chunk offset: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); offset += 4; } @@ -1414,7 +1415,7 @@ qtdemux_dump_co64 (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s chunk offset: %" G_GUINT64_FORMAT "\n", depth, "", - QTDEMUX_GUINT64_GET (buffer + offset)); + QTDEMUX_GUINT64_GET (buffer + offset)); offset += 8; } @@ -1569,58 +1570,58 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) if (stream->subtype == FOURCC_vide) { offset = 16; GST_LOG ("st type: " GST_FOURCC_FORMAT "\n", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + offset + 4))); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + offset + 4))); stream->width = QTDEMUX_GUINT16_GET (stsd->data + offset + 32); stream->height = QTDEMUX_GUINT16_GET (stsd->data + offset + 34); - stream->fps = 0.; /* this is filled in later */ + stream->fps = 0.; /* this is filled in later */ GST_LOG ("frame count: %u\n", - QTDEMUX_GUINT16_GET (stsd->data + offset + 48)); + QTDEMUX_GUINT16_GET (stsd->data + offset + 48)); stream->caps = qtdemux_video_caps (qtdemux, - QTDEMUX_FOURCC_GET (stsd->data + offset + 4), stsd->data); + QTDEMUX_FOURCC_GET (stsd->data + offset + 4), stsd->data); GST_INFO ("type " GST_FOURCC_FORMAT " caps %" GST_PTR_FORMAT "\n", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + offset + 4)), - stream->caps); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + offset + 4)), + stream->caps); } else if (stream->subtype == FOURCC_soun) { int version, samplesize; GST_LOG ("st type: " GST_FOURCC_FORMAT "\n", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4))); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4))); offset = 32; GST_LOG ("version/rev: %08x\n", - QTDEMUX_GUINT32_GET (stsd->data + offset)); + QTDEMUX_GUINT32_GET (stsd->data + offset)); version = QTDEMUX_GUINT32_GET (stsd->data + offset); GST_LOG ("vendor: %08x\n", - QTDEMUX_GUINT32_GET (stsd->data + offset + 4)); + QTDEMUX_GUINT32_GET (stsd->data + offset + 4)); GST_LOG ("n_channels: %d\n", - QTDEMUX_GUINT16_GET (stsd->data + offset + 8)); + QTDEMUX_GUINT16_GET (stsd->data + offset + 8)); stream->n_channels = QTDEMUX_GUINT16_GET (stsd->data + offset + 8); GST_LOG ("sample_size: %d\n", - QTDEMUX_GUINT16_GET (stsd->data + offset + 10)); + QTDEMUX_GUINT16_GET (stsd->data + offset + 10)); samplesize = QTDEMUX_GUINT16_GET (stsd->data + offset + 10); GST_LOG ("compression_id: %d\n", - QTDEMUX_GUINT16_GET (stsd->data + offset + 12)); + QTDEMUX_GUINT16_GET (stsd->data + offset + 12)); GST_LOG ("packet size: %d\n", - QTDEMUX_GUINT16_GET (stsd->data + offset + 14)); + QTDEMUX_GUINT16_GET (stsd->data + offset + 14)); GST_LOG ("sample rate: %g\n", - QTDEMUX_FP32_GET (stsd->data + offset + 16)); + QTDEMUX_FP32_GET (stsd->data + offset + 16)); stream->rate = QTDEMUX_FP32_GET (stsd->data + offset + 16); offset = 52; if (version == 0x00010000) { GST_LOG ("samples/packet: %d\n", - QTDEMUX_GUINT32_GET (stsd->data + offset)); + QTDEMUX_GUINT32_GET (stsd->data + offset)); stream->samples_per_packet = QTDEMUX_GUINT32_GET (stsd->data + offset); GST_LOG ("bytes/packet: %d\n", - QTDEMUX_GUINT32_GET (stsd->data + offset + 4)); + QTDEMUX_GUINT32_GET (stsd->data + offset + 4)); GST_LOG ("bytes/frame: %d\n", - QTDEMUX_GUINT32_GET (stsd->data + offset + 8)); + QTDEMUX_GUINT32_GET (stsd->data + offset + 8)); stream->bytes_per_frame = QTDEMUX_GUINT32_GET (stsd->data + offset + 8); GST_LOG ("bytes/sample: %d\n", - QTDEMUX_GUINT32_GET (stsd->data + offset + 12)); + QTDEMUX_GUINT32_GET (stsd->data + offset + 12)); offset = 68; } else { stream->bytes_per_frame = stream->n_channels * samplesize / 8; @@ -1628,12 +1629,12 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) } stream->caps = qtdemux_audio_caps (qtdemux, - QTDEMUX_FOURCC_GET (stsd->data + 16 + 4), - (QTDEMUX_GUINT32_GET (stsd->data) > - offset) ? stsd->data + offset : NULL); + QTDEMUX_FOURCC_GET (stsd->data + 16 + 4), + (QTDEMUX_GUINT32_GET (stsd->data) > + offset) ? stsd->data + offset : NULL); GST_INFO ("type " GST_FOURCC_FORMAT " caps %" GST_PTR_FORMAT "\n", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4)), - stream->caps); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4)), + stream->caps); } else { GST_LOG ("unknown subtype\n"); return; @@ -1672,28 +1673,28 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) first_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 0) - 1; if (i == n_samples_per_chunk - 1) { - last_chunk = INT_MAX; + last_chunk = INT_MAX; } else { - last_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 12) - 1; + last_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 12) - 1; } samples_per_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 4); for (j = first_chunk; j < last_chunk; j++) { - int chunk_offset; + int chunk_offset; - if (stco) { - chunk_offset = QTDEMUX_GUINT32_GET (stco->data + 16 + j * 4); - } else { - chunk_offset = QTDEMUX_GUINT64_GET (co64->data + 16 + j * 8); - } - for (k = 0; k < samples_per_chunk; k++) { - samples[index].chunk = j; - samples[index].offset = chunk_offset; - chunk_offset += samples[index].size; - index++; - if (index >= n_samples) - goto done; - } + if (stco) { + chunk_offset = QTDEMUX_GUINT32_GET (stco->data + 16 + j * 4); + } else { + chunk_offset = QTDEMUX_GUINT64_GET (co64->data + 16 + j * 8); + } + for (k = 0; k < samples_per_chunk; k++) { + samples[index].chunk = j; + samples[index].offset = chunk_offset; + chunk_offset += samples[index].size; + index++; + if (index >= n_samples) + goto done; + } } } done: @@ -1710,11 +1711,11 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) duration = QTDEMUX_GUINT32_GET (stts->data + 16 + 8 * i + 4); time = (GST_SECOND * duration) / stream->timescale; for (j = 0; j < n; j++) { - //GST_INFO("moo %lld", timestamp); - samples[index].timestamp = timestamp; - samples[index].duration = time; - timestamp += time; - index++; + //GST_INFO("moo %lld", timestamp); + samples[index].timestamp = timestamp; + samples[index].duration = time; + timestamp += time; + index++; } } } else { @@ -1744,40 +1745,40 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) first_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 0) - 1; if (i == n_samples - 1) { - last_chunk = INT_MAX; + last_chunk = INT_MAX; } else { - last_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 12) - 1; + last_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 12) - 1; } samples_per_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 4); for (j = first_chunk; j < last_chunk; j++) { - int chunk_offset; + int chunk_offset; - if (j >= n_samples) - goto done2; - if (stco) { - chunk_offset = QTDEMUX_GUINT32_GET (stco->data + 16 + j * 4); - } else { - chunk_offset = QTDEMUX_GUINT64_GET (co64->data + 16 + j * 8); - } - samples[j].chunk = j; - samples[j].offset = chunk_offset; - samples[j].size = - samples_per_chunk * stream->bytes_per_frame / - stream->samples_per_packet; - samples[j].duration = - samples_per_chunk * GST_SECOND / (stream->rate / 2); - samples[j].timestamp = timestamp; - timestamp += (samples_per_chunk * GST_SECOND) / stream->rate; + if (j >= n_samples) + goto done2; + if (stco) { + chunk_offset = QTDEMUX_GUINT32_GET (stco->data + 16 + j * 4); + } else { + chunk_offset = QTDEMUX_GUINT64_GET (co64->data + 16 + j * 8); + } + samples[j].chunk = j; + samples[j].offset = chunk_offset; + samples[j].size = + samples_per_chunk * stream->bytes_per_frame / + stream->samples_per_packet; + samples[j].duration = + samples_per_chunk * GST_SECOND / (stream->rate / 2); + samples[j].timestamp = timestamp; + timestamp += (samples_per_chunk * GST_SECOND) / stream->rate; #if 0 - GST_INFO ("moo samples_per_chunk=%d rate=%d dur=%lld %lld", - (int) samples_per_chunk, - (int) stream->rate, - (long long) ((samples_per_chunk * GST_SECOND) / stream->rate), - (long long) timestamp); + GST_INFO ("moo samples_per_chunk=%d rate=%d dur=%lld %lld", + (int) samples_per_chunk, + (int) stream->rate, + (long long) ((samples_per_chunk * GST_SECOND) / stream->rate), + (long long) timestamp); #endif - samples[j].sample_index = sample_index; - sample_index += samples_per_chunk; + samples[j].sample_index = sample_index; + sample_index += samples_per_chunk; } } /* @@ -1809,8 +1810,8 @@ done2: #if 0 for (i = 0; i < n_samples; i++) { GST_LOG ("%d: %d %d %d %d %" G_GUINT64_FORMAT "\n", i, - samples[i].sample_index, samples[i].chunk, - samples[i].offset, samples[i].size, samples[i].timestamp); + samples[i].sample_index, samples[i].chunk, + samples[i].offset, samples[i].size, samples[i].timestamp); if (i > 10) break; } @@ -1836,53 +1837,53 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc, return gst_caps_from_string ("image/jpeg"); case GST_MAKE_FOURCC ('S', 'V', 'Q', '3'): if (stsd_data != NULL) { - gst_getbits_t gb; - gint halfpel_flag; - gint thirdpel_flag; - gint unknown_svq3_flag; - gint low_delay; - gint size; + gst_getbits_t gb; + gint halfpel_flag; + gint thirdpel_flag; + gint unknown_svq3_flag; + gint low_delay; + gint size; - size = QTDEMUX_GUINT32_GET (stsd_data + 16); + size = QTDEMUX_GUINT32_GET (stsd_data + 16); - gst_getbits_init (&gb, NULL, NULL); - gst_getbits_newbuf (&gb, (unsigned char *) stsd_data + 98 + 16 + 4, - (size - 102 + 16)); + gst_getbits_init (&gb, NULL, NULL); + gst_getbits_newbuf (&gb, (unsigned char *) stsd_data + 98 + 16 + 4, + (size - 102 + 16)); - /* Infos ripped from ffmpeg see libavcodec/svq3.c */ + /* Infos ripped from ffmpeg see libavcodec/svq3.c */ - /* 'frame size code' and optional 'width, height' */ - if (gst_getbitsn (&gb, 3) == 7) { - gst_getbitsn (&gb, 12); - gst_getbitsn (&gb, 12); - } + /* 'frame size code' and optional 'width, height' */ + if (gst_getbitsn (&gb, 3) == 7) { + gst_getbitsn (&gb, 12); + gst_getbitsn (&gb, 12); + } - halfpel_flag = gst_get1bit (&gb); - thirdpel_flag = gst_get1bit (&gb); + halfpel_flag = gst_get1bit (&gb); + thirdpel_flag = gst_get1bit (&gb); - /* unknown fields */ - gst_get1bit (&gb); - gst_get1bit (&gb); - gst_get1bit (&gb); - gst_get1bit (&gb); + /* unknown fields */ + gst_get1bit (&gb); + gst_get1bit (&gb); + gst_get1bit (&gb); + gst_get1bit (&gb); - low_delay = gst_get1bit (&gb); + low_delay = gst_get1bit (&gb); - /* unknown field */ - gst_get1bit (&gb); + /* unknown field */ + gst_get1bit (&gb); - while (gst_get1bit (&gb)) { - gst_getbitsn (&gb, 8); - } + while (gst_get1bit (&gb)) { + gst_getbitsn (&gb, 8); + } - unknown_svq3_flag = gst_get1bit (&gb); + unknown_svq3_flag = gst_get1bit (&gb); - return gst_caps_new_simple ("video/x-svq", - "svqversion", G_TYPE_INT, 3, - "halfpel_flag", G_TYPE_INT, halfpel_flag, - "thirdpel_flag", G_TYPE_INT, thirdpel_flag, - "low_delay", G_TYPE_INT, low_delay, - "unknown_svq3_flag", G_TYPE_INT, unknown_svq3_flag, NULL); + return gst_caps_new_simple ("video/x-svq", + "svqversion", G_TYPE_INT, 3, + "halfpel_flag", G_TYPE_INT, halfpel_flag, + "thirdpel_flag", G_TYPE_INT, thirdpel_flag, + "low_delay", G_TYPE_INT, low_delay, + "unknown_svq3_flag", G_TYPE_INT, unknown_svq3_flag, NULL); } return gst_caps_from_string ("video/x-svq, " "svqversion = (int) 3"); case GST_MAKE_FOURCC ('s', 'v', 'q', 'i'): @@ -1891,7 +1892,7 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc, case GST_MAKE_FOURCC ('r', 'a', 'w', ' '): /* uncompressed RGB */ return gst_caps_from_string ("video/x-raw-rgb, " - "endianness = (int) BIG_ENDIAN"); + "endianness = (int) BIG_ENDIAN"); /*"bpp", GST_PROPS_INT(x), "depth", GST_PROPS_INT(x), "red_mask", GST_PROPS_INT(x), @@ -1900,11 +1901,11 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc, case GST_MAKE_FOURCC ('Y', 'u', 'v', '2'): /* uncompressed YUV2 */ return gst_caps_from_string ("video/x-raw-yuv, " - "format = (fourcc) YUY2"); + "format = (fourcc) YUY2"); case GST_MAKE_FOURCC ('m', 'p', 'e', 'g'): /* MPEG */ return gst_caps_from_string ("video/mpeg, " - "systemstream = (boolean) false, " "mpegversion = (int) 1"); + "systemstream = (boolean) false, " "mpegversion = (int) 1"); case GST_MAKE_FOURCC ('g', 'i', 'f', ' '): return gst_caps_from_string ("image/gif"); case GST_MAKE_FOURCC ('h', '2', '6', '3'): @@ -1914,7 +1915,7 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc, case GST_MAKE_FOURCC ('m', 'p', '4', 'v'): /* MPEG-4 */ return gst_caps_from_string ("video/mpeg, " - "mpegversion = (int) 4, " "systemstream = (boolean) false"); + "mpegversion = (int) 4, " "systemstream = (boolean) false"); case GST_MAKE_FOURCC ('3', 'I', 'V', '1'): return gst_caps_from_string ("video/x-3ivx"); case GST_MAKE_FOURCC ('c', 'v', 'i', 'd'): @@ -1927,7 +1928,7 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc, case GST_MAKE_FOURCC ('k', 'p', 'c', 'd'): default: g_critical ("Don't know how to convert fourcc '" GST_FOURCC_FORMAT - "' to caps\n", GST_FOURCC_ARGS (fourcc)); + "' to caps\n", GST_FOURCC_ARGS (fourcc)); return NULL; } } @@ -1937,41 +1938,41 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, const guint8 * data) { switch (fourcc) { case GST_MAKE_FOURCC ('N', 'O', 'N', 'E'): - return NULL; /*gst_caps_from_string ("audio/raw"); */ + return NULL; /*gst_caps_from_string ("audio/raw"); */ case GST_MAKE_FOURCC ('r', 'a', 'w', ' '): /* FIXME */ return gst_caps_from_string ("audio/x-raw-int, " - "width = (int) 8, " "depth = (int) 8, " "signed = (boolean) true"); + "width = (int) 8, " "depth = (int) 8, " "signed = (boolean) true"); case GST_MAKE_FOURCC ('t', 'w', 'o', 's'): /* FIXME */ return gst_caps_from_string ("audio/x-raw-int, " - "width = (int) 16, " - "depth = (int) 16, " - "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true"); + "width = (int) 16, " + "depth = (int) 16, " + "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true"); case GST_MAKE_FOURCC ('s', 'o', 'w', 't'): /* FIXME */ return gst_caps_from_string ("audio/x-raw-int, " - "width = (int) 16, " - "depth = (int) 16, " - "endianness = (int) G_LITTLE_ENDIAN, " "signed = (boolean) true"); + "width = (int) 16, " + "depth = (int) 16, " + "endianness = (int) G_LITTLE_ENDIAN, " "signed = (boolean) true"); case GST_MAKE_FOURCC ('f', 'l', '6', '4'): return gst_caps_from_string ("audio/x-raw-float, " - "width = (int) 64, " "endianness = (int) G_BIG_ENDIAN"); + "width = (int) 64, " "endianness = (int) G_BIG_ENDIAN"); case GST_MAKE_FOURCC ('f', 'l', '3', '2'): return gst_caps_from_string ("audio/x-raw-float, " - "width = (int) 32, " "endianness = (int) G_BIG_ENDIAN"); + "width = (int) 32, " "endianness = (int) G_BIG_ENDIAN"); case GST_MAKE_FOURCC ('i', 'n', '2', '4'): /* FIXME */ return gst_caps_from_string ("audio/x-raw-int, " - "width = (int) 24, " - "depth = (int) 32, " - "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true"); + "width = (int) 24, " + "depth = (int) 32, " + "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true"); case GST_MAKE_FOURCC ('i', 'n', '3', '2'): /* FIXME */ return gst_caps_from_string ("audio/x-raw-int, " - "width = (int) 32, " - "depth = (int) 32, " - "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true"); + "width = (int) 32, " + "depth = (int) 32, " + "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true"); case GST_MAKE_FOURCC ('u', 'l', 'a', 'w'): /* FIXME */ return gst_caps_from_string ("audio/x-mulaw"); @@ -1981,18 +1982,18 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, const guint8 * data) case 0x6d730002: /* Microsoft ADPCM-ACM code 2 */ return gst_caps_from_string ("audio/x-adpcm, " - "layout = (string) microsoft"); + "layout = (string) microsoft"); case 0x6d730011: /* FIXME DVI/Intel IMA ADPCM/ACM code 17 */ return gst_caps_from_string ("audio/x-adpcm, " - "layout = (string) quicktime"); + "layout = (string) quicktime"); case 0x6d730055: /* MPEG layer 3, CBR only (pre QT4.1) */ case 0x5500736d: case GST_MAKE_FOURCC ('.', 'm', 'p', '3'): /* MPEG layer 3, CBR & VBR (QT4.1 and later) */ return gst_caps_from_string ("audio/mpeg, " - "layer = (int) 3, " "mpegversion = (int) 1"); + "layer = (int) 3, " "mpegversion = (int) 1"); case GST_MAKE_FOURCC ('M', 'A', 'C', '3'): /* MACE 3:1 */ return gst_caps_from_string ("audio/x-mace, " "maceversion = (int) 3"); @@ -2011,11 +2012,11 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, const guint8 * data) case GST_MAKE_FOURCC ('Q', 'D', 'M', '2'): /* FIXME: QDesign music version 2 (no constant) */ if (QTDEMUX_GUINT32_GET (data) <= 100) { - gst_util_dump_mem ((guint8 *) data, 100); - return gst_caps_new_simple ("audio/x-qdm2", - "framesize", G_TYPE_INT, QTDEMUX_GUINT32_GET (data + 52), - "bitrate", G_TYPE_INT, QTDEMUX_GUINT32_GET (data + 40), - "blocksize", G_TYPE_INT, QTDEMUX_GUINT32_GET (data + 44), NULL); + gst_util_dump_mem ((guint8 *) data, 100); + return gst_caps_new_simple ("audio/x-qdm2", + "framesize", G_TYPE_INT, QTDEMUX_GUINT32_GET (data + 52), + "bitrate", G_TYPE_INT, QTDEMUX_GUINT32_GET (data + 40), + "blocksize", G_TYPE_INT, QTDEMUX_GUINT32_GET (data + 44), NULL); } case GST_MAKE_FOURCC ('q', 't', 'v', 'r'): /* ? */ @@ -2029,7 +2030,7 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, const guint8 * data) /* ? */ default: g_critical ("Don't know how to convert fourcc '" GST_FOURCC_FORMAT - "' to caps\n", GST_FOURCC_ARGS (fourcc)); + "' to caps\n", GST_FOURCC_ARGS (fourcc)); return NULL; } } diff --git a/gst/rtjpeg/RTjpeg.c b/gst/rtjpeg/RTjpeg.c index d2e7b67dad..f2f61252c3 100644 --- a/gst/rtjpeg/RTjpeg.c +++ b/gst/rtjpeg/RTjpeg.c @@ -147,7 +147,7 @@ RTjpeg_b2s (__s16 * data, __s8 * strm, __u8 bt8) strm[0] = (__u8) (data[RTjpeg_ZZ[0]] > 254) ? 254 : ((data[RTjpeg_ZZ[0]] < - 0) ? 0 : data[RTjpeg_ZZ[0]]); + 0) ? 0 : data[RTjpeg_ZZ[0]]); for (ci = 1; ci <= bt8; ci++) { ZZvalue = data[RTjpeg_ZZ[ci]]; @@ -166,11 +166,11 @@ RTjpeg_b2s (__s16 * data, __s8 * strm, __u8 bt8) strm[co++] = (__s8) (ZZvalue > 63) ? 63 : ZZvalue; } else if (ZZvalue < 0) { strm[co++] = (__s8) (ZZvalue < -64) ? -64 : ZZvalue; - } else { /* compress zeros */ + } else { /* compress zeros */ tmp = ci; do { - ci++; + ci++; } while ((ci < 64) && (data[RTjpeg_ZZ[ci]] == 0)); @@ -199,7 +199,7 @@ RTjpeg_s2b (__s16 * data, __s8 * strm, __u8 bt8, __u32 * qtbl) if (strm[ci] > 63) { tmp = co + strm[ci] - 63; for (; co < tmp; co++) - data[RTjpeg_ZZ[co]] = 0; + data[RTjpeg_ZZ[co]] = 0; co--; } else { i = RTjpeg_ZZ[co]; @@ -242,19 +242,19 @@ RTjpeg_quant (__s16 * block, __s32 * qtbl) movq_m2r (RTjpeg_half, mm7); for (i = 16; i; i--) { - movq_m2r (*(ql++), mm0); /* quant vals (4) */ - movq_m2r (*bl, mm2); /* block vals (4) */ + movq_m2r (*(ql++), mm0); /* quant vals (4) */ + movq_m2r (*bl, mm2); /* block vals (4) */ movq_r2r (mm0, mm1); movq_r2r (mm2, mm3); - punpcklwd_r2r (mm6, mm0); /* 1 qb 1 qa */ - punpckhwd_r2r (mm6, mm1); /* 1 qd 1 qc */ + punpcklwd_r2r (mm6, mm0); /* 1 qb 1 qa */ + punpckhwd_r2r (mm6, mm1); /* 1 qd 1 qc */ - punpcklwd_r2r (mm7, mm2); /* 32767 bb 32767 ba */ - punpckhwd_r2r (mm7, mm3); /* 32767 bd 32767 bc */ + punpcklwd_r2r (mm7, mm2); /* 32767 bb 32767 ba */ + punpckhwd_r2r (mm7, mm3); /* 32767 bd 32767 bc */ - pmaddwd_r2r (mm2, mm0); /* 32767+bb*qb 32767+ba*qa */ - pmaddwd_r2r (mm3, mm1); /* 32767+bd*qd 32767+bc*qc */ + pmaddwd_r2r (mm2, mm0); /* 32767+bb*qb 32767+ba*qa */ + pmaddwd_r2r (mm3, mm1); /* 32767+bd*qd 32767+bc*qc */ psrad_i2r (16, mm0); psrad_i2r (16, mm1); @@ -293,10 +293,10 @@ static mmx_t RTjpeg_zero = (mmx_t) (long long) 0x0000000000000000LL; #else -#define FIX_0_382683433 ((__s32) 98) /* FIX(0.382683433) */ -#define FIX_0_541196100 ((__s32) 139) /* FIX(0.541196100) */ -#define FIX_0_707106781 ((__s32) 181) /* FIX(0.707106781) */ -#define FIX_1_306562965 ((__s32) 334) /* FIX(1.306562965) */ +#define FIX_0_382683433 ((__s32) 98) /* FIX(0.382683433) */ +#define FIX_0_541196100 ((__s32) 139) /* FIX(0.541196100) */ +#define FIX_0_707106781 ((__s32) 181) /* FIX(0.707106781) */ +#define FIX_1_306562965 ((__s32) 334) /* FIX(1.306562965) */ #define DESCALE10(x) (__s16)( ((x)+128) >> 8) #define DESCALE20(x) (__s16)(((x)+32768) >> 16) @@ -338,36 +338,36 @@ RTjpeg_dctY (__u8 * idata, __s16 * odata, int rskip) tmp3 = idataptr[3] + idataptr[4]; tmp4 = idataptr[3] - idataptr[4]; - tmp10 = (tmp0 + tmp3); /* phase 2 */ + tmp10 = (tmp0 + tmp3); /* phase 2 */ tmp13 = tmp0 - tmp3; tmp11 = (tmp1 + tmp2); tmp12 = tmp1 - tmp2; - wsptr[0] = (tmp10 + tmp11) << 8; /* phase 3 */ + wsptr[0] = (tmp10 + tmp11) << 8; /* phase 3 */ wsptr[4] = (tmp10 - tmp11) << 8; - z1 = D_MULTIPLY (tmp12 + tmp13, FIX_0_707106781); /* c4 */ - wsptr[2] = (tmp13 << 8) + z1; /* phase 5 */ + z1 = D_MULTIPLY (tmp12 + tmp13, FIX_0_707106781); /* c4 */ + wsptr[2] = (tmp13 << 8) + z1; /* phase 5 */ wsptr[6] = (tmp13 << 8) - z1; - tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp10 = tmp4 + tmp5; /* phase 2 */ tmp11 = tmp5 + tmp6; tmp12 = tmp6 + tmp7; - z5 = D_MULTIPLY (tmp10 - tmp12, FIX_0_382683433); /* c6 */ - z2 = D_MULTIPLY (tmp10, FIX_0_541196100) + z5; /* c2-c6 */ - z4 = D_MULTIPLY (tmp12, FIX_1_306562965) + z5; /* c2+c6 */ - z3 = D_MULTIPLY (tmp11, FIX_0_707106781); /* c4 */ + z5 = D_MULTIPLY (tmp10 - tmp12, FIX_0_382683433); /* c6 */ + z2 = D_MULTIPLY (tmp10, FIX_0_541196100) + z5; /* c2-c6 */ + z4 = D_MULTIPLY (tmp12, FIX_1_306562965) + z5; /* c2+c6 */ + z3 = D_MULTIPLY (tmp11, FIX_0_707106781); /* c4 */ - z11 = (tmp7 << 8) + z3; /* phase 5 */ + z11 = (tmp7 << 8) + z3; /* phase 5 */ z13 = (tmp7 << 8) - z3; - wsptr[5] = z13 + z2; /* phase 6 */ + wsptr[5] = z13 + z2; /* phase 6 */ wsptr[3] = z13 - z2; wsptr[1] = z11 + z4; wsptr[7] = z11 - z4; - idataptr += rskip << 3; /* advance pointer to next row */ + idataptr += rskip << 3; /* advance pointer to next row */ wsptr += 8; } @@ -383,36 +383,36 @@ RTjpeg_dctY (__u8 * idata, __s16 * odata, int rskip) tmp3 = wsptr[24] + wsptr[32]; tmp4 = wsptr[24] - wsptr[32]; - tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp10 = tmp0 + tmp3; /* phase 2 */ tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; - odataptr[0] = DESCALE10 (tmp10 + tmp11); /* phase 3 */ + odataptr[0] = DESCALE10 (tmp10 + tmp11); /* phase 3 */ odataptr[32] = DESCALE10 (tmp10 - tmp11); - z1 = D_MULTIPLY (tmp12 + tmp13, FIX_0_707106781); /* c4 */ - odataptr[16] = DESCALE20 ((tmp13 << 8) + z1); /* phase 5 */ + z1 = D_MULTIPLY (tmp12 + tmp13, FIX_0_707106781); /* c4 */ + odataptr[16] = DESCALE20 ((tmp13 << 8) + z1); /* phase 5 */ odataptr[48] = DESCALE20 ((tmp13 << 8) - z1); - tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp10 = tmp4 + tmp5; /* phase 2 */ tmp11 = tmp5 + tmp6; tmp12 = tmp6 + tmp7; - z5 = D_MULTIPLY (tmp10 - tmp12, FIX_0_382683433); /* c6 */ - z2 = D_MULTIPLY (tmp10, FIX_0_541196100) + z5; /* c2-c6 */ - z4 = D_MULTIPLY (tmp12, FIX_1_306562965) + z5; /* c2+c6 */ - z3 = D_MULTIPLY (tmp11, FIX_0_707106781); /* c4 */ + z5 = D_MULTIPLY (tmp10 - tmp12, FIX_0_382683433); /* c6 */ + z2 = D_MULTIPLY (tmp10, FIX_0_541196100) + z5; /* c2-c6 */ + z4 = D_MULTIPLY (tmp12, FIX_1_306562965) + z5; /* c2+c6 */ + z3 = D_MULTIPLY (tmp11, FIX_0_707106781); /* c4 */ - z11 = (tmp7 << 8) + z3; /* phase 5 */ + z11 = (tmp7 << 8) + z3; /* phase 5 */ z13 = (tmp7 << 8) - z3; - odataptr[40] = DESCALE20 (z13 + z2); /* phase 6 */ + odataptr[40] = DESCALE20 (z13 + z2); /* phase 6 */ odataptr[24] = DESCALE20 (z13 - z2); odataptr[8] = DESCALE20 (z11 + z4); odataptr[56] = DESCALE20 (z11 - z4); - odataptr++; /* advance pointer to next column */ + odataptr++; /* advance pointer to next column */ wsptr++; } #else @@ -513,169 +513,169 @@ RTjpeg_dctY (__u8 * idata, __s16 * odata, int rskip) /* Start Transpose to do calculations on rows */ - movq_m2r (*(dataptr + 9), mm7); /* m03:m02|m01:m00 - first line (line 4)and copy into m5 */ + movq_m2r (*(dataptr + 9), mm7); /* m03:m02|m01:m00 - first line (line 4)and copy into m5 */ - movq_m2r (*(dataptr + 13), mm6); /* m23:m22|m21:m20 - third line (line 6)and copy into m2 */ + movq_m2r (*(dataptr + 13), mm6); /* m23:m22|m21:m20 - third line (line 6)and copy into m2 */ movq_r2r (mm7, mm5); - punpcklwd_m2r (*(dataptr + 11), mm7); /* m11:m01|m10:m00 - interleave first and second lines */ + punpcklwd_m2r (*(dataptr + 11), mm7); /* m11:m01|m10:m00 - interleave first and second lines */ movq_r2r (mm6, mm2); - punpcklwd_m2r (*(dataptr + 15), mm6); /* m31:m21|m30:m20 - interleave third and fourth lines */ + punpcklwd_m2r (*(dataptr + 15), mm6); /* m31:m21|m30:m20 - interleave third and fourth lines */ movq_r2r (mm7, mm1); - movq_m2r (*(dataptr + 11), mm3); /* m13:m13|m11:m10 - second line */ - punpckldq_r2r (mm6, mm7); /* m30:m20|m10:m00 - interleave to produce result 1 */ + movq_m2r (*(dataptr + 11), mm3); /* m13:m13|m11:m10 - second line */ + punpckldq_r2r (mm6, mm7); /* m30:m20|m10:m00 - interleave to produce result 1 */ - movq_m2r (*(dataptr + 15), mm0); /* m13:m13|m11:m10 - fourth line */ - punpckhdq_r2r (mm6, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ + movq_m2r (*(dataptr + 15), mm0); /* m13:m13|m11:m10 - fourth line */ + punpckhdq_r2r (mm6, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ - movq_r2m (mm7, *(dataptr + 9)); /* write result 1 */ - punpckhwd_r2r (mm3, mm5); /* m13:m03|m12:m02 - interleave first and second lines */ + movq_r2m (mm7, *(dataptr + 9)); /* write result 1 */ + punpckhwd_r2r (mm3, mm5); /* m13:m03|m12:m02 - interleave first and second lines */ - movq_r2m (mm1, *(dataptr + 11)); /* write result 2 */ - punpckhwd_r2r (mm0, mm2); /* m33:m23|m32:m22 - interleave third and fourth lines */ + movq_r2m (mm1, *(dataptr + 11)); /* write result 2 */ + punpckhwd_r2r (mm0, mm2); /* m33:m23|m32:m22 - interleave third and fourth lines */ movq_r2r (mm5, mm1); - punpckldq_r2r (mm2, mm5); /* m32:m22|m12:m02 - interleave to produce result 3 */ + punpckldq_r2r (mm2, mm5); /* m32:m22|m12:m02 - interleave to produce result 3 */ - movq_m2r (*(dataptr + 1), mm0); /* m03:m02|m01:m00 - first line, 4x4 */ - punpckhdq_r2r (mm2, mm1); /* m33:m23|m13:m03 - interleave to produce result 4 */ + movq_m2r (*(dataptr + 1), mm0); /* m03:m02|m01:m00 - first line, 4x4 */ + punpckhdq_r2r (mm2, mm1); /* m33:m23|m13:m03 - interleave to produce result 4 */ - movq_r2m (mm5, *(dataptr + 13)); /* write result 3 */ + movq_r2m (mm5, *(dataptr + 13)); /* write result 3 */ /* last 4x4 done */ - movq_r2m (mm1, *(dataptr + 15)); /* write result 4, last 4x4 */ + movq_r2m (mm1, *(dataptr + 15)); /* write result 4, last 4x4 */ - movq_m2r (*(dataptr + 5), mm2); /* m23:m22|m21:m20 - third line */ + movq_m2r (*(dataptr + 5), mm2); /* m23:m22|m21:m20 - third line */ movq_r2r (mm0, mm6); - punpcklwd_m2r (*(dataptr + 3), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ + punpcklwd_m2r (*(dataptr + 3), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ movq_r2r (mm2, mm7); - punpcklwd_m2r (*(dataptr + 7), mm2); /* m31:m21|m30:m20 - interleave third and fourth lines */ + punpcklwd_m2r (*(dataptr + 7), mm2); /* m31:m21|m30:m20 - interleave third and fourth lines */ movq_r2r (mm0, mm4); - movq_m2r (*(dataptr + 8), mm1); /* n03:n02|n01:n00 - first line */ - punpckldq_r2r (mm2, mm0); /* m30:m20|m10:m00 - interleave to produce first result */ + movq_m2r (*(dataptr + 8), mm1); /* n03:n02|n01:n00 - first line */ + punpckldq_r2r (mm2, mm0); /* m30:m20|m10:m00 - interleave to produce first result */ - movq_m2r (*(dataptr + 12), mm3); /* n23:n22|n21:n20 - third line */ - punpckhdq_r2r (mm2, mm4); /* m31:m21|m11:m01 - interleave to produce second result */ + movq_m2r (*(dataptr + 12), mm3); /* n23:n22|n21:n20 - third line */ + punpckhdq_r2r (mm2, mm4); /* m31:m21|m11:m01 - interleave to produce second result */ - punpckhwd_m2r (*(dataptr + 3), mm6); /* m13:m03|m12:m02 - interleave first and second lines */ - movq_r2r (mm1, mm2); /* copy first line */ + punpckhwd_m2r (*(dataptr + 3), mm6); /* m13:m03|m12:m02 - interleave first and second lines */ + movq_r2r (mm1, mm2); /* copy first line */ - punpckhwd_m2r (*(dataptr + 7), mm7); /* m33:m23|m32:m22 - interleave third and fourth lines */ - movq_r2r (mm6, mm5); /* copy first intermediate result */ + punpckhwd_m2r (*(dataptr + 7), mm7); /* m33:m23|m32:m22 - interleave third and fourth lines */ + movq_r2r (mm6, mm5); /* copy first intermediate result */ - movq_r2m (mm0, *(dataptr + 8)); /* write result 1 */ - punpckhdq_r2r (mm7, mm5); /* m33:m23|m13:m03 - produce third result */ + movq_r2m (mm0, *(dataptr + 8)); /* write result 1 */ + punpckhdq_r2r (mm7, mm5); /* m33:m23|m13:m03 - produce third result */ - punpcklwd_m2r (*(dataptr + 10), mm1); /* n11:n01|n10:n00 - interleave first and second lines */ - movq_r2r (mm3, mm0); /* copy third line */ + punpcklwd_m2r (*(dataptr + 10), mm1); /* n11:n01|n10:n00 - interleave first and second lines */ + movq_r2r (mm3, mm0); /* copy third line */ - punpckhwd_m2r (*(dataptr + 10), mm2); /* n13:n03|n12:n02 - interleave first and second lines */ + punpckhwd_m2r (*(dataptr + 10), mm2); /* n13:n03|n12:n02 - interleave first and second lines */ - movq_r2m (mm4, *(dataptr + 10)); /* write result 2 out */ - punpckldq_r2r (mm7, mm6); /* m32:m22|m12:m02 - produce fourth result */ + movq_r2m (mm4, *(dataptr + 10)); /* write result 2 out */ + punpckldq_r2r (mm7, mm6); /* m32:m22|m12:m02 - produce fourth result */ - punpcklwd_m2r (*(dataptr + 14), mm3); /* n31:n21|n30:n20 - interleave third and fourth lines */ + punpcklwd_m2r (*(dataptr + 14), mm3); /* n31:n21|n30:n20 - interleave third and fourth lines */ movq_r2r (mm1, mm4); - movq_r2m (mm6, *(dataptr + 12)); /* write result 3 out */ - punpckldq_r2r (mm3, mm1); /* n30:n20|n10:n00 - produce first result */ + movq_r2m (mm6, *(dataptr + 12)); /* write result 3 out */ + punpckldq_r2r (mm3, mm1); /* n30:n20|n10:n00 - produce first result */ - punpckhwd_m2r (*(dataptr + 14), mm0); /* n33:n23|n32:n22 - interleave third and fourth lines */ + punpckhwd_m2r (*(dataptr + 14), mm0); /* n33:n23|n32:n22 - interleave third and fourth lines */ movq_r2r (mm2, mm6); - movq_r2m (mm5, *(dataptr + 14)); /* write result 4 out */ - punpckhdq_r2r (mm3, mm4); /* n31:n21|n11:n01- produce second result */ + movq_r2m (mm5, *(dataptr + 14)); /* write result 4 out */ + punpckhdq_r2r (mm3, mm4); /* n31:n21|n11:n01- produce second result */ - movq_r2m (mm1, *(dataptr + 1)); /* write result 5 out - (first result for other 4 x 4 block) */ - punpckldq_r2r (mm0, mm2); /* n32:n22|n12:n02- produce third result */ + movq_r2m (mm1, *(dataptr + 1)); /* write result 5 out - (first result for other 4 x 4 block) */ + punpckldq_r2r (mm0, mm2); /* n32:n22|n12:n02- produce third result */ - movq_r2m (mm4, *(dataptr + 3)); /* write result 6 out */ - punpckhdq_r2r (mm0, mm6); /* n33:n23|n13:n03 - produce fourth result */ + movq_r2m (mm4, *(dataptr + 3)); /* write result 6 out */ + punpckhdq_r2r (mm0, mm6); /* n33:n23|n13:n03 - produce fourth result */ - movq_r2m (mm2, *(dataptr + 5)); /* write result 7 out */ + movq_r2m (mm2, *(dataptr + 5)); /* write result 7 out */ - movq_m2r (*dataptr, mm0); /* m03:m02|m01:m00 - first line, first 4x4 */ + movq_m2r (*dataptr, mm0); /* m03:m02|m01:m00 - first line, first 4x4 */ - movq_r2m (mm6, *(dataptr + 7)); /* write result 8 out */ + movq_r2m (mm6, *(dataptr + 7)); /* write result 8 out */ /* Do first 4x4 quadrant, which is used in the beginning of the DCT: */ - movq_m2r (*(dataptr + 4), mm7); /* m23:m22|m21:m20 - third line */ + movq_m2r (*(dataptr + 4), mm7); /* m23:m22|m21:m20 - third line */ movq_r2r (mm0, mm2); - punpcklwd_m2r (*(dataptr + 2), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ + punpcklwd_m2r (*(dataptr + 2), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ movq_r2r (mm7, mm4); - punpcklwd_m2r (*(dataptr + 6), mm7); /* m31:m21|m30:m20 - interleave third and fourth lines */ + punpcklwd_m2r (*(dataptr + 6), mm7); /* m31:m21|m30:m20 - interleave third and fourth lines */ movq_r2r (mm0, mm1); - movq_m2r (*(dataptr + 2), mm6); /* m13:m12|m11:m10 - second line */ - punpckldq_r2r (mm7, mm0); /* m30:m20|m10:m00 - interleave to produce result 1 */ + movq_m2r (*(dataptr + 2), mm6); /* m13:m12|m11:m10 - second line */ + punpckldq_r2r (mm7, mm0); /* m30:m20|m10:m00 - interleave to produce result 1 */ - movq_m2r (*(dataptr + 6), mm5); /* m33:m32|m31:m30 - fourth line */ - punpckhdq_r2r (mm7, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ + movq_m2r (*(dataptr + 6), mm5); /* m33:m32|m31:m30 - fourth line */ + punpckhdq_r2r (mm7, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ - movq_r2r (mm0, mm7); /* write result 1 */ - punpckhwd_r2r (mm6, mm2); /* m13:m03|m12:m02 - interleave first and second lines */ + movq_r2r (mm0, mm7); /* write result 1 */ + punpckhwd_r2r (mm6, mm2); /* m13:m03|m12:m02 - interleave first and second lines */ - psubw_m2r (*(dataptr + 14), mm7); /* tmp07=x0-x7: Stage 1 */ - movq_r2r (mm1, mm6); /* write result 2 */ + psubw_m2r (*(dataptr + 14), mm7); /* tmp07=x0-x7: Stage 1 */ + movq_r2r (mm1, mm6); /* write result 2 */ - paddw_m2r (*(dataptr + 14), mm0); /* tmp00=x0+x7: Stage 1 */ - punpckhwd_r2r (mm5, mm4); /* m33:m23|m32:m22 - interleave third and fourth lines */ + paddw_m2r (*(dataptr + 14), mm0); /* tmp00=x0+x7: Stage 1 */ + punpckhwd_r2r (mm5, mm4); /* m33:m23|m32:m22 - interleave third and fourth lines */ - paddw_m2r (*(dataptr + 12), mm1); /* tmp01=x1+x6: Stage 1 */ - movq_r2r (mm2, mm3); /* copy first intermediate result */ + paddw_m2r (*(dataptr + 12), mm1); /* tmp01=x1+x6: Stage 1 */ + movq_r2r (mm2, mm3); /* copy first intermediate result */ - psubw_m2r (*(dataptr + 12), mm6); /* tmp06=x1-x6: Stage 1 */ - punpckldq_r2r (mm4, mm2); /* m32:m22|m12:m02 - interleave to produce result 3 */ + psubw_m2r (*(dataptr + 12), mm6); /* tmp06=x1-x6: Stage 1 */ + punpckldq_r2r (mm4, mm2); /* m32:m22|m12:m02 - interleave to produce result 3 */ movq_r2m (mm7, tmp7); - movq_r2r (mm2, mm5); /* write result 3 */ + movq_r2r (mm2, mm5); /* write result 3 */ movq_r2m (mm6, tmp6); - punpckhdq_r2r (mm4, mm3); /* m33:m23|m13:m03 - interleave to produce result 4 */ + punpckhdq_r2r (mm4, mm3); /* m33:m23|m13:m03 - interleave to produce result 4 */ - paddw_m2r (*(dataptr + 10), mm2); /* tmp02=x2+5: Stage 1 */ - movq_r2r (mm3, mm4); /* write result 4 */ + paddw_m2r (*(dataptr + 10), mm2); /* tmp02=x2+5: Stage 1 */ + movq_r2r (mm3, mm4); /* write result 4 */ /************************************************************************************************ End of Transpose ************************************************************************************************/ - paddw_m2r (*(dataptr + 8), mm3); /* tmp03=x3+x4: stage 1 */ + paddw_m2r (*(dataptr + 8), mm3); /* tmp03=x3+x4: stage 1 */ movq_r2r (mm0, mm7); - psubw_m2r (*(dataptr + 8), mm4); /* tmp04=x3-x4: stage 1 */ + psubw_m2r (*(dataptr + 8), mm4); /* tmp04=x3-x4: stage 1 */ movq_r2r (mm1, mm6); - paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03: even 2 */ - psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03: even 2 */ + paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03: even 2 */ + psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03: even 2 */ - psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02: even 2 */ - paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02: even 2 */ + psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02: even 2 */ + paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02: even 2 */ - psubw_m2r (*(dataptr + 10), mm5); /* tmp05=x2-x5: stage 1 */ - paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ + psubw_m2r (*(dataptr + 10), mm5); /* tmp05=x2-x5: stage 1 */ + paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ /* stage 3 */ movq_m2r (tmp6, mm2); movq_r2r (mm0, mm3); - psllw_i2r (2, mm6); /* m8 * 2^2 */ + psllw_i2r (2, mm6); /* m8 * 2^2 */ paddw_r2r (mm1, mm0); - pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ + pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ psubw_r2r (mm1, mm3); movq_r2m (mm0, *dataptr); @@ -683,349 +683,349 @@ RTjpeg_dctY (__u8 * idata, __s16 * odata, int rskip) /* Odd part */ movq_r2m (mm3, *(dataptr + 8)); - paddw_r2r (mm5, mm4); /* tmp10 */ + paddw_r2r (mm5, mm4); /* tmp10 */ movq_m2r (tmp7, mm3); - paddw_r2r (mm6, mm0); /* tmp32 */ + paddw_r2r (mm6, mm0); /* tmp32 */ - paddw_r2r (mm2, mm5); /* tmp11 */ - psubw_r2r (mm6, mm7); /* tmp33 */ + paddw_r2r (mm2, mm5); /* tmp11 */ + psubw_r2r (mm6, mm7); /* tmp33 */ movq_r2m (mm0, *(dataptr + 4)); - paddw_r2r (mm3, mm2); /* tmp12 */ + paddw_r2r (mm3, mm2); /* tmp12 */ /* stage 4 */ movq_r2m (mm7, *(dataptr + 12)); - movq_r2r (mm4, mm1); /* copy of tmp10 */ + movq_r2r (mm4, mm1); /* copy of tmp10 */ - psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ - psllw_i2r (2, mm4); /* m8 * 2^2 */ + psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ + psllw_i2r (2, mm4); /* m8 * 2^2 */ movq_m2r (RTjpeg_C2mC6, mm0); psllw_i2r (2, mm1); - pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ + pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ psllw_i2r (2, mm2); - pmulhw_r2r (mm0, mm4); /* z5 */ + pmulhw_r2r (mm0, mm4); /* z5 */ /* stage 5 */ pmulhw_m2r (RTjpeg_C2pC6, mm2); psllw_i2r (2, mm5); - pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ - movq_r2r (mm3, mm0); /* copy tmp7 */ + pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ + movq_r2r (mm3, mm0); /* copy tmp7 */ movq_m2r (*(dataptr + 1), mm7); - paddw_r2r (mm1, mm4); /* z2 */ + paddw_r2r (mm1, mm4); /* z2 */ - paddw_r2r (mm1, mm2); /* z4 */ + paddw_r2r (mm1, mm2); /* z4 */ - paddw_r2r (mm5, mm0); /* z11 */ - psubw_r2r (mm5, mm3); /* z13 */ + paddw_r2r (mm5, mm0); /* z11 */ + psubw_r2r (mm5, mm3); /* z13 */ /* stage 6 */ - movq_r2r (mm3, mm5); /* copy z13 */ - psubw_r2r (mm4, mm3); /* y3=z13 - z2 */ + movq_r2r (mm3, mm5); /* copy z13 */ + psubw_r2r (mm4, mm3); /* y3=z13 - z2 */ - paddw_r2r (mm4, mm5); /* y5=z13 + z2 */ - movq_r2r (mm0, mm6); /* copy z11 */ + paddw_r2r (mm4, mm5); /* y5=z13 + z2 */ + movq_r2r (mm0, mm6); /* copy z11 */ - movq_r2m (mm3, *(dataptr + 6)); /*save y3 */ - psubw_r2r (mm2, mm0); /* y7=z11 - z4 */ + movq_r2m (mm3, *(dataptr + 6)); /*save y3 */ + psubw_r2r (mm2, mm0); /* y7=z11 - z4 */ - movq_r2m (mm5, *(dataptr + 10)); /*save y5 */ - paddw_r2r (mm2, mm6); /* y1=z11 + z4 */ + movq_r2m (mm5, *(dataptr + 10)); /*save y5 */ + paddw_r2r (mm2, mm6); /* y1=z11 + z4 */ - movq_r2m (mm0, *(dataptr + 14)); /*save y7 */ + movq_r2m (mm0, *(dataptr + 14)); /*save y7 */ - /************************************************ + /************************************************ * End of 1st 4 rows ************************************************/ - movq_m2r (*(dataptr + 3), mm1); /* load x1: stage 1 */ - movq_r2r (mm7, mm0); /* copy x0 */ + movq_m2r (*(dataptr + 3), mm1); /* load x1: stage 1 */ + movq_r2r (mm7, mm0); /* copy x0 */ - movq_r2m (mm6, *(dataptr + 2)); /*save y1 */ + movq_r2m (mm6, *(dataptr + 2)); /*save y1 */ - movq_m2r (*(dataptr + 5), mm2); /* load x2: stage 1 */ - movq_r2r (mm1, mm6); /* copy x1 */ + movq_m2r (*(dataptr + 5), mm2); /* load x2: stage 1 */ + movq_r2r (mm1, mm6); /* copy x1 */ - paddw_m2r (*(dataptr + 15), mm0); /* tmp00 = x0 + x7 */ + paddw_m2r (*(dataptr + 15), mm0); /* tmp00 = x0 + x7 */ - movq_m2r (*(dataptr + 7), mm3); /* load x3 : stage 1 */ - movq_r2r (mm2, mm5); /* copy x2 */ + movq_m2r (*(dataptr + 7), mm3); /* load x3 : stage 1 */ + movq_r2r (mm2, mm5); /* copy x2 */ - psubw_m2r (*(dataptr + 15), mm7); /* tmp07 = x0 - x7 */ - movq_r2r (mm3, mm4); /* copy x3 */ + psubw_m2r (*(dataptr + 15), mm7); /* tmp07 = x0 - x7 */ + movq_r2r (mm3, mm4); /* copy x3 */ - paddw_m2r (*(dataptr + 13), mm1); /* tmp01 = x1 + x6 */ + paddw_m2r (*(dataptr + 13), mm1); /* tmp01 = x1 + x6 */ - movq_r2m (mm7, tmp7); /* save tmp07 */ - movq_r2r (mm0, mm7); /* copy tmp00 */ + movq_r2m (mm7, tmp7); /* save tmp07 */ + movq_r2r (mm0, mm7); /* copy tmp00 */ - psubw_m2r (*(dataptr + 13), mm6); /* tmp06 = x1 - x6 */ + psubw_m2r (*(dataptr + 13), mm6); /* tmp06 = x1 - x6 */ /* stage 2, Even Part */ - paddw_m2r (*(dataptr + 9), mm3); /* tmp03 = x3 + x4 */ + paddw_m2r (*(dataptr + 9), mm3); /* tmp03 = x3 + x4 */ - movq_r2m (mm6, tmp6); /* save tmp07 */ - movq_r2r (mm1, mm6); /* copy tmp01 */ + movq_r2m (mm6, tmp6); /* save tmp07 */ + movq_r2r (mm1, mm6); /* copy tmp01 */ - paddw_m2r (*(dataptr + 11), mm2); /* tmp02 = x2 + x5 */ - paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03 */ + paddw_m2r (*(dataptr + 11), mm2); /* tmp02 = x2 + x5 */ + paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03 */ - psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03 */ + psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03 */ - psubw_m2r (*(dataptr + 9), mm4); /* tmp04 = x3 - x4 */ - psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02 */ + psubw_m2r (*(dataptr + 9), mm4); /* tmp04 = x3 - x4 */ + psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02 */ - paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02 */ + paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02 */ - psubw_m2r (*(dataptr + 11), mm5); /* tmp05 = x2 - x5 */ - paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ + psubw_m2r (*(dataptr + 11), mm5); /* tmp05 = x2 - x5 */ + paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ /* stage 3, Even and stage 4 & 5 even */ - movq_m2r (tmp6, mm2); /* load tmp6 */ - movq_r2r (mm0, mm3); /* copy tmp10 */ + movq_m2r (tmp6, mm2); /* load tmp6 */ + movq_r2r (mm0, mm3); /* copy tmp10 */ - psllw_i2r (2, mm6); /* shift z1 */ - paddw_r2r (mm1, mm0); /* y0=tmp10 + tmp11 */ + psllw_i2r (2, mm6); /* shift z1 */ + paddw_r2r (mm1, mm0); /* y0=tmp10 + tmp11 */ - pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ - psubw_r2r (mm1, mm3); /* y4=tmp10 - tmp11 */ + pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ + psubw_r2r (mm1, mm3); /* y4=tmp10 - tmp11 */ - movq_r2m (mm0, *(dataptr + 1)); /*save y0 */ - movq_r2r (mm7, mm0); /* copy tmp13 */ + movq_r2m (mm0, *(dataptr + 1)); /*save y0 */ + movq_r2r (mm7, mm0); /* copy tmp13 */ /* odd part */ - movq_r2m (mm3, *(dataptr + 9)); /*save y4 */ - paddw_r2r (mm5, mm4); /* tmp10 = tmp4 + tmp5 */ + movq_r2m (mm3, *(dataptr + 9)); /*save y4 */ + paddw_r2r (mm5, mm4); /* tmp10 = tmp4 + tmp5 */ - movq_m2r (tmp7, mm3); /* load tmp7 */ - paddw_r2r (mm6, mm0); /* tmp32 = tmp13 + z1 */ + movq_m2r (tmp7, mm3); /* load tmp7 */ + paddw_r2r (mm6, mm0); /* tmp32 = tmp13 + z1 */ - paddw_r2r (mm2, mm5); /* tmp11 = tmp5 + tmp6 */ - psubw_r2r (mm6, mm7); /* tmp33 = tmp13 - z1 */ + paddw_r2r (mm2, mm5); /* tmp11 = tmp5 + tmp6 */ + psubw_r2r (mm6, mm7); /* tmp33 = tmp13 - z1 */ - movq_r2m (mm0, *(dataptr + 5)); /*save y2 */ - paddw_r2r (mm3, mm2); /* tmp12 = tmp6 + tmp7 */ + movq_r2m (mm0, *(dataptr + 5)); /*save y2 */ + paddw_r2r (mm3, mm2); /* tmp12 = tmp6 + tmp7 */ /* stage 4 */ - movq_r2m (mm7, *(dataptr + 13)); /*save y6 */ - movq_r2r (mm4, mm1); /* copy tmp10 */ + movq_r2m (mm7, *(dataptr + 13)); /*save y6 */ + movq_r2r (mm4, mm1); /* copy tmp10 */ - psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ - psllw_i2r (2, mm4); /* shift tmp10 */ + psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ + psllw_i2r (2, mm4); /* shift tmp10 */ - movq_m2r (RTjpeg_C2mC6, mm0); /* load C2mC6 */ - psllw_i2r (2, mm1); /* shift (tmp10-tmp12) */ + movq_m2r (RTjpeg_C2mC6, mm0); /* load C2mC6 */ + psllw_i2r (2, mm1); /* shift (tmp10-tmp12) */ - pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ - psllw_i2r (2, mm5); /* prepare for multiply */ + pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ + psllw_i2r (2, mm5); /* prepare for multiply */ - pmulhw_r2r (mm0, mm4); /* multiply by converted real */ + pmulhw_r2r (mm0, mm4); /* multiply by converted real */ /* stage 5 */ - pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ - psllw_i2r (2, mm2); /* prepare for multiply */ + pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ + psllw_i2r (2, mm2); /* prepare for multiply */ - pmulhw_m2r (RTjpeg_C2pC6, mm2); /* multiply */ - movq_r2r (mm3, mm0); /* copy tmp7 */ + pmulhw_m2r (RTjpeg_C2pC6, mm2); /* multiply */ + movq_r2r (mm3, mm0); /* copy tmp7 */ - movq_m2r (*(dataptr + 9), mm7); /* m03:m02|m01:m00 - first line (line 4)and copy into mm7 */ - paddw_r2r (mm1, mm4); /* z2 */ + movq_m2r (*(dataptr + 9), mm7); /* m03:m02|m01:m00 - first line (line 4)and copy into mm7 */ + paddw_r2r (mm1, mm4); /* z2 */ - paddw_r2r (mm5, mm0); /* z11 */ - psubw_r2r (mm5, mm3); /* z13 */ + paddw_r2r (mm5, mm0); /* z11 */ + psubw_r2r (mm5, mm3); /* z13 */ /* stage 6 */ - movq_r2r (mm3, mm5); /* copy z13 */ - paddw_r2r (mm1, mm2); /* z4 */ + movq_r2r (mm3, mm5); /* copy z13 */ + paddw_r2r (mm1, mm2); /* z4 */ - movq_r2r (mm0, mm6); /* copy z11 */ - psubw_r2r (mm4, mm5); /* y3 */ + movq_r2r (mm0, mm6); /* copy z11 */ + psubw_r2r (mm4, mm5); /* y3 */ - paddw_r2r (mm2, mm6); /* y1 */ - paddw_r2r (mm4, mm3); /* y5 */ + paddw_r2r (mm2, mm6); /* y1 */ + paddw_r2r (mm4, mm3); /* y5 */ - movq_r2m (mm5, *(dataptr + 7)); /*save y3 */ + movq_r2m (mm5, *(dataptr + 7)); /*save y3 */ - movq_r2m (mm6, *(dataptr + 3)); /*save y1 */ - psubw_r2r (mm2, mm0); /* y7 */ + movq_r2m (mm6, *(dataptr + 3)); /*save y1 */ + psubw_r2r (mm2, mm0); /* y7 */ /************************************************************************************************ Start of Transpose ************************************************************************************************/ - movq_m2r (*(dataptr + 13), mm6); /* m23:m22|m21:m20 - third line (line 6)and copy into m2 */ - movq_r2r (mm7, mm5); /* copy first line */ + movq_m2r (*(dataptr + 13), mm6); /* m23:m22|m21:m20 - third line (line 6)and copy into m2 */ + movq_r2r (mm7, mm5); /* copy first line */ - punpcklwd_r2r (mm3, mm7); /* m11:m01|m10:m00 - interleave first and second lines */ - movq_r2r (mm6, mm2); /* copy third line */ + punpcklwd_r2r (mm3, mm7); /* m11:m01|m10:m00 - interleave first and second lines */ + movq_r2r (mm6, mm2); /* copy third line */ - punpcklwd_r2r (mm0, mm6); /* m31:m21|m30:m20 - interleave third and fourth lines */ - movq_r2r (mm7, mm1); /* copy first intermediate result */ + punpcklwd_r2r (mm0, mm6); /* m31:m21|m30:m20 - interleave third and fourth lines */ + movq_r2r (mm7, mm1); /* copy first intermediate result */ - punpckldq_r2r (mm6, mm7); /* m30:m20|m10:m00 - interleave to produce result 1 */ + punpckldq_r2r (mm6, mm7); /* m30:m20|m10:m00 - interleave to produce result 1 */ - punpckhdq_r2r (mm6, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ + punpckhdq_r2r (mm6, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ - movq_r2m (mm7, *(dataptr + 9)); /* write result 1 */ - punpckhwd_r2r (mm3, mm5); /* m13:m03|m12:m02 - interleave first and second lines */ + movq_r2m (mm7, *(dataptr + 9)); /* write result 1 */ + punpckhwd_r2r (mm3, mm5); /* m13:m03|m12:m02 - interleave first and second lines */ - movq_r2m (mm1, *(dataptr + 11)); /* write result 2 */ - punpckhwd_r2r (mm0, mm2); /* m33:m23|m32:m22 - interleave third and fourth lines */ + movq_r2m (mm1, *(dataptr + 11)); /* write result 2 */ + punpckhwd_r2r (mm0, mm2); /* m33:m23|m32:m22 - interleave third and fourth lines */ - movq_r2r (mm5, mm1); /* copy first intermediate result */ - punpckldq_r2r (mm2, mm5); /* m32:m22|m12:m02 - interleave to produce result 3 */ + movq_r2r (mm5, mm1); /* copy first intermediate result */ + punpckldq_r2r (mm2, mm5); /* m32:m22|m12:m02 - interleave to produce result 3 */ - movq_m2r (*(dataptr + 1), mm0); /* m03:m02|m01:m00 - first line, 4x4 */ - punpckhdq_r2r (mm2, mm1); /* m33:m23|m13:m03 - interleave to produce result 4 */ + movq_m2r (*(dataptr + 1), mm0); /* m03:m02|m01:m00 - first line, 4x4 */ + punpckhdq_r2r (mm2, mm1); /* m33:m23|m13:m03 - interleave to produce result 4 */ - movq_r2m (mm5, *(dataptr + 13)); /* write result 3 */ + movq_r2m (mm5, *(dataptr + 13)); /* write result 3 */ - /****** last 4x4 done */ + /****** last 4x4 done */ - movq_r2m (mm1, *(dataptr + 15)); /* write result 4, last 4x4 */ + movq_r2m (mm1, *(dataptr + 15)); /* write result 4, last 4x4 */ - movq_m2r (*(dataptr + 5), mm2); /* m23:m22|m21:m20 - third line */ - movq_r2r (mm0, mm6); /* copy first line */ + movq_m2r (*(dataptr + 5), mm2); /* m23:m22|m21:m20 - third line */ + movq_r2r (mm0, mm6); /* copy first line */ - punpcklwd_m2r (*(dataptr + 3), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ - movq_r2r (mm2, mm7); /* copy third line */ + punpcklwd_m2r (*(dataptr + 3), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ + movq_r2r (mm2, mm7); /* copy third line */ - punpcklwd_m2r (*(dataptr + 7), mm2); /* m31:m21|m30:m20 - interleave third and fourth lines */ - movq_r2r (mm0, mm4); /* copy first intermediate result */ + punpcklwd_m2r (*(dataptr + 7), mm2); /* m31:m21|m30:m20 - interleave third and fourth lines */ + movq_r2r (mm0, mm4); /* copy first intermediate result */ - movq_m2r (*(dataptr + 8), mm1); /* n03:n02|n01:n00 - first line */ - punpckldq_r2r (mm2, mm0); /* m30:m20|m10:m00 - interleave to produce first result */ + movq_m2r (*(dataptr + 8), mm1); /* n03:n02|n01:n00 - first line */ + punpckldq_r2r (mm2, mm0); /* m30:m20|m10:m00 - interleave to produce first result */ - movq_m2r (*(dataptr + 12), mm3); /* n23:n22|n21:n20 - third line */ - punpckhdq_r2r (mm2, mm4); /* m31:m21|m11:m01 - interleave to produce second result */ + movq_m2r (*(dataptr + 12), mm3); /* n23:n22|n21:n20 - third line */ + punpckhdq_r2r (mm2, mm4); /* m31:m21|m11:m01 - interleave to produce second result */ - punpckhwd_m2r (*(dataptr + 3), mm6); /* m13:m03|m12:m02 - interleave first and second lines */ - movq_r2r (mm1, mm2); /* copy first line */ + punpckhwd_m2r (*(dataptr + 3), mm6); /* m13:m03|m12:m02 - interleave first and second lines */ + movq_r2r (mm1, mm2); /* copy first line */ - punpckhwd_m2r (*(dataptr + 7), mm7); /* m33:m23|m32:m22 - interleave third and fourth lines */ - movq_r2r (mm6, mm5); /* copy first intermediate result */ + punpckhwd_m2r (*(dataptr + 7), mm7); /* m33:m23|m32:m22 - interleave third and fourth lines */ + movq_r2r (mm6, mm5); /* copy first intermediate result */ - movq_r2m (mm0, *(dataptr + 8)); /* write result 1 */ - punpckhdq_r2r (mm7, mm5); /* m33:m23|m13:m03 - produce third result */ + movq_r2m (mm0, *(dataptr + 8)); /* write result 1 */ + punpckhdq_r2r (mm7, mm5); /* m33:m23|m13:m03 - produce third result */ - punpcklwd_m2r (*(dataptr + 10), mm1); /* n11:n01|n10:n00 - interleave first and second lines */ - movq_r2r (mm3, mm0); /* copy third line */ + punpcklwd_m2r (*(dataptr + 10), mm1); /* n11:n01|n10:n00 - interleave first and second lines */ + movq_r2r (mm3, mm0); /* copy third line */ - punpckhwd_m2r (*(dataptr + 10), mm2); /* n13:n03|n12:n02 - interleave first and second lines */ + punpckhwd_m2r (*(dataptr + 10), mm2); /* n13:n03|n12:n02 - interleave first and second lines */ - movq_r2m (mm4, *(dataptr + 10)); /* write result 2 out */ - punpckldq_r2r (mm7, mm6); /* m32:m22|m12:m02 - produce fourth result */ + movq_r2m (mm4, *(dataptr + 10)); /* write result 2 out */ + punpckldq_r2r (mm7, mm6); /* m32:m22|m12:m02 - produce fourth result */ - punpcklwd_m2r (*(dataptr + 14), mm3); /* n33:n23|n32:n22 - interleave third and fourth lines */ - movq_r2r (mm1, mm4); /* copy second intermediate result */ + punpcklwd_m2r (*(dataptr + 14), mm3); /* n33:n23|n32:n22 - interleave third and fourth lines */ + movq_r2r (mm1, mm4); /* copy second intermediate result */ - movq_r2m (mm6, *(dataptr + 12)); /* write result 3 out */ - punpckldq_r2r (mm3, mm1); /* */ + movq_r2m (mm6, *(dataptr + 12)); /* write result 3 out */ + punpckldq_r2r (mm3, mm1); /* */ - punpckhwd_m2r (*(dataptr + 14), mm0); /* n33:n23|n32:n22 - interleave third and fourth lines */ - movq_r2r (mm2, mm6); /* copy second intermediate result */ + punpckhwd_m2r (*(dataptr + 14), mm0); /* n33:n23|n32:n22 - interleave third and fourth lines */ + movq_r2r (mm2, mm6); /* copy second intermediate result */ - movq_r2m (mm5, *(dataptr + 14)); /* write result 4 out */ - punpckhdq_r2r (mm3, mm4); /* n31:n21|n11:n01- produce second result */ + movq_r2m (mm5, *(dataptr + 14)); /* write result 4 out */ + punpckhdq_r2r (mm3, mm4); /* n31:n21|n11:n01- produce second result */ - movq_r2m (mm1, *(dataptr + 1)); /* write result 5 out - (first result for other 4 x 4 block) */ - punpckldq_r2r (mm0, mm2); /* n32:n22|n12:n02- produce third result */ + movq_r2m (mm1, *(dataptr + 1)); /* write result 5 out - (first result for other 4 x 4 block) */ + punpckldq_r2r (mm0, mm2); /* n32:n22|n12:n02- produce third result */ - movq_r2m (mm4, *(dataptr + 3)); /* write result 6 out */ - punpckhdq_r2r (mm0, mm6); /* n33:n23|n13:n03 - produce fourth result */ + movq_r2m (mm4, *(dataptr + 3)); /* write result 6 out */ + punpckhdq_r2r (mm0, mm6); /* n33:n23|n13:n03 - produce fourth result */ - movq_r2m (mm2, *(dataptr + 5)); /* write result 7 out */ + movq_r2m (mm2, *(dataptr + 5)); /* write result 7 out */ - movq_m2r (*dataptr, mm0); /* m03:m02|m01:m00 - first line, first 4x4 */ + movq_m2r (*dataptr, mm0); /* m03:m02|m01:m00 - first line, first 4x4 */ - movq_r2m (mm6, *(dataptr + 7)); /* write result 8 out */ + movq_r2m (mm6, *(dataptr + 7)); /* write result 8 out */ /* Do first 4x4 quadrant, which is used in the beginning of the DCT: */ - movq_m2r (*(dataptr + 4), mm7); /* m23:m22|m21:m20 - third line */ - movq_r2r (mm0, mm2); /* copy first line */ + movq_m2r (*(dataptr + 4), mm7); /* m23:m22|m21:m20 - third line */ + movq_r2r (mm0, mm2); /* copy first line */ - punpcklwd_m2r (*(dataptr + 2), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ - movq_r2r (mm7, mm4); /* copy third line */ + punpcklwd_m2r (*(dataptr + 2), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ + movq_r2r (mm7, mm4); /* copy third line */ - punpcklwd_m2r (*(dataptr + 6), mm7); /* m31:m21|m30:m20 - interleave third and fourth lines */ - movq_r2r (mm0, mm1); /* copy first intermediate result */ + punpcklwd_m2r (*(dataptr + 6), mm7); /* m31:m21|m30:m20 - interleave third and fourth lines */ + movq_r2r (mm0, mm1); /* copy first intermediate result */ - movq_m2r (*(dataptr + 2), mm6); /* m13:m12|m11:m10 - second line */ - punpckldq_r2r (mm7, mm0); /* m30:m20|m10:m00 - interleave to produce result 1 */ + movq_m2r (*(dataptr + 2), mm6); /* m13:m12|m11:m10 - second line */ + punpckldq_r2r (mm7, mm0); /* m30:m20|m10:m00 - interleave to produce result 1 */ - movq_m2r (*(dataptr + 6), mm5); /* m33:m32|m31:m30 - fourth line */ - punpckhdq_r2r (mm7, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ + movq_m2r (*(dataptr + 6), mm5); /* m33:m32|m31:m30 - fourth line */ + punpckhdq_r2r (mm7, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ - movq_r2r (mm0, mm7); /* write result 1 */ - punpckhwd_r2r (mm6, mm2); /* m13:m03|m12:m02 - interleave first and second lines */ + movq_r2r (mm0, mm7); /* write result 1 */ + punpckhwd_r2r (mm6, mm2); /* m13:m03|m12:m02 - interleave first and second lines */ - psubw_m2r (*(dataptr + 14), mm7); /* tmp07=x0-x7: Stage 1 */ - movq_r2r (mm1, mm6); /* write result 2 */ + psubw_m2r (*(dataptr + 14), mm7); /* tmp07=x0-x7: Stage 1 */ + movq_r2r (mm1, mm6); /* write result 2 */ - paddw_m2r (*(dataptr + 14), mm0); /* tmp00=x0+x7: Stage 1 */ - punpckhwd_r2r (mm5, mm4); /* m33:m23|m32:m22 - interleave third and fourth lines */ + paddw_m2r (*(dataptr + 14), mm0); /* tmp00=x0+x7: Stage 1 */ + punpckhwd_r2r (mm5, mm4); /* m33:m23|m32:m22 - interleave third and fourth lines */ - paddw_m2r (*(dataptr + 12), mm1); /* tmp01=x1+x6: Stage 1 */ - movq_r2r (mm2, mm3); /* copy first intermediate result */ + paddw_m2r (*(dataptr + 12), mm1); /* tmp01=x1+x6: Stage 1 */ + movq_r2r (mm2, mm3); /* copy first intermediate result */ - psubw_m2r (*(dataptr + 12), mm6); /* tmp06=x1-x6: Stage 1 */ - punpckldq_r2r (mm4, mm2); /* m32:m22|m12:m02 - interleave to produce result 3 */ + psubw_m2r (*(dataptr + 12), mm6); /* tmp06=x1-x6: Stage 1 */ + punpckldq_r2r (mm4, mm2); /* m32:m22|m12:m02 - interleave to produce result 3 */ - movq_r2m (mm7, tmp7); /* save tmp07 */ - movq_r2r (mm2, mm5); /* write result 3 */ + movq_r2m (mm7, tmp7); /* save tmp07 */ + movq_r2r (mm2, mm5); /* write result 3 */ - movq_r2m (mm6, tmp6); /* save tmp06 */ + movq_r2m (mm6, tmp6); /* save tmp06 */ - punpckhdq_r2r (mm4, mm3); /* m33:m23|m13:m03 - interleave to produce result 4 */ + punpckhdq_r2r (mm4, mm3); /* m33:m23|m13:m03 - interleave to produce result 4 */ - paddw_m2r (*(dataptr + 10), mm2); /* tmp02=x2+x5: stage 1 */ - movq_r2r (mm3, mm4); /* write result 4 */ + paddw_m2r (*(dataptr + 10), mm2); /* tmp02=x2+x5: stage 1 */ + movq_r2r (mm3, mm4); /* write result 4 */ /************************************************************************************************ End of Transpose 2 ************************************************************************************************/ - paddw_m2r (*(dataptr + 8), mm3); /* tmp03=x3+x4: stage 1 */ + paddw_m2r (*(dataptr + 8), mm3); /* tmp03=x3+x4: stage 1 */ movq_r2r (mm0, mm7); - psubw_m2r (*(dataptr + 8), mm4); /* tmp04=x3-x4: stage 1 */ + psubw_m2r (*(dataptr + 8), mm4); /* tmp04=x3-x4: stage 1 */ movq_r2r (mm1, mm6); - paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03: even 2 */ - psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03: even 2 */ + paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03: even 2 */ + psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03: even 2 */ - psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02: even 2 */ - paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02: even 2 */ + psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02: even 2 */ + paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02: even 2 */ - psubw_m2r (*(dataptr + 10), mm5); /* tmp05=x2-x5: stage 1 */ - paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ + psubw_m2r (*(dataptr + 10), mm5); /* tmp05=x2-x5: stage 1 */ + paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ /* stage 3 */ movq_m2r (tmp6, mm2); movq_r2r (mm0, mm3); - psllw_i2r (2, mm6); /* m8 * 2^2 */ + psllw_i2r (2, mm6); /* m8 * 2^2 */ paddw_r2r (mm1, mm0); - pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ + pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ psubw_r2r (mm1, mm3); movq_r2m (mm0, *dataptr); @@ -1033,197 +1033,197 @@ RTjpeg_dctY (__u8 * idata, __s16 * odata, int rskip) /* Odd part */ movq_r2m (mm3, *(dataptr + 8)); - paddw_r2r (mm5, mm4); /* tmp10 */ + paddw_r2r (mm5, mm4); /* tmp10 */ movq_m2r (tmp7, mm3); - paddw_r2r (mm6, mm0); /* tmp32 */ + paddw_r2r (mm6, mm0); /* tmp32 */ - paddw_r2r (mm2, mm5); /* tmp11 */ - psubw_r2r (mm6, mm7); /* tmp33 */ + paddw_r2r (mm2, mm5); /* tmp11 */ + psubw_r2r (mm6, mm7); /* tmp33 */ movq_r2m (mm0, *(dataptr + 4)); - paddw_r2r (mm3, mm2); /* tmp12 */ + paddw_r2r (mm3, mm2); /* tmp12 */ /* stage 4 */ movq_r2m (mm7, *(dataptr + 12)); - movq_r2r (mm4, mm1); /* copy of tmp10 */ + movq_r2r (mm4, mm1); /* copy of tmp10 */ - psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ - psllw_i2r (2, mm4); /* m8 * 2^2 */ + psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ + psllw_i2r (2, mm4); /* m8 * 2^2 */ movq_m2r (RTjpeg_C2mC6, mm0); psllw_i2r (2, mm1); - pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ + pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ psllw_i2r (2, mm2); - pmulhw_r2r (mm0, mm4); /* z5 */ + pmulhw_r2r (mm0, mm4); /* z5 */ /* stage 5 */ pmulhw_m2r (RTjpeg_C2pC6, mm2); psllw_i2r (2, mm5); - pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ - movq_r2r (mm3, mm0); /* copy tmp7 */ + pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ + movq_r2r (mm3, mm0); /* copy tmp7 */ movq_m2r (*(dataptr + 1), mm7); - paddw_r2r (mm1, mm4); /* z2 */ + paddw_r2r (mm1, mm4); /* z2 */ - paddw_r2r (mm1, mm2); /* z4 */ + paddw_r2r (mm1, mm2); /* z4 */ - paddw_r2r (mm5, mm0); /* z11 */ - psubw_r2r (mm5, mm3); /* z13 */ + paddw_r2r (mm5, mm0); /* z11 */ + psubw_r2r (mm5, mm3); /* z13 */ /* stage 6 */ - movq_r2r (mm3, mm5); /* copy z13 */ - psubw_r2r (mm4, mm3); /* y3=z13 - z2 */ + movq_r2r (mm3, mm5); /* copy z13 */ + psubw_r2r (mm4, mm3); /* y3=z13 - z2 */ - paddw_r2r (mm4, mm5); /* y5=z13 + z2 */ - movq_r2r (mm0, mm6); /* copy z11 */ + paddw_r2r (mm4, mm5); /* y5=z13 + z2 */ + movq_r2r (mm0, mm6); /* copy z11 */ - movq_r2m (mm3, *(dataptr + 6)); /*save y3 */ - psubw_r2r (mm2, mm0); /* y7=z11 - z4 */ + movq_r2m (mm3, *(dataptr + 6)); /*save y3 */ + psubw_r2r (mm2, mm0); /* y7=z11 - z4 */ - movq_r2m (mm5, *(dataptr + 10)); /*save y5 */ - paddw_r2r (mm2, mm6); /* y1=z11 + z4 */ + movq_r2m (mm5, *(dataptr + 10)); /*save y5 */ + paddw_r2r (mm2, mm6); /* y1=z11 + z4 */ - movq_r2m (mm0, *(dataptr + 14)); /*save y7 */ + movq_r2m (mm0, *(dataptr + 14)); /*save y7 */ - /************************************************ + /************************************************ * End of 1st 4 rows ************************************************/ - movq_m2r (*(dataptr + 3), mm1); /* load x1 : stage 1 */ - movq_r2r (mm7, mm0); /* copy x0 */ + movq_m2r (*(dataptr + 3), mm1); /* load x1 : stage 1 */ + movq_r2r (mm7, mm0); /* copy x0 */ - movq_r2m (mm6, *(dataptr + 2)); /*save y1 */ + movq_r2m (mm6, *(dataptr + 2)); /*save y1 */ - movq_m2r (*(dataptr + 5), mm2); /* load x2 : stage 1 */ - movq_r2r (mm1, mm6); /* copy x1 */ + movq_m2r (*(dataptr + 5), mm2); /* load x2 : stage 1 */ + movq_r2r (mm1, mm6); /* copy x1 */ - paddw_m2r (*(dataptr + 15), mm0); /* tmp00 = x0 + x7 */ + paddw_m2r (*(dataptr + 15), mm0); /* tmp00 = x0 + x7 */ - movq_m2r (*(dataptr + 7), mm3); /* load x3 : stage 1 */ - movq_r2r (mm2, mm5); /* copy x2 */ + movq_m2r (*(dataptr + 7), mm3); /* load x3 : stage 1 */ + movq_r2r (mm2, mm5); /* copy x2 */ - psubw_m2r (*(dataptr + 15), mm7); /* tmp07 = x0 - x7 */ - movq_r2r (mm3, mm4); /* copy x3 */ + psubw_m2r (*(dataptr + 15), mm7); /* tmp07 = x0 - x7 */ + movq_r2r (mm3, mm4); /* copy x3 */ - paddw_m2r (*(dataptr + 13), mm1); /* tmp01 = x1 + x6 */ + paddw_m2r (*(dataptr + 13), mm1); /* tmp01 = x1 + x6 */ - movq_r2m (mm7, tmp7); /* save tmp07 */ - movq_r2r (mm0, mm7); /* copy tmp00 */ + movq_r2m (mm7, tmp7); /* save tmp07 */ + movq_r2r (mm0, mm7); /* copy tmp00 */ - psubw_m2r (*(dataptr + 13), mm6); /* tmp06 = x1 - x6 */ + psubw_m2r (*(dataptr + 13), mm6); /* tmp06 = x1 - x6 */ /* stage 2, Even Part */ - paddw_m2r (*(dataptr + 9), mm3); /* tmp03 = x3 + x4 */ + paddw_m2r (*(dataptr + 9), mm3); /* tmp03 = x3 + x4 */ - movq_r2m (mm6, tmp6); /* save tmp07 */ - movq_r2r (mm1, mm6); /* copy tmp01 */ + movq_r2m (mm6, tmp6); /* save tmp07 */ + movq_r2r (mm1, mm6); /* copy tmp01 */ - paddw_m2r (*(dataptr + 11), mm2); /* tmp02 = x2 + x5 */ - paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03 */ + paddw_m2r (*(dataptr + 11), mm2); /* tmp02 = x2 + x5 */ + paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03 */ - psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03 */ + psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03 */ - psubw_m2r (*(dataptr + 9), mm4); /* tmp04 = x3 - x4 */ - psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02 */ + psubw_m2r (*(dataptr + 9), mm4); /* tmp04 = x3 - x4 */ + psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02 */ - paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02 */ + paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02 */ - psubw_m2r (*(dataptr + 11), mm5); /* tmp05 = x2 - x5 */ - paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ + psubw_m2r (*(dataptr + 11), mm5); /* tmp05 = x2 - x5 */ + paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ /* stage 3, Even and stage 4 & 5 even */ - movq_m2r (tmp6, mm2); /* load tmp6 */ - movq_r2r (mm0, mm3); /* copy tmp10 */ + movq_m2r (tmp6, mm2); /* load tmp6 */ + movq_r2r (mm0, mm3); /* copy tmp10 */ - psllw_i2r (2, mm6); /* shift z1 */ - paddw_r2r (mm1, mm0); /* y0=tmp10 + tmp11 */ + psllw_i2r (2, mm6); /* shift z1 */ + paddw_r2r (mm1, mm0); /* y0=tmp10 + tmp11 */ - pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ - psubw_r2r (mm1, mm3); /* y4=tmp10 - tmp11 */ + pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ + psubw_r2r (mm1, mm3); /* y4=tmp10 - tmp11 */ - movq_r2m (mm0, *(dataptr + 1)); /*save y0 */ - movq_r2r (mm7, mm0); /* copy tmp13 */ + movq_r2m (mm0, *(dataptr + 1)); /*save y0 */ + movq_r2r (mm7, mm0); /* copy tmp13 */ /* odd part */ - movq_r2m (mm3, *(dataptr + 9)); /*save y4 */ - paddw_r2r (mm5, mm4); /* tmp10 = tmp4 + tmp5 */ + movq_r2m (mm3, *(dataptr + 9)); /*save y4 */ + paddw_r2r (mm5, mm4); /* tmp10 = tmp4 + tmp5 */ - movq_m2r (tmp7, mm3); /* load tmp7 */ - paddw_r2r (mm6, mm0); /* tmp32 = tmp13 + z1 */ + movq_m2r (tmp7, mm3); /* load tmp7 */ + paddw_r2r (mm6, mm0); /* tmp32 = tmp13 + z1 */ - paddw_r2r (mm2, mm5); /* tmp11 = tmp5 + tmp6 */ - psubw_r2r (mm6, mm7); /* tmp33 = tmp13 - z1 */ + paddw_r2r (mm2, mm5); /* tmp11 = tmp5 + tmp6 */ + psubw_r2r (mm6, mm7); /* tmp33 = tmp13 - z1 */ - movq_r2m (mm0, *(dataptr + 5)); /*save y2 */ - paddw_r2r (mm3, mm2); /* tmp12 = tmp6 + tmp7 */ + movq_r2m (mm0, *(dataptr + 5)); /*save y2 */ + paddw_r2r (mm3, mm2); /* tmp12 = tmp6 + tmp7 */ /* stage 4 */ - movq_r2m (mm7, *(dataptr + 13)); /*save y6 */ - movq_r2r (mm4, mm1); /* copy tmp10 */ + movq_r2m (mm7, *(dataptr + 13)); /*save y6 */ + movq_r2r (mm4, mm1); /* copy tmp10 */ - psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ - psllw_i2r (2, mm4); /* shift tmp10 */ + psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ + psllw_i2r (2, mm4); /* shift tmp10 */ - movq_m2r (RTjpeg_C2mC6, mm0); /* load C2mC6 */ - psllw_i2r (2, mm1); /* shift (tmp10-tmp12) */ + movq_m2r (RTjpeg_C2mC6, mm0); /* load C2mC6 */ + psllw_i2r (2, mm1); /* shift (tmp10-tmp12) */ - pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ - psllw_i2r (2, mm5); /* prepare for multiply */ + pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ + psllw_i2r (2, mm5); /* prepare for multiply */ - pmulhw_r2r (mm0, mm4); /* multiply by converted real */ + pmulhw_r2r (mm0, mm4); /* multiply by converted real */ /* stage 5 */ - pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ - psllw_i2r (2, mm2); /* prepare for multiply */ + pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ + psllw_i2r (2, mm2); /* prepare for multiply */ - pmulhw_m2r (RTjpeg_C2pC6, mm2); /* multiply */ - movq_r2r (mm3, mm0); /* copy tmp7 */ + pmulhw_m2r (RTjpeg_C2pC6, mm2); /* multiply */ + movq_r2r (mm3, mm0); /* copy tmp7 */ - movq_m2r (*(dataptr + 9), mm7); /* m03:m02|m01:m00 - first line (line 4)and copy into mm7 */ - paddw_r2r (mm1, mm4); /* z2 */ + movq_m2r (*(dataptr + 9), mm7); /* m03:m02|m01:m00 - first line (line 4)and copy into mm7 */ + paddw_r2r (mm1, mm4); /* z2 */ - paddw_r2r (mm5, mm0); /* z11 */ - psubw_r2r (mm5, mm3); /* z13 */ + paddw_r2r (mm5, mm0); /* z11 */ + psubw_r2r (mm5, mm3); /* z13 */ /* stage 6 */ - movq_r2r (mm3, mm5); /* copy z13 */ - paddw_r2r (mm1, mm2); /* z4 */ + movq_r2r (mm3, mm5); /* copy z13 */ + paddw_r2r (mm1, mm2); /* z4 */ - movq_r2r (mm0, mm6); /* copy z11 */ - psubw_r2r (mm4, mm5); /* y3 */ + movq_r2r (mm0, mm6); /* copy z11 */ + psubw_r2r (mm4, mm5); /* y3 */ - paddw_r2r (mm2, mm6); /* y1 */ - paddw_r2r (mm4, mm3); /* y5 */ + paddw_r2r (mm2, mm6); /* y1 */ + paddw_r2r (mm4, mm3); /* y5 */ - movq_r2m (mm5, *(dataptr + 7)); /*save y3 */ - psubw_r2r (mm2, mm0); /* yè=z11 - z4 */ + movq_r2m (mm5, *(dataptr + 7)); /*save y3 */ + psubw_r2r (mm2, mm0); /* yè=z11 - z4 */ - movq_r2m (mm3, *(dataptr + 11)); /*save y5 */ + movq_r2m (mm3, *(dataptr + 11)); /*save y5 */ - movq_r2m (mm6, *(dataptr + 3)); /*save y1 */ + movq_r2m (mm6, *(dataptr + 3)); /*save y1 */ - movq_r2m (mm0, *(dataptr + 15)); /*save y7 */ + movq_r2m (mm0, *(dataptr + 15)); /*save y7 */ #endif } -#define FIX_1_082392200 ((__s32) 277) /* FIX(1.082392200) */ -#define FIX_1_414213562 ((__s32) 362) /* FIX(1.414213562) */ -#define FIX_1_847759065 ((__s32) 473) /* FIX(1.847759065) */ -#define FIX_2_613125930 ((__s32) 669) /* FIX(2.613125930) */ +#define FIX_1_082392200 ((__s32) 277) /* FIX(1.082392200) */ +#define FIX_1_414213562 ((__s32) 362) /* FIX(1.414213562) */ +#define FIX_1_847759065 ((__s32) 473) /* FIX(1.847759065) */ +#define FIX_2_613125930 ((__s32) 669) /* FIX(2.613125930) */ #define DESCALE(x) (__s16)( ((x)+4) >> 3) @@ -1266,119 +1266,119 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* Odd part */ - movq_m2r (*(idata + 10), mm1); /* load idata[DCTSIZE*5] */ + movq_m2r (*(idata + 10), mm1); /* load idata[DCTSIZE*5] */ - movq_m2r (*(idata + 6), mm0); /* load idata[DCTSIZE*3] */ + movq_m2r (*(idata + 6), mm0); /* load idata[DCTSIZE*3] */ - movq_m2r (*(idata + 2), mm3); /* load idata[DCTSIZE*1] */ + movq_m2r (*(idata + 2), mm3); /* load idata[DCTSIZE*1] */ - movq_r2r (mm1, mm2); /* copy tmp6 : phase 6 */ - */movq_m2r (*(idata + 14), mm4); /* load idata[DCTSIZE*7] */ + movq_r2r (mm1, mm2); /* copy tmp6 : phase 6 */ + */movq_m2r (*(idata + 14), mm4); /* load idata[DCTSIZE*7] */ - paddw_r2r (mm0, mm1); /* z13 = tmp6 + tmp5; */ + paddw_r2r (mm0, mm1); /* z13 = tmp6 + tmp5; */ - psubw_r2r (mm0, mm2); /* z10 = tmp6 - tmp5 */ + psubw_r2r (mm0, mm2); /* z10 = tmp6 - tmp5 */ - psllw_i2r (2, mm2); /* shift z10 */ - movq_r2r (mm2, mm0); /* copy z10 */ + psllw_i2r (2, mm2); /* shift z10 */ + movq_r2r (mm2, mm0); /* copy z10 */ - pmulhw_m2r (fix_184n261, mm2); /* MULTIPLY( z12, FIX_1_847759065); : 2*c2 */ - movq_r2r (mm3, mm5); /* copy tmp4 */ + pmulhw_m2r (fix_184n261, mm2); /* MULTIPLY( z12, FIX_1_847759065); : 2*c2 */ + movq_r2r (mm3, mm5); /* copy tmp4 */ - pmulhw_m2r (fix_n184, mm0); /* MULTIPLY(z10, -FIX_1_847759065); : 2*c2 */ - paddw_r2r (mm4, mm3); /* z11 = tmp4 + tmp7; */ + pmulhw_m2r (fix_n184, mm0); /* MULTIPLY(z10, -FIX_1_847759065); : 2*c2 */ + paddw_r2r (mm4, mm3); /* z11 = tmp4 + tmp7; */ - movq_r2r (mm3, mm6); /* copy z11 : phase 5 */ - psubw_r2r (mm4, mm5); /* z12 = tmp4 - tmp7; */ + movq_r2r (mm3, mm6); /* copy z11 : phase 5 */ + psubw_r2r (mm4, mm5); /* z12 = tmp4 - tmp7; */ - psubw_r2r (mm1, mm6); /* z11-z13 */ - psllw_i2r (2, mm5); /* shift z12 */ + psubw_r2r (mm1, mm6); /* z11-z13 */ + psllw_i2r (2, mm5); /* shift z12 */ - movq_m2r (*(idata + 12), mm4); /* load idata[DCTSIZE*6], even part */ - movq_r2r (mm5, mm7); /* copy z12 */ + movq_m2r (*(idata + 12), mm4); /* load idata[DCTSIZE*6], even part */ + movq_r2r (mm5, mm7); /* copy z12 */ - pmulhw_m2r (fix_108n184, mm5); /* MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; 2*(c2-c6): even part */ - paddw_r2r (mm1, mm3); /* tmp7 = z11 + z13; */ + pmulhw_m2r (fix_108n184, mm5); /* MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; 2*(c2-c6): even part */ + paddw_r2r (mm1, mm3); /* tmp7 = z11 + z13; */ /*ok */ /* Even part */ - pmulhw_m2r (fix_184, mm7); /* MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; -2*(c2+c6) */ + pmulhw_m2r (fix_184, mm7); /* MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; -2*(c2+c6) */ psllw_i2r (2, mm6); - movq_m2r (*(idata + 4), mm1); /* load idata[DCTSIZE*2] */ + movq_m2r (*(idata + 4), mm1); /* load idata[DCTSIZE*2] */ - paddw_r2r (mm5, mm0); /* tmp10 */ + paddw_r2r (mm5, mm0); /* tmp10 */ - paddw_r2r (mm7, mm2); /* tmp12 */ + paddw_r2r (mm7, mm2); /* tmp12 */ - pmulhw_m2r (fix_141, mm6); /* tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); 2*c4 */ - psubw_r2r (mm3, mm2); /* tmp6 = tmp12 - tmp7 */ + pmulhw_m2r (fix_141, mm6); /* tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); 2*c4 */ + psubw_r2r (mm3, mm2); /* tmp6 = tmp12 - tmp7 */ - movq_r2r (mm1, mm5); /* copy tmp1 */ - paddw_r2r (mm4, mm1); /* tmp13= tmp1 + tmp3; phases 5-3 */ + movq_r2r (mm1, mm5); /* copy tmp1 */ + paddw_r2r (mm4, mm1); /* tmp13= tmp1 + tmp3; phases 5-3 */ - psubw_r2r (mm4, mm5); /* tmp1-tmp3 */ - psubw_r2r (mm2, mm6); /* tmp5 = tmp11 - tmp6; */ + psubw_r2r (mm4, mm5); /* tmp1-tmp3 */ + psubw_r2r (mm2, mm6); /* tmp5 = tmp11 - tmp6; */ - movq_r2m (mm1, *(wsptr)); /* save tmp13 in workspace */ - psllw_i2r (2, mm5); /* shift tmp1-tmp3 */ + movq_r2m (mm1, *(wsptr)); /* save tmp13 in workspace */ + psllw_i2r (2, mm5); /* shift tmp1-tmp3 */ - movq_m2r (*(idata), mm7); /* load idata[DCTSIZE*0] */ + movq_m2r (*(idata), mm7); /* load idata[DCTSIZE*0] */ - pmulhw_m2r (fix_141, mm5); /* MULTIPLY(tmp1 - tmp3, FIX_1_414213562) */ - paddw_r2r (mm6, mm0); /* tmp4 = tmp10 + tmp5; */ + pmulhw_m2r (fix_141, mm5); /* MULTIPLY(tmp1 - tmp3, FIX_1_414213562) */ + paddw_r2r (mm6, mm0); /* tmp4 = tmp10 + tmp5; */ - movq_m2r (*(idata + 8), mm4); /* load idata[DCTSIZE*4] */ + movq_m2r (*(idata + 8), mm4); /* load idata[DCTSIZE*4] */ - psubw_r2r (mm1, mm5); /* tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; 2*c4 */ + psubw_r2r (mm1, mm5); /* tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; 2*c4 */ - movq_r2m (mm0, *(wsptr + 4)); /* save tmp4 in workspace */ - movq_r2r (mm7, mm1); /* copy tmp0 : phase 3 */ + movq_r2m (mm0, *(wsptr + 4)); /* save tmp4 in workspace */ + movq_r2r (mm7, mm1); /* copy tmp0 : phase 3 */ - movq_r2m (mm5, *(wsptr + 2)); /* save tmp12 in workspace */ - psubw_r2r (mm4, mm1); /* tmp11 = tmp0 - tmp2; */ + movq_r2m (mm5, *(wsptr + 2)); /* save tmp12 in workspace */ + psubw_r2r (mm4, mm1); /* tmp11 = tmp0 - tmp2; */ - paddw_r2r (mm4, mm7); /* tmp10 = tmp0 + tmp2; */ - movq_r2r (mm1, mm5); /* copy tmp11 */ + paddw_r2r (mm4, mm7); /* tmp10 = tmp0 + tmp2; */ + movq_r2r (mm1, mm5); /* copy tmp11 */ - paddw_m2r (*(wsptr + 2), mm1); /* tmp1 = tmp11 + tmp12; */ - movq_r2r (mm7, mm4); /* copy tmp10 : phase 2 */ + paddw_m2r (*(wsptr + 2), mm1); /* tmp1 = tmp11 + tmp12; */ + movq_r2r (mm7, mm4); /* copy tmp10 : phase 2 */ - paddw_m2r (*(wsptr), mm7); /* tmp0 = tmp10 + tmp13; */ + paddw_m2r (*(wsptr), mm7); /* tmp0 = tmp10 + tmp13; */ - psubw_m2r (*(wsptr), mm4); /* tmp3 = tmp10 - tmp13; */ - movq_r2r (mm7, mm0); /* copy tmp0 */ + psubw_m2r (*(wsptr), mm4); /* tmp3 = tmp10 - tmp13; */ + movq_r2r (mm7, mm0); /* copy tmp0 */ - psubw_m2r (*(wsptr + 2), mm5); /* tmp2 = tmp11 - tmp12; */ - paddw_r2r (mm3, mm7); /* wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); */ + psubw_m2r (*(wsptr + 2), mm5); /* tmp2 = tmp11 - tmp12; */ + paddw_r2r (mm3, mm7); /* wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); */ - psubw_r2r (mm3, mm0); /* wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); */ + psubw_r2r (mm3, mm0); /* wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); */ - movq_r2m (mm7, *(wsptr)); /* wsptr[DCTSIZE*0] */ - movq_r2r (mm1, mm3); /* copy tmp1 */ + movq_r2m (mm7, *(wsptr)); /* wsptr[DCTSIZE*0] */ + movq_r2r (mm1, mm3); /* copy tmp1 */ - movq_r2m (mm0, *(wsptr + 14)); /* wsptr[DCTSIZE*7] */ - paddw_r2r (mm2, mm1); /* wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); */ + movq_r2m (mm0, *(wsptr + 14)); /* wsptr[DCTSIZE*7] */ + paddw_r2r (mm2, mm1); /* wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); */ - psubw_r2r (mm2, mm3); /* wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); */ + psubw_r2r (mm2, mm3); /* wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); */ - movq_r2m (mm1, *(wsptr + 2)); /* wsptr[DCTSIZE*1] */ - movq_r2r (mm4, mm1); /* copy tmp3 */ + movq_r2m (mm1, *(wsptr + 2)); /* wsptr[DCTSIZE*1] */ + movq_r2r (mm4, mm1); /* copy tmp3 */ - movq_r2m (mm3, *(wsptr + 12)); /* wsptr[DCTSIZE*6] */ + movq_r2m (mm3, *(wsptr + 12)); /* wsptr[DCTSIZE*6] */ - paddw_m2r (*(wsptr + 4), mm4); /* wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); */ + paddw_m2r (*(wsptr + 4), mm4); /* wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); */ - psubw_m2r (*(wsptr + 4), mm1); /* wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); */ + psubw_m2r (*(wsptr + 4), mm1); /* wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); */ movq_r2m (mm4, *(wsptr + 8)); - movq_r2r (mm5, mm7); /* copy tmp2 */ + movq_r2r (mm5, mm7); /* copy tmp2 */ - paddw_r2r (mm6, mm5); /* wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5) */ + paddw_r2r (mm6, mm5); /* wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5) */ movq_r2m (mm1, *(wsptr + 6)); - psubw_r2r (mm6, mm7); /* wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); */ + psubw_r2r (mm6, mm7); /* wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); */ movq_r2m (mm5, *(wsptr + 4)); @@ -1394,117 +1394,117 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /*****************************************************************/ - movq_m2r (*(idata + 10), mm1); /* load idata[DCTSIZE*5] */ + movq_m2r (*(idata + 10), mm1); /* load idata[DCTSIZE*5] */ - movq_m2r (*(idata + 6), mm0); /* load idata[DCTSIZE*3] */ + movq_m2r (*(idata + 6), mm0); /* load idata[DCTSIZE*3] */ - movq_m2r (*(idata + 2), mm3); /* load idata[DCTSIZE*1] */ - movq_r2r (mm1, mm2); /* copy tmp6 : phase 6 */ - */movq_m2r (*(idata + 14), mm4); /* load idata[DCTSIZE*7] */ - paddw_r2r (mm0, mm1); /* z13 = tmp6 + tmp5; */ + movq_m2r (*(idata + 2), mm3); /* load idata[DCTSIZE*1] */ + movq_r2r (mm1, mm2); /* copy tmp6 : phase 6 */ + */movq_m2r (*(idata + 14), mm4); /* load idata[DCTSIZE*7] */ + paddw_r2r (mm0, mm1); /* z13 = tmp6 + tmp5; */ - psubw_r2r (mm0, mm2); /* z10 = tmp6 - tmp5 */ + psubw_r2r (mm0, mm2); /* z10 = tmp6 - tmp5 */ - psllw_i2r (2, mm2); /* shift z10 */ - movq_r2r (mm2, mm0); /* copy z10 */ + psllw_i2r (2, mm2); /* shift z10 */ + movq_r2r (mm2, mm0); /* copy z10 */ - pmulhw_m2r (fix_184n261, mm2); /* MULTIPLY( z12, FIX_1_847759065); : 2*c2 */ - movq_r2r (mm3, mm5); /* copy tmp4 */ + pmulhw_m2r (fix_184n261, mm2); /* MULTIPLY( z12, FIX_1_847759065); : 2*c2 */ + movq_r2r (mm3, mm5); /* copy tmp4 */ - pmulhw_m2r (fix_n184, mm0); /* MULTIPLY(z10, -FIX_1_847759065); : 2*c2 */ - paddw_r2r (mm4, mm3); /* z11 = tmp4 + tmp7; */ + pmulhw_m2r (fix_n184, mm0); /* MULTIPLY(z10, -FIX_1_847759065); : 2*c2 */ + paddw_r2r (mm4, mm3); /* z11 = tmp4 + tmp7; */ - movq_r2r (mm3, mm6); /* copy z11 : phase 5 */ - psubw_r2r (mm4, mm5); /* z12 = tmp4 - tmp7; */ + movq_r2r (mm3, mm6); /* copy z11 : phase 5 */ + psubw_r2r (mm4, mm5); /* z12 = tmp4 - tmp7; */ - psubw_r2r (mm1, mm6); /* z11-z13 */ - psllw_i2r (2, mm5); /* shift z12 */ + psubw_r2r (mm1, mm6); /* z11-z13 */ + psllw_i2r (2, mm5); /* shift z12 */ - movq_m2r (*(idata + 12), mm4); /* load idata[DCTSIZE*6], even part */ - movq_r2r (mm5, mm7); /* copy z12 */ + movq_m2r (*(idata + 12), mm4); /* load idata[DCTSIZE*6], even part */ + movq_r2r (mm5, mm7); /* copy z12 */ - pmulhw_m2r (fix_108n184, mm5); /* MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; 2*(c2-c6) even part */ - paddw_r2r (mm1, mm3); /* tmp7 = z11 + z13; */ + pmulhw_m2r (fix_108n184, mm5); /* MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; 2*(c2-c6) even part */ + paddw_r2r (mm1, mm3); /* tmp7 = z11 + z13; */ /*ok */ /* Even part */ - pmulhw_m2r (fix_184, mm7); /* MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; -2*(c2+c6) */ + pmulhw_m2r (fix_184, mm7); /* MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; -2*(c2+c6) */ psllw_i2r (2, mm6); - movq_m2r (*(idata + 4), mm1); /* load idata[DCTSIZE*2] */ + movq_m2r (*(idata + 4), mm1); /* load idata[DCTSIZE*2] */ - paddw_r2r (mm5, mm0); /* tmp10 */ + paddw_r2r (mm5, mm0); /* tmp10 */ - paddw_r2r (mm7, mm2); /* tmp12 */ + paddw_r2r (mm7, mm2); /* tmp12 */ - pmulhw_m2r (fix_141, mm6); /* tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); 2*c4 */ - psubw_r2r (mm3, mm2); /* tmp6 = tmp12 - tmp7 */ + pmulhw_m2r (fix_141, mm6); /* tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); 2*c4 */ + psubw_r2r (mm3, mm2); /* tmp6 = tmp12 - tmp7 */ - movq_r2r (mm1, mm5); /* copy tmp1 */ - paddw_r2r (mm4, mm1); /* tmp13= tmp1 + tmp3; phases 5-3 */ + movq_r2r (mm1, mm5); /* copy tmp1 */ + paddw_r2r (mm4, mm1); /* tmp13= tmp1 + tmp3; phases 5-3 */ - psubw_r2r (mm4, mm5); /* tmp1-tmp3 */ - psubw_r2r (mm2, mm6); /* tmp5 = tmp11 - tmp6; */ + psubw_r2r (mm4, mm5); /* tmp1-tmp3 */ + psubw_r2r (mm2, mm6); /* tmp5 = tmp11 - tmp6; */ - movq_r2m (mm1, *(wsptr)); /* save tmp13 in workspace */ - psllw_i2r (2, mm5); /* shift tmp1-tmp3 */ + movq_r2m (mm1, *(wsptr)); /* save tmp13 in workspace */ + psllw_i2r (2, mm5); /* shift tmp1-tmp3 */ - movq_m2r (*(idata), mm7); /* load idata[DCTSIZE*0] */ - paddw_r2r (mm6, mm0); /* tmp4 = tmp10 + tmp5; */ + movq_m2r (*(idata), mm7); /* load idata[DCTSIZE*0] */ + paddw_r2r (mm6, mm0); /* tmp4 = tmp10 + tmp5; */ - pmulhw_m2r (fix_141, mm5); /* MULTIPLY(tmp1 - tmp3, FIX_1_414213562) */ + pmulhw_m2r (fix_141, mm5); /* MULTIPLY(tmp1 - tmp3, FIX_1_414213562) */ - movq_m2r (*(idata + 8), mm4); /* load idata[DCTSIZE*4] */ + movq_m2r (*(idata + 8), mm4); /* load idata[DCTSIZE*4] */ - psubw_r2r (mm1, mm5); /* tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; 2*c4 */ + psubw_r2r (mm1, mm5); /* tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; 2*c4 */ - movq_r2m (mm0, *(wsptr + 4)); /* save tmp4 in workspace */ - movq_r2r (mm7, mm1); /* copy tmp0: phase 3 */ + movq_r2m (mm0, *(wsptr + 4)); /* save tmp4 in workspace */ + movq_r2r (mm7, mm1); /* copy tmp0: phase 3 */ - movq_r2m (mm5, *(wsptr + 2)); /* save tmp12 in workspace */ - psubw_r2r (mm4, mm1); /* tmp11 = tmp0 - tmp2; */ + movq_r2m (mm5, *(wsptr + 2)); /* save tmp12 in workspace */ + psubw_r2r (mm4, mm1); /* tmp11 = tmp0 - tmp2; */ - paddw_r2r (mm4, mm7); /* tmp10 = tmp0 + tmp2; */ - movq_r2r (mm1, mm5); /* copy tmp11 */ + paddw_r2r (mm4, mm7); /* tmp10 = tmp0 + tmp2; */ + movq_r2r (mm1, mm5); /* copy tmp11 */ - paddw_m2r (*(wsptr + 2), mm1); /* tmp1 = tmp11 + tmp12; */ - movq_r2r (mm7, mm4); /* copy tmp10: phase 2 */ + paddw_m2r (*(wsptr + 2), mm1); /* tmp1 = tmp11 + tmp12; */ + movq_r2r (mm7, mm4); /* copy tmp10: phase 2 */ - paddw_m2r (*(wsptr), mm7); /* tmp0 = tmp10 + tmp13; */ + paddw_m2r (*(wsptr), mm7); /* tmp0 = tmp10 + tmp13; */ - psubw_m2r (*(wsptr), mm4); /* tmp3 = tmp10 - tmp13; */ - movq_r2r (mm7, mm0); /* copy tmp0 */ + psubw_m2r (*(wsptr), mm4); /* tmp3 = tmp10 - tmp13; */ + movq_r2r (mm7, mm0); /* copy tmp0 */ - psubw_m2r (*(wsptr + 2), mm5); /* tmp2 = tmp11 - tmp12; */ - paddw_r2r (mm3, mm7); /* wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); */ + psubw_m2r (*(wsptr + 2), mm5); /* tmp2 = tmp11 - tmp12; */ + paddw_r2r (mm3, mm7); /* wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); */ - psubw_r2r (mm3, mm0); /* wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); */ + psubw_r2r (mm3, mm0); /* wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); */ - movq_r2m (mm7, *(wsptr)); /* wsptr[DCTSIZE*0] */ - movq_r2r (mm1, mm3); /* copy tmp1 */ + movq_r2m (mm7, *(wsptr)); /* wsptr[DCTSIZE*0] */ + movq_r2r (mm1, mm3); /* copy tmp1 */ - movq_r2m (mm0, *(wsptr + 14)); /* wsptr[DCTSIZE*7] */ - paddw_r2r (mm2, mm1); /* wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); */ + movq_r2m (mm0, *(wsptr + 14)); /* wsptr[DCTSIZE*7] */ + paddw_r2r (mm2, mm1); /* wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); */ - psubw_r2r (mm2, mm3); /* wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); */ + psubw_r2r (mm2, mm3); /* wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); */ - movq_r2m (mm1, *(wsptr + 2)); /* wsptr[DCTSIZE*1] */ - movq_r2r (mm4, mm1); /* copy tmp3 */ + movq_r2m (mm1, *(wsptr + 2)); /* wsptr[DCTSIZE*1] */ + movq_r2r (mm4, mm1); /* copy tmp3 */ - movq_r2m (mm3, *(wsptr + 12)); /* wsptr[DCTSIZE*6] */ + movq_r2m (mm3, *(wsptr + 12)); /* wsptr[DCTSIZE*6] */ - paddw_m2r (*(wsptr + 4), mm4); /* wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); */ + paddw_m2r (*(wsptr + 4), mm4); /* wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); */ - psubw_m2r (*(wsptr + 4), mm1); /* wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); */ + psubw_m2r (*(wsptr + 4), mm1); /* wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); */ movq_r2m (mm4, *(wsptr + 8)); - movq_r2r (mm5, mm7); /* copy tmp2 */ + movq_r2r (mm5, mm7); /* copy tmp2 */ - paddw_r2r (mm6, mm5); /* wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5) */ + paddw_r2r (mm6, mm5); /* wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5) */ movq_r2m (mm1, *(wsptr + 6)); - psubw_r2r (mm6, mm7); /* wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); */ + psubw_r2r (mm6, mm7); /* wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); */ movq_r2m (mm5, *(wsptr + 4)); @@ -1525,62 +1525,62 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); */ /* tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); */ /* tmp14 = ((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6]); */ - movq_m2r (*(wsptr), mm0); /* wsptr[0,0],[0,1],[0,2],[0,3] */ + movq_m2r (*(wsptr), mm0); /* wsptr[0,0],[0,1],[0,2],[0,3] */ - movq_m2r (*(wsptr + 1), mm1); /* wsptr[0,4],[0,5],[0,6],[0,7] */ + movq_m2r (*(wsptr + 1), mm1); /* wsptr[0,4],[0,5],[0,6],[0,7] */ movq_r2r (mm0, mm2); - movq_m2r (*(wsptr + 2), mm3); /* wsptr[1,0],[1,1],[1,2],[1,3] */ - paddw_r2r (mm1, mm0); /* wsptr[0,tmp10],[xxx],[0,tmp13],[xxx] */ + movq_m2r (*(wsptr + 2), mm3); /* wsptr[1,0],[1,1],[1,2],[1,3] */ + paddw_r2r (mm1, mm0); /* wsptr[0,tmp10],[xxx],[0,tmp13],[xxx] */ - movq_m2r (*(wsptr + 3), mm4); /* wsptr[1,4],[1,5],[1,6],[1,7] */ - psubw_r2r (mm1, mm2); /* wsptr[0,tmp11],[xxx],[0,tmp14],[xxx] */ + movq_m2r (*(wsptr + 3), mm4); /* wsptr[1,4],[1,5],[1,6],[1,7] */ + psubw_r2r (mm1, mm2); /* wsptr[0,tmp11],[xxx],[0,tmp14],[xxx] */ movq_r2r (mm0, mm6); movq_r2r (mm3, mm5); - paddw_r2r (mm4, mm3); /* wsptr[1,tmp10],[xxx],[1,tmp13],[xxx] */ + paddw_r2r (mm4, mm3); /* wsptr[1,tmp10],[xxx],[1,tmp13],[xxx] */ movq_r2r (mm2, mm1); - psubw_r2r (mm4, mm5); /* wsptr[1,tmp11],[xxx],[1,tmp14],[xxx] */ - punpcklwd_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[xxx],[xxx] */ + psubw_r2r (mm4, mm5); /* wsptr[1,tmp11],[xxx],[1,tmp14],[xxx] */ + punpcklwd_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[xxx],[xxx] */ - movq_m2r (*(wsptr + 7), mm7); /* wsptr[3,4],[3,5],[3,6],[3,7] */ - punpckhwd_r2r (mm3, mm6); /* wsptr[0,tmp13],[1,tmp13],[xxx],[xxx] */ + movq_m2r (*(wsptr + 7), mm7); /* wsptr[3,4],[3,5],[3,6],[3,7] */ + punpckhwd_r2r (mm3, mm6); /* wsptr[0,tmp13],[1,tmp13],[xxx],[xxx] */ - movq_m2r (*(wsptr + 4), mm3); /* wsptr[2,0],[2,1],[2,2],[2,3] */ - punpckldq_r2r (mm6, mm0); /* wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] */ + movq_m2r (*(wsptr + 4), mm3); /* wsptr[2,0],[2,1],[2,2],[2,3] */ + punpckldq_r2r (mm6, mm0); /* wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] */ - punpcklwd_r2r (mm5, mm1); /* wsptr[0,tmp11],[1,tmp11],[xxx],[xxx] */ + punpcklwd_r2r (mm5, mm1); /* wsptr[0,tmp11],[1,tmp11],[xxx],[xxx] */ movq_r2r (mm3, mm4); - movq_m2r (*(wsptr + 6), mm6); /* wsptr[3,0],[3,1],[3,2],[3,3] */ - punpckhwd_r2r (mm5, mm2); /* wsptr[0,tmp14],[1,tmp14],[xxx],[xxx] */ + movq_m2r (*(wsptr + 6), mm6); /* wsptr[3,0],[3,1],[3,2],[3,3] */ + punpckhwd_r2r (mm5, mm2); /* wsptr[0,tmp14],[1,tmp14],[xxx],[xxx] */ - movq_m2r (*(wsptr + 5), mm5); /* wsptr[2,4],[2,5],[2,6],[2,7] */ - punpckldq_r2r (mm2, mm1); /* wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] */ + movq_m2r (*(wsptr + 5), mm5); /* wsptr[2,4],[2,5],[2,6],[2,7] */ + punpckldq_r2r (mm2, mm1); /* wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] */ - paddw_r2r (mm5, mm3); /* wsptr[2,tmp10],[xxx],[2,tmp13],[xxx] */ + paddw_r2r (mm5, mm3); /* wsptr[2,tmp10],[xxx],[2,tmp13],[xxx] */ movq_r2r (mm6, mm2); - psubw_r2r (mm5, mm4); /* wsptr[2,tmp11],[xxx],[2,tmp14],[xxx] */ - paddw_r2r (mm7, mm6); /* wsptr[3,tmp10],[xxx],[3,tmp13],[xxx] */ + psubw_r2r (mm5, mm4); /* wsptr[2,tmp11],[xxx],[2,tmp14],[xxx] */ + paddw_r2r (mm7, mm6); /* wsptr[3,tmp10],[xxx],[3,tmp13],[xxx] */ movq_r2r (mm3, mm5); - punpcklwd_r2r (mm6, mm3); /* wsptr[2,tmp10],[3,tmp10],[xxx],[xxx] */ + punpcklwd_r2r (mm6, mm3); /* wsptr[2,tmp10],[3,tmp10],[xxx],[xxx] */ - psubw_r2r (mm7, mm2); /* wsptr[3,tmp11],[xxx],[3,tmp14],[xxx] */ - punpckhwd_r2r (mm6, mm5); /* wsptr[2,tmp13],[3,tmp13],[xxx],[xxx] */ + psubw_r2r (mm7, mm2); /* wsptr[3,tmp11],[xxx],[3,tmp14],[xxx] */ + punpckhwd_r2r (mm6, mm5); /* wsptr[2,tmp13],[3,tmp13],[xxx],[xxx] */ movq_r2r (mm4, mm7); - punpckldq_r2r (mm5, mm3); /* wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13] */ + punpckldq_r2r (mm5, mm3); /* wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13] */ - punpcklwd_r2r (mm2, mm4); /* wsptr[2,tmp11],[3,tmp11],[xxx],[xxx] */ + punpcklwd_r2r (mm2, mm4); /* wsptr[2,tmp11],[3,tmp11],[xxx],[xxx] */ - punpckhwd_r2r (mm2, mm7); /* wsptr[2,tmp14],[3,tmp14],[xxx],[xxx] */ + punpckhwd_r2r (mm2, mm7); /* wsptr[2,tmp14],[3,tmp14],[xxx],[xxx] */ - punpckldq_r2r (mm7, mm4); /* wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14] */ + punpckldq_r2r (mm7, mm4); /* wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14] */ movq_r2r (mm1, mm6); /*ok */ @@ -1590,24 +1590,24 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) movq_r2r (mm0, mm2); - punpckhdq_r2r (mm4, mm6); /* wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14] */ + punpckhdq_r2r (mm4, mm6); /* wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14] */ - punpckldq_r2r (mm4, mm1); /* wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11] */ + punpckldq_r2r (mm4, mm1); /* wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11] */ psllw_i2r (2, mm6); pmulhw_m2r (fix_141, mm6); - punpckldq_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10] */ + punpckldq_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10] */ - punpckhdq_r2r (mm3, mm2); /* wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13] */ + punpckhdq_r2r (mm3, mm2); /* wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13] */ movq_r2r (mm0, mm7); /* tmp0 = tmp10 + tmp13; */ /* tmp3 = tmp10 - tmp13; */ - paddw_r2r (mm2, mm0); /* [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0] */ - psubw_r2r (mm2, mm7); /* [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3] */ + paddw_r2r (mm2, mm0); /* [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0] */ + psubw_r2r (mm2, mm7); /* [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3] */ /* tmp12 = MULTIPLY(tmp14, FIX_1_414213562) - tmp13; */ - psubw_r2r (mm2, mm6); /* wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12] */ + psubw_r2r (mm2, mm6); /* wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12] */ /* tmp1 = tmp11 + tmp12; */ /* tmp2 = tmp11 - tmp12; */ movq_r2r (mm1, mm5); @@ -1620,115 +1620,115 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3]; */ /* z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7]; */ /* z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7]; */ - movq_m2r (*(wsptr), mm3); /* wsptr[0,0],[0,1],[0,2],[0,3] */ - paddw_r2r (mm6, mm1); /* [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1] */ + movq_m2r (*(wsptr), mm3); /* wsptr[0,0],[0,1],[0,2],[0,3] */ + paddw_r2r (mm6, mm1); /* [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1] */ - movq_m2r (*(wsptr + 1), mm4); /* wsptr[0,4],[0,5],[0,6],[0,7] */ - psubw_r2r (mm6, mm5); /* [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2] */ + movq_m2r (*(wsptr + 1), mm4); /* wsptr[0,4],[0,5],[0,6],[0,7] */ + psubw_r2r (mm6, mm5); /* [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2] */ movq_r2r (mm3, mm6); - punpckldq_r2r (mm4, mm3); /* wsptr[0,0],[0,1],[0,4],[0,5] */ + punpckldq_r2r (mm4, mm3); /* wsptr[0,0],[0,1],[0,4],[0,5] */ - punpckhdq_r2r (mm6, mm4); /* wsptr[0,6],[0,7],[0,2],[0,3] */ + punpckhdq_r2r (mm6, mm4); /* wsptr[0,6],[0,7],[0,2],[0,3] */ movq_r2r (mm3, mm2); /*Save tmp0 and tmp1 in wsptr */ - movq_r2m (mm0, *(wsptr)); /* save tmp0 */ - paddw_r2r (mm4, mm2); /* wsptr[xxx],[0,z11],[xxx],[0,z13] */ + movq_r2m (mm0, *(wsptr)); /* save tmp0 */ + paddw_r2r (mm4, mm2); /* wsptr[xxx],[0,z11],[xxx],[0,z13] */ /*Continue with z10 --- z13 */ - movq_m2r (*(wsptr + 2), mm6); /* wsptr[1,0],[1,1],[1,2],[1,3] */ - psubw_r2r (mm4, mm3); /* wsptr[xxx],[0,z12],[xxx],[0,z10] */ + movq_m2r (*(wsptr + 2), mm6); /* wsptr[1,0],[1,1],[1,2],[1,3] */ + psubw_r2r (mm4, mm3); /* wsptr[xxx],[0,z12],[xxx],[0,z10] */ - movq_m2r (*(wsptr + 3), mm0); /* wsptr[1,4],[1,5],[1,6],[1,7] */ + movq_m2r (*(wsptr + 3), mm0); /* wsptr[1,4],[1,5],[1,6],[1,7] */ movq_r2r (mm6, mm4); - movq_r2m (mm1, *(wsptr + 1)); /* save tmp1 */ - punpckldq_r2r (mm0, mm6); /* wsptr[1,0],[1,1],[1,4],[1,5] */ + movq_r2m (mm1, *(wsptr + 1)); /* save tmp1 */ + punpckldq_r2r (mm0, mm6); /* wsptr[1,0],[1,1],[1,4],[1,5] */ - punpckhdq_r2r (mm4, mm0); /* wsptr[1,6],[1,7],[1,2],[1,3] */ + punpckhdq_r2r (mm4, mm0); /* wsptr[1,6],[1,7],[1,2],[1,3] */ movq_r2r (mm6, mm1); /*Save tmp2 and tmp3 in wsptr */ - paddw_r2r (mm0, mm6); /* wsptr[xxx],[1,z11],[xxx],[1,z13] */ + paddw_r2r (mm0, mm6); /* wsptr[xxx],[1,z11],[xxx],[1,z13] */ movq_r2r (mm2, mm4); /*Continue with z10 --- z13 */ - movq_r2m (mm5, *(wsptr + 2)); /* save tmp2 */ - punpcklwd_r2r (mm6, mm2); /* wsptr[xxx],[xxx],[0,z11],[1,z11] */ + movq_r2m (mm5, *(wsptr + 2)); /* save tmp2 */ + punpcklwd_r2r (mm6, mm2); /* wsptr[xxx],[xxx],[0,z11],[1,z11] */ - psubw_r2r (mm0, mm1); /* wsptr[xxx],[1,z12],[xxx],[1,z10] */ - punpckhwd_r2r (mm6, mm4); /* wsptr[xxx],[xxx],[0,z13],[1,z13] */ + psubw_r2r (mm0, mm1); /* wsptr[xxx],[1,z12],[xxx],[1,z10] */ + punpckhwd_r2r (mm6, mm4); /* wsptr[xxx],[xxx],[0,z13],[1,z13] */ movq_r2r (mm3, mm0); - punpcklwd_r2r (mm1, mm3); /* wsptr[xxx],[xxx],[0,z12],[1,z12] */ + punpcklwd_r2r (mm1, mm3); /* wsptr[xxx],[xxx],[0,z12],[1,z12] */ - movq_r2m (mm7, *(wsptr + 3)); /* save tmp3 */ - punpckhwd_r2r (mm1, mm0); /* wsptr[xxx],[xxx],[0,z10],[1,z10] */ + movq_r2m (mm7, *(wsptr + 3)); /* save tmp3 */ + punpckhwd_r2r (mm1, mm0); /* wsptr[xxx],[xxx],[0,z10],[1,z10] */ - movq_m2r (*(wsptr + 4), mm6); /* wsptr[2,0],[2,1],[2,2],[2,3] */ - punpckhdq_r2r (mm2, mm0); /* wsptr[0,z10],[1,z10],[0,z11],[1,z11] */ + movq_m2r (*(wsptr + 4), mm6); /* wsptr[2,0],[2,1],[2,2],[2,3] */ + punpckhdq_r2r (mm2, mm0); /* wsptr[0,z10],[1,z10],[0,z11],[1,z11] */ - movq_m2r (*(wsptr + 5), mm7); /* wsptr[2,4],[2,5],[2,6],[2,7] */ - punpckhdq_r2r (mm4, mm3); /* wsptr[0,z12],[1,z12],[0,z13],[1,z13] */ + movq_m2r (*(wsptr + 5), mm7); /* wsptr[2,4],[2,5],[2,6],[2,7] */ + punpckhdq_r2r (mm4, mm3); /* wsptr[0,z12],[1,z12],[0,z13],[1,z13] */ - movq_m2r (*(wsptr + 6), mm1); /* wsptr[3,0],[3,1],[3,2],[3,3] */ + movq_m2r (*(wsptr + 6), mm1); /* wsptr[3,0],[3,1],[3,2],[3,3] */ movq_r2r (mm6, mm4); - punpckldq_r2r (mm7, mm6); /* wsptr[2,0],[2,1],[2,4],[2,5] */ + punpckldq_r2r (mm7, mm6); /* wsptr[2,0],[2,1],[2,4],[2,5] */ movq_r2r (mm1, mm5); - punpckhdq_r2r (mm4, mm7); /* wsptr[2,6],[2,7],[2,2],[2,3] */ + punpckhdq_r2r (mm4, mm7); /* wsptr[2,6],[2,7],[2,2],[2,3] */ movq_r2r (mm6, mm2); - movq_m2r (*(wsptr + 7), mm4); /* wsptr[3,4],[3,5],[3,6],[3,7] */ - paddw_r2r (mm7, mm6); /* wsptr[xxx],[2,z11],[xxx],[2,z13] */ + movq_m2r (*(wsptr + 7), mm4); /* wsptr[3,4],[3,5],[3,6],[3,7] */ + paddw_r2r (mm7, mm6); /* wsptr[xxx],[2,z11],[xxx],[2,z13] */ - psubw_r2r (mm7, mm2); /* wsptr[xxx],[2,z12],[xxx],[2,z10] */ - punpckldq_r2r (mm4, mm1); /* wsptr[3,0],[3,1],[3,4],[3,5] */ + psubw_r2r (mm7, mm2); /* wsptr[xxx],[2,z12],[xxx],[2,z10] */ + punpckldq_r2r (mm4, mm1); /* wsptr[3,0],[3,1],[3,4],[3,5] */ - punpckhdq_r2r (mm5, mm4); /* wsptr[3,6],[3,7],[3,2],[3,3] */ + punpckhdq_r2r (mm5, mm4); /* wsptr[3,6],[3,7],[3,2],[3,3] */ movq_r2r (mm1, mm7); - paddw_r2r (mm4, mm1); /* wsptr[xxx],[3,z11],[xxx],[3,z13] */ - psubw_r2r (mm4, mm7); /* wsptr[xxx],[3,z12],[xxx],[3,z10] */ + paddw_r2r (mm4, mm1); /* wsptr[xxx],[3,z11],[xxx],[3,z13] */ + psubw_r2r (mm4, mm7); /* wsptr[xxx],[3,z12],[xxx],[3,z10] */ movq_r2r (mm6, mm5); - punpcklwd_r2r (mm1, mm6); /* wsptr[xxx],[xxx],[2,z11],[3,z11] */ + punpcklwd_r2r (mm1, mm6); /* wsptr[xxx],[xxx],[2,z11],[3,z11] */ - punpckhwd_r2r (mm1, mm5); /* wsptr[xxx],[xxx],[2,z13],[3,z13] */ + punpckhwd_r2r (mm1, mm5); /* wsptr[xxx],[xxx],[2,z13],[3,z13] */ movq_r2r (mm2, mm4); - punpcklwd_r2r (mm7, mm2); /* wsptr[xxx],[xxx],[2,z12],[3,z12] */ + punpcklwd_r2r (mm7, mm2); /* wsptr[xxx],[xxx],[2,z12],[3,z12] */ - punpckhwd_r2r (mm7, mm4); /* wsptr[xxx],[xxx],[2,z10],[3,z10] */ + punpckhwd_r2r (mm7, mm4); /* wsptr[xxx],[xxx],[2,z10],[3,z10] */ - punpckhdq_r2r (mm6, mm4); /*/ wsptr[2,z10],[3,z10],[2,z11],[3,z11] */ + punpckhdq_r2r (mm6, mm4); /*/ wsptr[2,z10],[3,z10],[2,z11],[3,z11] */ - punpckhdq_r2r (mm5, mm2); /* wsptr[2,z12],[3,z12],[2,z13],[3,z13] */ + punpckhdq_r2r (mm5, mm2); /* wsptr[2,z12],[3,z12],[2,z13],[3,z13] */ movq_r2r (mm0, mm5); - punpckldq_r2r (mm4, mm0); /* wsptr[0,z10],[1,z10],[2,z10],[3,z10] */ + punpckldq_r2r (mm4, mm0); /* wsptr[0,z10],[1,z10],[2,z10],[3,z10] */ - punpckhdq_r2r (mm4, mm5); /* wsptr[0,z11],[1,z11],[2,z11],[3,z11] */ + punpckhdq_r2r (mm4, mm5); /* wsptr[0,z11],[1,z11],[2,z11],[3,z11] */ movq_r2r (mm3, mm4); - punpckhdq_r2r (mm2, mm4); /* wsptr[0,z13],[1,z13],[2,z13],[3,z13] */ + punpckhdq_r2r (mm2, mm4); /* wsptr[0,z13],[1,z13],[2,z13],[3,z13] */ movq_r2r (mm5, mm1); - punpckldq_r2r (mm2, mm3); /* wsptr[0,z12],[1,z12],[2,z12],[3,z12] */ + punpckldq_r2r (mm2, mm3); /* wsptr[0,z12],[1,z12],[2,z12],[3,z12] */ /* tmp7 = z11 + z13; : phase 5 */ /* tmp8 = z11 - z13; : phase 5 */ - psubw_r2r (mm4, mm1); /* tmp8 */ + psubw_r2r (mm4, mm1); /* tmp8 */ - paddw_r2r (mm4, mm5); /* tmp7 */ + paddw_r2r (mm4, mm5); /* tmp7 */ /* tmp21 = MULTIPLY(tmp8, FIX_1_414213562); 2*c4 */ psllw_i2r (2, mm1); psllw_i2r (2, mm0); - pmulhw_m2r (fix_141, mm1); /* tmp21 */ + pmulhw_m2r (fix_141, mm1); /* tmp21 */ /* tmp20 = MULTIPLY(z12, (FIX_1_082392200- FIX_1_847759065)) 2*(c2-c6) */ /* + MULTIPLY(z10, - FIX_1_847759065); : 2*c2 */ psllw_i2r (2, mm3); @@ -1737,36 +1737,36 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) pmulhw_m2r (fix_n184, mm7); movq_r2r (mm3, mm6); - movq_m2r (*(wsptr), mm2); /* tmp0,final1 */ + movq_m2r (*(wsptr), mm2); /* tmp0,final1 */ pmulhw_m2r (fix_108n184, mm6); /* tmp22 = MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) : -2*(c2+c6) */ /* + MULTIPLY(z12, FIX_1_847759065); 2*c2 */ - movq_r2r (mm2, mm4); /* final1 */ + movq_r2r (mm2, mm4); /* final1 */ pmulhw_m2r (fix_184n261, mm0); - paddw_r2r (mm5, mm2); /* tmp0+tmp7,final1 */ + paddw_r2r (mm5, mm2); /* tmp0+tmp7,final1 */ pmulhw_m2r (fix_184, mm3); - psubw_r2r (mm5, mm4); /* tmp0-tmp7,final1 */ + psubw_r2r (mm5, mm4); /* tmp0-tmp7,final1 */ /* tmp6 = tmp22 - tmp7; phase 2 */ - psraw_i2r (3, mm2); /* outptr[0,0],[1,0],[2,0],[3,0],final1 */ + psraw_i2r (3, mm2); /* outptr[0,0],[1,0],[2,0],[3,0],final1 */ - paddw_r2r (mm6, mm7); /* tmp20 */ - psraw_i2r (3, mm4); /* outptr[0,7],[1,7],[2,7],[3,7],final1 */ + paddw_r2r (mm6, mm7); /* tmp20 */ + psraw_i2r (3, mm4); /* outptr[0,7],[1,7],[2,7],[3,7],final1 */ - paddw_r2r (mm0, mm3); /* tmp22 */ + paddw_r2r (mm0, mm3); /* tmp22 */ /* tmp5 = tmp21 - tmp6; */ - psubw_r2r (mm5, mm3); /* tmp6 */ + psubw_r2r (mm5, mm3); /* tmp6 */ /* tmp4 = tmp20 + tmp5; */ - movq_m2r (*(wsptr + 1), mm0); /* tmp1,final2 */ - psubw_r2r (mm3, mm1); /* tmp5 */ + movq_m2r (*(wsptr + 1), mm0); /* tmp1,final2 */ + psubw_r2r (mm3, mm1); /* tmp5 */ - movq_r2r (mm0, mm6); /* final2 */ - paddw_r2r (mm3, mm0); /* tmp1+tmp6,final2 */ + movq_r2r (mm0, mm6); /* final2 */ + paddw_r2r (mm3, mm0); /* tmp1+tmp6,final2 */ /* Final output stage: scale down by a factor of 8 and range-limit */ @@ -1781,30 +1781,30 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* & RANGE_MASK]; */ /* outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) */ /* & RANGE_MASK]; final2 */ - psubw_r2r (mm3, mm6); /* tmp1-tmp6,final2 */ - psraw_i2r (3, mm0); /* outptr[0,1],[1,1],[2,1],[3,1] */ + psubw_r2r (mm3, mm6); /* tmp1-tmp6,final2 */ + psraw_i2r (3, mm0); /* outptr[0,1],[1,1],[2,1],[3,1] */ - psraw_i2r (3, mm6); /* outptr[0,6],[1,6],[2,6],[3,6] */ + psraw_i2r (3, mm6); /* outptr[0,6],[1,6],[2,6],[3,6] */ - packuswb_r2r (mm4, mm0); /* out[0,1],[1,1],[2,1],[3,1],[0,7],[1,7],[2,7],[3,7] */ + packuswb_r2r (mm4, mm0); /* out[0,1],[1,1],[2,1],[3,1],[0,7],[1,7],[2,7],[3,7] */ - movq_m2r (*(wsptr + 2), mm5); /* tmp2,final3 */ - packuswb_r2r (mm6, mm2); /* out[0,0],[1,0],[2,0],[3,0],[0,6],[1,6],[2,6],[3,6] */ + movq_m2r (*(wsptr + 2), mm5); /* tmp2,final3 */ + packuswb_r2r (mm6, mm2); /* out[0,0],[1,0],[2,0],[3,0],[0,6],[1,6],[2,6],[3,6] */ /* outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) */ /* & RANGE_MASK]; */ /* outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) */ /* & RANGE_MASK]; final3 */ - paddw_r2r (mm1, mm7); /* tmp4 */ + paddw_r2r (mm1, mm7); /* tmp4 */ movq_r2r (mm5, mm3); - paddw_r2r (mm1, mm5); /* tmp2+tmp5 */ - psubw_r2r (mm1, mm3); /* tmp2-tmp5 */ + paddw_r2r (mm1, mm5); /* tmp2+tmp5 */ + psubw_r2r (mm1, mm3); /* tmp2-tmp5 */ - psraw_i2r (3, mm5); /* outptr[0,2],[1,2],[2,2],[3,2] */ + psraw_i2r (3, mm5); /* outptr[0,2],[1,2],[2,2],[3,2] */ - movq_m2r (*(wsptr + 3), mm4); /* tmp3,final4 */ - psraw_i2r (3, mm3); /* outptr[0,5],[1,5],[2,5],[3,5] */ + movq_m2r (*(wsptr + 3), mm4); /* tmp3,final4 */ + psraw_i2r (3, mm3); /* outptr[0,5],[1,5],[2,5],[3,5] */ @@ -1813,45 +1813,45 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) */ /* & RANGE_MASK]; final4 */ movq_r2r (mm4, mm6); - paddw_r2r (mm7, mm4); /* tmp3+tmp4 */ + paddw_r2r (mm7, mm4); /* tmp3+tmp4 */ - psubw_r2r (mm7, mm6); /* tmp3-tmp4 */ - psraw_i2r (3, mm4); /* outptr[0,4],[1,4],[2,4],[3,4] */ + psubw_r2r (mm7, mm6); /* tmp3-tmp4 */ + psraw_i2r (3, mm4); /* outptr[0,4],[1,4],[2,4],[3,4] */ /* mov ecx, [dataptr] */ - psraw_i2r (3, mm6); /* outptr[0,3],[1,3],[2,3],[3,3] */ + psraw_i2r (3, mm6); /* outptr[0,3],[1,3],[2,3],[3,3] */ - packuswb_r2r (mm4, mm5); /* out[0,2],[1,2],[2,2],[3,2],[0,4],[1,4],[2,4],[3,4] */ + packuswb_r2r (mm4, mm5); /* out[0,2],[1,2],[2,2],[3,2],[0,4],[1,4],[2,4],[3,4] */ - packuswb_r2r (mm3, mm6); /* out[0,3],[1,3],[2,3],[3,3],[0,5],[1,5],[2,5],[3,5] */ + packuswb_r2r (mm3, mm6); /* out[0,3],[1,3],[2,3],[3,3],[0,5],[1,5],[2,5],[3,5] */ movq_r2r (mm2, mm4); movq_r2r (mm5, mm7); - punpcklbw_r2r (mm0, mm2); /* out[0,0],[0,1],[1,0],[1,1],[2,0],[2,1],[3,0],[3,1] */ + punpcklbw_r2r (mm0, mm2); /* out[0,0],[0,1],[1,0],[1,1],[2,0],[2,1],[3,0],[3,1] */ - punpckhbw_r2r (mm0, mm4); /* out[0,6],[0,7],[1,6],[1,7],[2,6],[2,7],[3,6],[3,7] */ + punpckhbw_r2r (mm0, mm4); /* out[0,6],[0,7],[1,6],[1,7],[2,6],[2,7],[3,6],[3,7] */ movq_r2r (mm2, mm1); - punpcklbw_r2r (mm6, mm5); /* out[0,2],[0,3],[1,2],[1,3],[2,2],[2,3],[3,2],[3,3] */ + punpcklbw_r2r (mm6, mm5); /* out[0,2],[0,3],[1,2],[1,3],[2,2],[2,3],[3,2],[3,3] */ /* add dataptr, 4 */ - punpckhbw_r2r (mm6, mm7); /* out[0,4],[0,5],[1,4],[1,5],[2,4],[2,5],[3,4],[3,5] */ + punpckhbw_r2r (mm6, mm7); /* out[0,4],[0,5],[1,4],[1,5],[2,4],[2,5],[3,4],[3,5] */ - punpcklwd_r2r (mm5, mm2); /* out[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3] */ + punpcklwd_r2r (mm5, mm2); /* out[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3] */ /* add ecx, output_col */ movq_r2r (mm7, mm6); - punpckhwd_r2r (mm5, mm1); /* out[2,0],[2,1],[2,2],[2,3],[3,0],[3,1],[3,2],[3,3] */ + punpckhwd_r2r (mm5, mm1); /* out[2,0],[2,1],[2,2],[2,3],[3,0],[3,1],[3,2],[3,3] */ movq_r2r (mm2, mm0); - punpcklwd_r2r (mm4, mm6); /* out[0,4],[0,5],[0,6],[0,7],[1,4],[1,5],[1,6],[1,7] */ + punpcklwd_r2r (mm4, mm6); /* out[0,4],[0,5],[0,6],[0,7],[1,4],[1,5],[1,6],[1,7] */ /* mov idata, [dataptr] */ - punpckldq_r2r (mm6, mm2); /* out[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7] */ + punpckldq_r2r (mm6, mm2); /* out[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7] */ /* add dataptr, 4 */ @@ -1859,17 +1859,17 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* add idata, output_col */ - punpckhwd_r2r (mm4, mm7); /* out[2,4],[2,5],[2,6],[2,7],[3,4],[3,5],[3,6],[3,7] */ + punpckhwd_r2r (mm4, mm7); /* out[2,4],[2,5],[2,6],[2,7],[3,4],[3,5],[3,6],[3,7] */ movq_r2m (mm2, *(dataptr)); - punpckhdq_r2r (mm6, mm0); /* out[1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7] */ + punpckhdq_r2r (mm6, mm0); /* out[1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7] */ dataptr += rskip; movq_r2m (mm0, *(dataptr)); - punpckldq_r2r (mm7, mm1); /* out[2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7] */ - punpckhdq_r2r (mm7, mm3); /* out[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7] */ + punpckldq_r2r (mm7, mm1); /* out[2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7] */ + punpckhdq_r2r (mm7, mm3); /* out[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7] */ dataptr += rskip; movq_r2m (mm1, *(dataptr)); @@ -1887,61 +1887,61 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); */ /* tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); */ /* tmp14 = ((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6]); */ - movq_m2r (*(wsptr), mm0); /* wsptr[0,0],[0,1],[0,2],[0,3] */ + movq_m2r (*(wsptr), mm0); /* wsptr[0,0],[0,1],[0,2],[0,3] */ - movq_m2r (*(wsptr + 1), mm1); /* wsptr[0,4],[0,5],[0,6],[0,7] */ + movq_m2r (*(wsptr + 1), mm1); /* wsptr[0,4],[0,5],[0,6],[0,7] */ movq_r2r (mm0, mm2); - movq_m2r (*(wsptr + 2), mm3); /* wsptr[1,0],[1,1],[1,2],[1,3] */ - paddw_r2r (mm1, mm0); /* wsptr[0,tmp10],[xxx],[0,tmp13],[xxx] */ + movq_m2r (*(wsptr + 2), mm3); /* wsptr[1,0],[1,1],[1,2],[1,3] */ + paddw_r2r (mm1, mm0); /* wsptr[0,tmp10],[xxx],[0,tmp13],[xxx] */ - movq_m2r (*(wsptr + 3), mm4); /* wsptr[1,4],[1,5],[1,6],[1,7] */ - psubw_r2r (mm1, mm2); /* wsptr[0,tmp11],[xxx],[0,tmp14],[xxx] */ + movq_m2r (*(wsptr + 3), mm4); /* wsptr[1,4],[1,5],[1,6],[1,7] */ + psubw_r2r (mm1, mm2); /* wsptr[0,tmp11],[xxx],[0,tmp14],[xxx] */ movq_r2r (mm0, mm6); movq_r2r (mm3, mm5); - paddw_r2r (mm4, mm3); /* wsptr[1,tmp10],[xxx],[1,tmp13],[xxx] */ + paddw_r2r (mm4, mm3); /* wsptr[1,tmp10],[xxx],[1,tmp13],[xxx] */ movq_r2r (mm2, mm1); - psubw_r2r (mm4, mm5); /* wsptr[1,tmp11],[xxx],[1,tmp14],[xxx] */ - punpcklwd_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[xxx],[xxx] */ + psubw_r2r (mm4, mm5); /* wsptr[1,tmp11],[xxx],[1,tmp14],[xxx] */ + punpcklwd_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[xxx],[xxx] */ - movq_m2r (*(wsptr + 7), mm7); /* wsptr[3,4],[3,5],[3,6],[3,7] */ - punpckhwd_r2r (mm3, mm6); /* wsptr[0,tmp13],[1,tmp13],[xxx],[xxx] */ + movq_m2r (*(wsptr + 7), mm7); /* wsptr[3,4],[3,5],[3,6],[3,7] */ + punpckhwd_r2r (mm3, mm6); /* wsptr[0,tmp13],[1,tmp13],[xxx],[xxx] */ - movq_m2r (*(wsptr + 4), mm3); /* wsptr[2,0],[2,1],[2,2],[2,3] */ - punpckldq_r2r (mm6, mm0); /* wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] */ + movq_m2r (*(wsptr + 4), mm3); /* wsptr[2,0],[2,1],[2,2],[2,3] */ + punpckldq_r2r (mm6, mm0); /* wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] */ - punpcklwd_r2r (mm5, mm1); /* wsptr[0,tmp11],[1,tmp11],[xxx],[xxx] */ + punpcklwd_r2r (mm5, mm1); /* wsptr[0,tmp11],[1,tmp11],[xxx],[xxx] */ movq_r2r (mm3, mm4); - movq_m2r (*(wsptr + 6), mm6); /* wsptr[3,0],[3,1],[3,2],[3,3] */ - punpckhwd_r2r (mm5, mm2); /* wsptr[0,tmp14],[1,tmp14],[xxx],[xxx] */ + movq_m2r (*(wsptr + 6), mm6); /* wsptr[3,0],[3,1],[3,2],[3,3] */ + punpckhwd_r2r (mm5, mm2); /* wsptr[0,tmp14],[1,tmp14],[xxx],[xxx] */ - movq_m2r (*(wsptr + 5), mm5); /* wsptr[2,4],[2,5],[2,6],[2,7] */ - punpckldq_r2r (mm2, mm1); /* wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] */ + movq_m2r (*(wsptr + 5), mm5); /* wsptr[2,4],[2,5],[2,6],[2,7] */ + punpckldq_r2r (mm2, mm1); /* wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] */ - paddw_r2r (mm5, mm3); /* wsptr[2,tmp10],[xxx],[2,tmp13],[xxx] */ + paddw_r2r (mm5, mm3); /* wsptr[2,tmp10],[xxx],[2,tmp13],[xxx] */ movq_r2r (mm6, mm2); - psubw_r2r (mm5, mm4); /* wsptr[2,tmp11],[xxx],[2,tmp14],[xxx] */ - paddw_r2r (mm7, mm6); /* wsptr[3,tmp10],[xxx],[3,tmp13],[xxx] */ + psubw_r2r (mm5, mm4); /* wsptr[2,tmp11],[xxx],[2,tmp14],[xxx] */ + paddw_r2r (mm7, mm6); /* wsptr[3,tmp10],[xxx],[3,tmp13],[xxx] */ movq_r2r (mm3, mm5); - punpcklwd_r2r (mm6, mm3); /* wsptr[2,tmp10],[3,tmp10],[xxx],[xxx] */ + punpcklwd_r2r (mm6, mm3); /* wsptr[2,tmp10],[3,tmp10],[xxx],[xxx] */ - psubw_r2r (mm7, mm2); /* wsptr[3,tmp11],[xxx],[3,tmp14],[xxx] */ - punpckhwd_r2r (mm6, mm5); /* wsptr[2,tmp13],[3,tmp13],[xxx],[xxx] */ + psubw_r2r (mm7, mm2); /* wsptr[3,tmp11],[xxx],[3,tmp14],[xxx] */ + punpckhwd_r2r (mm6, mm5); /* wsptr[2,tmp13],[3,tmp13],[xxx],[xxx] */ movq_r2r (mm4, mm7); - punpckldq_r2r (mm5, mm3); /* wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13] */ + punpckldq_r2r (mm5, mm3); /* wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13] */ - punpcklwd_r2r (mm2, mm4); /* wsptr[2,tmp11],[3,tmp11],[xxx],[xxx] */ + punpcklwd_r2r (mm2, mm4); /* wsptr[2,tmp11],[3,tmp11],[xxx],[xxx] */ - punpckhwd_r2r (mm2, mm7); /* wsptr[2,tmp14],[3,tmp14],[xxx],[xxx] */ + punpckhwd_r2r (mm2, mm7); /* wsptr[2,tmp14],[3,tmp14],[xxx],[xxx] */ - punpckldq_r2r (mm7, mm4); /* wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14] */ + punpckldq_r2r (mm7, mm4); /* wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14] */ movq_r2r (mm1, mm6); /*OK */ @@ -1950,24 +1950,24 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* mm1 = ;wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] */ movq_r2r (mm0, mm2); - punpckhdq_r2r (mm4, mm6); /* wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14] */ + punpckhdq_r2r (mm4, mm6); /* wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14] */ - punpckldq_r2r (mm4, mm1); /* wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11] */ + punpckldq_r2r (mm4, mm1); /* wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11] */ psllw_i2r (2, mm6); pmulhw_m2r (fix_141, mm6); - punpckldq_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10] */ + punpckldq_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10] */ - punpckhdq_r2r (mm3, mm2); /* wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13] */ + punpckhdq_r2r (mm3, mm2); /* wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13] */ movq_r2r (mm0, mm7); /* tmp0 = tmp10 + tmp13; */ /* tmp3 = tmp10 - tmp13; */ - paddw_r2r (mm2, mm0); /* [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0] */ - psubw_r2r (mm2, mm7); /* [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3] */ + paddw_r2r (mm2, mm0); /* [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0] */ + psubw_r2r (mm2, mm7); /* [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3] */ /* tmp12 = MULTIPLY(tmp14, FIX_1_414213562) - tmp13; */ - psubw_r2r (mm2, mm6); /* wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12] */ + psubw_r2r (mm2, mm6); /* wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12] */ /* tmp1 = tmp11 + tmp12; */ /* tmp2 = tmp11 - tmp12; */ movq_r2r (mm1, mm5); @@ -1981,115 +1981,115 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3]; */ /* z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7]; */ /* z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7]; */ - movq_m2r (*(wsptr), mm3); /* wsptr[0,0],[0,1],[0,2],[0,3] */ - paddw_r2r (mm6, mm1); /* [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1] */ + movq_m2r (*(wsptr), mm3); /* wsptr[0,0],[0,1],[0,2],[0,3] */ + paddw_r2r (mm6, mm1); /* [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1] */ - movq_m2r (*(wsptr + 1), mm4); /* wsptr[0,4],[0,5],[0,6],[0,7] */ - psubw_r2r (mm6, mm5); /* [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2] */ + movq_m2r (*(wsptr + 1), mm4); /* wsptr[0,4],[0,5],[0,6],[0,7] */ + psubw_r2r (mm6, mm5); /* [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2] */ movq_r2r (mm3, mm6); - punpckldq_r2r (mm4, mm3); /* wsptr[0,0],[0,1],[0,4],[0,5] */ + punpckldq_r2r (mm4, mm3); /* wsptr[0,0],[0,1],[0,4],[0,5] */ - punpckhdq_r2r (mm6, mm4); /* wsptr[0,6],[0,7],[0,2],[0,3] */ + punpckhdq_r2r (mm6, mm4); /* wsptr[0,6],[0,7],[0,2],[0,3] */ movq_r2r (mm3, mm2); /*Save tmp0 and tmp1 in wsptr */ - movq_r2m (mm0, *(wsptr)); /* save tmp0 */ - paddw_r2r (mm4, mm2); /* wsptr[xxx],[0,z11],[xxx],[0,z13] */ + movq_r2m (mm0, *(wsptr)); /* save tmp0 */ + paddw_r2r (mm4, mm2); /* wsptr[xxx],[0,z11],[xxx],[0,z13] */ /*Continue with z10 --- z13 */ - movq_m2r (*(wsptr + 2), mm6); /* wsptr[1,0],[1,1],[1,2],[1,3] */ - psubw_r2r (mm4, mm3); /* wsptr[xxx],[0,z12],[xxx],[0,z10] */ + movq_m2r (*(wsptr + 2), mm6); /* wsptr[1,0],[1,1],[1,2],[1,3] */ + psubw_r2r (mm4, mm3); /* wsptr[xxx],[0,z12],[xxx],[0,z10] */ - movq_m2r (*(wsptr + 3), mm0); /* wsptr[1,4],[1,5],[1,6],[1,7] */ + movq_m2r (*(wsptr + 3), mm0); /* wsptr[1,4],[1,5],[1,6],[1,7] */ movq_r2r (mm6, mm4); - movq_r2m (mm1, *(wsptr + 1)); /* save tmp1 */ - punpckldq_r2r (mm0, mm6); /* wsptr[1,0],[1,1],[1,4],[1,5] */ + movq_r2m (mm1, *(wsptr + 1)); /* save tmp1 */ + punpckldq_r2r (mm0, mm6); /* wsptr[1,0],[1,1],[1,4],[1,5] */ - punpckhdq_r2r (mm4, mm0); /* wsptr[1,6],[1,7],[1,2],[1,3] */ + punpckhdq_r2r (mm4, mm0); /* wsptr[1,6],[1,7],[1,2],[1,3] */ movq_r2r (mm6, mm1); /*Save tmp2 and tmp3 in wsptr */ - paddw_r2r (mm0, mm6); /* wsptr[xxx],[1,z11],[xxx],[1,z13] */ + paddw_r2r (mm0, mm6); /* wsptr[xxx],[1,z11],[xxx],[1,z13] */ movq_r2r (mm2, mm4); /*Continue with z10 --- z13 */ - movq_r2m (mm5, *(wsptr + 2)); /* save tmp2 */ - punpcklwd_r2r (mm6, mm2); /* wsptr[xxx],[xxx],[0,z11],[1,z11] */ + movq_r2m (mm5, *(wsptr + 2)); /* save tmp2 */ + punpcklwd_r2r (mm6, mm2); /* wsptr[xxx],[xxx],[0,z11],[1,z11] */ - psubw_r2r (mm0, mm1); /* wsptr[xxx],[1,z12],[xxx],[1,z10] */ - punpckhwd_r2r (mm6, mm4); /* wsptr[xxx],[xxx],[0,z13],[1,z13] */ + psubw_r2r (mm0, mm1); /* wsptr[xxx],[1,z12],[xxx],[1,z10] */ + punpckhwd_r2r (mm6, mm4); /* wsptr[xxx],[xxx],[0,z13],[1,z13] */ movq_r2r (mm3, mm0); - punpcklwd_r2r (mm1, mm3); /* wsptr[xxx],[xxx],[0,z12],[1,z12] */ + punpcklwd_r2r (mm1, mm3); /* wsptr[xxx],[xxx],[0,z12],[1,z12] */ - movq_r2m (mm7, *(wsptr + 3)); /* save tmp3 */ - punpckhwd_r2r (mm1, mm0); /* wsptr[xxx],[xxx],[0,z10],[1,z10] */ + movq_r2m (mm7, *(wsptr + 3)); /* save tmp3 */ + punpckhwd_r2r (mm1, mm0); /* wsptr[xxx],[xxx],[0,z10],[1,z10] */ - movq_m2r (*(wsptr + 4), mm6); /* wsptr[2,0],[2,1],[2,2],[2,3] */ - punpckhdq_r2r (mm2, mm0); /* wsptr[0,z10],[1,z10],[0,z11],[1,z11] */ + movq_m2r (*(wsptr + 4), mm6); /* wsptr[2,0],[2,1],[2,2],[2,3] */ + punpckhdq_r2r (mm2, mm0); /* wsptr[0,z10],[1,z10],[0,z11],[1,z11] */ - movq_m2r (*(wsptr + 5), mm7); /* wsptr[2,4],[2,5],[2,6],[2,7] */ - punpckhdq_r2r (mm4, mm3); /* wsptr[0,z12],[1,z12],[0,z13],[1,z13] */ + movq_m2r (*(wsptr + 5), mm7); /* wsptr[2,4],[2,5],[2,6],[2,7] */ + punpckhdq_r2r (mm4, mm3); /* wsptr[0,z12],[1,z12],[0,z13],[1,z13] */ - movq_m2r (*(wsptr + 6), mm1); /* wsptr[3,0],[3,1],[3,2],[3,3] */ + movq_m2r (*(wsptr + 6), mm1); /* wsptr[3,0],[3,1],[3,2],[3,3] */ movq_r2r (mm6, mm4); - punpckldq_r2r (mm7, mm6); /* wsptr[2,0],[2,1],[2,4],[2,5] */ + punpckldq_r2r (mm7, mm6); /* wsptr[2,0],[2,1],[2,4],[2,5] */ movq_r2r (mm1, mm5); - punpckhdq_r2r (mm4, mm7); /* wsptr[2,6],[2,7],[2,2],[2,3] */ + punpckhdq_r2r (mm4, mm7); /* wsptr[2,6],[2,7],[2,2],[2,3] */ movq_r2r (mm6, mm2); - movq_m2r (*(wsptr + 7), mm4); /* wsptr[3,4],[3,5],[3,6],[3,7] */ - paddw_r2r (mm7, mm6); /* wsptr[xxx],[2,z11],[xxx],[2,z13] */ + movq_m2r (*(wsptr + 7), mm4); /* wsptr[3,4],[3,5],[3,6],[3,7] */ + paddw_r2r (mm7, mm6); /* wsptr[xxx],[2,z11],[xxx],[2,z13] */ - psubw_r2r (mm7, mm2); /* wsptr[xxx],[2,z12],[xxx],[2,z10] */ - punpckldq_r2r (mm4, mm1); /* wsptr[3,0],[3,1],[3,4],[3,5] */ + psubw_r2r (mm7, mm2); /* wsptr[xxx],[2,z12],[xxx],[2,z10] */ + punpckldq_r2r (mm4, mm1); /* wsptr[3,0],[3,1],[3,4],[3,5] */ - punpckhdq_r2r (mm5, mm4); /* wsptr[3,6],[3,7],[3,2],[3,3] */ + punpckhdq_r2r (mm5, mm4); /* wsptr[3,6],[3,7],[3,2],[3,3] */ movq_r2r (mm1, mm7); - paddw_r2r (mm4, mm1); /* wsptr[xxx],[3,z11],[xxx],[3,z13] */ - psubw_r2r (mm4, mm7); /* wsptr[xxx],[3,z12],[xxx],[3,z10] */ + paddw_r2r (mm4, mm1); /* wsptr[xxx],[3,z11],[xxx],[3,z13] */ + psubw_r2r (mm4, mm7); /* wsptr[xxx],[3,z12],[xxx],[3,z10] */ movq_r2r (mm6, mm5); - punpcklwd_r2r (mm1, mm6); /* wsptr[xxx],[xxx],[2,z11],[3,z11] */ + punpcklwd_r2r (mm1, mm6); /* wsptr[xxx],[xxx],[2,z11],[3,z11] */ - punpckhwd_r2r (mm1, mm5); /* wsptr[xxx],[xxx],[2,z13],[3,z13] */ + punpckhwd_r2r (mm1, mm5); /* wsptr[xxx],[xxx],[2,z13],[3,z13] */ movq_r2r (mm2, mm4); - punpcklwd_r2r (mm7, mm2); /* wsptr[xxx],[xxx],[2,z12],[3,z12] */ + punpcklwd_r2r (mm7, mm2); /* wsptr[xxx],[xxx],[2,z12],[3,z12] */ - punpckhwd_r2r (mm7, mm4); /* wsptr[xxx],[xxx],[2,z10],[3,z10] */ + punpckhwd_r2r (mm7, mm4); /* wsptr[xxx],[xxx],[2,z10],[3,z10] */ - punpckhdq_r2r (mm6, mm4); /* wsptr[2,z10],[3,z10],[2,z11],[3,z11] */ + punpckhdq_r2r (mm6, mm4); /* wsptr[2,z10],[3,z10],[2,z11],[3,z11] */ - punpckhdq_r2r (mm5, mm2); /* wsptr[2,z12],[3,z12],[2,z13],[3,z13] */ + punpckhdq_r2r (mm5, mm2); /* wsptr[2,z12],[3,z12],[2,z13],[3,z13] */ movq_r2r (mm0, mm5); - punpckldq_r2r (mm4, mm0); /* wsptr[0,z10],[1,z10],[2,z10],[3,z10] */ + punpckldq_r2r (mm4, mm0); /* wsptr[0,z10],[1,z10],[2,z10],[3,z10] */ - punpckhdq_r2r (mm4, mm5); /* wsptr[0,z11],[1,z11],[2,z11],[3,z11] */ + punpckhdq_r2r (mm4, mm5); /* wsptr[0,z11],[1,z11],[2,z11],[3,z11] */ movq_r2r (mm3, mm4); - punpckhdq_r2r (mm2, mm4); /* wsptr[0,z13],[1,z13],[2,z13],[3,z13] */ + punpckhdq_r2r (mm2, mm4); /* wsptr[0,z13],[1,z13],[2,z13],[3,z13] */ movq_r2r (mm5, mm1); - punpckldq_r2r (mm2, mm3); /* wsptr[0,z12],[1,z12],[2,z12],[3,z12] */ + punpckldq_r2r (mm2, mm3); /* wsptr[0,z12],[1,z12],[2,z12],[3,z12] */ /* tmp7 = z11 + z13; : phase 5 */ /* tmp8 = z11 - z13; : phase 5 */ - psubw_r2r (mm4, mm1); /* tmp8 */ + psubw_r2r (mm4, mm1); /* tmp8 */ - paddw_r2r (mm4, mm5); /* tmp7 */ + paddw_r2r (mm4, mm5); /* tmp7 */ /* tmp21 = MULTIPLY(tmp8, FIX_1_414213562); 2*c4 */ psllw_i2r (2, mm1); psllw_i2r (2, mm0); - pmulhw_m2r (fix_141, mm1); /* tmp21 */ + pmulhw_m2r (fix_141, mm1); /* tmp21 */ /* tmp20 = MULTIPLY(z12, (FIX_1_082392200- FIX_1_847759065)) : 2*(c2-c6) */ /* + MULTIPLY(z10, - FIX_1_847759065); : 2*c2 */ psllw_i2r (2, mm3); @@ -2098,36 +2098,36 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) pmulhw_m2r (fix_n184, mm7); movq_r2r (mm3, mm6); - movq_m2r (*(wsptr), mm2); /* tmp0,final1 */ + movq_m2r (*(wsptr), mm2); /* tmp0,final1 */ pmulhw_m2r (fix_108n184, mm6); /* tmp22 = MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) : -2*(c2+c6) */ /* + MULTIPLY(z12, FIX_1_847759065); : 2*c2 */ - movq_r2r (mm2, mm4); /* final1 */ + movq_r2r (mm2, mm4); /* final1 */ pmulhw_m2r (fix_184n261, mm0); - paddw_r2r (mm5, mm2); /* tmp0+tmp7,final1 */ + paddw_r2r (mm5, mm2); /* tmp0+tmp7,final1 */ pmulhw_m2r (fix_184, mm3); - psubw_r2r (mm5, mm4); /* tmp0-tmp7,final1 */ + psubw_r2r (mm5, mm4); /* tmp0-tmp7,final1 */ /* tmp6 = tmp22 - tmp7; phase 2 */ - psraw_i2r (3, mm2); /* outptr[0,0],[1,0],[2,0],[3,0],final1 */ + psraw_i2r (3, mm2); /* outptr[0,0],[1,0],[2,0],[3,0],final1 */ - paddw_r2r (mm6, mm7); /* tmp20 */ - psraw_i2r (3, mm4); /* outptr[0,7],[1,7],[2,7],[3,7],final1 */ + paddw_r2r (mm6, mm7); /* tmp20 */ + psraw_i2r (3, mm4); /* outptr[0,7],[1,7],[2,7],[3,7],final1 */ - paddw_r2r (mm0, mm3); /* tmp22 */ + paddw_r2r (mm0, mm3); /* tmp22 */ /* tmp5 = tmp21 - tmp6; */ - psubw_r2r (mm5, mm3); /* tmp6 */ + psubw_r2r (mm5, mm3); /* tmp6 */ /* tmp4 = tmp20 + tmp5; */ - movq_m2r (*(wsptr + 1), mm0); /* tmp1,final2 */ - psubw_r2r (mm3, mm1); /* tmp5 */ + movq_m2r (*(wsptr + 1), mm0); /* tmp1,final2 */ + psubw_r2r (mm3, mm1); /* tmp5 */ - movq_r2r (mm0, mm6); /* final2 */ - paddw_r2r (mm3, mm0); /* tmp1+tmp6,final2 */ + movq_r2r (mm0, mm6); /* final2 */ + paddw_r2r (mm3, mm0); /* tmp1+tmp6,final2 */ /* Final output stage: scale down by a factor of 8 and range-limit */ @@ -2141,30 +2141,30 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* & RANGE_MASK]; */ /* outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) */ /* & RANGE_MASK]; final2 */ - psubw_r2r (mm3, mm6); /* tmp1-tmp6,final2 */ - psraw_i2r (3, mm0); /* outptr[0,1],[1,1],[2,1],[3,1] */ + psubw_r2r (mm3, mm6); /* tmp1-tmp6,final2 */ + psraw_i2r (3, mm0); /* outptr[0,1],[1,1],[2,1],[3,1] */ - psraw_i2r (3, mm6); /* outptr[0,6],[1,6],[2,6],[3,6] */ + psraw_i2r (3, mm6); /* outptr[0,6],[1,6],[2,6],[3,6] */ - packuswb_r2r (mm4, mm0); /* out[0,1],[1,1],[2,1],[3,1],[0,7],[1,7],[2,7],[3,7] */ + packuswb_r2r (mm4, mm0); /* out[0,1],[1,1],[2,1],[3,1],[0,7],[1,7],[2,7],[3,7] */ - movq_m2r (*(wsptr + 2), mm5); /* tmp2,final3 */ - packuswb_r2r (mm6, mm2); /* out[0,0],[1,0],[2,0],[3,0],[0,6],[1,6],[2,6],[3,6] */ + movq_m2r (*(wsptr + 2), mm5); /* tmp2,final3 */ + packuswb_r2r (mm6, mm2); /* out[0,0],[1,0],[2,0],[3,0],[0,6],[1,6],[2,6],[3,6] */ /* outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) */ /* & RANGE_MASK]; */ /* outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) */ /* & RANGE_MASK]; final3 */ - paddw_r2r (mm1, mm7); /* tmp4 */ + paddw_r2r (mm1, mm7); /* tmp4 */ movq_r2r (mm5, mm3); - paddw_r2r (mm1, mm5); /* tmp2+tmp5 */ - psubw_r2r (mm1, mm3); /* tmp2-tmp5 */ + paddw_r2r (mm1, mm5); /* tmp2+tmp5 */ + psubw_r2r (mm1, mm3); /* tmp2-tmp5 */ - psraw_i2r (3, mm5); /* outptr[0,2],[1,2],[2,2],[3,2] */ + psraw_i2r (3, mm5); /* outptr[0,2],[1,2],[2,2],[3,2] */ - movq_m2r (*(wsptr + 3), mm4); /* tmp3,final4 */ - psraw_i2r (3, mm3); /* outptr[0,5],[1,5],[2,5],[3,5] */ + movq_m2r (*(wsptr + 3), mm4); /* tmp3,final4 */ + psraw_i2r (3, mm3); /* outptr[0,5],[1,5],[2,5],[3,5] */ @@ -2173,12 +2173,12 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) */ /* & RANGE_MASK]; final4 */ movq_r2r (mm4, mm6); - paddw_r2r (mm7, mm4); /* tmp3+tmp4 */ + paddw_r2r (mm7, mm4); /* tmp3+tmp4 */ - psubw_r2r (mm7, mm6); /* tmp3-tmp4 */ - psraw_i2r (3, mm4); /* outptr[0,4],[1,4],[2,4],[3,4] */ + psubw_r2r (mm7, mm6); /* tmp3-tmp4 */ + psraw_i2r (3, mm4); /* outptr[0,4],[1,4],[2,4],[3,4] */ - psraw_i2r (3, mm6); /* outptr[0,3],[1,3],[2,3],[3,3] */ + psraw_i2r (3, mm6); /* outptr[0,3],[1,3],[2,3],[3,3] */ /* movq_r2m(mm4, *dummy); @@ -2188,46 +2188,46 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) */ - packuswb_r2r (mm4, mm5); /* out[0,2],[1,2],[2,2],[3,2],[0,4],[1,4],[2,4],[3,4] */ + packuswb_r2r (mm4, mm5); /* out[0,2],[1,2],[2,2],[3,2],[0,4],[1,4],[2,4],[3,4] */ - packuswb_r2r (mm3, mm6); /* out[0,3],[1,3],[2,3],[3,3],[0,5],[1,5],[2,5],[3,5] */ + packuswb_r2r (mm3, mm6); /* out[0,3],[1,3],[2,3],[3,3],[0,5],[1,5],[2,5],[3,5] */ movq_r2r (mm2, mm4); movq_r2r (mm5, mm7); - punpcklbw_r2r (mm0, mm2); /* out[0,0],[0,1],[1,0],[1,1],[2,0],[2,1],[3,0],[3,1] */ + punpcklbw_r2r (mm0, mm2); /* out[0,0],[0,1],[1,0],[1,1],[2,0],[2,1],[3,0],[3,1] */ - punpckhbw_r2r (mm0, mm4); /* out[0,6],[0,7],[1,6],[1,7],[2,6],[2,7],[3,6],[3,7] */ + punpckhbw_r2r (mm0, mm4); /* out[0,6],[0,7],[1,6],[1,7],[2,6],[2,7],[3,6],[3,7] */ movq_r2r (mm2, mm1); - punpcklbw_r2r (mm6, mm5); /* out[0,2],[0,3],[1,2],[1,3],[2,2],[2,3],[3,2],[3,3] */ + punpcklbw_r2r (mm6, mm5); /* out[0,2],[0,3],[1,2],[1,3],[2,2],[2,3],[3,2],[3,3] */ - punpckhbw_r2r (mm6, mm7); /* out[0,4],[0,5],[1,4],[1,5],[2,4],[2,5],[3,4],[3,5] */ + punpckhbw_r2r (mm6, mm7); /* out[0,4],[0,5],[1,4],[1,5],[2,4],[2,5],[3,4],[3,5] */ - punpcklwd_r2r (mm5, mm2); /* out[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3] */ + punpcklwd_r2r (mm5, mm2); /* out[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3] */ movq_r2r (mm7, mm6); - punpckhwd_r2r (mm5, mm1); /* out[2,0],[2,1],[2,2],[2,3],[3,0],[3,1],[3,2],[3,3] */ + punpckhwd_r2r (mm5, mm1); /* out[2,0],[2,1],[2,2],[2,3],[3,0],[3,1],[3,2],[3,3] */ movq_r2r (mm2, mm0); - punpcklwd_r2r (mm4, mm6); /* out[0,4],[0,5],[0,6],[0,7],[1,4],[1,5],[1,6],[1,7] */ + punpcklwd_r2r (mm4, mm6); /* out[0,4],[0,5],[0,6],[0,7],[1,4],[1,5],[1,6],[1,7] */ - punpckldq_r2r (mm6, mm2); /* out[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7] */ + punpckldq_r2r (mm6, mm2); /* out[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7] */ movq_r2r (mm1, mm3); - punpckhwd_r2r (mm4, mm7); /* out[2,4],[2,5],[2,6],[2,7],[3,4],[3,5],[3,6],[3,7] */ + punpckhwd_r2r (mm4, mm7); /* out[2,4],[2,5],[2,6],[2,7],[3,4],[3,5],[3,6],[3,7] */ dataptr += rskip; movq_r2m (mm2, *(dataptr)); - punpckhdq_r2r (mm6, mm0); /* out[1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7] */ + punpckhdq_r2r (mm6, mm0); /* out[1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7] */ dataptr += rskip; movq_r2m (mm0, *(dataptr)); - punpckldq_r2r (mm7, mm1); /* out[2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7] */ + punpckldq_r2r (mm7, mm1); /* out[2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7] */ - punpckhdq_r2r (mm7, mm3); /* out[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7] */ + punpckhdq_r2r (mm7, mm3); /* out[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7] */ dataptr += rskip; movq_r2m (mm1, *(dataptr)); @@ -2251,7 +2251,7 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) for (ctr = 8; ctr > 0; ctr--) { if ((inptr[8] | inptr[16] | inptr[24] | - inptr[32] | inptr[40] | inptr[48] | inptr[56]) == 0) { + inptr[32] | inptr[40] | inptr[48] | inptr[56]) == 0) { dcval = inptr[0]; wsptr[0] = dcval; wsptr[8] = dcval; @@ -2388,7 +2388,7 @@ RTjpeg_init_data (void) dptr = (unsigned long) &(RTjpeg_alldata[0]); dptr += 32; dptr = dptr >> 5; - dptr = dptr << 5; /* cache align data */ + dptr = dptr << 5; /* cache align data */ RTjpeg_block = (__s16 *) dptr; dptr += sizeof (__s16) * 64; @@ -2418,15 +2418,15 @@ RTjpeg_init_Q (__u8 Q) int i; __u64 qual; - qual = (__u64) Q << (32 - 7); /* 32 bit FP, 255=2, 0=0 */ + qual = (__u64) Q << (32 - 7); /* 32 bit FP, 255=2, 0=0 */ for (i = 0; i < 64; i++) { RTjpeg_lqt[i] = - (__s32) ((qual / ((__u64) RTjpeg_lum_quant_tbl[i] << 16)) >> 3); + (__s32) ((qual / ((__u64) RTjpeg_lum_quant_tbl[i] << 16)) >> 3); if (RTjpeg_lqt[i] == 0) RTjpeg_lqt[i] = 1; RTjpeg_cqt[i] = - (__s32) ((qual / ((__u64) RTjpeg_chrom_quant_tbl[i] << 16)) >> 3); + (__s32) ((qual / ((__u64) RTjpeg_chrom_quant_tbl[i] << 16)) >> 3); if (RTjpeg_cqt[i] == 0) RTjpeg_cqt[i] = 1; RTjpeg_liqt[i] = (1 << 16) / (RTjpeg_lqt[i] << 3); @@ -2476,15 +2476,15 @@ RTjpeg_init_compress (__u32 * buf, int width, int height, __u8 Q) RTjpeg_Cwidth = RTjpeg_width >> 4; RTjpeg_Csize = (width >> 1) * height; - qual = (__u64) Q << (32 - 7); /* 32 bit FP, 255=2, 0=0 */ + qual = (__u64) Q << (32 - 7); /* 32 bit FP, 255=2, 0=0 */ for (i = 0; i < 64; i++) { RTjpeg_lqt[i] = - (__s32) ((qual / ((__u64) RTjpeg_lum_quant_tbl[i] << 16)) >> 3); + (__s32) ((qual / ((__u64) RTjpeg_lum_quant_tbl[i] << 16)) >> 3); if (RTjpeg_lqt[i] == 0) RTjpeg_lqt[i] = 1; RTjpeg_cqt[i] = - (__s32) ((qual / ((__u64) RTjpeg_chrom_quant_tbl[i] << 16)) >> 3); + (__s32) ((qual / ((__u64) RTjpeg_chrom_quant_tbl[i] << 16)) >> 3); if (RTjpeg_cqt[i] == 0) RTjpeg_cqt[i] = 1; RTjpeg_liqt[i] = (1 << 16) / (RTjpeg_lqt[i] << 3); @@ -2678,28 +2678,28 @@ RTjpeg_decompressYUV422 (__s8 * sp, __u8 * bp) for (i = RTjpeg_height; i; i -= 8) { for (k = 0, j = 0; j < RTjpeg_width; j += 16, k += 8) { if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp + j, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp + j, RTjpeg_block, RTjpeg_width); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp + j + 8, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp + j + 8, RTjpeg_block, RTjpeg_width); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); - RTjpeg_idct (bp2 + k, RTjpeg_block, RTjpeg_width >> 1); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); + RTjpeg_idct (bp2 + k, RTjpeg_block, RTjpeg_width >> 1); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); - RTjpeg_idct (bp3 + k, RTjpeg_block, RTjpeg_width >> 1); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); + RTjpeg_idct (bp3 + k, RTjpeg_block, RTjpeg_width >> 1); } } bp += RTjpeg_width << 3; @@ -2727,40 +2727,40 @@ RTjpeg_decompressYUV420 (__s8 * sp, __u8 * bp) for (i = RTjpeg_height >> 1; i; i -= 8) { for (k = 0, j = 0; j < RTjpeg_width; j += 16, k += 8) { if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp + j, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp + j, RTjpeg_block, RTjpeg_width); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp + j + 8, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp + j + 8, RTjpeg_block, RTjpeg_width); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp1 + j, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp1 + j, RTjpeg_block, RTjpeg_width); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp1 + j + 8, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp1 + j + 8, RTjpeg_block, RTjpeg_width); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); - RTjpeg_idct (bp2 + k, RTjpeg_block, RTjpeg_width >> 1); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); + RTjpeg_idct (bp2 + k, RTjpeg_block, RTjpeg_width >> 1); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); - RTjpeg_idct (bp3 + k, RTjpeg_block, RTjpeg_width >> 1); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); + RTjpeg_idct (bp3 + k, RTjpeg_block, RTjpeg_width >> 1); } } bp += RTjpeg_width << 4; @@ -2786,10 +2786,10 @@ RTjpeg_decompress8 (__s8 * sp, __u8 * bp) for (i = 0; i < RTjpeg_height; i += 8) { for (j = 0; j < RTjpeg_width; j += 8) if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp + j, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp + j, RTjpeg_block, RTjpeg_width); } bp += RTjpeg_width << 3; } @@ -2861,7 +2861,7 @@ RTjpeg_bcomp (__s16 * old, mmx_t * mask) if (result.q) { if (!RTjpeg_mtest) for (i = 0; i < 16; i++) - ((__u64 *) old)[i] = ((__u64 *) RTjpeg_block)[i]; + ((__u64 *) old)[i] = ((__u64 *) RTjpeg_block)[i]; return 0; } /* printf("."); */ @@ -2877,8 +2877,8 @@ RTjpeg_bcomp (__s16 * old, __u16 * mask) for (i = 0; i < 64; i++) if (abs (old[i] - RTjpeg_block[i]) > *mask) { if (!RTjpeg_mtest) - for (i = 0; i < 16; i++) - ((__u64 *) old)[i] = ((__u64 *) RTjpeg_block)[i]; + for (i = 0; i < 16; i++) + ((__u64 *) old)[i] = ((__u64 *) RTjpeg_block)[i]; return 0; } return 1; @@ -2904,10 +2904,10 @@ RTjpeg_mcompress (__s8 * sp, unsigned char *bp, __u16 lmask, __u16 cmask) emms (); RTjpeg_lmask = (mmx_t) (((__u64) lmask << 48) | ((__u64) lmask << 32) | ((__u64) lmask << - 16) | lmask); + 16) | lmask); RTjpeg_cmask = (mmx_t) (((__u64) cmask << 48) | ((__u64) cmask << 32) | ((__u64) cmask << - 16) | cmask); + 16) | cmask); #else RTjpeg_lmask = lmask; RTjpeg_cmask = cmask; @@ -2925,33 +2925,33 @@ RTjpeg_mcompress (__s8 * sp, unsigned char *bp, __u16 lmask, __u16 cmask) RTjpeg_dctY (bp + j, RTjpeg_block, RTjpeg_Ywidth); RTjpeg_quant (RTjpeg_block, RTjpeg_lqt); if (RTjpeg_bcomp (block, &RTjpeg_lmask)) { - *((__u8 *) sp++) = 255; + *((__u8 *) sp++) = 255; } else - sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_lb8); + sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_lb8); block += 64; RTjpeg_dctY (bp + j + 8, RTjpeg_block, RTjpeg_Ywidth); RTjpeg_quant (RTjpeg_block, RTjpeg_lqt); if (RTjpeg_bcomp (block, &RTjpeg_lmask)) { - *((__u8 *) sp++) = 255; + *((__u8 *) sp++) = 255; } else - sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_lb8); + sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_lb8); block += 64; RTjpeg_dctY (bp2 + k, RTjpeg_block, RTjpeg_Cwidth); RTjpeg_quant (RTjpeg_block, RTjpeg_cqt); if (RTjpeg_bcomp (block, &RTjpeg_cmask)) { - *((__u8 *) sp++) = 255; + *((__u8 *) sp++) = 255; } else - sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_cb8); + sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_cb8); block += 64; RTjpeg_dctY (bp3 + k, RTjpeg_block, RTjpeg_Cwidth); RTjpeg_quant (RTjpeg_block, RTjpeg_cqt); if (RTjpeg_bcomp (block, &RTjpeg_cmask)) { - *((__u8 *) sp++) = 255; + *((__u8 *) sp++) = 255; } else - sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_cb8); + sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_cb8); block += 64; } @@ -2977,7 +2977,7 @@ RTjpeg_mcompress8 (__s8 * sp, unsigned char *bp, __u16 lmask) emms (); RTjpeg_lmask = (mmx_t) (((__u64) lmask << 48) | ((__u64) lmask << 32) | ((__u64) lmask << - 16) | lmask); + 16) | lmask); #else RTjpeg_lmask = lmask; #endif @@ -2991,10 +2991,10 @@ RTjpeg_mcompress8 (__s8 * sp, unsigned char *bp, __u16 lmask) RTjpeg_dctY (bp + j, RTjpeg_block, RTjpeg_width); RTjpeg_quant (RTjpeg_block, RTjpeg_lqt); if (RTjpeg_bcomp (block, &RTjpeg_lmask)) { - *((__u8 *) sp++) = 255; + *((__u8 *) sp++) = 255; /* printf("* %d ", sp[-1]); */ } else - sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_lb8); + sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_lb8); block += 64; } bp += RTjpeg_width << 3; diff --git a/gst/rtjpeg/gstrtjpeg.c b/gst/rtjpeg/gstrtjpeg.c index e61cb7d0fe..2a90e30a93 100644 --- a/gst/rtjpeg/gstrtjpeg.c +++ b/gst/rtjpeg/gstrtjpeg.c @@ -28,9 +28,9 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "rtjpegenc", - GST_RANK_NONE, GST_TYPE_RTJPEGENC) || + GST_RANK_NONE, GST_TYPE_RTJPEGENC) || !gst_element_register (plugin, "rtjpegdec", - GST_RANK_NONE, GST_TYPE_RTJPEGDEC)) + GST_RANK_NONE, GST_TYPE_RTJPEGDEC)) return FALSE; return TRUE; diff --git a/gst/rtjpeg/gstrtjpegdec.c b/gst/rtjpeg/gstrtjpegdec.c index 44dcc3f329..e96d4a093f 100644 --- a/gst/rtjpeg/gstrtjpegdec.c +++ b/gst/rtjpeg/gstrtjpegdec.c @@ -74,9 +74,10 @@ gst_rtjpegdec_get_type (void) 0, (GInstanceInitFunc) gst_rtjpegdec_init, }; + rtjpegdec_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstRTJpegDec", - &rtjpegdec_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstRTJpegDec", + &rtjpegdec_info, 0); } return rtjpegdec_type; } diff --git a/gst/rtjpeg/gstrtjpegenc.c b/gst/rtjpeg/gstrtjpegenc.c index 14d7df1f22..dbb364acd2 100644 --- a/gst/rtjpeg/gstrtjpegenc.c +++ b/gst/rtjpeg/gstrtjpegenc.c @@ -72,9 +72,10 @@ gst_rtjpegenc_get_type (void) 0, (GInstanceInitFunc) gst_rtjpegenc_init, }; + rtjpegenc_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstRTJpegEnc", - &rtjpegenc_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstRTJpegEnc", + &rtjpegenc_info, 0); } return rtjpegenc_type; } diff --git a/gst/smooth/gstsmooth.c b/gst/smooth/gstsmooth.c index 0302c7e029..fd2d576af7 100644 --- a/gst/smooth/gstsmooth.c +++ b/gst/smooth/gstsmooth.c @@ -99,8 +99,9 @@ gst_smooth_get_type (void) 0, (GInstanceInitFunc) gst_smooth_init, }; + smooth_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSmooth", &smooth_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSmooth", &smooth_info, 0); } return smooth_type; } @@ -128,9 +129,9 @@ gst_smooth_class_init (GstSmoothClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_boolean ("active", "active", "active", TRUE, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TOLERANCE, g_param_spec_int ("tolerance", "tolerance", "tolerance", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FILTERSIZE, g_param_spec_int ("filtersize", "filtersize", "filtersize", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_boolean ("active", "active", "active", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TOLERANCE, g_param_spec_int ("tolerance", "tolerance", "tolerance", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FILTERSIZE, g_param_spec_int ("filtersize", "filtersize", "filtersize", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = gst_smooth_set_property; gobject_class->get_property = gst_smooth_get_property; @@ -207,16 +208,16 @@ smooth_filter (unsigned char *dest, unsigned char *src, int width, int height, fx2 = MIN (x + filtersize + 1, width) + fy1; for (fy = fy1; fy < fy2; fy += width) { - for (fx = fx1; fx < fx2; fx++) { - aktval = srcp[fx]; - if ((lowerval - aktval) * (upperval - aktval) < 0) { - numvalues++; - sum += aktval; - } - } /*for fx */ - fx1 += width; - fx2 += width; - } /*for fy */ + for (fx = fx1; fx < fx2; fx++) { + aktval = srcp[fx]; + if ((lowerval - aktval) * (upperval - aktval) < 0) { + numvalues++; + sum += aktval; + } + } /*for fx */ + fx1 += width; + fx2 += width; + } /*for fy */ src++; *dest++ = sum / numvalues; @@ -261,11 +262,11 @@ gst_smooth_chain (GstPad * pad, GstData * _data) smooth->tolerance, smooth->filtersize); if (!smooth->lum_only) { smooth_filter (GST_BUFFER_DATA (outbuf) + lumsize, data + lumsize, - smooth->width / 2, smooth->height / 2, smooth->tolerance, - smooth->filtersize / 2); + smooth->width / 2, smooth->height / 2, smooth->tolerance, + smooth->filtersize / 2); smooth_filter (GST_BUFFER_DATA (outbuf) + lumsize + chromsize, - data + lumsize + chromsize, smooth->width / 2, smooth->height / 2, - smooth->tolerance, smooth->filtersize / 2); + data + lumsize + chromsize, smooth->width / 2, smooth->height / 2, + smooth->tolerance, smooth->filtersize / 2); } else { memcpy (GST_BUFFER_DATA (outbuf) + lumsize, data + lumsize, chromsize * 2); } diff --git a/gst/smoothwave/gstsmoothwave.c b/gst/smoothwave/gstsmoothwave.c index 2abbdec2f2..9775e3d0d4 100644 --- a/gst/smoothwave/gstsmoothwave.c +++ b/gst/smoothwave/gstsmoothwave.c @@ -80,9 +80,10 @@ gst_smoothwave_get_type (void) 0, (GInstanceInitFunc) gst_smoothwave_init, }; + smoothwave_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSmoothWave", - &smoothwave_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSmoothWave", + &smoothwave_info, 0); } return smoothwave_type; } @@ -106,9 +107,9 @@ gst_smoothwave_class_init (GstSmoothWaveClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDTH, g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HEIGHT, g_param_spec_int ("height", "height", "height", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDGET, g_param_spec_object ("widget", "widget", "widget", GTK_TYPE_WIDGET, G_PARAM_READABLE)); /* CHECKME! */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDTH, g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HEIGHT, g_param_spec_int ("height", "height", "height", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDGET, g_param_spec_object ("widget", "widget", "widget", GTK_TYPE_WIDGET, G_PARAM_READABLE)); /* CHECKME! */ gobject_class->set_property = gst_smoothwave_set_property; gobject_class->get_property = gst_smoothwave_get_property; @@ -192,7 +193,7 @@ gst_smoothwave_chain (GstPad * pad, GstData * _data) for (i = 0; i < MAX (smoothwave->width, samplecount); i++) { gint16 y1 = (gint32) (samples[i * 2] * qheight) / 32768 + qheight; gint16 y2 = (gint32) (samples[(i * 2) + 1] * qheight) / 32768 + - (qheight * 3); + (qheight * 3); smoothwave->imagebuffer[y1 * smoothwave->width + i] = 0xff; smoothwave->imagebuffer[y2 * smoothwave->width + i] = 0xff; /* smoothwave->imagebuffer[i+(smoothwave->width*5)] = i; */ @@ -246,16 +247,16 @@ gst_smoothwave_set_property (GObject * object, guint prop_id, case ARG_WIDTH: smoothwave->width = g_value_get_int (value); gtk_drawing_area_size (GTK_DRAWING_AREA (smoothwave->image), - smoothwave->width, smoothwave->height); + smoothwave->width, smoothwave->height); gtk_widget_set_usize (GTK_WIDGET (smoothwave->image), - smoothwave->width, smoothwave->height); + smoothwave->width, smoothwave->height); break; case ARG_HEIGHT: smoothwave->height = g_value_get_int (value); gtk_drawing_area_size (GTK_DRAWING_AREA (smoothwave->image), - smoothwave->width, smoothwave->height); + smoothwave->width, smoothwave->height); gtk_widget_set_usize (GTK_WIDGET (smoothwave->image), - smoothwave->width, smoothwave->height); + smoothwave->width, smoothwave->height); break; default: break; @@ -297,7 +298,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "smoothwave", GST_RANK_NONE, - GST_TYPE_SMOOTHWAVE)) + GST_TYPE_SMOOTHWAVE)) return FALSE; return TRUE; diff --git a/gst/smpte/barboxwipes.c b/gst/smpte/barboxwipes.c index 2508adf482..b843c97b3c 100644 --- a/gst/smpte/barboxwipes.c +++ b/gst/smpte/barboxwipes.c @@ -108,117 +108,117 @@ static gint box_clock_2b[][2 * 10] = { static gint box_clock_4b[][4 * 10] = { #define WIPE_B4_201 0 {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1, - BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, - BOX_CLOCK, 1, 1, 0, 1, 2, 2, 0, 1, 3, + BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, + BOX_CLOCK, 1, 1, 0, 1, 2, 2, 0, 1, 3, BOX_CLOCK, 1, 1, 0, 0, 1, 3, 1, 0, 4}, #define WIPE_B4_202 1 {BOX_CLOCK, 1, 1, 0, 1, 0, 3, 2, 1, 4, - BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, - BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2, + BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, + BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2, BOX_CLOCK, 1, 1, 0, 0, 1, 2, 1, 0, 3}, #define WIPE_B4_203 2 {BOX_CLOCK, 1, 1, 0, 1, 0, 2, 2, 1, 3, - BOX_CLOCK, 1, 1, 0, 2, 1, 3, 1, 2, 4, - BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1, + BOX_CLOCK, 1, 1, 0, 2, 1, 3, 1, 2, 4, + BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1, BOX_CLOCK, 1, 1, 0, 0, 1, 1, 1, 0, 2}, #define WIPE_B4_204 3 {BOX_CLOCK, 1, 1, 0, 1, 0, 1, 2, 1, 2, - BOX_CLOCK, 1, 1, 0, 2, 1, 2, 1, 2, 3, - BOX_CLOCK, 1, 1, 0, 1, 2, 3, 0, 1, 4, + BOX_CLOCK, 1, 1, 0, 2, 1, 2, 1, 2, 3, + BOX_CLOCK, 1, 1, 0, 1, 2, 3, 0, 1, 4, BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1}, #define WIPE_B4_205 4 {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1, - BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, - BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1, + BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, + BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1, BOX_CLOCK, 1, 1, 0, 0, 1, 1, 1, 0, 2}, #define WIPE_B4_206 5 {BOX_CLOCK, 1, 1, 0, 1, 0, 1, 2, 1, 2, - BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, - BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2, + BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, + BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2, BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1}, #define WIPE_B4_207 6 {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1, - BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, - BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1, + BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, + BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1, BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1}, #define WIPE_B4_211 7 {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1, - BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, - BOX_CLOCK, 1, 1, 0, 1, 0, 0, 0, 1, 1, + BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, + BOX_CLOCK, 1, 1, 0, 1, 0, 0, 0, 1, 1, BOX_CLOCK, 1, 1, 0, 0, 1, 1, 1, 2, 2}, #define WIPE_B4_212 8 {BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 0, 1, - BOX_CLOCK, 1, 1, 0, 1, 0, 1, 0, 1, 2, - BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, + BOX_CLOCK, 1, 1, 0, 1, 0, 1, 0, 1, 2, + BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2}, #define WIPE_B4_213 9 {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1, - BOX_CLOCK, 1, 1, 0, 1, 0, 0, 0, 1, 1, - BOX_CLOCK, 1, 1, 0, 1, 2, 0, 2, 1, 1, + BOX_CLOCK, 1, 1, 0, 1, 0, 0, 0, 1, 1, + BOX_CLOCK, 1, 1, 0, 1, 2, 0, 2, 1, 1, BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1}, #define WIPE_B4_214 10 {BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 0, 1, - BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, - BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1, + BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, + BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1, BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 2, 1}, #define WIPE_B4_227 11 {BOX_CLOCK, 1, 0, 0, 2, 0, 0, 1, 1, 1, - BOX_CLOCK, 1, 0, 0, 1, 1, 1, 0, 0, 2, - BOX_CLOCK, 1, 2, 0, 2, 2, 0, 1, 1, 1, + BOX_CLOCK, 1, 0, 0, 1, 1, 1, 0, 0, 2, + BOX_CLOCK, 1, 2, 0, 2, 2, 0, 1, 1, 1, BOX_CLOCK, 1, 2, 0, 1, 1, 1, 0, 2, 2}, #define WIPE_B4_228 12 {BOX_CLOCK, 0, 1, 0, 0, 0, 0, 1, 1, 1, - BOX_CLOCK, 0, 1, 0, 1, 1, 1, 0, 2, 2, - BOX_CLOCK, 2, 1, 0, 2, 0, 0, 1, 1, 1, + BOX_CLOCK, 0, 1, 0, 1, 1, 1, 0, 2, 2, + BOX_CLOCK, 2, 1, 0, 2, 0, 0, 1, 1, 1, BOX_CLOCK, 2, 1, 0, 1, 1, 1, 2, 2, 2}, #define WIPE_B4_235 13 {BOX_CLOCK, 1, 0, 0, 1, 1, 0, 0, 0, 1, - BOX_CLOCK, 1, 0, 0, 1, 1, 0, 2, 0, 1, - BOX_CLOCK, 1, 2, 0, 1, 1, 0, 2, 2, 1, + BOX_CLOCK, 1, 0, 0, 1, 1, 0, 2, 0, 1, + BOX_CLOCK, 1, 2, 0, 1, 1, 0, 2, 2, 1, BOX_CLOCK, 1, 2, 0, 1, 1, 0, 0, 2, 1}, #define WIPE_B4_236 14 {BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 0, 1, - BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 2, 1, - BOX_CLOCK, 2, 1, 0, 1, 1, 0, 2, 0, 1, + BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 2, 1, + BOX_CLOCK, 2, 1, 0, 1, 1, 0, 2, 0, 1, BOX_CLOCK, 2, 1, 0, 1, 1, 0, 2, 2, 1}, }; static gint box_clock_8b[][8 * 10] = { #define WIPE_B8_261 0 {BOX_CLOCK, 2, 1, 0, 2, 2, 0, 4, 1, 1, - BOX_CLOCK, 2, 1, 0, 4, 1, 1, 2, 0, 2, - BOX_CLOCK, 2, 1, 0, 2, 0, 2, 0, 1, 3, - BOX_CLOCK, 2, 1, 0, 0, 1, 3, 2, 2, 4, - BOX_CLOCK, 2, 3, 0, 2, 2, 0, 4, 3, 1, - BOX_CLOCK, 2, 3, 0, 4, 3, 1, 2, 4, 2, - BOX_CLOCK, 2, 3, 0, 2, 4, 2, 0, 3, 3, + BOX_CLOCK, 2, 1, 0, 4, 1, 1, 2, 0, 2, + BOX_CLOCK, 2, 1, 0, 2, 0, 2, 0, 1, 3, + BOX_CLOCK, 2, 1, 0, 0, 1, 3, 2, 2, 4, + BOX_CLOCK, 2, 3, 0, 2, 2, 0, 4, 3, 1, + BOX_CLOCK, 2, 3, 0, 4, 3, 1, 2, 4, 2, + BOX_CLOCK, 2, 3, 0, 2, 4, 2, 0, 3, 3, BOX_CLOCK, 2, 3, 0, 0, 3, 3, 2, 2, 4}, #define WIPE_B8_262 1 {BOX_CLOCK, 1, 2, 0, 2, 2, 0, 1, 0, 1, - BOX_CLOCK, 1, 2, 0, 1, 0, 1, 0, 2, 2, - BOX_CLOCK, 1, 2, 0, 0, 2, 2, 1, 4, 3, - BOX_CLOCK, 1, 2, 0, 1, 4, 3, 2, 2, 4, - BOX_CLOCK, 3, 2, 0, 2, 2, 0, 3, 0, 1, - BOX_CLOCK, 3, 2, 0, 3, 0, 1, 4, 2, 2, - BOX_CLOCK, 3, 2, 0, 4, 2, 2, 3, 4, 3, + BOX_CLOCK, 1, 2, 0, 1, 0, 1, 0, 2, 2, + BOX_CLOCK, 1, 2, 0, 0, 2, 2, 1, 4, 3, + BOX_CLOCK, 1, 2, 0, 1, 4, 3, 2, 2, 4, + BOX_CLOCK, 3, 2, 0, 2, 2, 0, 3, 0, 1, + BOX_CLOCK, 3, 2, 0, 3, 0, 1, 4, 2, 2, + BOX_CLOCK, 3, 2, 0, 4, 2, 2, 3, 4, 3, BOX_CLOCK, 3, 2, 0, 3, 4, 3, 2, 2, 4}, #define WIPE_B8_263 2 {BOX_CLOCK, 2, 1, 0, 2, 0, 0, 4, 1, 1, - BOX_CLOCK, 2, 1, 0, 4, 1, 1, 2, 2, 2, - BOX_CLOCK, 2, 1, 0, 2, 0, 0, 0, 1, 1, - BOX_CLOCK, 2, 1, 0, 0, 1, 1, 2, 2, 2, - BOX_CLOCK, 2, 3, 0, 2, 4, 0, 4, 3, 1, - BOX_CLOCK, 2, 3, 0, 4, 3, 1, 2, 2, 2, - BOX_CLOCK, 2, 3, 0, 2, 4, 0, 0, 3, 1, + BOX_CLOCK, 2, 1, 0, 4, 1, 1, 2, 2, 2, + BOX_CLOCK, 2, 1, 0, 2, 0, 0, 0, 1, 1, + BOX_CLOCK, 2, 1, 0, 0, 1, 1, 2, 2, 2, + BOX_CLOCK, 2, 3, 0, 2, 4, 0, 4, 3, 1, + BOX_CLOCK, 2, 3, 0, 4, 3, 1, 2, 2, 2, + BOX_CLOCK, 2, 3, 0, 2, 4, 0, 0, 3, 1, BOX_CLOCK, 2, 3, 0, 0, 3, 1, 2, 2, 2}, #define WIPE_B8_264 3 {BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 0, 1, - BOX_CLOCK, 1, 2, 0, 1, 0, 1, 2, 2, 2, - BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 4, 1, - BOX_CLOCK, 1, 2, 0, 1, 4, 1, 2, 2, 2, - BOX_CLOCK, 3, 2, 0, 4, 2, 0, 3, 0, 1, - BOX_CLOCK, 3, 2, 0, 3, 0, 1, 2, 2, 2, - BOX_CLOCK, 3, 2, 0, 4, 2, 0, 3, 4, 1, + BOX_CLOCK, 1, 2, 0, 1, 0, 1, 2, 2, 2, + BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 4, 1, + BOX_CLOCK, 1, 2, 0, 1, 4, 1, 2, 2, 2, + BOX_CLOCK, 3, 2, 0, 4, 2, 0, 3, 0, 1, + BOX_CLOCK, 3, 2, 0, 3, 0, 1, 2, 2, 2, + BOX_CLOCK, 3, 2, 0, 4, 2, 0, 3, 4, 1, BOX_CLOCK, 3, 2, 0, 3, 4, 1, 2, 2, 2}, }; @@ -260,67 +260,67 @@ static gint triangles_3t[][3 * 9] = { /* 23 -> 26 */ #define WIPE_T3_23 0 {0, 0, 1, 1, 0, 0, 0, 2, 1, - 1, 0, 0, 0, 2, 1, 2, 2, 1, + 1, 0, 0, 0, 2, 1, 2, 2, 1, 1, 0, 0, 2, 0, 1, 2, 2, 1}, #define WIPE_T3_24 1 {0, 0, 1, 2, 0, 1, 2, 1, 0, - 0, 0, 1, 2, 1, 0, 0, 2, 1, + 0, 0, 1, 2, 1, 0, 0, 2, 1, 2, 1, 0, 0, 2, 1, 2, 2, 1}, #define WIPE_T3_25 2 {0, 0, 1, 0, 2, 1, 1, 2, 0, - 0, 0, 1, 2, 0, 1, 1, 2, 0, + 0, 0, 1, 2, 0, 1, 1, 2, 0, 2, 0, 1, 1, 2, 0, 2, 2, 1}, #define WIPE_T3_26 3 {0, 0, 1, 2, 0, 1, 0, 1, 0, - 2, 0, 1, 0, 1, 0, 2, 2, 1, + 2, 0, 1, 0, 1, 0, 2, 2, 1, 0, 1, 0, 0, 2, 1, 2, 2, 1}, }; static gint triangles_4t[][4 * 9] = { #define WIPE_T4_61 0 {0, 0, 1, 1, 0, 0, 1, 2, 1, - 0, 0, 1, 0, 2, 2, 1, 2, 1, - 1, 0, 0, 2, 0, 1, 1, 2, 1, + 0, 0, 1, 0, 2, 2, 1, 2, 1, + 1, 0, 0, 2, 0, 1, 1, 2, 1, 2, 0, 1, 1, 2, 1, 2, 2, 2}, #define WIPE_T4_62 1 {0, 0, 2, 2, 0, 1, 0, 1, 1, - 2, 0, 1, 0, 1, 1, 2, 1, 0, - 0, 1, 1, 2, 1, 0, 2, 2, 1, + 2, 0, 1, 0, 1, 1, 2, 1, 0, + 0, 1, 1, 2, 1, 0, 2, 2, 1, 0, 1, 1, 0, 2, 2, 2, 2, 1}, #define WIPE_T4_63 2 {0, 0, 2, 1, 0, 1, 0, 2, 1, - 1, 0, 1, 0, 2, 1, 1, 2, 0, - 1, 0, 1, 1, 2, 0, 2, 2, 1, + 1, 0, 1, 0, 2, 1, 1, 2, 0, + 1, 0, 1, 1, 2, 0, 2, 2, 1, 1, 0, 1, 2, 0, 2, 2, 2, 1}, #define WIPE_T4_64 3 {0, 0, 1, 2, 0, 2, 2, 1, 1, - 0, 0, 1, 0, 1, 0, 2, 1, 1, - 0, 1, 0, 2, 1, 1, 0, 2, 1, + 0, 0, 1, 0, 1, 0, 2, 1, 1, + 0, 1, 0, 2, 1, 1, 0, 2, 1, 2, 1, 1, 0, 2, 1, 2, 2, 2}, #define WIPE_T4_65 4 {0, 0, 0, 1, 0, 1, 1, 2, 0, - 0, 0, 0, 0, 2, 1, 1, 2, 0, - 1, 0, 1, 2, 0, 0, 1, 2, 0, + 0, 0, 0, 0, 2, 1, 1, 2, 0, + 1, 0, 1, 2, 0, 0, 1, 2, 0, 2, 0, 0, 1, 2, 0, 2, 2, 1}, #define WIPE_T4_66 5 {0, 0, 1, 2, 0, 0, 0, 1, 0, - 2, 0, 0, 0, 1, 0, 2, 1, 1, - 0, 1, 0, 2, 1, 1, 2, 2, 0, + 2, 0, 0, 0, 1, 0, 2, 1, 1, + 0, 1, 0, 2, 1, 1, 2, 2, 0, 0, 1, 0, 0, 2, 1, 2, 2, 0}, #define WIPE_T4_67 6 {0, 0, 1, 1, 0, 0, 0, 2, 0, - 1, 0, 0, 0, 2, 0, 1, 2, 1, - 1, 0, 0, 1, 2, 1, 2, 2, 0, + 1, 0, 0, 0, 2, 0, 1, 2, 1, + 1, 0, 0, 1, 2, 1, 2, 2, 0, 1, 0, 0, 2, 0, 1, 2, 2, 0}, #define WIPE_T4_68 7 {0, 0, 0, 2, 0, 1, 2, 1, 0, - 0, 0, 0, 0, 1, 1, 2, 1, 0, - 0, 1, 1, 2, 1, 0, 0, 2, 0, + 0, 0, 0, 0, 1, 1, 2, 1, 0, + 0, 1, 1, 2, 1, 0, 0, 2, 0, 2, 1, 0, 0, 2, 0, 2, 2, 1}, #define WIPE_T4_101 8 {0, 0, 1, 2, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, 2, 1, - 1, 1, 0, 0, 2, 1, 2, 2, 1, + 0, 0, 1, 1, 1, 0, 0, 2, 1, + 1, 1, 0, 0, 2, 1, 2, 2, 1, 2, 0, 1, 1, 1, 0, 2, 2, 1}, }; @@ -328,48 +328,48 @@ static gint triangles_8t[][8 * 9] = { /* 7 */ #define WIPE_T8_7 0 {0, 0, 0, 1, 0, 1, 1, 1, 1, - 1, 0, 1, 2, 0, 0, 1, 1, 1, - 2, 0, 0, 1, 1, 1, 2, 1, 1, - 1, 1, 1, 2, 1, 1, 2, 2, 0, - 1, 1, 1, 1, 2, 1, 2, 2, 0, - 1, 1, 1, 0, 2, 0, 1, 2, 1, - 0, 1, 1, 1, 1, 1, 0, 2, 0, + 1, 0, 1, 2, 0, 0, 1, 1, 1, + 2, 0, 0, 1, 1, 1, 2, 1, 1, + 1, 1, 1, 2, 1, 1, 2, 2, 0, + 1, 1, 1, 1, 2, 1, 2, 2, 0, + 1, 1, 1, 0, 2, 0, 1, 2, 1, + 0, 1, 1, 1, 1, 1, 0, 2, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1}, #define WIPE_T8_43 1 {0, 0, 1, 1, 0, 0, 1, 1, 1, - 1, 0, 0, 2, 0, 1, 1, 1, 1, - 2, 0, 1, 1, 1, 1, 2, 1, 2, - 1, 1, 1, 2, 1, 2, 2, 2, 1, - 1, 1, 1, 1, 2, 0, 2, 2, 1, - 1, 1, 1, 0, 2, 1, 1, 2, 0, - 0, 1, 2, 1, 1, 1, 0, 2, 1, + 1, 0, 0, 2, 0, 1, 1, 1, 1, + 2, 0, 1, 1, 1, 1, 2, 1, 2, + 1, 1, 1, 2, 1, 2, 2, 2, 1, + 1, 1, 1, 1, 2, 0, 2, 2, 1, + 1, 1, 1, 0, 2, 1, 1, 2, 0, + 0, 1, 2, 1, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 2, 1, 1, 1}, #define WIPE_T8_44 2 {0, 0, 1, 1, 0, 2, 1, 1, 1, - 1, 0, 2, 2, 0, 1, 1, 1, 1, - 2, 0, 1, 1, 1, 1, 2, 1, 0, - 1, 1, 1, 2, 1, 0, 2, 2, 1, - 1, 1, 1, 1, 2, 2, 2, 2, 1, - 1, 1, 1, 0, 2, 1, 1, 2, 2, - 0, 1, 0, 1, 1, 1, 0, 2, 1, + 1, 0, 2, 2, 0, 1, 1, 1, 1, + 2, 0, 1, 1, 1, 1, 2, 1, 0, + 1, 1, 1, 2, 1, 0, 2, 2, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 1, + 1, 1, 1, 0, 2, 1, 1, 2, 2, + 0, 1, 0, 1, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1}, #define WIPE_T8_47 3 {0, 0, 0, 1, 0, 1, 1, 1, 0, - 1, 0, 1, 2, 0, 0, 1, 1, 0, - 2, 0, 0, 1, 1, 0, 2, 1, 1, - 1, 1, 0, 2, 1, 1, 2, 2, 0, - 1, 1, 0, 1, 2, 1, 2, 2, 0, - 1, 1, 0, 0, 2, 0, 1, 2, 1, - 0, 1, 1, 1, 1, 0, 0, 2, 0, + 1, 0, 1, 2, 0, 0, 1, 1, 0, + 2, 0, 0, 1, 1, 0, 2, 1, 1, + 1, 1, 0, 2, 1, 1, 2, 2, 0, + 1, 1, 0, 1, 2, 1, 2, 2, 0, + 1, 1, 0, 0, 2, 0, 1, 2, 1, + 0, 1, 1, 1, 1, 0, 0, 2, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0}, #define WIPE_T8_48 4 {0, 0, 1, 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, 1, 1, 1, - 1, 0, 0, 2, 0, 1, 2, 1, 0, - 1, 0, 0, 1, 1, 1, 2, 1, 0, - 0, 1, 0, 1, 1, 1, 1, 2, 0, - 0, 1, 0, 0, 2, 1, 1, 2, 0, - 1, 1, 1, 2, 1, 0, 1, 2, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1, + 1, 0, 0, 2, 0, 1, 2, 1, 0, + 1, 0, 0, 1, 1, 1, 2, 1, 0, + 0, 1, 0, 1, 1, 1, 1, 2, 0, + 0, 1, 0, 0, 2, 1, 1, 2, 0, + 1, 1, 1, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 2, 1}, }; @@ -377,20 +377,20 @@ static gint triangles_16t[][16 * 9] = { /* 8 */ #define WIPE_T16_8 0 {0, 0, 1, 2, 0, 1, 1, 1, 0, - 2, 0, 1, 1, 1, 0, 2, 2, 1, - 1, 1, 0, 0, 2, 1, 2, 2, 1, - 0, 0, 1, 1, 1, 0, 0, 2, 1, - 2, 0, 1, 4, 0, 1, 3, 1, 0, - 4, 0, 1, 3, 1, 0, 4, 2, 1, - 3, 1, 0, 2, 2, 1, 4, 2, 1, - 2, 0, 1, 3, 1, 0, 2, 2, 1, - 0, 2, 1, 2, 2, 1, 1, 3, 0, - 2, 2, 1, 1, 3, 0, 2, 4, 1, - 1, 3, 0, 0, 4, 1, 2, 4, 1, - 0, 2, 1, 1, 3, 0, 0, 4, 1, - 2, 2, 1, 4, 2, 1, 3, 3, 0, - 4, 2, 1, 3, 3, 0, 4, 4, 1, - 3, 3, 0, 2, 4, 1, 4, 4, 1, + 2, 0, 1, 1, 1, 0, 2, 2, 1, + 1, 1, 0, 0, 2, 1, 2, 2, 1, + 0, 0, 1, 1, 1, 0, 0, 2, 1, + 2, 0, 1, 4, 0, 1, 3, 1, 0, + 4, 0, 1, 3, 1, 0, 4, 2, 1, + 3, 1, 0, 2, 2, 1, 4, 2, 1, + 2, 0, 1, 3, 1, 0, 2, 2, 1, + 0, 2, 1, 2, 2, 1, 1, 3, 0, + 2, 2, 1, 1, 3, 0, 2, 4, 1, + 1, 3, 0, 0, 4, 1, 2, 4, 1, + 0, 2, 1, 1, 3, 0, 0, 4, 1, + 2, 2, 1, 4, 2, 1, 3, 3, 0, + 4, 2, 1, 3, 3, 0, 4, 4, 1, + 3, 3, 0, 2, 4, 1, 4, 4, 1, 2, 2, 1, 3, 3, 0, 2, 4, 1} }; @@ -407,148 +407,148 @@ struct _GstWipeConfig static GstWipeConfig wipe_config[] = { #define WIPE_CONFIG_1 0 - {boxes_1b[WIPE_B1_1], 1, 0, 0, 0}, /* 1 */ + {boxes_1b[WIPE_B1_1], 1, 0, 0, 0}, /* 1 */ #define WIPE_CONFIG_2 WIPE_CONFIG_1+1 - {boxes_1b[WIPE_B1_2], 1, 0, 0, 0}, /* 2 */ + {boxes_1b[WIPE_B1_2], 1, 0, 0, 0}, /* 2 */ #define WIPE_CONFIG_3 WIPE_CONFIG_2+1 - {triangles_2t[WIPE_T2_3], 2, 0, 0, 0}, /* 3 */ + {triangles_2t[WIPE_T2_3], 2, 0, 0, 0}, /* 3 */ #define WIPE_CONFIG_4 WIPE_CONFIG_3+1 - {triangles_2t[WIPE_T2_4], 2, 0, 0, 0}, /* 4 */ + {triangles_2t[WIPE_T2_4], 2, 0, 0, 0}, /* 4 */ #define WIPE_CONFIG_5 WIPE_CONFIG_4+1 - {triangles_2t[WIPE_T2_5], 2, 0, 0, 0}, /* 5 */ + {triangles_2t[WIPE_T2_5], 2, 0, 0, 0}, /* 5 */ #define WIPE_CONFIG_6 WIPE_CONFIG_5+1 - {triangles_2t[WIPE_T2_6], 2, 0, 0, 0}, /* 6 */ + {triangles_2t[WIPE_T2_6], 2, 0, 0, 0}, /* 6 */ #define WIPE_CONFIG_7 WIPE_CONFIG_6+1 - {triangles_8t[WIPE_T8_7], 8, 1, 1, 0}, /* 7 */ + {triangles_8t[WIPE_T8_7], 8, 1, 1, 0}, /* 7 */ #define WIPE_CONFIG_8 WIPE_CONFIG_7+1 - {triangles_16t[WIPE_T16_8], 16, 2, 2, 0}, /* 8 */ + {triangles_16t[WIPE_T16_8], 16, 2, 2, 0}, /* 8 */ #define WIPE_CONFIG_21 WIPE_CONFIG_8+1 - {boxes_2b[WIPE_B2_21], 2, 1, 1, 0}, /* 21 */ + {boxes_2b[WIPE_B2_21], 2, 1, 1, 0}, /* 21 */ #define WIPE_CONFIG_22 WIPE_CONFIG_21+1 - {boxes_2b[WIPE_B2_22], 2, 1, 1, 0}, /* 22 */ + {boxes_2b[WIPE_B2_22], 2, 1, 1, 0}, /* 22 */ #define WIPE_CONFIG_23 WIPE_CONFIG_22+1 - {triangles_3t[WIPE_T3_23], 3, 1, 1, 0}, /* 23 */ + {triangles_3t[WIPE_T3_23], 3, 1, 1, 0}, /* 23 */ #define WIPE_CONFIG_24 WIPE_CONFIG_23+1 - {triangles_3t[WIPE_T3_24], 3, 1, 1, 0}, /* 24 */ + {triangles_3t[WIPE_T3_24], 3, 1, 1, 0}, /* 24 */ #define WIPE_CONFIG_25 WIPE_CONFIG_24+1 - {triangles_3t[WIPE_T3_23], 3, 1, 1, 0}, /* 25 */ + {triangles_3t[WIPE_T3_23], 3, 1, 1, 0}, /* 25 */ #define WIPE_CONFIG_26 WIPE_CONFIG_25+1 - {triangles_3t[WIPE_T3_26], 3, 1, 1, 0}, /* 26 */ + {triangles_3t[WIPE_T3_26], 3, 1, 1, 0}, /* 26 */ #define WIPE_CONFIG_41 WIPE_CONFIG_26+1 - {triangles_2t[WIPE_T2_41], 2, 0, 0, 1}, /* 41 */ + {triangles_2t[WIPE_T2_41], 2, 0, 0, 1}, /* 41 */ #define WIPE_CONFIG_42 WIPE_CONFIG_41+1 - {triangles_2t[WIPE_T2_42], 2, 0, 0, 1}, /* 42 */ + {triangles_2t[WIPE_T2_42], 2, 0, 0, 1}, /* 42 */ #define WIPE_CONFIG_43 WIPE_CONFIG_42+1 - {triangles_8t[WIPE_T8_43], 8, 1, 1, 1}, /* 43 */ + {triangles_8t[WIPE_T8_43], 8, 1, 1, 1}, /* 43 */ #define WIPE_CONFIG_44 WIPE_CONFIG_43+1 - {triangles_8t[WIPE_T8_44], 8, 1, 1, 1}, /* 44 */ + {triangles_8t[WIPE_T8_44], 8, 1, 1, 1}, /* 44 */ #define WIPE_CONFIG_45 WIPE_CONFIG_44+1 - {triangles_2t[WIPE_T2_45], 2, 0, 0, 0}, /* 45 */ + {triangles_2t[WIPE_T2_45], 2, 0, 0, 0}, /* 45 */ #define WIPE_CONFIG_46 WIPE_CONFIG_45+1 - {triangles_2t[WIPE_T2_46], 2, 0, 0, 0}, /* 46 */ + {triangles_2t[WIPE_T2_46], 2, 0, 0, 0}, /* 46 */ #define WIPE_CONFIG_47 WIPE_CONFIG_46+1 - {triangles_8t[WIPE_T8_47], 8, 1, 1, 0}, /* 47 */ + {triangles_8t[WIPE_T8_47], 8, 1, 1, 0}, /* 47 */ #define WIPE_CONFIG_48 WIPE_CONFIG_47+1 - {triangles_8t[WIPE_T8_48], 8, 1, 1, 0}, /* 48 */ + {triangles_8t[WIPE_T8_48], 8, 1, 1, 0}, /* 48 */ #define WIPE_CONFIG_61 WIPE_CONFIG_48+1 - {triangles_4t[WIPE_T4_61], 4, 1, 1, 1}, /* 61 */ + {triangles_4t[WIPE_T4_61], 4, 1, 1, 1}, /* 61 */ #define WIPE_CONFIG_62 WIPE_CONFIG_61+1 - {triangles_4t[WIPE_T4_62], 4, 1, 1, 1}, /* 62 */ + {triangles_4t[WIPE_T4_62], 4, 1, 1, 1}, /* 62 */ #define WIPE_CONFIG_63 WIPE_CONFIG_62+1 - {triangles_4t[WIPE_T4_63], 4, 1, 1, 1}, /* 63 */ + {triangles_4t[WIPE_T4_63], 4, 1, 1, 1}, /* 63 */ #define WIPE_CONFIG_64 WIPE_CONFIG_63+1 - {triangles_4t[WIPE_T4_64], 4, 1, 1, 1}, /* 64 */ + {triangles_4t[WIPE_T4_64], 4, 1, 1, 1}, /* 64 */ #define WIPE_CONFIG_65 WIPE_CONFIG_64+1 - {triangles_4t[WIPE_T4_65], 4, 1, 1, 0}, /* 65 */ + {triangles_4t[WIPE_T4_65], 4, 1, 1, 0}, /* 65 */ #define WIPE_CONFIG_66 WIPE_CONFIG_65+1 - {triangles_4t[WIPE_T4_66], 4, 1, 1, 0}, /* 66 */ + {triangles_4t[WIPE_T4_66], 4, 1, 1, 0}, /* 66 */ #define WIPE_CONFIG_67 WIPE_CONFIG_66+1 - {triangles_4t[WIPE_T4_67], 4, 1, 1, 0}, /* 67 */ + {triangles_4t[WIPE_T4_67], 4, 1, 1, 0}, /* 67 */ #define WIPE_CONFIG_68 WIPE_CONFIG_67+1 - {triangles_4t[WIPE_T4_68], 4, 1, 1, 0}, /* 68 */ + {triangles_4t[WIPE_T4_68], 4, 1, 1, 0}, /* 68 */ #define WIPE_CONFIG_101 WIPE_CONFIG_68+1 - {triangles_4t[WIPE_T4_101], 4, 1, 1, 0}, /* 101 */ + {triangles_4t[WIPE_T4_101], 4, 1, 1, 0}, /* 101 */ #define WIPE_CONFIG_201 WIPE_CONFIG_101+1 - {box_clock_4b[WIPE_B4_201], 4, 1, 1, 2}, /* 201 */ + {box_clock_4b[WIPE_B4_201], 4, 1, 1, 2}, /* 201 */ #define WIPE_CONFIG_202 WIPE_CONFIG_201+1 - {box_clock_4b[WIPE_B4_202], 4, 1, 1, 2}, /* 202 */ + {box_clock_4b[WIPE_B4_202], 4, 1, 1, 2}, /* 202 */ #define WIPE_CONFIG_203 WIPE_CONFIG_202+1 - {box_clock_4b[WIPE_B4_203], 4, 1, 1, 2}, /* 203 */ + {box_clock_4b[WIPE_B4_203], 4, 1, 1, 2}, /* 203 */ #define WIPE_CONFIG_204 WIPE_CONFIG_203+1 - {box_clock_4b[WIPE_B4_204], 4, 1, 1, 2}, /* 204 */ + {box_clock_4b[WIPE_B4_204], 4, 1, 1, 2}, /* 204 */ #define WIPE_CONFIG_205 WIPE_CONFIG_204+1 - {box_clock_4b[WIPE_B4_205], 4, 1, 1, 1}, /* 205 */ + {box_clock_4b[WIPE_B4_205], 4, 1, 1, 1}, /* 205 */ #define WIPE_CONFIG_206 WIPE_CONFIG_205+1 - {box_clock_4b[WIPE_B4_206], 4, 1, 1, 1}, /* 206 */ + {box_clock_4b[WIPE_B4_206], 4, 1, 1, 1}, /* 206 */ #define WIPE_CONFIG_207 WIPE_CONFIG_206+1 - {box_clock_4b[WIPE_B4_207], 4, 1, 1, 0}, /* 207 */ + {box_clock_4b[WIPE_B4_207], 4, 1, 1, 0}, /* 207 */ #define WIPE_CONFIG_211 WIPE_CONFIG_207+1 - {box_clock_4b[WIPE_B4_211], 4, 1, 1, 1}, /* 211 */ + {box_clock_4b[WIPE_B4_211], 4, 1, 1, 1}, /* 211 */ #define WIPE_CONFIG_212 WIPE_CONFIG_211+1 - {box_clock_4b[WIPE_B4_212], 4, 1, 1, 1}, /* 212 */ + {box_clock_4b[WIPE_B4_212], 4, 1, 1, 1}, /* 212 */ #define WIPE_CONFIG_213 WIPE_CONFIG_212+1 - {box_clock_4b[WIPE_B4_213], 4, 1, 1, 0}, /* 213 */ + {box_clock_4b[WIPE_B4_213], 4, 1, 1, 0}, /* 213 */ #define WIPE_CONFIG_214 WIPE_CONFIG_213+1 - {box_clock_4b[WIPE_B4_214], 4, 1, 1, 0}, /* 214 */ + {box_clock_4b[WIPE_B4_214], 4, 1, 1, 0}, /* 214 */ #define WIPE_CONFIG_221 WIPE_CONFIG_214+1 - {box_clock_2b[WIPE_B2_221], 2, 1, 1, 1}, /* 221 */ + {box_clock_2b[WIPE_B2_221], 2, 1, 1, 1}, /* 221 */ #define WIPE_CONFIG_222 WIPE_CONFIG_221+1 - {box_clock_2b[WIPE_B2_222], 2, 1, 1, 1}, /* 222 */ + {box_clock_2b[WIPE_B2_222], 2, 1, 1, 1}, /* 222 */ #define WIPE_CONFIG_223 WIPE_CONFIG_222+1 - {box_clock_2b[WIPE_B2_223], 2, 1, 1, 1}, /* 223 */ + {box_clock_2b[WIPE_B2_223], 2, 1, 1, 1}, /* 223 */ #define WIPE_CONFIG_224 WIPE_CONFIG_223+1 - {box_clock_2b[WIPE_B2_224], 2, 1, 1, 1}, /* 224 */ + {box_clock_2b[WIPE_B2_224], 2, 1, 1, 1}, /* 224 */ #define WIPE_CONFIG_225 WIPE_CONFIG_224+1 - {box_clock_2b[WIPE_B2_225], 2, 1, 1, 0}, /* 225 */ + {box_clock_2b[WIPE_B2_225], 2, 1, 1, 0}, /* 225 */ #define WIPE_CONFIG_226 WIPE_CONFIG_225+1 - {box_clock_2b[WIPE_B2_226], 2, 1, 1, 0}, /* 226 */ + {box_clock_2b[WIPE_B2_226], 2, 1, 1, 0}, /* 226 */ #define WIPE_CONFIG_227 WIPE_CONFIG_226+1 - {box_clock_4b[WIPE_B4_227], 4, 1, 1, 1}, /* 227 */ + {box_clock_4b[WIPE_B4_227], 4, 1, 1, 1}, /* 227 */ #define WIPE_CONFIG_228 WIPE_CONFIG_227+1 - {box_clock_4b[WIPE_B4_228], 4, 1, 1, 1}, /* 228 */ + {box_clock_4b[WIPE_B4_228], 4, 1, 1, 1}, /* 228 */ #define WIPE_CONFIG_231 WIPE_CONFIG_228+1 - {box_clock_2b[WIPE_B2_231], 2, 1, 1, 0}, /* 231 */ + {box_clock_2b[WIPE_B2_231], 2, 1, 1, 0}, /* 231 */ #define WIPE_CONFIG_232 WIPE_CONFIG_231+1 - {box_clock_2b[WIPE_B2_232], 2, 1, 1, 0}, /* 232 */ + {box_clock_2b[WIPE_B2_232], 2, 1, 1, 0}, /* 232 */ #define WIPE_CONFIG_233 WIPE_CONFIG_232+1 - {box_clock_2b[WIPE_B2_233], 2, 1, 1, 0}, /* 233 */ + {box_clock_2b[WIPE_B2_233], 2, 1, 1, 0}, /* 233 */ #define WIPE_CONFIG_234 WIPE_CONFIG_233+1 - {box_clock_2b[WIPE_B2_234], 2, 1, 1, 0}, /* 234 */ + {box_clock_2b[WIPE_B2_234], 2, 1, 1, 0}, /* 234 */ #define WIPE_CONFIG_235 WIPE_CONFIG_234+1 - {box_clock_4b[WIPE_B4_235], 4, 1, 1, 0}, /* 235 */ + {box_clock_4b[WIPE_B4_235], 4, 1, 1, 0}, /* 235 */ #define WIPE_CONFIG_236 WIPE_CONFIG_235+1 - {box_clock_4b[WIPE_B4_236], 4, 1, 1, 0}, /* 236 */ + {box_clock_4b[WIPE_B4_236], 4, 1, 1, 0}, /* 236 */ #define WIPE_CONFIG_241 WIPE_CONFIG_236+1 - {box_clock_1b[WIPE_B1_241], 1, 0, 0, 0}, /* 241 */ + {box_clock_1b[WIPE_B1_241], 1, 0, 0, 0}, /* 241 */ #define WIPE_CONFIG_242 WIPE_CONFIG_241+1 - {box_clock_1b[WIPE_B1_242], 1, 0, 0, 0}, /* 242 */ + {box_clock_1b[WIPE_B1_242], 1, 0, 0, 0}, /* 242 */ #define WIPE_CONFIG_243 WIPE_CONFIG_242+1 - {box_clock_1b[WIPE_B1_243], 1, 0, 0, 0}, /* 243 */ + {box_clock_1b[WIPE_B1_243], 1, 0, 0, 0}, /* 243 */ #define WIPE_CONFIG_244 WIPE_CONFIG_243+1 - {box_clock_1b[WIPE_B1_244], 1, 0, 0, 0}, /* 244 */ + {box_clock_1b[WIPE_B1_244], 1, 0, 0, 0}, /* 244 */ #define WIPE_CONFIG_245 WIPE_CONFIG_244+1 - {triangles_2t[WIPE_T2_245], 2, 1, 1, 0}, /* 245 */ + {triangles_2t[WIPE_T2_245], 2, 1, 1, 0}, /* 245 */ #define WIPE_CONFIG_246 WIPE_CONFIG_245+1 - {triangles_2t[WIPE_T2_246], 2, 1, 1, 0}, /* 246 */ + {triangles_2t[WIPE_T2_246], 2, 1, 1, 0}, /* 246 */ #define WIPE_CONFIG_251 WIPE_CONFIG_246+1 - {box_clock_2b[WIPE_B2_251], 2, 1, 1, 0}, /* 251 */ + {box_clock_2b[WIPE_B2_251], 2, 1, 1, 0}, /* 251 */ #define WIPE_CONFIG_252 WIPE_CONFIG_251+1 - {box_clock_2b[WIPE_B2_252], 2, 1, 1, 0}, /* 252 */ + {box_clock_2b[WIPE_B2_252], 2, 1, 1, 0}, /* 252 */ #define WIPE_CONFIG_253 WIPE_CONFIG_252+1 - {box_clock_2b[WIPE_B2_253], 2, 1, 1, 0}, /* 253 */ + {box_clock_2b[WIPE_B2_253], 2, 1, 1, 0}, /* 253 */ #define WIPE_CONFIG_254 WIPE_CONFIG_253+1 - {box_clock_2b[WIPE_B2_254], 2, 1, 1, 0}, /* 254 */ + {box_clock_2b[WIPE_B2_254], 2, 1, 1, 0}, /* 254 */ #define WIPE_CONFIG_261 WIPE_CONFIG_254+1 - {box_clock_8b[WIPE_B8_261], 8, 2, 2, 2}, /* 261 */ + {box_clock_8b[WIPE_B8_261], 8, 2, 2, 2}, /* 261 */ #define WIPE_CONFIG_262 WIPE_CONFIG_261+1 - {box_clock_8b[WIPE_B8_262], 8, 2, 2, 2}, /* 262 */ + {box_clock_8b[WIPE_B8_262], 8, 2, 2, 2}, /* 262 */ #define WIPE_CONFIG_263 WIPE_CONFIG_262+1 - {box_clock_8b[WIPE_B8_263], 8, 2, 2, 1}, /* 263 */ + {box_clock_8b[WIPE_B8_263], 8, 2, 2, 1}, /* 263 */ #define WIPE_CONFIG_264 WIPE_CONFIG_263+1 - {box_clock_8b[WIPE_B8_264], 8, 2, 2, 1}, /* 264 */ + {box_clock_8b[WIPE_B8_264], 8, 2, 2, 1}, /* 264 */ }; static void @@ -565,24 +565,24 @@ gst_wipe_boxes_draw (GstMask * mask) for (i = 0; i < config->nobjects; i++) { switch (impacts[0]) { case BOX_VERTICAL: - gst_smpte_paint_vbox (mask->data, mask->width, - impacts[1] * width, impacts[2] * height, impacts[3] * depth, - impacts[4] * width, impacts[5] * height, impacts[6] * depth); - impacts += 7; - break; + gst_smpte_paint_vbox (mask->data, mask->width, + impacts[1] * width, impacts[2] * height, impacts[3] * depth, + impacts[4] * width, impacts[5] * height, impacts[6] * depth); + impacts += 7; + break; case BOX_HORIZONTAL: - gst_smpte_paint_hbox (mask->data, mask->width, - impacts[1] * width, impacts[2] * height, impacts[3] * depth, - impacts[4] * width, impacts[5] * height, impacts[6] * depth); - impacts += 7; + gst_smpte_paint_hbox (mask->data, mask->width, + impacts[1] * width, impacts[2] * height, impacts[3] * depth, + impacts[4] * width, impacts[5] * height, impacts[6] * depth); + impacts += 7; case BOX_CLOCK: - gst_smpte_paint_box_clock (mask->data, mask->width, - impacts[1] * width, impacts[2] * height, impacts[3] * depth, - impacts[4] * width, impacts[5] * height, impacts[6] * depth, - impacts[7] * width, impacts[8] * height, impacts[9] * depth); - impacts += 10; + gst_smpte_paint_box_clock (mask->data, mask->width, + impacts[1] * width, impacts[2] * height, impacts[3] * depth, + impacts[4] * width, impacts[5] * height, impacts[6] * depth, + impacts[7] * width, impacts[8] * height, impacts[9] * depth); + impacts += 10; default: - break; + break; } } } @@ -599,9 +599,9 @@ gst_wipe_triangles_clock_draw (GstMask * mask) for (i = 0; i < config->nobjects; i++) { gst_smpte_paint_triangle_clock (mask->data, mask->width, - impacts[0] * width, impacts[1] * height, impacts[2] * depth, - impacts[3] * width, impacts[4] * height, impacts[5] * depth, - impacts[6] * width, impacts[7] * height, impacts[8] * depth); + impacts[0] * width, impacts[1] * height, impacts[2] * depth, + impacts[3] * width, impacts[4] * height, impacts[5] * depth, + impacts[6] * width, impacts[7] * height, impacts[8] * depth); impacts += 9; } } @@ -619,293 +619,293 @@ gst_wipe_triangles_draw (GstMask * mask) for (i = 0; i < config->nobjects; i++) { gst_smpte_paint_triangle_linear (mask->data, mask->width, - impacts[0] * width, impacts[1] * height, impacts[2] * depth, - impacts[3] * width, impacts[4] * height, impacts[5] * depth, - impacts[6] * width, impacts[7] * height, impacts[8] * depth); + impacts[0] * width, impacts[1] * height, impacts[2] * depth, + impacts[3] * width, impacts[4] * height, impacts[5] * depth, + impacts[6] * width, impacts[7] * height, impacts[8] * depth); impacts += 9; } } static GstMaskDefinition definitions[] = { {1, "bar_wipe_lr", - "A bar moves from left to right", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A bar moves from left to right", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_1]}, {2, "bar_wipe_tb", - "A bar moves from top to bottom", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A bar moves from top to bottom", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_2]}, {3, "box_wipe_tl", - "A box expands from the upper-left corner to the lower-right corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the upper-left corner to the lower-right corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_3]}, {4, "box_wipe_tr", - "A box expands from the upper-right corner to the lower-left corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the upper-right corner to the lower-left corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_4]}, {5, "box_wipe_br", - "A box expands from the lower-right corner to the upper-left corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the lower-right corner to the upper-left corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_5]}, {6, "box_wipe_bl", - "A box expands from the lower-left corner to the upper-right corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the lower-left corner to the upper-right corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_6]}, {7, "four_box_wipe_ci", - "A box shape expands from each of the four corners toward the center", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box shape expands from each of the four corners toward the center", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_7]}, {8, "four_box_wipe_co", - "A box shape expands from the center of each quadrant toward the corners of each quadrant", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box shape expands from the center of each quadrant toward the corners of each quadrant", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_8]}, {21, "barndoor_v", - "A central, vertical line splits and expands toward the left and right edges", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A central, vertical line splits and expands toward the left and right edges", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_21]}, {22, "barndoor_h", - "A central, horizontal line splits and expands toward the top and bottom edges", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A central, horizontal line splits and expands toward the top and bottom edges", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_22]}, {23, "box_wipe_tc", - "A box expands from the top edge's midpoint to the bottom corners", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the top edge's midpoint to the bottom corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_23]}, {24, "box_wipe_rc", - "A box expands from the right edge's midpoint to the left corners", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the right edge's midpoint to the left corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_24]}, {25, "box_wipe_bc", - "A box expands from the bottom edge's midpoint to the top corners", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the bottom edge's midpoint to the top corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_25]}, {26, "box_wipe_lc", - "A box expands from the left edge's midpoint to the right corners", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the left edge's midpoint to the right corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_26]}, {41, "diagonal_tl", - "A diagonal line moves from the upper-left corner to the lower-right corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A diagonal line moves from the upper-left corner to the lower-right corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_41]}, {42, "diagonal_tr", - "A diagonal line moves from the upper right corner to the lower-left corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A diagonal line moves from the upper right corner to the lower-left corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_42]}, {43, "bowtie_v", - "Two wedge shapes slide in from the top and bottom edges toward the center", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "Two wedge shapes slide in from the top and bottom edges toward the center", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_43]}, {44, "bowtie_h", - "Two wedge shapes slide in from the left and right edges toward the center", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "Two wedge shapes slide in from the left and right edges toward the center", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_44]}, {45, "barndoor_dbl", - "A diagonal line from the lower-left to upper-right corners splits and expands toward the opposite corners", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A diagonal line from the lower-left to upper-right corners splits and expands toward the opposite corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_45]}, {46, "barndoor_dtl", - "A diagonal line from upper-left to lower-right corners splits and expands toward the opposite corners", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A diagonal line from upper-left to lower-right corners splits and expands toward the opposite corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_46]}, {47, "misc_diagonal_dbd", - "Four wedge shapes split from the center and retract toward the four edges", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "Four wedge shapes split from the center and retract toward the four edges", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_47]}, {48, "misc_diagonal_dd", - "A diamond connecting the four edge midpoints simultaneously contracts toward the center and expands toward the edges", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A diamond connecting the four edge midpoints simultaneously contracts toward the center and expands toward the edges", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_48]}, {61, "vee_d", - "A wedge shape moves from top to bottom", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A wedge shape moves from top to bottom", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_61]}, {62, "vee_l", - "A wedge shape moves from right to left", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A wedge shape moves from right to left", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_62]}, {63, "vee_u", - "A wedge shape moves from bottom to top", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A wedge shape moves from bottom to top", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_63]}, {64, "vee_r", - "A wedge shape moves from left to right", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A wedge shape moves from left to right", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_64]}, {65, "barnvee_d", - "A 'V' shape extending from the bottom edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A 'V' shape extending from the bottom edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_65]}, {66, "barnvee_l", - "A 'V' shape extending from the left edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A 'V' shape extending from the left edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_66]}, {67, "barnvee_u", - "A 'V' shape extending from the top edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A 'V' shape extending from the top edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_67]}, {68, "barnvee_r", - "A 'V' shape extending from the right edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A 'V' shape extending from the right edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_68]}, {101, "iris_rect", - "A rectangle expands from the center.", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A rectangle expands from the center.", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_101]}, {201, "clock_cw12", - "A radial hand sweeps clockwise from the twelve o'clock position", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the twelve o'clock position", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_201]}, {202, "clock_cw3", - "A radial hand sweeps clockwise from the three o'clock position", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the three o'clock position", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_202]}, {203, "clock_cw6", - "A radial hand sweeps clockwise from the six o'clock position", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the six o'clock position", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_203]}, {204, "clock_cw9", - "A radial hand sweeps clockwise from the nine o'clock position", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the nine o'clock position", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_204]}, {205, "pinwheel_tbv", - "Two radial hands sweep clockwise from the twelve and six o'clock positions", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands sweep clockwise from the twelve and six o'clock positions", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_205]}, {206, "pinwheel_tbh", - "Two radial hands sweep clockwise from the nine and three o'clock positions", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands sweep clockwise from the nine and three o'clock positions", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_206]}, {207, "pinwheel_fb", - "Four radial hands sweep clockwise", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Four radial hands sweep clockwise", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_207]}, {211, "fan_ct", - "A fan unfolds from the top edge, the fan axis at the center", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A fan unfolds from the top edge, the fan axis at the center", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_211]}, {212, "fan_cr", - "A fan unfolds from the right edge, the fan axis at the center", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A fan unfolds from the right edge, the fan axis at the center", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_212]}, {213, "doublefan_fov", - "Two fans, their axes at the center, unfold from the top and bottom", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two fans, their axes at the center, unfold from the top and bottom", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_213]}, {214, "doublefan_foh", - "Two fans, their axes at the center, unfold from the left and right", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two fans, their axes at the center, unfold from the left and right", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_214]}, {221, "singlesweep_cwt", - "A radial hand sweeps clockwise from the top edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the top edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_221]}, {222, "singlesweep_cwr", - "A radial hand sweeps clockwise from the right edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the right edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_222]}, {223, "singlesweep_cwb", - "A radial hand sweeps clockwise from the bottom edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the bottom edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_223]}, {224, "singlesweep_cwl", - "A radial hand sweeps clockwise from the left edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the left edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_224]}, {225, "doublesweep_pv", - "Two radial hands sweep clockwise and counter-clockwise from the top and bottom edges' midpoints", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands sweep clockwise and counter-clockwise from the top and bottom edges' midpoints", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_225]}, {226, "doublesweep_pd", - "Two radial hands sweep clockwise and counter-clockwise from the left and right edges' midpoints", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands sweep clockwise and counter-clockwise from the left and right edges' midpoints", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_226]}, {227, "doublesweep_ov", - "Two radial hands attached at the top and bottom edges' midpoints sweep from right to left", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the top and bottom edges' midpoints sweep from right to left", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_227]}, {228, "doublesweep_oh", - "Two radial hands attached at the left and right edges' midpoints sweep from top to bottom", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the left and right edges' midpoints sweep from top to bottom", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_228]}, {231, "fan_t", - "A fan unfolds from the bottom, the fan axis at the top edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A fan unfolds from the bottom, the fan axis at the top edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_231]}, {232, "fan_r", - "A fan unfolds from the left, the fan axis at the right edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A fan unfolds from the left, the fan axis at the right edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_232]}, {233, "fan_b", - "A fan unfolds from the top, the fan axis at the bottom edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A fan unfolds from the top, the fan axis at the bottom edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_233]}, {234, "fan_l", - "A fan unfolds from the right, the fan axis at the left edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A fan unfolds from the right, the fan axis at the left edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_234]}, {235, "doublefan_fiv", - "Two fans, their axes at the top and bottom, unfold from the center", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two fans, their axes at the top and bottom, unfold from the center", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_235]}, {236, "doublefan_fih", - "Two fans, their axes at the left and right, unfold from the center", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two fans, their axes at the left and right, unfold from the center", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_236]}, {241, "singlesweep_cwtl", - "A radial hand sweeps clockwise from the upper-left corner", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the upper-left corner", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_241]}, {242, "singlesweep_cwbl", - "A radial hand sweeps counter-clockwise from the lower-left corner.", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps counter-clockwise from the lower-left corner.", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_242]}, {243, "singlesweep_cwbr", - "A radial hand sweeps clockwise from the lower-right corner", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the lower-right corner", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_243]}, {244, "singlesweep_cwtr", - "A radial hand sweeps counter-clockwise from the upper-right corner", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps counter-clockwise from the upper-right corner", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_244]}, {245, "doublesweep_pdtl", - "Two radial hands attached at the upper-left and lower-right corners sweep down and up", - gst_wipe_triangles_clock_draw, _gst_mask_default_destroy, + "Two radial hands attached at the upper-left and lower-right corners sweep down and up", + gst_wipe_triangles_clock_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_245]}, {246, "doublesweep_pdbl", - "Two radial hands attached at the lower-left and upper-right corners sweep down and up", - gst_wipe_triangles_clock_draw, _gst_mask_default_destroy, + "Two radial hands attached at the lower-left and upper-right corners sweep down and up", + gst_wipe_triangles_clock_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_246]}, {251, "saloondoor_t", - "Two radial hands attached at the upper-left and upper-right corners sweep down", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the upper-left and upper-right corners sweep down", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_251]}, {252, "saloondoor_l", - "Two radial hands attached at the upper-left and lower-left corners sweep to the right", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the upper-left and lower-left corners sweep to the right", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_252]}, {253, "saloondoor_b", - "Two radial hands attached at the lower-left and lower-right corners sweep up", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the lower-left and lower-right corners sweep up", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_253]}, {254, "saloondoor_r", - "Two radial hands attached at the upper-right and lower-right corners sweep to the left", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the upper-right and lower-right corners sweep to the left", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_254]}, {261, "windshield_r", - "Two radial hands attached at the midpoints of the top and bottom halves sweep from right to left", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the midpoints of the top and bottom halves sweep from right to left", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_261]}, {262, "windshield_u", - "Two radial hands attached at the midpoints of the left and right halves sweep from top to bottom", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the midpoints of the left and right halves sweep from top to bottom", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_262]}, {263, "windshield_v", - "Two sets of radial hands attached at the midpoints of the top and bottom halves sweep from top to bottom and bottom to top", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two sets of radial hands attached at the midpoints of the top and bottom halves sweep from top to bottom and bottom to top", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_263]}, {264, "windshield_h", - "Two sets of radial hands attached at the midpoints of the left and right halves sweep from left to right and right to left", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two sets of radial hands attached at the midpoints of the left and right halves sweep from left to right and right to left", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_264]}, {0, NULL, NULL, NULL} }; diff --git a/gst/smpte/gstsmpte.c b/gst/smpte/gstsmpte.c index 91b91d9da5..c948ad17ab 100644 --- a/gst/smpte/gstsmpte.c +++ b/gst/smpte/gstsmpte.c @@ -87,7 +87,7 @@ gst_smpte_transition_type_get_type (void) definitions = gst_mask_get_definitions (); smpte_transitions = - g_new0 (GEnumValue, g_list_length ((GList *) definitions) + 1); + g_new0 (GEnumValue, g_list_length ((GList *) definitions) + 1); while (definitions) { GstMaskDefinition *definition = (GstMaskDefinition *) definitions->data; @@ -102,7 +102,7 @@ gst_smpte_transition_type_get_type (void) } smpte_transition_type = - g_enum_register_static ("GstSMPTETransitionType", smpte_transitions); + g_enum_register_static ("GstSMPTETransitionType", smpte_transitions); } return smpte_transition_type; } @@ -140,8 +140,9 @@ gst_smpte_get_type (void) 0, (GInstanceInitFunc) gst_smpte_init, }; + smpte_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSMPTE", &smpte_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSMPTE", &smpte_info, 0); } return smpte_type; } @@ -178,18 +179,18 @@ gst_smpte_class_init (GstSMPTEClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TYPE, g_param_spec_enum ("type", "Type", "The type of transition to use", - GST_TYPE_SMPTE_TRANSITION_TYPE, 1, G_PARAM_READWRITE)); + GST_TYPE_SMPTE_TRANSITION_TYPE, 1, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FPS, g_param_spec_float ("fps", "FPS", - "Frames per second if no input files are given", 0., G_MAXFLOAT, 25., - G_PARAM_READWRITE)); + "Frames per second if no input files are given", 0., G_MAXFLOAT, 25., + G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BORDER, g_param_spec_int ("border", "Border", - "The border width of the transition", 0, G_MAXINT, 0, - G_PARAM_READWRITE)); + "The border width of the transition", 0, G_MAXINT, 0, + G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DEPTH, g_param_spec_int ("depth", "Depth", "Depth of the mask in bits", 1, 24, - 16, G_PARAM_READWRITE)); + 16, G_PARAM_READWRITE)); } /* wht yel cya grn mag red blu blk -I Q */ @@ -324,8 +325,8 @@ gst_smpte_blend_i420 (guint8 * in1, guint8 * in2, guint8 * out, GstMask * mask, *out++ = ((*in1++ * value) + (*in2++ * (256 - value))) >> 8; if (!(i & 1) && !(j & 1)) { - *outu++ = ((*in1u++ * value) + (*in2u++ * (256 - value))) >> 8; - *outv++ = ((*in1v++ * value) + (*in2v++ * (256 - value))) >> 8; + *outu++ = ((*in1u++ * value) + (*in2u++ * (256 - value))) >> 8; + *outv++ = ((*in1v++ * value) + (*in2v++ * (256 - value))) >> 8; } } } @@ -376,25 +377,25 @@ gst_smpte_loop (GstElement * element) GstCaps *caps; caps = - gst_caps_copy (gst_static_caps_get (&gst_smpte_src_template. - static_caps)); + gst_caps_copy (gst_static_caps_get (&gst_smpte_src_template. + static_caps)); gst_caps_set_simple (caps, "width", G_TYPE_INT, smpte->width, "height", - G_TYPE_INT, smpte->height, "framerate", G_TYPE_DOUBLE, smpte->fps, - NULL); + G_TYPE_INT, smpte->height, "framerate", G_TYPE_DOUBLE, smpte->fps, + NULL); if (!gst_pad_try_set_caps (smpte->srcpad, caps)) { - GST_ELEMENT_ERROR (smpte, CORE, NEGOTIATION, (NULL), (NULL)); - return; + GST_ELEMENT_ERROR (smpte, CORE, NEGOTIATION, (NULL), (NULL)); + return; } } gst_smpte_blend_i420 (GST_BUFFER_DATA (in1), - GST_BUFFER_DATA (in2), - GST_BUFFER_DATA (outbuf), - smpte->mask, smpte->width, smpte->height, - smpte->border, - ((1 << smpte->depth) + smpte->border) * - smpte->position / smpte->duration); + GST_BUFFER_DATA (in2), + GST_BUFFER_DATA (outbuf), + smpte->mask, smpte->width, smpte->height, + smpte->border, + ((1 << smpte->depth) + smpte->border) * + smpte->position / smpte->duration); } else { outbuf = in2; gst_buffer_ref (in2); @@ -425,7 +426,7 @@ gst_smpte_set_property (GObject * object, guint prop_id, gint type = g_value_get_enum (value); gst_smpte_update_mask (smpte, type, smpte->depth, - smpte->width, smpte->height); + smpte->width, smpte->height); break; } case ARG_BORDER: @@ -439,7 +440,7 @@ gst_smpte_set_property (GObject * object, guint prop_id, gint depth = g_value_get_int (value); gst_smpte_update_mask (smpte, smpte->type, depth, - smpte->width, smpte->height); + smpte->width, smpte->height); break; } default: @@ -459,7 +460,7 @@ gst_smpte_get_property (GObject * object, guint prop_id, switch (prop_id) { case ARG_TYPE: if (smpte->mask) { - g_value_set_enum (value, smpte->mask->type); + g_value_set_enum (value, smpte->mask->type); } break; case ARG_FPS: diff --git a/gst/smpte/paint.c b/gst/smpte/paint.c index fdff77e531..f4f648296c 100644 --- a/gst/smpte/paint.c +++ b/gst/smpte/paint.c @@ -189,22 +189,22 @@ gst_smpte_paint_triangle_linear (guint32 * dest, gint stride, e += sign; for (j = s; j != e; j += sign) { - dest[j] = (ec * (j - s) + sc * (e - j)) / (e - s); + dest[j] = (ec * (j - s) + sc * (e - j)) / (e - s); } while (pyr == i) { - STEP_3D_LINE (dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, - xrr, yrr, crr, pxr, pyr, pcr); + STEP_3D_LINE (dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, + xrr, yrr, crr, pxr, pyr, pcr); } while (pyl == i) { - STEP_3D_LINE (dxlabs, dylabs, dclabs, sdxl, sdyl, sdcl, - xrl, yrl, crl, pxl, pyl, pcl); + STEP_3D_LINE (dxlabs, dylabs, dclabs, sdxl, sdyl, sdcl, + xrl, yrl, crl, pxl, pyl, pcl); } dest += stride; } PREPARE_3D_LINE (x1, y1, c1, x2, y2, c2, - dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, xrr, yrr, crr, pxr, pyr, pcr); + dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, xrr, yrr, crr, pxr, pyr, pcr); seg_start = y1; seg_end = y2; @@ -265,7 +265,7 @@ gst_smpte_paint_triangle_clock (guint32 * dest, gint stride, angle_s = 0.0; angle_e = acos (((x1 - x0) * (x2 - x0) + (y1 - y0) * (y2 - y0)) / (sqrt ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) * - sqrt ((x2 - x0) * (x2 - x0) + (y2 - y0) * (y2 - y0)))); + sqrt ((x2 - x0) * (x2 - x0) + (y2 - y0) * (y2 - y0)))); len1 = sqrt ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)); @@ -274,28 +274,28 @@ gst_smpte_paint_triangle_clock (guint32 * dest, gint stride, for (i = y1; i != (y2 + sign); i += sign) { if (y1 == i) - angle = 0; + angle = 0; else - angle = acos (((x1 - x0) * (x2 - x0) + (y1 - y0) * (i - y0)) / - (len1 * sqrt ((x1 - x0) * (x1 - x0) + (i - y0) * (i - - y0)))) / angle_e; + angle = acos (((x1 - x0) * (x2 - x0) + (y1 - y0) * (i - y0)) / + (len1 * sqrt ((x1 - x0) * (x1 - x0) + (i - y0) * (i - + y0)))) / angle_e; draw_bresenham_line (dest, stride, - x0, y0, x1, i, (c2 * angle + c1 * (1.0 - angle))); + x0, y0, x1, i, (c2 * angle + c1 * (1.0 - angle))); } } else if (y1 == y2) { sign = SIGN (x2 - x1); for (i = x1; i != (x2 + sign); i += sign) { if (x1 == i) - angle = 0; + angle = 0; else - angle = acos (((x1 - x0) * (i - x0) + (y1 - y0) * (y2 - y0)) / - (len1 * sqrt ((i - x0) * (i - x0) + (y2 - y0) * (y2 - - y0)))) / angle_e; + angle = acos (((x1 - x0) * (i - x0) + (y1 - y0) * (y2 - y0)) / + (len1 * sqrt ((i - x0) * (i - x0) + (y2 - y0) * (y2 - + y0)))) / angle_e; draw_bresenham_line (dest, stride, - x0, y0, i, y1, (c2 * angle + c1 * (1.0 - angle))); + x0, y0, i, y1, (c2 * angle + c1 * (1.0 - angle))); } } } @@ -321,7 +321,7 @@ gst_smpte_paint_box_clock (guint32 * dest, gint stride, angle_m = 2 * acos (((x1 - x0) * (xv - x0) + (y1 - y0) * (yv - y0)) / (sqrt ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) * - sqrt ((xv - x0) * (xv - x0) + (yv - y0) * (yv - y0)))) / M_PI; + sqrt ((xv - x0) * (xv - x0) + (yv - y0) * (yv - y0)))) / M_PI; col_m = c2 * angle_m + c1 * (1.0 - angle_m); diff --git a/gst/spectrum/demo-osssrc.c b/gst/spectrum/demo-osssrc.c index 462fcf9062..1bd2fa11d1 100644 --- a/gst/spectrum/demo-osssrc.c +++ b/gst/spectrum/demo-osssrc.c @@ -75,7 +75,7 @@ spectrum_chain (GstPad * pad, GstData * _data) TRUE, 0, 0, GST_BUFFER_SIZE (buf), 25); for (i = 0; i < GST_BUFFER_SIZE (buf); i++) { gdk_draw_rectangle (drawingarea->window, drawingarea->style->white_gc, - TRUE, i, 32 - data[i], 1, data[i]); + TRUE, i, 32 - data[i], 1, data[i]); } gst_buffer_unref (buf); } diff --git a/gst/spectrum/fix_fft.c b/gst/spectrum/fix_fft.c index db6c3a82b7..d5aed1f1f0 100644 --- a/gst/spectrum/fix_fft.c +++ b/gst/spectrum/fix_fft.c @@ -61,11 +61,11 @@ #define FIX_MPY(DEST,A,B) DEST = ((long)(A) * (long)(B))>>15 -#define N_WAVE 1024 /* dimension of Sinewave[] */ -#define LOG2_N_WAVE 10 /* log2(N_WAVE) */ -#define N_LOUD 100 /* dimension of Loudampl[] */ +#define N_WAVE 1024 /* dimension of Sinewave[] */ +#define LOG2_N_WAVE 10 /* log2(N_WAVE) */ +#define N_LOUD 100 /* dimension of Loudampl[] */ -extern fixed gst_spectrum_Sinewave[N_WAVE]; /* placed at end of this file for clarity */ +extern fixed gst_spectrum_Sinewave[N_WAVE]; /* placed at end of this file for clarity */ extern fixed gst_spectrum_Loudampl[N_LOUD]; static int gst_spectrum_db_from_ampl (fixed re, fixed im); static fixed gst_spectrum_fix_mpy (fixed a, fixed b); @@ -119,19 +119,19 @@ gst_spectrum_fix_fft (fixed fr[], fixed fi[], int m, int inverse) /* variable scaling, depending upon data */ shift = 0; for (i = 0; i < n; ++i) { - j = fr[i]; - if (j < 0) - j = -j; - m = fi[i]; - if (m < 0) - m = -m; - if (j > 16383 || m > 16383) { - shift = 1; - break; - } + j = fr[i]; + if (j < 0) + j = -j; + m = fi[i]; + if (m < 0) + m = -m; + if (j > 16383 || m > 16383) { + shift = 1; + break; + } } if (shift) - ++scale; + ++scale; } else { /* fixed scaling, for proper normalization - there will be log2(n) passes, so this @@ -148,27 +148,27 @@ gst_spectrum_fix_fft (fixed fr[], fixed fi[], int m, int inverse) wr = gst_spectrum_Sinewave[j + N_WAVE / 4]; wi = -gst_spectrum_Sinewave[j]; if (inverse) - wi = -wi; + wi = -wi; if (shift) { - wr >>= 1; - wi >>= 1; + wr >>= 1; + wi >>= 1; } for (i = m; i < n; i += istep) { - j = i + l; - tr = gst_spectrum_fix_mpy (wr, fr[j]) - - gst_spectrum_fix_mpy (wi, fi[j]); - ti = gst_spectrum_fix_mpy (wr, fi[j]) + - gst_spectrum_fix_mpy (wi, fr[j]); - qr = fr[i]; - qi = fi[i]; - if (shift) { - qr >>= 1; - qi >>= 1; - } - fr[j] = qr - tr; - fi[j] = qi - ti; - fr[i] = qr + tr; - fi[i] = qi + ti; + j = i + l; + tr = gst_spectrum_fix_mpy (wr, fr[j]) - + gst_spectrum_fix_mpy (wi, fi[j]); + ti = gst_spectrum_fix_mpy (wr, fi[j]) + + gst_spectrum_fix_mpy (wi, fr[j]); + qr = fr[i]; + qi = fi[i]; + if (shift) { + qr >>= 1; + qi >>= 1; + } + fr[j] = qr - tr; + fi[j] = qi - ti; + fr[i] = qr + tr; + fi[i] = qi + ti; } } --k; @@ -230,7 +230,7 @@ gst_spectrum_db_from_ampl (fixed re, fixed im) if (loud2[0] == 0) { loud2[0] = - (long) gst_spectrum_Loudampl[0] * (long) gst_spectrum_Loudampl[0]; + (long) gst_spectrum_Loudampl[0] * (long) gst_spectrum_Loudampl[0]; for (i = 1; i < N_LOUD; ++i) { v = (long) gst_spectrum_Loudampl[i] * (long) gst_spectrum_Loudampl[i]; loud2[i] = v; @@ -272,7 +272,7 @@ gst_spectrum_iscale (int value, int numer, int denom) fixed gst_spectrum_fix_dot (fixed * hpa, fixed * pb, int n) { - fixed *pa = hpa; /* FIXME */ + fixed *pa = hpa; /* FIXME */ long sum; register fixed a, b; diff --git a/gst/spectrum/gstspectrum.c b/gst/spectrum/gstspectrum.c index aa309f1cf8..b87763cb06 100644 --- a/gst/spectrum/gstspectrum.c +++ b/gst/spectrum/gstspectrum.c @@ -82,9 +82,10 @@ gst_spectrum_get_type (void) 0, (GInstanceInitFunc) gst_spectrum_init, }; + spectrum_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSpectrum", &spectrum_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSpectrum", &spectrum_info, + 0); } return spectrum_type; } @@ -105,7 +106,7 @@ gst_spectrum_class_init (GstSpectrumClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDTH, g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_WRITABLE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDTH, g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_WRITABLE)); /* CHECKME */ gobject_class->set_property = gst_spectrum_set_property; } diff --git a/gst/speed/demo-mp3.c b/gst/speed/demo-mp3.c index 5b83347a16..f9a169ae94 100644 --- a/gst/speed/demo-mp3.c +++ b/gst/speed/demo-mp3.c @@ -49,7 +49,7 @@ main (int argc, char **argv) vbox = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox); hscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1.0, 0.01, 4.0, - 0.1, 0.0, 0.0))); + 0.1, 0.0, 0.0))); gtk_scale_set_digits (GTK_SCALE (hscale), 2); gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_CONTINUOUS); button = gtk_button_new_with_label ("quit"); @@ -68,7 +68,7 @@ main (int argc, char **argv) g_object_set (osssink, "fragment", 0x00180008, NULL); gtk_signal_connect (GTK_OBJECT (gtk_range_get_adjustment (GTK_RANGE - (hscale))), "value_changed", G_CALLBACK (set_speed), speed); + (hscale))), "value_changed", G_CALLBACK (set_speed), speed); pipeline = gst_pipeline_new ("app"); gst_bin_add_many (GST_BIN (pipeline), filesrc, mad, stereo2mono, speed, diff --git a/gst/speed/gstspeed.c b/gst/speed/gstspeed.c index 12752f12c5..090d13d0e2 100644 --- a/gst/speed/gstspeed.c +++ b/gst/speed/gstspeed.c @@ -60,7 +60,7 @@ static GstStaticPadTemplate gst_speed_sink_template = GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) + GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) ); static GstStaticPadTemplate gst_speed_src_template = @@ -68,7 +68,7 @@ static GstStaticPadTemplate gst_speed_src_template = GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) + GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) ); static void speed_base_init (gpointer g_class); @@ -157,8 +157,9 @@ gst_speed_get_type (void) 0, (GInstanceInitFunc) speed_init, }; + speed_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSpeed", &speed_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSpeed", &speed_info, 0); } return speed_type; } @@ -187,7 +188,7 @@ speed_class_init (GstSpeedClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SPEED, g_param_spec_float ("speed", "speed", "speed", - 0.1, 40.0, 1.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + 0.1, 40.0, 1.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); } static void @@ -250,7 +251,7 @@ speed_loop (GstElement * element) #undef _FORMAT } else { GST_ELEMENT_ERROR (filter, CORE, NEGOTIATION, (NULL), - ("format wasn't negotiated before chain function")); + ("format wasn't negotiated before chain function")); gst_element_yield (element); } } diff --git a/gst/stereo/gststereo.c b/gst/stereo/gststereo.c index 947c3885c8..a0fb74a387 100644 --- a/gst/stereo/gststereo.c +++ b/gst/stereo/gststereo.c @@ -81,8 +81,9 @@ gst_stereo_get_type (void) 0, (GInstanceInitFunc) gst_stereo_init, }; + stereo_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstStereo", &stereo_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstStereo", &stereo_info, 0); } return stereo_type; } @@ -105,8 +106,8 @@ gst_stereo_class_init (GstStereoClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_int ("active", "active", "active", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", 0.0, 1.0, 0.0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_int ("active", "active", "active", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", 0.0, 1.0, 0.0, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = gst_stereo_set_property; gobject_class->get_property = gst_stereo_get_property; @@ -160,16 +161,16 @@ gst_stereo_chain (GstPad * pad, GstData * _data) tmp = avg + ldiff * mul; if (tmp < -32768) - tmp = -32768; + tmp = -32768; if (tmp > 32767) - tmp = 32767; + tmp = 32767; data[i] = tmp; tmp = avg + rdiff * mul; if (tmp < -32768) - tmp = -32768; + tmp = -32768; if (tmp > 32767) - tmp = 32767; + tmp = 32767; data[i + 1] = tmp; } /*} */ diff --git a/gst/switch/gstswitch.c b/gst/switch/gstswitch.c index 995bbdbe0d..d0cb2cc57b 100644 --- a/gst/switch/gstswitch.c +++ b/gst/switch/gstswitch.c @@ -115,7 +115,7 @@ gst_switch_request_new_pad (GstElement * element, /* We only provide requested sink pads */ if (templ->direction != GST_PAD_SINK) { GST_CAT_LOG_OBJECT (GST_CAT_ELEMENT_PADS, gstswitch, - "requested a non sink pad"); + "requested a non sink pad"); return NULL; } @@ -171,41 +171,41 @@ gst_switch_poll_sinkpads (GstSwitch * gstswitch) if (GST_PAD_IS_USABLE (switchpad->sinkpad) && !switchpad->eos) { GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "polling pad %p", switchpad->sinkpad); + "polling pad %p", switchpad->sinkpad); /* We loose the reference to the data we stored */ if (switchpad->data) { - gst_data_unref (switchpad->data); + gst_data_unref (switchpad->data); } /* If that data was not forwarded we unref it another time to destroy it */ if (!switchpad->forwarded && switchpad->data) { - gst_data_unref (switchpad->data); + gst_data_unref (switchpad->data); } switchpad->data = NULL; switchpad->data = gst_pad_pull (switchpad->sinkpad); if (!switchpad->data) { - GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "received NULL data from pad %p", switchpad->sinkpad); + GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, + "received NULL data from pad %p", switchpad->sinkpad); } else { - gst_data_ref (switchpad->data); - switchpad->forwarded = FALSE; + gst_data_ref (switchpad->data); + switchpad->forwarded = FALSE; - /* If the buffer is an EOS event we tag the pad as being in EOS. That - means we won't try to pull more data from that pad */ - if (GST_IS_EVENT (switchpad->data) && - (GST_EVENT_TYPE (GST_EVENT (switchpad->data)) == GST_EVENT_EOS)) { - GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "received EOS event on pad %p", switchpad->sinkpad); - switchpad->eos = TRUE; - } + /* If the buffer is an EOS event we tag the pad as being in EOS. That + means we won't try to pull more data from that pad */ + if (GST_IS_EVENT (switchpad->data) && + (GST_EVENT_TYPE (GST_EVENT (switchpad->data)) == GST_EVENT_EOS)) { + GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, + "received EOS event on pad %p", switchpad->sinkpad); + switchpad->eos = TRUE; + } } } else { GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "not pulling from pad %s (eos is %d)", - gst_pad_get_name (switchpad->sinkpad), switchpad->eos); + "not pulling from pad %s (eos is %d)", + gst_pad_get_name (switchpad->sinkpad), switchpad->eos); } pads = g_list_next (pads); } @@ -238,20 +238,20 @@ gst_switch_loop (GstElement * element) switchpad->data = NULL; GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "using data from active pad %p", switchpad->sinkpad); + "using data from active pad %p", switchpad->sinkpad); if (GST_IS_EVENT (data)) { GstEvent *event = GST_EVENT (data); GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "handling event from active pad %p", switchpad->sinkpad); + "handling event from active pad %p", switchpad->sinkpad); /* Handling event */ gst_pad_event_default (switchpad->sinkpad, event); } else { /* Pushing active sinkpad data to srcpad */ GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "pushing data from active pad %p to %p", - switchpad->sinkpad, gstswitch->srcpad); + "pushing data from active pad %p to %p", + switchpad->sinkpad, gstswitch->srcpad); gst_pad_push (gstswitch->srcpad, data); } @@ -281,18 +281,18 @@ gst_switch_change_state (GstElement * element) sinkpads = gstswitch->sinkpads; while (sinkpads) { - GstSwitchPad *switchpad = sinkpads->data; + GstSwitchPad *switchpad = sinkpads->data; - /* If a data is still stored in our structure we unref it */ - if (switchpad->data) { - gst_data_unref (switchpad->data); - switchpad->data = NULL; - } + /* If a data is still stored in our structure we unref it */ + if (switchpad->data) { + gst_data_unref (switchpad->data); + switchpad->data = NULL; + } - switchpad->forwarded = FALSE; - switchpad->eos = FALSE; + switchpad->forwarded = FALSE; + switchpad->eos = FALSE; - sinkpads = g_list_next (sinkpads); + sinkpads = g_list_next (sinkpads); } } break; @@ -438,13 +438,13 @@ gst_switch_class_init (GstSwitchClass * klass) g_object_class_install_property (gobject_class, ARG_NB_SOURCES, g_param_spec_int ("nb_sources", - "number of sources", - "number of sources", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); + "number of sources", + "number of sources", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); g_object_class_install_property (gobject_class, ARG_ACTIVE_SOURCE, g_param_spec_int ("active_source", - "active source", - "active source", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); + "active source", + "active source", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); gobject_class->dispose = gst_switch_dispose; gobject_class->set_property = gst_switch_set_property; @@ -480,7 +480,7 @@ gst_switch_get_type (void) }; switch_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstSwitch", &switch_info, 0); + "GstSwitch", &switch_info, 0); } return switch_type; diff --git a/gst/vbidec/gstvbidec.c b/gst/vbidec/gstvbidec.c index 2a92b29780..749cf65deb 100644 --- a/gst/vbidec/gstvbidec.c +++ b/gst/vbidec/gstvbidec.c @@ -115,10 +115,11 @@ gst_vbidec_caption_type_get_type (void) {CAPTURE_T4, "9", "Closed Caption T4"}, {0, NULL, NULL}, }; + if (!vbidec_caption_type_type) { vbidec_caption_type_type = - g_enum_register_static ("GstVBIDecCaptionTypeType", - vbidec_caption_type); + g_enum_register_static ("GstVBIDecCaptionTypeType", + vbidec_caption_type); } return vbidec_caption_type_type; } @@ -155,8 +156,9 @@ gst_vbidec_get_type (void) 0, (GInstanceInitFunc) gst_vbidec_init, }; + vbidec_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstVBIDec", &vbidec_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstVBIDec", &vbidec_info, 0); } return vbidec_type; } @@ -189,14 +191,14 @@ gst_vbidec_class_init (GstVBIDecClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_VERBOSE, g_param_spec_boolean ("verbose", "verbose", "verbose", - FALSE, G_PARAM_WRITABLE)); + FALSE, G_PARAM_WRITABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_CAPTION_TYPE, g_param_spec_enum ("caption type", "caption type", "Closed Caption Type", - GST_TYPE_VBIDEC_CAPTION_TYPE_TYPE, CAPTURE_OFF, G_PARAM_READWRITE)); + GST_TYPE_VBIDEC_CAPTION_TYPE_TYPE, CAPTURE_OFF, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DVD_INPUT, g_param_spec_boolean ("dvd input", "dvd input", - "VBI is encapsulated in MPEG2 GOP user_data field (as on DVDs)", - FALSE, G_PARAM_READWRITE)); + "VBI is encapsulated in MPEG2 GOP user_data field (as on DVDs)", + FALSE, G_PARAM_READWRITE)); } static void @@ -233,7 +235,7 @@ dvd_user_data_decode (GstVBIDec * vbidec, guint8 * data, guint32 size) { //char caption[128]; //int ci; /* caption index */ - int i; /* buf index */ + int i; /* buf index */ int num_disp_field; guint8 b1, b2; int w; @@ -248,8 +250,8 @@ dvd_user_data_decode (GstVBIDec * vbidec, guint8 * data, guint32 size) return; } //g_print ("CC data\n"); - i += 4; /* above */ - i += 4; /* ? */ + i += 4; /* above */ + i += 4; /* ? */ num_disp_field = data[i] & 0x3f; //g_print ("ndf %d\n", num_disp_field); while ((data[i] & 0xfe) == 0xfe) { diff --git a/gst/vbidec/vbidata.c b/gst/vbidec/vbidata.c index 75a85e4823..76f43110b4 100644 --- a/gst/vbidec/vbidata.c +++ b/gst/vbidec/vbidata.c @@ -115,7 +115,7 @@ static char *extcode2 = "\0303\0343\0315\0314\0354\0322\0362\0325" int parityok (int n) -{ /* check parity for 2 bytes packed in n */ +{ /* check parity for 2 bytes packed in n */ int j, k; for (k = 0, j = 0; j < 7; j++) @@ -135,11 +135,11 @@ int decodebit (unsigned char *data, int threshold) { return ((data[0] + data[1] + data[2] + data[3] + data[4] + data[5] + - data[6] + data[7] + data[8] + data[9] + data[10] + data[11] + - data[12] + data[13] + data[14] + data[15] + data[16] + data[17] + - data[18] + data[19] + data[20] + data[21] + data[22] + data[23] + - data[24] + data[25] + data[26] + data[27] + data[28] + data[29] + - data[30] + data[31]) >> 5 > threshold); + data[6] + data[7] + data[8] + data[9] + data[10] + data[11] + + data[12] + data[13] + data[14] + data[15] + data[16] + data[17] + + data[18] + data[19] + data[20] + data[21] + data[22] + data[23] + + data[24] + data[25] + data[26] + data[27] + data[28] + data[29] + + data[30] + data[31]) >> 5 > threshold); } @@ -170,7 +170,7 @@ ccdecode (unsigned char *vbiline) if (!decodebit (&vbiline[i], sample)) return 0; #ifndef PAL_DECODE - tmp = i + 57; /* tmp = data bit zero */ + tmp = i + 57; /* tmp = data bit zero */ #else tmp = i + 71; #endif @@ -187,7 +187,7 @@ ccdecode (unsigned char *vbiline) if (parityok (packedbits)) return packedbits; return 0; -} /* ccdecode */ +} /* ccdecode */ const char *movies[] = { "N/A", "G", "PG", "PG-13", "R", "NC-17", "X", "Not Rated" @@ -280,25 +280,25 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) const char *str; switch (VSL | scheme) { - case 3: /* Canadian English TV */ - str = cane_tv[tv_rating]; - break; - case 7: /* Canadian French TV */ - str = canf_tv[tv_rating]; - break; - case 19: /* Reserved */ + case 3: /* Canadian English TV */ + str = cane_tv[tv_rating]; + break; + case 7: /* Canadian French TV */ + str = canf_tv[tv_rating]; + break; + case 19: /* Reserved */ case 31: - str = ""; - break; + str = ""; + break; default: - if (((VSL | scheme) & 3) == 1) { - /* USA TV */ - str = usa_tv[tv_rating]; - } else { - /* MPAA Movie Rating */ - str = movies[movie_rating]; - } - break; + if (((VSL | scheme) & 3) == 1) { + /* USA TV */ + str = usa_tv[tv_rating]; + } else { + /* MPAA Movie Rating */ + str = movies[movie_rating]; + } + break; } if (vbi->rating && !strcmp (vbi->rating, str)) { @@ -310,20 +310,20 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) if (((VSL | scheme) & 3) == 1 || ((VSL | scheme) & 3) == 0) { /* show VSLD for the americans */ if ((VSL | scheme) & 32) { - if (vbi->verbose) - fprintf (stderr, " V"); + if (vbi->verbose) + fprintf (stderr, " V"); } if ((VSL | scheme) & 16) { - if (vbi->verbose) - fprintf (stderr, " S"); + if (vbi->verbose) + fprintf (stderr, " S"); } if ((VSL | scheme) & 8) { - if (vbi->verbose) - fprintf (stderr, " L"); + if (vbi->verbose) + fprintf (stderr, " L"); } if ((VSL | scheme) & 4) { - if (vbi->verbose) - fprintf (stderr, " D"); + if (vbi->verbose) + fprintf (stderr, " D"); } } if (vbi->verbose) @@ -342,15 +342,15 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) vbi->call_letters = strdup (packet + 2); /*tvtime_osd_set_network_call( vbi->osd, vbi->call_letters ); */ } else if (packet[0] == 0x01 && packet[1] == 0x01) { - int month = packet[5]; // & 15; - int day = packet[4]; // & 31; - int hour = packet[3]; // & 31; - int min = packet[2]; // & 63; + int month = packet[5]; // & 15; + int day = packet[4]; // & 31; + int hour = packet[3]; // & 31; + int min = packet[2]; // & 63; char str[33]; if (vbi->verbose) fprintf (stderr, "Program Start: %02d %s, %02d:%02d\n", - day & 31, months[month & 15], hour & 31, min & 63); + day & 31, months[month & 15], hour & 31, min & 63); // packet[ 3 ], packet[ 4 ], packet[ 5 ], packet[ 6 ] ); //packet[ 5 ] & 31, packet[ 6 ], packet[ 4 ] & 31, packet[ 3 ] & 63 ); vbi->start_month = month & 15; @@ -358,7 +358,7 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) vbi->start_hour = hour & 31; vbi->start_min = hour & 63; snprintf (str, 32, "%02d %s, %02d:%02d", - day & 31, months[month & 15], hour & 31, min & 63); + day & 31, months[month & 15], hour & 31, min & 63); /*tvtime_osd_set_show_start( vbi->osd, str ); */ } else if (packet[0] == 0x01 && packet[1] == 0x04) { if (vbi->verbose) @@ -367,10 +367,10 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) int cur = packet[2 + i] - 0x20; if (cur >= 0 && cur < 96) { - if (vbi->verbose) - fprintf (stderr, "%s%s", i ? ", " : "", eia608_program_type[cur]); - /* this will cause us to keep only the last type we check */ - vbi->program_type = eia608_program_type[cur]; + if (vbi->verbose) + fprintf (stderr, "%s%s", i ? ", " : "", eia608_program_type[cur]); + /* this will cause us to keep only the last type we check */ + vbi->program_type = eia608_program_type[cur]; } } if (vbi->verbose) @@ -378,7 +378,7 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) } else if (packet[0] < 0x03 && packet[1] >= 0x10 && packet[1] <= 0x17) { if (vbi->program_desc[packet[1] & 0xf] && - !strcmp (vbi->program_desc[packet[1] & 0xf], packet + 2)) { + !strcmp (vbi->program_desc[packet[1] & 0xf], packet + 2)) { return; } @@ -395,17 +395,17 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) str[0] = 0; if (vbi->verbose) fprintf (stderr, "Program Length: %02d:%02d", - packet[3] & 63, packet[2] & 63); + packet[3] & 63, packet[2] & 63); vbi->length_hour = packet[3] & 63; vbi->length_min = packet[2] & 63; snprintf (str, 32, "%02d:%02d", packet[3] & 63, packet[2] & 63); if (length > 4) { if (vbi->verbose) - fprintf (stderr, " Elapsed: %02d:%02d", packet[5] & 63, packet[4] & 63); + fprintf (stderr, " Elapsed: %02d:%02d", packet[5] & 63, packet[4] & 63); vbi->length_elapsed_hour = packet[5] & 63; vbi->length_elapsed_min = packet[4] & 63; snprintf (str, 32, "%02d:%02d/%02d:%02d", - packet[5] & 63, packet[4] & 63, packet[3] & 63, packet[2] & 63); + packet[5] & 63, packet[4] & 63, packet[3] & 63, packet[2] & 63); } else { vbi->length_elapsed_hour = 0; vbi->length_elapsed_min = 0; @@ -413,11 +413,11 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) if (length > 6) { if (vbi->verbose) - fprintf (stderr, ".%02d", packet[6] & 63); + fprintf (stderr, ".%02d", packet[6] & 63); vbi->length_elapsed_hour = packet[6] & 63; snprintf (str, 32, "%02d:%02d.%02d/%02d:%02d", - packet[5] & 63, packet[4] & 63, packet[6] & 63, - packet[3] & 63, packet[2] & 63); + packet[5] & 63, packet[4] & 63, packet[6] & 63, + packet[3] & 63, packet[2] & 63); } else { vbi->length_elapsed_hour = 0; } @@ -427,7 +427,7 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) } else if (packet[0] == 0x05 && packet[1] == 0x04) { if (vbi->verbose) fprintf (stderr, "Transmission Signal Identifier (TSID): 0x%04x\n", - packet[2] << 24 | packet[3] << 16 | packet[4] << 8 | packet[5]); + packet[2] << 24 | packet[3] << 16 | packet[4] << 8 | packet[5]); } else { /* unknown */ @@ -435,71 +435,71 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) fprintf (stderr, "Unknown XDS packet, class "); switch (packet[0]) { case 0x1: - if (vbi->verbose) - fprintf (stderr, "CURRENT start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "CURRENT start\n"); + break; case 0x2: - if (vbi->verbose) - fprintf (stderr, "CURRENT continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "CURRENT continue\n"); + break; case 0x3: - if (vbi->verbose) - fprintf (stderr, "FUTURE start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "FUTURE start\n"); + break; case 0x4: - if (vbi->verbose) - fprintf (stderr, "FUTURE continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "FUTURE continue\n"); + break; case 0x5: - if (vbi->verbose) - fprintf (stderr, "CHANNEL start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "CHANNEL start\n"); + break; case 0x6: - if (vbi->verbose) - fprintf (stderr, "CHANNEL continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "CHANNEL continue\n"); + break; case 0x7: - if (vbi->verbose) - fprintf (stderr, "MISC start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "MISC start\n"); + break; case 0x8: - if (vbi->verbose) - fprintf (stderr, "MISC continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "MISC continue\n"); + break; case 0x9: - if (vbi->verbose) - fprintf (stderr, "PUB start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "PUB start\n"); + break; case 0xa: - if (vbi->verbose) - fprintf (stderr, "PUB continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "PUB continue\n"); + break; case 0xb: - if (vbi->verbose) - fprintf (stderr, "RES start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "RES start\n"); + break; case 0xc: - if (vbi->verbose) - fprintf (stderr, "RES continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "RES continue\n"); + break; case 0xd: - if (vbi->verbose) - fprintf (stderr, "UNDEF start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "UNDEF start\n"); + break; case 0xe: - if (vbi->verbose) - fprintf (stderr, "UNDEF continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "UNDEF continue\n"); + break; } for (i = 0; i < length; i++) { if (vbi->verbose) - fprintf (stderr, "0x%02x ", packet[i]); + fprintf (stderr, "0x%02x ", packet[i]); } if (vbi->verbose) fprintf (stderr, "\n"); @@ -554,18 +554,18 @@ xds_decode (vbidata_t * vbi, int b1, int b2) #define T4 4 const unsigned int colours[] = { - 0xFFFFFFFFU, /* white */ - 0xFF00FF00U, /* green */ - 0xFF0000FFU, /* blue */ - 0xFF00C7C7U, /* cyan */ - 0xFFFF0000U, /* red */ - 0xFFFFFF00U, /* yellow */ - 0xFFC700C7U /* magenta */ + 0xFFFFFFFFU, /* white */ + 0xFF00FF00U, /* green */ + 0xFF0000FFU, /* blue */ + 0xFF00C7C7U, /* cyan */ + 0xFFFF0000U, /* red */ + 0xFFFFFF00U, /* yellow */ + 0xFFC700C7U /* magenta */ }; const int rows[] = { 11, - 0, /* unused */ + 0, /* unused */ 1, 2, 3, @@ -609,46 +609,46 @@ Process16b (vbidata_t * vbi, int bottom, int w1) /* This sets up colors and indenting */ if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - vbi->lastcount = (vbi->lastcount + 1) % 2; - return 1; + vbi->lastcount = (vbi->lastcount + 1) % 2; + return 1; } vbi->current_chan = (b1 & 8) >> 3; if (!bottom == vbi->wanttop) { - if (vbi->chan != vbi->current_chan) - return 0; + if (vbi->chan != vbi->current_chan) + return 0; } else - return 0; + return 0; vbi->current_ital = (b2 & 1); if (!(b2 & 16)) { - vbi->current_colour = colours[(b2 & 30) >> 1]; - vbi->current_indent = 0; + vbi->current_colour = colours[(b2 & 30) >> 1]; + vbi->current_indent = 0; } else { - vbi->current_colour = 0xFFFFFFFFU; /* white */ - vbi->current_indent = 4 * ((b2 & 14) >> 1); + vbi->current_colour = 0xFFFFFFFFU; /* white */ + vbi->current_indent = 4 * ((b2 & 14) >> 1); } vbi->current_row = rows[((b1 & 7) << 1) | ((b2 & 32) >> 5)]; vbi->current_ul = b2 & 1; if (vbi->verbose) - fprintf (stderr, "field: %d chan %d, ital %d, ul %d, colour 0x%x, " - "indent %d, row %d\n", bottom, vbi->current_chan, - vbi->current_ital, vbi->current_ul, vbi->current_colour, - vbi->current_indent, vbi->current_row); + fprintf (stderr, "field: %d chan %d, ital %d, ul %d, colour 0x%x, " + "indent %d, row %d\n", bottom, vbi->current_chan, + vbi->current_ital, vbi->current_ul, vbi->current_colour, + vbi->current_indent, vbi->current_row); if (!bottom == vbi->wanttop && - vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { + vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 0; + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 0; - vbiscreen_new_caption (vbi->vs, vbi->indent, vbi->ital, - vbi->colour, vbi->row); + vbiscreen_new_caption (vbi->vs, vbi->indent, vbi->ital, + vbi->colour, vbi->row); } @@ -660,15 +660,15 @@ Process16b (vbidata_t * vbi, int bottom, int w1) if ((b1 & 8) == 1) { /* Midrow code */ if (!vbi->initialised) - return 0; + return 0; if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - vbi->lastcount = (vbi->lastcount + 1) % 2; - return 1; + vbi->lastcount = (vbi->lastcount + 1) % 2; + return 1; } if (vbi->verbose) - fprintf (stderr, "Midrow TODO: Add me.\n"); + fprintf (stderr, "Midrow TODO: Add me.\n"); vbi->lastcode = (b1 << 8) | b2; return 1; @@ -676,229 +676,229 @@ Process16b (vbidata_t * vbi, int bottom, int w1) if ((b1 & 2) && !(b2 & 64)) { if (!vbi->initialised) - return 0; + return 0; if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - vbi->lastcount = (vbi->lastcount + 1) % 2; - return 1; + vbi->lastcount = (vbi->lastcount + 1) % 2; + return 1; } if (vbi->verbose) - fprintf (stderr, "Tab Offset: %d columns\n", b2 & 3); + fprintf (stderr, "Tab Offset: %d columns\n", b2 & 3); if (vbi->wanttext && vbi->current_istext && - vbi->current_chan == vbi->chan && !bottom == vbi->wanttop) { - vbiscreen_tab (vbi->vs, b2 & 3); + vbi->current_chan == vbi->chan && !bottom == vbi->wanttop) { + vbiscreen_tab (vbi->vs, b2 & 3); } vbi->lastcode = (b1 << 8) | b2; return 1; } switch ((code = b2 & 15)) { - case 0: /* POP-UP */ - case 5: /* ROLL UP 2 */ - case 6: /* ROLL UP 3 */ - case 7: /* ROLL UP 4 */ - case 9: /* PAINT-ON */ - case 10: /* TEXT */ - case 11: /* TEXT */ - vbi->initialised = 1; - if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - /* This is the repeated Control Code */ - vbi->lastcount = (vbi->lastcount + 1) % 2; - return 1; - } - switch (code) { - case 0: /* POP-UP */ - if (!vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Pop-Up\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 0; - vbiscreen_set_mode (vbi->vs, 1, POP_UP); - } - break; - case 5: /* ROLL UP 2 */ - if (!vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Roll-Up 2 (RU2)\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 0; - vbiscreen_set_mode (vbi->vs, 1, ROLL_2); - } - break; - case 6: /* ROLL UP 3 */ - if (!vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Roll-Up 3 (RU3)\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 0; - vbiscreen_set_mode (vbi->vs, 1, ROLL_3); - } - break; - case 7: /* ROLL UP 4 */ - if (!vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Roll-Up 4 (RU4)\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 0; - vbiscreen_set_mode (vbi->vs, 1, ROLL_4); - } - break; - case 9: /* PAINT-ON */ - if (!vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Paint-On\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 0; - vbiscreen_set_mode (vbi->vs, 1, PAINT_ON); - } - break; - case 10: /* TEXT */ - if (vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Text Restart\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 1; - vbiscreen_set_mode (vbi->vs, 0, 0); - } - break; - case 11: /* TEXT */ - if (vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Resume Text Display\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 1; - vbiscreen_set_mode (vbi->vs, 0, 0); - } - break; - default: /* impossible */ - break; - } - break; + case 0: /* POP-UP */ + case 5: /* ROLL UP 2 */ + case 6: /* ROLL UP 3 */ + case 7: /* ROLL UP 4 */ + case 9: /* PAINT-ON */ + case 10: /* TEXT */ + case 11: /* TEXT */ + vbi->initialised = 1; + if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { + /* This is the repeated Control Code */ + vbi->lastcount = (vbi->lastcount + 1) % 2; + return 1; + } + switch (code) { + case 0: /* POP-UP */ + if (!vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Pop-Up\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 0; + vbiscreen_set_mode (vbi->vs, 1, POP_UP); + } + break; + case 5: /* ROLL UP 2 */ + if (!vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Roll-Up 2 (RU2)\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 0; + vbiscreen_set_mode (vbi->vs, 1, ROLL_2); + } + break; + case 6: /* ROLL UP 3 */ + if (!vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Roll-Up 3 (RU3)\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 0; + vbiscreen_set_mode (vbi->vs, 1, ROLL_3); + } + break; + case 7: /* ROLL UP 4 */ + if (!vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Roll-Up 4 (RU4)\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 0; + vbiscreen_set_mode (vbi->vs, 1, ROLL_4); + } + break; + case 9: /* PAINT-ON */ + if (!vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Paint-On\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 0; + vbiscreen_set_mode (vbi->vs, 1, PAINT_ON); + } + break; + case 10: /* TEXT */ + if (vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Text Restart\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 1; + vbiscreen_set_mode (vbi->vs, 0, 0); + } + break; + case 11: /* TEXT */ + if (vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Resume Text Display\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 1; + vbiscreen_set_mode (vbi->vs, 0, 0); + } + break; + default: /* impossible */ + break; + } + break; case 1: - if (!vbi->initialised) - return 0; - if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - vbi->lastcount = (vbi->lastcount + 1) % 2; - } - if (!bottom == vbi->wanttop && vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { - if (vbi->verbose) - fprintf (stderr, "Backspace\n"); - vbiscreen_backspace (vbi->vs); - } - break; + if (!vbi->initialised) + return 0; + if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { + vbi->lastcount = (vbi->lastcount + 1) % 2; + } + if (!bottom == vbi->wanttop && vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { + if (vbi->verbose) + fprintf (stderr, "Backspace\n"); + vbiscreen_backspace (vbi->vs); + } + break; case 2: case 3: - if (!vbi->initialised) - return 0; - fprintf (stderr, "Reserved\n"); - break; + if (!vbi->initialised) + return 0; + fprintf (stderr, "Reserved\n"); + break; case 4: - if (!vbi->initialised) - return 0; - if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - vbi->lastcount = (vbi->lastcount + 1) % 2; - } - if (!bottom == vbi->wanttop && vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { - if (vbi->verbose) - fprintf (stderr, "Delete to End of Row\n"); - vbiscreen_delete_to_end (vbi->vs); - } - break; + if (!vbi->initialised) + return 0; + if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { + vbi->lastcount = (vbi->lastcount + 1) % 2; + } + if (!bottom == vbi->wanttop && vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { + if (vbi->verbose) + fprintf (stderr, "Delete to End of Row\n"); + vbiscreen_delete_to_end (vbi->vs); + } + break; case 8: - if (!vbi->initialised) - return 0; - if (vbi->verbose) - fprintf (stderr, "Flash On\n"); - break; + if (!vbi->initialised) + return 0; + if (vbi->verbose) + fprintf (stderr, "Flash On\n"); + break; case 12: case 13: case 14: case 15: - if (!vbi->initialised) - return 0; - if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - vbi->lastcount = (vbi->lastcount + 1) % 2; - return 1; - } + if (!vbi->initialised) + return 0; + if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { + vbi->lastcount = (vbi->lastcount + 1) % 2; + return 1; + } - switch (code) { - case 12: - /* Show buffer 1, Fill buffer 2 */ - if (!bottom == vbi->wanttop && - vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { - if (vbi->verbose) - fprintf (stderr, "Erase Displayed Memory\n"); - vbiscreen_erase_displayed (vbi->vs); - } - break; - case 13: - if (!bottom == vbi->wanttop && - vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { - if (vbi->verbose) - fprintf (stderr, "Carriage Return\n"); - vbiscreen_carriage_return (vbi->vs); - } - break; - case 14: - if (!bottom == vbi->wanttop && - vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { - if (vbi->verbose) - fprintf (stderr, "Erase Non-Displayed\n"); - vbiscreen_erase_non_displayed (vbi->vs); - } - break; - case 15: - /* Show buffer 2, Fill Buffer 1 */ - if (!bottom == vbi->wanttop && - vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { - if (vbi->verbose) - fprintf (stderr, "End Of Caption\n"); - vbiscreen_end_of_caption (vbi->vs); - } - break; - default: /* impossible */ - return 0; - break; - } - break; - default: /* Impossible */ - return 0; - break; + switch (code) { + case 12: + /* Show buffer 1, Fill buffer 2 */ + if (!bottom == vbi->wanttop && + vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { + if (vbi->verbose) + fprintf (stderr, "Erase Displayed Memory\n"); + vbiscreen_erase_displayed (vbi->vs); + } + break; + case 13: + if (!bottom == vbi->wanttop && + vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { + if (vbi->verbose) + fprintf (stderr, "Carriage Return\n"); + vbiscreen_carriage_return (vbi->vs); + } + break; + case 14: + if (!bottom == vbi->wanttop && + vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { + if (vbi->verbose) + fprintf (stderr, "Erase Non-Displayed\n"); + vbiscreen_erase_non_displayed (vbi->vs); + } + break; + case 15: + /* Show buffer 2, Fill Buffer 1 */ + if (!bottom == vbi->wanttop && + vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { + if (vbi->verbose) + fprintf (stderr, "End Of Caption\n"); + vbiscreen_end_of_caption (vbi->vs); + } + break; + default: /* impossible */ + return 0; + break; + } + break; + default: /* Impossible */ + return 0; + break; } if (vbi->lastcode != ((b1 << 8) | b2)) { @@ -932,33 +932,33 @@ Process16b (vbidata_t * vbi, int bottom, int w1) switch (b1) { case 0x1A: case 0x12: - /* use extcode1 */ - if (b1 > 31 && b2 > 31 && b1 <= 0x3F && b2 <= 0x3F) - if (vbi->verbose) - fprintf (stderr, "char %d (%c), char %d (%c)\n", b1, - extcode1[b1 - 32], b2, extcode1[b2 - 32]); + /* use extcode1 */ + if (b1 > 31 && b2 > 31 && b1 <= 0x3F && b2 <= 0x3F) + if (vbi->verbose) + fprintf (stderr, "char %d (%c), char %d (%c)\n", b1, + extcode1[b1 - 32], b2, extcode1[b2 - 32]); - break; + break; case 0x13: case 0x1B: - /* use extcode2 */ - if (b1 > 31 && b2 > 31 && b1 <= 0x3F && b2 <= 0x3F) - if (vbi->verbose) - fprintf (stderr, "char %d (%c), char %d (%c)\n", b1, - extcode2[b1 - 32], b2, extcode2[b2 - 32]); + /* use extcode2 */ + if (b1 > 31 && b2 > 31 && b1 <= 0x3F && b2 <= 0x3F) + if (vbi->verbose) + fprintf (stderr, "char %d (%c), char %d (%c)\n", b1, + extcode2[b1 - 32], b2, extcode2[b2 - 32]); - break; + break; case 0x11: case 0x19: - /* use wcode */ - if (b1 > 31 && b2 > 31 && b1 <= 0x3F && b2 <= 0x3F) - if (vbi->verbose) - fprintf (stderr, "char %d (%c), char %d (%c)\n", b1, - wccode[b1 - 32], b2, wccode[b2 - 32]); + /* use wcode */ + if (b1 > 31 && b2 > 31 && b1 <= 0x3F && b2 <= 0x3F) + if (vbi->verbose) + fprintf (stderr, "char %d (%c), char %d (%c)\n", b1, + wccode[b1 - 32], b2, wccode[b2 - 32]); - break; + break; default: - break; + break; } } else if (b1) { /* use ccode */ @@ -968,13 +968,13 @@ Process16b (vbidata_t * vbi, int bottom, int w1) b2 = 32; if (vbi->verbose) fprintf (stderr, "vbidata: data: %c %c\n", ccode[b1 - 32], - ccode[b2 - 32]); + ccode[b2 - 32]); vbiscreen_print (vbi->vs, ccode[b1 - 32], ccode[b2 - 32]); } return 1; -} /* Process16b */ +} /* Process16b */ int ProcessLine (vbidata_t * vbi, unsigned char *s, int bottom) @@ -989,7 +989,7 @@ ProcessLine (vbidata_t * vbi, unsigned char *s, int bottom) w1 = ccdecode (s); return Process16b (vbi, bottom, w1); -} /* ProcessLine */ +} /* ProcessLine */ @@ -1006,7 +1006,7 @@ vbidata_new_file (const char *filename, vbiscreen_t * vs, vbi->fd = open (filename, O_RDONLY); if (vbi->fd < 0) { fprintf (stderr, "vbidata: Can't open %s: %s\n", - filename, strerror (errno)); + filename, strerror (errno)); free (vbi); return 0; } diff --git a/gst/vbidec/vbiscreen.c b/gst/vbidec/vbiscreen.c index f441ba7852..bad96b5283 100644 --- a/gst/vbidec/vbiscreen.c +++ b/gst/vbidec/vbiscreen.c @@ -144,16 +144,16 @@ struct vbiscreen_s int frame_height; int frame_aspect; - int x, y; /* where to draw console */ - int width, height; /* the size box we have to draw in */ + int x, y; /* where to draw console */ + int width, height; /* the size box we have to draw in */ int rowheight, charwidth; - int curx, cury; /* cursor position */ - int rows, cols; /* 32 cols 15 rows */ - int captions, style; /* CC (1) or Text (0), RU2 RU3 RU4 POP_UP PAINT_ON */ - int first_line; /* where to start drawing */ + int curx, cury; /* cursor position */ + int rows, cols; /* 32 cols 15 rows */ + int captions, style; /* CC (1) or Text (0), RU2 RU3 RU4 POP_UP PAINT_ON */ + int first_line; /* where to start drawing */ int curbuffer; - int top_of_screen; /* a pointer into line[] */ + int top_of_screen; /* a pointer into line[] */ int indent; int got_eoc; int scroll; @@ -184,8 +184,8 @@ vbiscreen_new (int video_width, int video_height, vs->frame_aspect = video_aspect; vs->curx = 0; vs->cury = 0; - vs->fgcolour = 0xFFFFFFFFU; /* white */ - vs->bgcolour = 0xFF000000U; /* black */ + vs->fgcolour = 0xFFFFFFFFU; /* white */ + vs->bgcolour = 0xFF000000U; /* black */ vs->bg_luma = 16; vs->bg_cb = 128; vs->bg_cr = 128; @@ -216,7 +216,7 @@ vbiscreen_new (int video_width, int video_height, vs->fontfile = "./FreeMonoBold.ttf"; vs->line[0] = osd_string_new (vs->fontfile, fontsize, - video_width, video_height, video_aspect, user_data); + video_width, video_height, video_aspect, user_data); } if (!vs->line[0]) { @@ -232,15 +232,15 @@ vbiscreen_new (int video_width, int video_height, for (i = 0; i < ROWS; i++) { vs->line[i] = osd_string_new (vs->fontfile, fontsize, - video_width, video_height, video_aspect, user_data); + video_width, video_height, video_aspect, user_data); if (!vs->line[i]) { fprintf (stderr, "vbiscreen: Could not allocate a line.\n"); vbiscreen_delete (vs); return NULL; } osd_string_set_colour_rgb (vs->line[i], - (vs->fgcolour & 0xff0000) >> 16, - (vs->fgcolour & 0xff00) >> 8, (vs->fgcolour & 0xff)); + (vs->fgcolour & 0xff0000) >> 16, + (vs->fgcolour & 0xff00) >> 8, (vs->fgcolour & 0xff)); osd_string_show_text (vs->line[i], " ", 0); } memset (vs->text, 0, 2 * ROWS * COLS); @@ -418,7 +418,7 @@ scroll_screen (vbiscreen_t * vs) start_row = (vs->first_line + vs->top_of_screen) % (2 * ROWS); if (vs->verbose) fprintf (stderr, "start row : %d first line %d\n ", start_row, - vs->first_line); + vs->first_line); /* zero out top row */ memset ((char *) (vs->text + start_row * COLS), 0, COLS); @@ -444,7 +444,7 @@ vbiscreen_new_caption (vbiscreen_t * vs, int indent, int ital, return; if (vs->verbose) fprintf (stderr, "indent: %d, ital: %d, colour: 0x%x, row: %d\n", indent, - ital, colour, row); + ital, colour, row); if (0 && vs->captions && vs->style <= ROLL_4 && vs->style) { if (row != vs->cury + 1) { @@ -476,22 +476,22 @@ vbiscreen_set_mode (vbiscreen_t * vs, int caption, int style) fprintf (stderr, "Caption: %d ", caption); switch (style) { case ROLL_2: - fprintf (stderr, "ROLL 2\n"); - break; + fprintf (stderr, "ROLL 2\n"); + break; case ROLL_3: - fprintf (stderr, "ROLL 3\n"); - break; + fprintf (stderr, "ROLL 3\n"); + break; case ROLL_4: - fprintf (stderr, "ROLL 4\n"); - break; + fprintf (stderr, "ROLL 4\n"); + break; case POP_UP: - fprintf (stderr, "POP UP\n"); - break; + fprintf (stderr, "POP UP\n"); + break; case PAINT_ON: - fprintf (stderr, "PAINT ON\n"); - break; + fprintf (stderr, "PAINT ON\n"); + break; default: - break; + break; } } if (!caption) { @@ -510,21 +510,21 @@ vbiscreen_set_mode (vbiscreen_t * vs, int caption, int style) case ROLL_2: case ROLL_3: case ROLL_4: - if (vs->style == style) { - return; - } - vs->first_line = ROWS - (style - 4); + if (vs->style == style) { + return; + } + vs->first_line = ROWS - (style - 4); - if (vs->verbose) - fprintf (stderr, "first_line %d\n", vs->first_line); + if (vs->verbose) + fprintf (stderr, "first_line %d\n", vs->first_line); - vs->cury = ROWS - 1; - break; + vs->cury = ROWS - 1; + break; case POP_UP: - vs->got_eoc = 0; - break; + vs->got_eoc = 0; + break; case PAINT_ON: - break; + break; } } @@ -586,7 +586,7 @@ vbiscreen_delete_to_end (vbiscreen_t * vs) vbiscreen_clear_current_cell (vs); vs->curx++; } - vs->curx = COLS - 1; /* is this right ? */ + vs->curx = COLS - 1; /* is this right ? */ if (vs->captions && vs->style && vs->style != POP_UP) update_row (vs); } @@ -631,7 +631,7 @@ vbiscreen_erase_non_displayed (vbiscreen_t * vs) if (vs->captions && vs->style == POP_UP) { memset (vs->buffers + vs->curbuffer * COLS * ROWS + vs->cury * COLS, 0, - COLS); + COLS); // clear_hidden_pop( vs ); } else if (vs->captions && vs->style && vs->style <= ROLL_4) { clear_hidden_roll (vs); @@ -711,17 +711,17 @@ vbiscreen_print (vbiscreen_t * vs, char c1, char c2) /* this all gets displayed at another time */ if (vs->curx != COLS - 1) { *(vs->buffers + vs->curx + vs->curbuffer * ROWS * COLS + - vs->cury * COLS) = c1; + vs->cury * COLS) = c1; vs->curx++; } if (vs->curx != COLS - 1 && c2) { *(vs->buffers + vs->curx + vs->curbuffer * ROWS * COLS + - vs->cury * COLS) = c2; + vs->cury * COLS) = c2; vs->curx++; } else if (c2) { *(vs->buffers + vs->curx + vs->curbuffer * ROWS * COLS + - vs->cury * COLS) = c2; + vs->cury * COLS) = c2; } } @@ -783,40 +783,40 @@ vbiscreen_composite_packed422_scanline (vbiscreen_t * vs, if (0 && !vs->captions) blit_colour_packed422_scanline (output + (vs->x * 2), vs->width, - vs->bg_luma, vs->bg_cb, vs->bg_cr); + vs->bg_luma, vs->bg_cb, vs->bg_cr); index = vs->top_of_screen * COLS; x = (vs->x + vs->charwidth) & ~1; for (row = 0; row < ROWS; row++) { y = vs->y + row * vs->rowheight + vs->rowheight; if (osd_string_visible (vs->line[row])) { - if (scanline >= y && scanline < y + vs->rowheight) { + if (scanline >= y && scanline < y + vs->rowheight) { - int startx; - int strx; + int startx; + int strx; - startx = x - xpos; - strx = 0; + startx = x - xpos; + strx = 0; - if (startx < 0) { - strx = -startx; - startx = 0; - } + if (startx < 0) { + strx = -startx; + startx = 0; + } - if (startx < width) { + if (startx < width) { - if (vs->captions) - blit_colour_packed422_scanline (output + (startx * 2), - osd_string_get_width (vs->line[row]), - vs->bg_luma, vs->bg_cb, vs->bg_cr); + if (vs->captions) + blit_colour_packed422_scanline (output + (startx * 2), + osd_string_get_width (vs->line[row]), + vs->bg_luma, vs->bg_cb, vs->bg_cr); - osd_string_composite_packed422_scanline (vs->line[row], - output + (startx * 2), - output + (startx * 2), width - startx, strx, scanline - y); - } - } - index++; + osd_string_composite_packed422_scanline (vs->line[row], + output + (startx * 2), + output + (startx * 2), width - startx, strx, scanline - y); + } + } + index++; } } } diff --git a/gst/videocrop/gstvideocrop.c b/gst/videocrop/gstvideocrop.c index f13610bcfb..5e4c0b38f4 100644 --- a/gst/videocrop/gstvideocrop.c +++ b/gst/videocrop/gstvideocrop.c @@ -135,9 +135,10 @@ gst_video_crop_get_type (void) 0, (GInstanceInitFunc) gst_video_crop_init, }; + video_crop_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstVideoCrop", - &video_crop_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstVideoCrop", + &video_crop_info, 0); } return video_crop_type; } @@ -167,16 +168,16 @@ gst_video_crop_class_init (GstVideoCropClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LEFT, g_param_spec_int ("left", "Left", "Pixels to crop at left", - 0, G_MAXINT, 0, G_PARAM_READWRITE)); + 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_RIGHT, g_param_spec_int ("right", "Right", "Pixels to crop at right", - 0, G_MAXINT, 0, G_PARAM_READWRITE)); + 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TOP, g_param_spec_int ("top", "Top", "Pixels to crop at top", - 0, G_MAXINT, 0, G_PARAM_READWRITE)); + 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BOTTOM, g_param_spec_int ("bottom", "Bottom", "Pixels to crop at bottom", - 0, G_MAXINT, 0, G_PARAM_READWRITE)); + 0, G_MAXINT, 0, G_PARAM_READWRITE)); gobject_class->set_property = gst_video_crop_set_property; gobject_class->get_property = gst_video_crop_get_property; @@ -369,8 +370,8 @@ gst_video_crop_chain (GstPad * pad, GstData * _data) switch (GST_EVENT_TYPE (event)) { default: - gst_pad_event_default (pad, event); - break; + gst_pad_event_default (pad, event); + break; } return; } diff --git a/gst/videodrop/gstvideodrop.c b/gst/videodrop/gstvideodrop.c index 6a83fd9de6..e210f89675 100644 --- a/gst/videodrop/gstvideodrop.c +++ b/gst/videodrop/gstvideodrop.c @@ -96,7 +96,7 @@ gst_videodrop_get_type (void) }; videodrop_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstVideodrop", &videodrop_info, 0); + "GstVideodrop", &videodrop_info, 0); } return videodrop_type; @@ -124,7 +124,7 @@ gst_videodrop_class_init (GstVideodropClass * klass) g_object_class_install_property (object_class, ARG_SPEED, g_param_spec_float ("speed", "Speed", - "Output speed (relative to input)", 0.01, 100, 1, G_PARAM_READWRITE)); + "Output speed (relative to input)", 0.01, 100, 1, G_PARAM_READWRITE)); object_class->set_property = gst_videodrop_set_property; object_class->get_property = gst_videodrop_get_property; @@ -151,7 +151,7 @@ gst_videodrop_getcaps (GstPad * pad) structure = gst_caps_get_structure (caps, i); gst_structure_set (structure, - "framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL); + "framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL); } return caps; @@ -244,13 +244,13 @@ gst_videodrop_chain (GstPad * pad, GstData * data) gint64 time; if (gst_event_discont_get_value (event, GST_FORMAT_TIME, &time)) { - videodrop->time_adjust = time; - videodrop->total = videodrop->pass = 0; + videodrop->time_adjust = time; + videodrop->total = videodrop->pass = 0; } else { - GST_ELEMENT_ERROR (videodrop, STREAM, TOO_LAZY, (NULL), - ("Received discont, but no time information")); - gst_event_unref (event); - return; + GST_ELEMENT_ERROR (videodrop, STREAM, TOO_LAZY, (NULL), + ("Received discont, but no time information")); + gst_event_unref (event); + return; } } @@ -262,7 +262,7 @@ gst_videodrop_chain (GstPad * pad, GstData * data) videodrop->total++; while (((GST_BUFFER_TIMESTAMP (buf) - videodrop->time_adjust) * - videodrop->to_fps * videodrop->speed / GST_SECOND) >= + videodrop->to_fps * videodrop->speed / GST_SECOND) >= videodrop->pass) { /* since we write to the struct (time/duration), we need a new struct, * but we don't want to copy around data - a subbuffer is the easiest @@ -271,7 +271,7 @@ gst_videodrop_chain (GstPad * pad, GstData * data) /* adjust timestamp/duration and push forward */ GST_BUFFER_TIMESTAMP (copy) = videodrop->time_adjust / videodrop->speed + - GST_SECOND * videodrop->pass / videodrop->to_fps; + GST_SECOND * videodrop->pass / videodrop->to_fps; GST_BUFFER_DURATION (copy) = GST_SECOND / videodrop->to_fps; gst_pad_push (videodrop->srcpad, GST_DATA (copy)); diff --git a/gst/virtualdub/gstvirtualdub.c b/gst/virtualdub/gstvirtualdub.c index 2495d449e1..cdaccf9fbe 100644 --- a/gst/virtualdub/gstvirtualdub.c +++ b/gst/virtualdub/gstvirtualdub.c @@ -46,21 +46,21 @@ gst_virtualdub_src_factory (void) if (!templ) { templ = GST_PAD_TEMPLATE_NEW ("src", - GST_PAD_SRC, - GST_PAD_ALWAYS, - GST_CAPS_NEW ("virtualdub_src", - "video/x-raw-rgb", - "bpp", GST_PROPS_INT (32), - "depth", GST_PROPS_INT (32), - "endianness", GST_PROPS_INT (G_BYTE_ORDER), - "red_mask", GST_PROPS_INT (0xff0000), - "green_mask", GST_PROPS_INT (0xff00), - "blue_mask", GST_PROPS_INT (0xff), - "width", GST_PROPS_INT_RANGE (16, 4096), - "height", GST_PROPS_INT_RANGE (16, 4096), - "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT) - ) - ); + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_CAPS_NEW ("virtualdub_src", + "video/x-raw-rgb", + "bpp", GST_PROPS_INT (32), + "depth", GST_PROPS_INT (32), + "endianness", GST_PROPS_INT (G_BYTE_ORDER), + "red_mask", GST_PROPS_INT (0xff0000), + "green_mask", GST_PROPS_INT (0xff00), + "blue_mask", GST_PROPS_INT (0xff), + "width", GST_PROPS_INT_RANGE (16, 4096), + "height", GST_PROPS_INT_RANGE (16, 4096), + "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT) + ) + ); } return templ; } @@ -72,21 +72,21 @@ gst_virtualdub_sink_factory (void) if (!templ) { templ = GST_PAD_TEMPLATE_NEW ("sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_CAPS_NEW ("virtualdub_sink", - "video/x-raw-rgb", - "bpp", GST_PROPS_INT (32), - "depth", GST_PROPS_INT (32), - "endianness", GST_PROPS_INT (G_BYTE_ORDER), - "red_mask", GST_PROPS_INT (0xff0000), - "green_mask", GST_PROPS_INT (0xff00), - "blue_mask", GST_PROPS_INT (0xff), - "width", GST_PROPS_INT_RANGE (16, 4096), - "height", GST_PROPS_INT_RANGE (16, 4096), - "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT) - ) - ); + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_CAPS_NEW ("virtualdub_sink", + "video/x-raw-rgb", + "bpp", GST_PROPS_INT (32), + "depth", GST_PROPS_INT (32), + "endianness", GST_PROPS_INT (G_BYTE_ORDER), + "red_mask", GST_PROPS_INT (0xff0000), + "green_mask", GST_PROPS_INT (0xff00), + "blue_mask", GST_PROPS_INT (0xff), + "width", GST_PROPS_INT_RANGE (16, 4096), + "height", GST_PROPS_INT_RANGE (16, 4096), + "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT) + ) + ); } return templ; } @@ -99,16 +99,16 @@ plugin_init (GModule * module, GstPlugin * plugin) while (_elements[i].name) { factory = gst_element_factory_new (_elements[i].name, - (_elements[i].type) (), _elements[i].details); + (_elements[i].type) (), _elements[i].details); if (!factory) { g_warning ("gst_virtualdub_new failed for `%s'", _elements[i].name); continue; } gst_element_factory_add_pad_template (factory, - gst_virtualdub_src_factory ()); + gst_virtualdub_src_factory ()); gst_element_factory_add_pad_template (factory, - gst_virtualdub_sink_factory ()); + gst_virtualdub_sink_factory ()); gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); if (_elements[i].factoryinit) { diff --git a/gst/virtualdub/gstxsharpen.c b/gst/virtualdub/gstxsharpen.c index df4d454736..a8d5413c8f 100644 --- a/gst/virtualdub/gstxsharpen.c +++ b/gst/virtualdub/gstxsharpen.c @@ -107,8 +107,8 @@ gst_xsharpen_get_type (void) }; xsharpen_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstXsharpen", &xsharpen_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstXsharpen", &xsharpen_info, + 0); } return xsharpen_type; } @@ -126,11 +126,11 @@ gst_xsharpen_class_init (GstXsharpenClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STRENGTH, g_param_spec_int ("strength", "strength", "strength", - 0, 255, 255, (GParamFlags) G_PARAM_READWRITE)); + 0, 255, 255, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_THRESHOLD, g_param_spec_int ("threshold", "threshold", "threshold", - 0, 255, 255, (GParamFlags) G_PARAM_READWRITE)); + 0, 255, 255, (GParamFlags) G_PARAM_READWRITE)); gobject_class->set_property = gst_xsharpen_set_property; gobject_class->get_property = gst_xsharpen_get_property; @@ -204,10 +204,10 @@ gst_xsharpen_chain (GstPad * pad, GstData * _data) src = (Pixel *) ((char *) src_buf + (xsharpen->height - - 1) * xsharpen->srcpitch); + 1) * xsharpen->srcpitch); dst = (Pixel *) ((char *) dst_buf + (xsharpen->height - - 1) * xsharpen->dstpitch); + 1) * xsharpen->dstpitch); for (x = 0; x < xsharpen->width; x++) { dst[x] = src[x]; @@ -252,100 +252,100 @@ gst_xsharpen_chain (GstPad * pad, GstData * _data) p = ((Pixel32 *) ((char *) src - xsharpen->srcpitch))[x - 1]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = ((Pixel32 *) ((char *) src - xsharpen->srcpitch))[x]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = ((Pixel32 *) ((char *) src - xsharpen->srcpitch))[x + 1]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = src[x - 1]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = src[x]; lumac = luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = src[x + 1]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = ((Pixel32 *) ((char *) src + xsharpen->srcpitch))[x - 1]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = ((Pixel32 *) ((char *) src + xsharpen->srcpitch))[x]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = ((Pixel32 *) ((char *) src + xsharpen->srcpitch))[x + 1]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } /* Determine whether the current pixel is closer to the @@ -356,32 +356,32 @@ gst_xsharpen_chain (GstPad * pad, GstData * _data) p = -1; if (xsharpen->strength != 0) { - mindiff = lumac - lumamin; - maxdiff = lumamax - lumac; - if (mindiff > maxdiff) { - if (maxdiff < xsharpen->threshold) { - p = max; - } - } else { - if (mindiff < xsharpen->threshold) { - p = min; - } - } + mindiff = lumac - lumamin; + maxdiff = lumamax - lumac; + if (mindiff > maxdiff) { + if (maxdiff < xsharpen->threshold) { + p = max; + } + } else { + if (mindiff < xsharpen->threshold) { + p = min; + } + } } if (p == -1) { - dst[x] = src[x]; + dst[x] = src[x]; } else { - R = (src[x] >> 16) & 0xff; - G = (src[x] >> 8) & 0xff; - B = src[x] & 0xff; - r = (p >> 16) & 0xff; - g = (p >> 8) & 0xff; - b = p & 0xff; - r = (xsharpen->strength * r + xsharpen->strengthinv * R) / 255; - g = (xsharpen->strength * g + xsharpen->strengthinv * G) / 255; - b = (xsharpen->strength * b + xsharpen->strengthinv * B) / 255; - dst[x] = (r << 16) | (g << 8) | b; + R = (src[x] >> 16) & 0xff; + G = (src[x] >> 8) & 0xff; + B = src[x] & 0xff; + r = (p >> 16) & 0xff; + g = (p >> 8) & 0xff; + b = p & 0xff; + r = (xsharpen->strength * r + xsharpen->strengthinv * R) / 255; + g = (xsharpen->strength * g + xsharpen->strengthinv * G) / 255; + b = (xsharpen->strength * b + xsharpen->strengthinv * B) / 255; + dst[x] = (r << 16) | (g << 8) | b; } } src = (Pixel *) ((char *) src + xsharpen->srcpitch); diff --git a/gst/y4m/gsty4mencode.c b/gst/y4m/gsty4mencode.c index 3c9c9fbe94..773f96b844 100644 --- a/gst/y4m/gsty4mencode.c +++ b/gst/y4m/gsty4mencode.c @@ -92,8 +92,9 @@ gst_y4mencode_get_type (void) 0, (GInstanceInitFunc) gst_y4mencode_init, }; + y4mencode_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstY4mEncode", &y4mencode_info, 0); + "GstY4mEncode", &y4mencode_info, 0); } return y4mencode_type; } @@ -135,9 +136,9 @@ gst_y4mencode_sinkconnect (GstPad * pad, const GstCaps * caps) gdouble fps; gdouble framerates[] = { 00.000, - 23.976, 24.000, /* 24fps movie */ - 25.000, /* PAL */ - 29.970, 30.000, /* NTSC */ + 23.976, 24.000, /* 24fps movie */ + 25.000, /* PAL */ + 29.970, 30.000, /* NTSC */ 50.000, 59.940, 60.000 }; @@ -157,10 +158,10 @@ gst_y4mencode_sinkconnect (GstPad * pad, const GstCaps * caps) idx = i; } else { gdouble old_diff = fabs (framerates[idx] - fps), - new_diff = fabs (framerates[i] - fps); + new_diff = fabs (framerates[i] - fps); if (new_diff < old_diff) { - idx = i; + idx = i; } } } diff --git a/sys/cdrom/gstcdplayer.c b/sys/cdrom/gstcdplayer.c index f76e9df6f8..a53b2bc8e3 100644 --- a/sys/cdrom/gstcdplayer.c +++ b/sys/cdrom/gstcdplayer.c @@ -84,7 +84,7 @@ cdplayer_get_type (void) }; cdplayer_type = - g_type_register_static (GST_TYPE_BIN, "CDPlayer", &cdplayer_info, 0); + g_type_register_static (GST_TYPE_BIN, "CDPlayer", &cdplayer_info, 0); } return cdplayer_type; @@ -120,25 +120,25 @@ cdplayer_class_init (CDPlayerClass * klass) g_object_class_install_property (gobject_klass, ARG_DEVICE, g_param_spec_string ("device", "device", "CDROM device", NULL, - G_PARAM_READWRITE)); + G_PARAM_READWRITE)); g_object_class_install_property (gobject_klass, ARG_NUM_TRACKS, g_param_spec_int ("num_tracks", "num_tracks", "Number of Tracks", - G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); + G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); g_object_class_install_property (gobject_klass, ARG_START_TRACK, g_param_spec_int ("start_track", "start_track", - "Track to start playback on", 1, - CDPLAYER_MAX_TRACKS - 1, 1, G_PARAM_READWRITE)); + "Track to start playback on", 1, + CDPLAYER_MAX_TRACKS - 1, 1, G_PARAM_READWRITE)); g_object_class_install_property (gobject_klass, ARG_END_TRACK, g_param_spec_int ("end_track", "end_track", - "Track to end playback on", 0, - CDPLAYER_MAX_TRACKS - 1, 0, G_PARAM_READWRITE)); + "Track to end playback on", 0, + CDPLAYER_MAX_TRACKS - 1, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_klass, ARG_CURRENT_TRACK, g_param_spec_int ("current_track", "current_track", - "Current track playing", 1, - CDPLAYER_MAX_TRACKS - 1, 1, G_PARAM_READABLE)); + "Current track playing", 1, + CDPLAYER_MAX_TRACKS - 1, 1, G_PARAM_READABLE)); g_object_class_install_property (gobject_klass, ARG_CDDB_DISCID, g_param_spec_uint ("cddb_discid", "cddb_discid", "CDDB Disc ID", - 0, G_MAXUINT, 1, G_PARAM_READABLE)); + 0, G_MAXUINT, 1, G_PARAM_READABLE)); cdplayer_signals[TRACK_CHANGE] = g_signal_new ("track-change", G_TYPE_FROM_CLASS (klass), @@ -178,7 +178,7 @@ cdplayer_set_property (GObject * object, guint prop_id, const GValue * value, case ARG_DEVICE: // FIXME prolly should uhh.. stop it or something if (cdp->device) { - g_free (cdp->device); + g_free (cdp->device); } cdp->device = g_strdup (g_value_get_string (value)); @@ -261,13 +261,13 @@ cdplayer_iterate (GstBin * bin) case CD_PLAYING: current_track = cd_current_track (CDPLAYER_CD (cdp)); if (current_track > cdp->end_track && cdp->end_track != 0) { - return FALSE; + return FALSE; } if (current_track != -1 && current_track != cdp->current_track) { - cdp->current_track = current_track; - g_signal_emit (G_OBJECT (cdp), cdplayer_signals[TRACK_CHANGE], 0, - cdp->current_track); + cdp->current_track = current_track; + g_signal_emit (G_OBJECT (cdp), cdplayer_signals[TRACK_CHANGE], 0, + cdp->current_track); } return TRUE; @@ -301,44 +301,44 @@ cdplayer_change_state (GstElement * element) switch (pending) { case GST_STATE_READY: if (state != GST_STATE_PAUSED) { - if (cd_init (CDPLAYER_CD (cdp), cdp->device) == FALSE) { - return GST_STATE_FAILURE; - } - cdp->num_tracks = cdp->cd.num_tracks; - cdp->cddb_discid = cd_cddb_discid (CDPLAYER_CD (cdp)); + if (cd_init (CDPLAYER_CD (cdp), cdp->device) == FALSE) { + return GST_STATE_FAILURE; + } + cdp->num_tracks = cdp->cd.num_tracks; + cdp->cddb_discid = cd_cddb_discid (CDPLAYER_CD (cdp)); } break; case GST_STATE_PAUSED: /* ready->paused is not useful */ if (state != GST_STATE_READY) { - if (cd_pause (CDPLAYER_CD (cdp)) == FALSE) { - return GST_STATE_FAILURE; - } + if (cd_pause (CDPLAYER_CD (cdp)) == FALSE) { + return GST_STATE_FAILURE; + } - cdp->paused = TRUE; + cdp->paused = TRUE; } break; case GST_STATE_PLAYING: if (cdp->paused == TRUE) { - if (cd_resume (CDPLAYER_CD (cdp)) == FALSE) { - return GST_STATE_FAILURE; - } + if (cd_resume (CDPLAYER_CD (cdp)) == FALSE) { + return GST_STATE_FAILURE; + } - cdp->paused = FALSE; + cdp->paused = FALSE; } else { - if (cd_start (CDPLAYER_CD (cdp), cdp->start_track, - cdp->end_track) == FALSE) { - return GST_STATE_FAILURE; - } + if (cd_start (CDPLAYER_CD (cdp), cdp->start_track, + cdp->end_track) == FALSE) { + return GST_STATE_FAILURE; + } } break; case GST_STATE_NULL: /* stop & close fd */ if (cd_stop (CDPLAYER_CD (cdp)) == FALSE - || cd_close (CDPLAYER_CD (cdp)) == FALSE) { - return GST_STATE_FAILURE; + || cd_close (CDPLAYER_CD (cdp)) == FALSE) { + return GST_STATE_FAILURE; } break; @@ -361,5 +361,5 @@ plugin_init (GstPlugin * plugin) GST_TYPE_CDPLAYER); } -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, "cdplayer", "CD Player", plugin_init, VERSION, GST_LICENSE, /* ? */ +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, "cdplayer", "CD Player", plugin_init, VERSION, GST_LICENSE, /* ? */ GST_PACKAGE, GST_ORIGIN); diff --git a/sys/dxr3/ac3_padder.c b/sys/dxr3/ac3_padder.c index 606923a75c..9e778bac4c 100644 --- a/sys/dxr3/ac3_padder.c +++ b/sys/dxr3/ac3_padder.c @@ -152,101 +152,101 @@ ac3p_parse (ac3_padder * padder) while (padder->remaining > 0) { switch (padder->state) { case AC3P_STATE_SYNC1: - if (*(padder->in_ptr) == 0x0b) { - /* The first sync byte was found. Go to the next state. */ - padder->frame.sync_byte1 = 0x0b; - padder->state = AC3P_STATE_SYNC2; - } - ac3p_in_fw (padder); - break; + if (*(padder->in_ptr) == 0x0b) { + /* The first sync byte was found. Go to the next state. */ + padder->frame.sync_byte1 = 0x0b; + padder->state = AC3P_STATE_SYNC2; + } + ac3p_in_fw (padder); + break; case AC3P_STATE_SYNC2: - if (*(padder->in_ptr) == 0x77) { - /* The second sync byte was seen right after the first. Go to - the next state. */ - padder->frame.sync_byte2 = 0x77; - padder->state = AC3P_STATE_HEADER; + if (*(padder->in_ptr) == 0x77) { + /* The second sync byte was seen right after the first. Go to + the next state. */ + padder->frame.sync_byte2 = 0x77; + padder->state = AC3P_STATE_HEADER; - /* Skip one byte. */ - ac3p_in_fw (padder); + /* Skip one byte. */ + ac3p_in_fw (padder); - /* Prepare for reading the header. */ - padder->out_ptr = (guchar *) & (padder->frame.crc1); - /* Discount the 2 sync bytes from the header size. */ - padder->bytes_to_copy = AC3P_AC3_HEADER_SIZE - 2; - } else { - /* The second sync byte was not seen. Go back to the - first state. */ - padder->state = AC3P_STATE_SYNC1; - } - break; + /* Prepare for reading the header. */ + padder->out_ptr = (guchar *) & (padder->frame.crc1); + /* Discount the 2 sync bytes from the header size. */ + padder->bytes_to_copy = AC3P_AC3_HEADER_SIZE - 2; + } else { + /* The second sync byte was not seen. Go back to the + first state. */ + padder->state = AC3P_STATE_SYNC1; + } + break; case AC3P_STATE_HEADER: - if (padder->bytes_to_copy > 0) { - /* Copy one byte. */ - *(padder->out_ptr) = *(padder->in_ptr); - ac3p_in_fw (padder); - ac3p_out_fw (padder); - } else { - int fscod; + if (padder->bytes_to_copy > 0) { + /* Copy one byte. */ + *(padder->out_ptr) = *(padder->in_ptr); + ac3p_in_fw (padder); + ac3p_out_fw (padder); + } else { + int fscod; - /* The header is ready: */ + /* The header is ready: */ - fscod = (padder->frame.code >> 6) & 0x03; + fscod = (padder->frame.code >> 6) & 0x03; - /* Calculate the frame size. */ - padder->ac3_frame_size = - 2 * frmsizecod_tbl[padder->frame.code & 0x3f].frm_size[fscod]; + /* Calculate the frame size. */ + padder->ac3_frame_size = + 2 * frmsizecod_tbl[padder->frame.code & 0x3f].frm_size[fscod]; - /* Set up the IEC header. */ - if (padder->ac3_frame_size > 0) { - padder->frame.header[4] = IEC61937_DATA_TYPE_AC3; - } else { - /* Don't know what it is, better be careful. */ - padder->state = AC3P_STATE_SYNC1; - break; - } - padder->frame.header[5] = 0x00; - padder->frame.header[6] = (padder->ac3_frame_size * 8) & 0xFF; - padder->frame.header[7] = ((padder->ac3_frame_size * 8) >> 8) & 0xFF; + /* Set up the IEC header. */ + if (padder->ac3_frame_size > 0) { + padder->frame.header[4] = IEC61937_DATA_TYPE_AC3; + } else { + /* Don't know what it is, better be careful. */ + padder->state = AC3P_STATE_SYNC1; + break; + } + padder->frame.header[5] = 0x00; + padder->frame.header[6] = (padder->ac3_frame_size * 8) & 0xFF; + padder->frame.header[7] = ((padder->ac3_frame_size * 8) >> 8) & 0xFF; - /* Prepare for reading the body. */ - padder->bytes_to_copy = padder->ac3_frame_size - AC3P_AC3_HEADER_SIZE; - padder->state = AC3P_STATE_CONTENT; - } - break; + /* Prepare for reading the body. */ + padder->bytes_to_copy = padder->ac3_frame_size - AC3P_AC3_HEADER_SIZE; + padder->state = AC3P_STATE_CONTENT; + } + break; case AC3P_STATE_CONTENT: - if (padder->bytes_to_copy > 0) { - /* Copy one byte. */ - *(padder->out_ptr) = *(padder->in_ptr); - ac3p_in_fw (padder); - ac3p_out_fw (padder); - } else { - guint16 *ptr, i; + if (padder->bytes_to_copy > 0) { + /* Copy one byte. */ + *(padder->out_ptr) = *(padder->in_ptr); + ac3p_in_fw (padder); + ac3p_out_fw (padder); + } else { + guint16 *ptr, i; - /* Frame ready. Prepare for output: */ + /* Frame ready. Prepare for output: */ - /* Zero the non AC3 portion of the padded frame. */ - memset (&(padder->frame.sync_byte1) + padder->ac3_frame_size, 0, - AC3P_IEC_FRAME_SIZE - AC3P_IEC_HEADER_SIZE - - padder->ac3_frame_size); + /* Zero the non AC3 portion of the padded frame. */ + memset (&(padder->frame.sync_byte1) + padder->ac3_frame_size, 0, + AC3P_IEC_FRAME_SIZE - AC3P_IEC_HEADER_SIZE - + padder->ac3_frame_size); - /* Fix the byte order in the AC3 portion: */ - ptr = (guint16 *) & (padder->frame.sync_byte1); - i = padder->ac3_frame_size / 2; - while (i > 0) { - *ptr = GUINT16_TO_BE (*ptr); - ptr++; - i--; - } + /* Fix the byte order in the AC3 portion: */ + ptr = (guint16 *) & (padder->frame.sync_byte1); + i = padder->ac3_frame_size / 2; + while (i > 0) { + *ptr = GUINT16_TO_BE (*ptr); + ptr++; + i--; + } - /* Start over again. */ - padder->state = AC3P_STATE_SYNC1; + /* Start over again. */ + padder->state = AC3P_STATE_SYNC1; - return AC3P_EVENT_FRAME; - } - break; + return AC3P_EVENT_FRAME; + } + break; } } diff --git a/sys/dxr3/dxr3audiosink.c b/sys/dxr3/dxr3audiosink.c index a1a7b8e61a..558dcb0cd8 100644 --- a/sys/dxr3/dxr3audiosink.c +++ b/sys/dxr3/dxr3audiosink.c @@ -73,11 +73,11 @@ GST_STATIC_PAD_TEMPLATE ("pcm_sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) TRUE, " - "width = (int) 16, " - "depth = (int) 16, " - "rate = (int) { 32000, 44100, 48000, 66000 }, " "channels = (int) 2") + "endianness = (int) BYTE_ORDER, " + "signed = (boolean) TRUE, " + "width = (int) 16, " + "depth = (int) 16, " + "rate = (int) { 32000, 44100, 48000, 66000 }, " "channels = (int) 2") ); static GstStaticPadTemplate dxr3audiosink_ac3_sink_factory = @@ -85,7 +85,7 @@ GST_STATIC_PAD_TEMPLATE ("ac3_sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-ac3" - /* no parameters needed, we don't need a parsed stream */ + /* no parameters needed, we don't need a parsed stream */ ) ); @@ -143,8 +143,9 @@ dxr3audiosink_get_type (void) 0, (GInstanceInitFunc) dxr3audiosink_init, }; + dxr3audiosink_type = g_type_register_static (GST_TYPE_ELEMENT, - "Dxr3AudioSink", &dxr3audiosink_info, 0); + "Dxr3AudioSink", &dxr3audiosink_info, 0); } return dxr3audiosink_type; @@ -184,7 +185,7 @@ dxr3audiosink_class_init (Dxr3AudioSinkClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DIGITAL_PCM, g_param_spec_boolean ("digital-pcm", "Digital PCM", - "Use the digital output for PCM sound", FALSE, G_PARAM_READWRITE)); + "Use the digital output for PCM sound", FALSE, G_PARAM_READWRITE)); gobject_class->set_property = dxr3audiosink_set_property; gobject_class->get_property = dxr3audiosink_get_property; @@ -249,7 +250,7 @@ dxr3audiosink_set_property (GObject * object, guint prop_id, sink->digital_pcm = g_value_get_boolean (value); /* Refresh the setup of the device. */ if (sink->mode == DXR3AUDIOSINK_MODE_PCM) { - dxr3audiosink_set_mode_pcm (sink); + dxr3audiosink_set_mode_pcm (sink); } g_object_notify (G_OBJECT (sink), "digital-pcm"); break; @@ -294,8 +295,8 @@ dxr3audiosink_open (Dxr3AudioSink * sink) sink->audio_fd = open (sink->audio_filename, O_WRONLY); if (sink->audio_fd < 0) { GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, - (_("Could not open audio device \"%s\" for writing."), - sink->audio_filename), GST_ERROR_SYSTEM); + (_("Could not open audio device \"%s\" for writing."), + sink->audio_filename), GST_ERROR_SYSTEM); return FALSE; } @@ -306,8 +307,8 @@ dxr3audiosink_open (Dxr3AudioSink * sink) sink->control_fd = open (sink->control_filename, O_WRONLY); if (sink->control_fd < 0) { GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, - (_("Could not open control device \"%s\" for writing."), - sink->control_filename), GST_ERROR_SYSTEM); + (_("Could not open control device \"%s\" for writing."), + sink->control_filename), GST_ERROR_SYSTEM); return FALSE; } @@ -339,8 +340,8 @@ dxr3audiosink_set_mode_pcm (Dxr3AudioSink * sink) tmp = oss_mode; if (ioctl (sink->audio_fd, SNDCTL_DSP_SETFMT, &tmp) < 0 || tmp != oss_mode) { GST_ELEMENT_ERROR (sink, RESOURCE, SETTINGS, - (_("Could not configure audio device \"%s\"."), sink->audio_filename), - GST_ERROR_SYSTEM); + (_("Could not configure audio device \"%s\"."), sink->audio_filename), + GST_ERROR_SYSTEM); return FALSE; } @@ -353,8 +354,8 @@ dxr3audiosink_set_mode_pcm (Dxr3AudioSink * sink) tmp = sink->rate; if (ioctl (sink->audio_fd, SNDCTL_DSP_SPEED, &tmp) < 0) { GST_ELEMENT_ERROR (sink, RESOURCE, SETTINGS, - (_("Could not set audio device \"%s\" to %d Hz."), sink->audio_filename, - sink->rate), GST_ERROR_SYSTEM); + (_("Could not set audio device \"%s\" to %d Hz."), sink->audio_filename, + sink->rate), GST_ERROR_SYSTEM); return FALSE; } @@ -390,8 +391,8 @@ dxr3audiosink_set_mode_ac3 (Dxr3AudioSink * sink) if (ioctl (sink->audio_fd, SNDCTL_DSP_SPEED, &tmp) < 0 || tmp != AC3_BYTE_RATE) { GST_ELEMENT_ERROR (sink, RESOURCE, SETTINGS, - (_("Could not set audio device \"%s\" to %d Hz."), sink->audio_filename, - AC3_BYTE_RATE), GST_ERROR_SYSTEM); + (_("Could not set audio device \"%s\" to %d Hz."), sink->audio_filename, + AC3_BYTE_RATE), GST_ERROR_SYSTEM); return FALSE; } @@ -418,15 +419,15 @@ dxr3audiosink_close (Dxr3AudioSink * sink) if (close (sink->audio_fd) != 0) { GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE, - (_("Could not close audio device \"%s\"."), sink->audio_filename), - GST_ERROR_SYSTEM); + (_("Could not close audio device \"%s\"."), sink->audio_filename), + GST_ERROR_SYSTEM); return; } if (close (sink->control_fd) != 0) { GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE, - (_("Could not close control device \"%s\"."), sink->audio_filename), - GST_ERROR_SYSTEM); + (_("Could not close control device \"%s\"."), sink->audio_filename), + GST_ERROR_SYSTEM); return; } @@ -495,18 +496,18 @@ dxr3audiosink_handle_event (GstPad * pad, GstEvent * event) switch (type) { case GST_EVENT_FLUSH: if (sink->control_fd >= 0) { - unsigned audiomode; + unsigned audiomode; - if (sink->mode == DXR3AUDIOSINK_MODE_AC3) { - audiomode = EM8300_AUDIOMODE_DIGITALPCM; - ioctl (sink->control_fd, EM8300_IOCTL_SET_AUDIOMODE, &audiomode); - audiomode = EM8300_AUDIOMODE_DIGITALAC3; - ioctl (sink->control_fd, EM8300_IOCTL_SET_AUDIOMODE, &audiomode); - } + if (sink->mode == DXR3AUDIOSINK_MODE_AC3) { + audiomode = EM8300_AUDIOMODE_DIGITALPCM; + ioctl (sink->control_fd, EM8300_IOCTL_SET_AUDIOMODE, &audiomode); + audiomode = EM8300_AUDIOMODE_DIGITALAC3; + ioctl (sink->control_fd, EM8300_IOCTL_SET_AUDIOMODE, &audiomode); + } - /* Report the flush operation. */ - g_signal_emit (G_OBJECT (sink), - dxr3audiosink_signals[SIGNAL_FLUSHED], 0); + /* Report the flush operation. */ + g_signal_emit (G_OBJECT (sink), + dxr3audiosink_signals[SIGNAL_FLUSHED], 0); } break; default: @@ -561,21 +562,21 @@ dxr3audiosink_chain_pcm (GstPad * pad, GstData * _data) in = MPEGTIME_TO_DXRTIME (sink->scr - (odelay * 90) / 192); diff = in > out ? in - out : out - in; if (diff > 1800) { - dxr3audiosink_set_scr (sink, in); + dxr3audiosink_set_scr (sink, in); } } /* Update our SCR value. */ sink->scr += (unsigned) (GST_BUFFER_SIZE (buf) * - (90000.0 / ((float) sink->rate * 4))); + (90000.0 / ((float) sink->rate * 4))); /* Write the buffer to the sound device. */ bytes_written = write (sink->audio_fd, GST_BUFFER_DATA (buf), - GST_BUFFER_SIZE (buf)); + GST_BUFFER_SIZE (buf)); if (bytes_written < GST_BUFFER_SIZE (buf)) { fprintf (stderr, "dxr3audiosink: Warning: %d bytes should be " - "written, only %d bytes written\n", - GST_BUFFER_SIZE (buf), bytes_written); + "written, only %d bytes written\n", + GST_BUFFER_SIZE (buf), bytes_written); } } @@ -627,40 +628,40 @@ dxr3audiosink_chain_ac3 (GstPad * pad, GstData * _data) event = ac3p_parse (sink->padder); while (event != AC3P_EVENT_PUSH) { switch (event) { - case AC3P_EVENT_FRAME: - /* We have a new frame: */ + case AC3P_EVENT_FRAME: + /* We have a new frame: */ - /* Update the system reference clock (SCR) in the card. */ - { - unsigned in, out, odelay; - unsigned diff; + /* Update the system reference clock (SCR) in the card. */ + { + unsigned in, out, odelay; + unsigned diff; - ioctl (sink->control_fd, EM8300_IOCTL_SCR_GET, &out); + ioctl (sink->control_fd, EM8300_IOCTL_SCR_GET, &out); - ioctl (sink->audio_fd, SNDCTL_DSP_GETODELAY, &odelay); - /* 192000 bytes/sec */ + ioctl (sink->audio_fd, SNDCTL_DSP_GETODELAY, &odelay); + /* 192000 bytes/sec */ - in = MPEGTIME_TO_DXRTIME (sink->scr - (odelay * 90) / 192); - diff = in > out ? in - out : out - in; - if (diff > 1800) { - dxr3audiosink_set_scr (sink, in); - } - } + in = MPEGTIME_TO_DXRTIME (sink->scr - (odelay * 90) / 192); + diff = in > out ? in - out : out - in; + if (diff > 1800) { + dxr3audiosink_set_scr (sink, in); + } + } - /* Update our SCR value. */ - sink->scr += TIME_FOR_BYTES (ac3p_frame_size (sink->padder)); + /* Update our SCR value. */ + sink->scr += TIME_FOR_BYTES (ac3p_frame_size (sink->padder)); - /* Write the frame to the sound device. */ - bytes_written = write (sink->audio_fd, ac3p_frame (sink->padder), - AC3P_IEC_FRAME_SIZE); + /* Write the frame to the sound device. */ + bytes_written = write (sink->audio_fd, ac3p_frame (sink->padder), + AC3P_IEC_FRAME_SIZE); - if (bytes_written < AC3P_IEC_FRAME_SIZE) { - fprintf (stderr, "dxr3audiosink: Warning: %d bytes should be " - "written, only %d bytes written\n", - AC3P_IEC_FRAME_SIZE, bytes_written); - } + if (bytes_written < AC3P_IEC_FRAME_SIZE) { + fprintf (stderr, "dxr3audiosink: Warning: %d bytes should be " + "written, only %d bytes written\n", + AC3P_IEC_FRAME_SIZE, bytes_written); + } - break; + break; } event = ac3p_parse (sink->padder); @@ -714,7 +715,7 @@ dxr3audiosink_change_state (GstElement * element) } else { if (!GST_FLAG_IS_SET (element, DXR3AUDIOSINK_OPEN)) { if (!dxr3audiosink_open (DXR3AUDIOSINK (element))) { - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; } } } diff --git a/sys/dxr3/dxr3init.c b/sys/dxr3/dxr3init.c index d5bbd0f250..921d4f89d6 100644 --- a/sys/dxr3/dxr3init.c +++ b/sys/dxr3/dxr3init.c @@ -34,11 +34,11 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "dxr3videosink", - GST_RANK_NONE, GST_TYPE_DXR3VIDEOSINK) || + GST_RANK_NONE, GST_TYPE_DXR3VIDEOSINK) || !gst_element_register (plugin, "dxr3audiosink", - GST_RANK_NONE, GST_TYPE_DXR3AUDIOSINK) || + GST_RANK_NONE, GST_TYPE_DXR3AUDIOSINK) || !gst_element_register (plugin, "dxr3spusink", - GST_RANK_NONE, GST_TYPE_DXR3SPUSINK)) + GST_RANK_NONE, GST_TYPE_DXR3SPUSINK)) return FALSE; #ifdef ENABLE_NLS diff --git a/sys/dxr3/dxr3spusink.c b/sys/dxr3/dxr3spusink.c index 1652cdc62a..0d7e6457c3 100644 --- a/sys/dxr3/dxr3spusink.c +++ b/sys/dxr3/dxr3spusink.c @@ -122,8 +122,9 @@ dxr3spusink_get_type (void) 0, (GInstanceInitFunc) dxr3spusink_init, }; + dxr3spusink_type = g_type_register_static (GST_TYPE_ELEMENT, - "Dxr3SpuSink", &dxr3spusink_info, 0); + "Dxr3SpuSink", &dxr3spusink_info, 0); } return dxr3spusink_type; } @@ -264,8 +265,8 @@ dxr3spusink_open (Dxr3SpuSink * sink) sink->spu_fd = open (sink->spu_filename, O_WRONLY); if (sink->spu_fd < 0) { GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, - (_("Could not open spu device \"%s\" for writing."), - sink->spu_filename), GST_ERROR_SYSTEM); + (_("Could not open spu device \"%s\" for writing."), + sink->spu_filename), GST_ERROR_SYSTEM); return FALSE; } @@ -276,8 +277,8 @@ dxr3spusink_open (Dxr3SpuSink * sink) sink->control_fd = open (sink->control_filename, O_WRONLY); if (sink->control_fd < 0) { GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, - (_("Could not open control device \"%s\" for writing."), - sink->control_filename), GST_ERROR_SYSTEM); + (_("Could not open control device \"%s\" for writing."), + sink->control_filename), GST_ERROR_SYSTEM); return FALSE; } @@ -294,15 +295,15 @@ dxr3spusink_close (Dxr3SpuSink * sink) if (close (sink->spu_fd) != 0) { GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE, - (_("Could not close spu device \"%s\"."), sink->spu_filename), - GST_ERROR_SYSTEM); + (_("Could not close spu device \"%s\"."), sink->spu_filename), + GST_ERROR_SYSTEM); return; } if (close (sink->control_fd) != 0) { GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE, - (_("Could not close control device \"%s\"."), sink->control_filename), - GST_ERROR_SYSTEM); + (_("Could not close control device \"%s\"."), sink->control_filename), + GST_ERROR_SYSTEM); return; } @@ -335,19 +336,19 @@ dxr3spusink_handle_event (GstPad * pad, GstEvent * event) switch (type) { case GST_EVENT_FLUSH: if (sink->control_fd >= 0) { - int subdevice; + int subdevice; - subdevice = EM8300_SUBDEVICE_SUBPICTURE; - ioctl (sink->control_fd, EM8300_IOCTL_FLUSH, &subdevice); + subdevice = EM8300_SUBDEVICE_SUBPICTURE; + ioctl (sink->control_fd, EM8300_IOCTL_FLUSH, &subdevice); - /* FIXME: There should be a nicer way to do this, but I tried - everything and nothing else seems to really reset the video - fifo. */ + /* FIXME: There should be a nicer way to do this, but I tried + everything and nothing else seems to really reset the video + fifo. */ /* dxr3spusink_close (sink); */ /* dxr3spusink_open (sink); */ - /* Report the flush operation. */ - g_signal_emit (G_OBJECT (sink), dxr3spusink_signals[SIGNAL_FLUSHED], 0); + /* Report the flush operation. */ + g_signal_emit (G_OBJECT (sink), dxr3spusink_signals[SIGNAL_FLUSHED], 0); } break; default: @@ -387,10 +388,10 @@ dxr3spusink_chain (GstPad * pad, GstData * _data) } bytes_written = write (sink->spu_fd, GST_BUFFER_DATA (buf), - GST_BUFFER_SIZE (buf)); + GST_BUFFER_SIZE (buf)); if (bytes_written < GST_BUFFER_SIZE (buf)) { fprintf (stderr, "dxr3spusink: Warning: %d bytes should be written," - " only %d bytes written\n", GST_BUFFER_SIZE (buf), bytes_written); + " only %d bytes written\n", GST_BUFFER_SIZE (buf), bytes_written); } } @@ -406,9 +407,9 @@ dxr3spusink_change_state (GstElement * element) switch (GST_STATE_TRANSITION (element)) { case GST_STATE_NULL_TO_READY: if (!GST_FLAG_IS_SET (element, DXR3SPUSINK_OPEN)) { - if (!dxr3spusink_open (DXR3SPUSINK (element))) { - return GST_STATE_FAILURE; - } + if (!dxr3spusink_open (DXR3SPUSINK (element))) { + return GST_STATE_FAILURE; + } } break; case GST_STATE_READY_TO_PAUSED: @@ -421,7 +422,7 @@ dxr3spusink_change_state (GstElement * element) break; case GST_STATE_READY_TO_NULL: if (GST_FLAG_IS_SET (element, DXR3SPUSINK_OPEN)) { - dxr3spusink_close (DXR3SPUSINK (element)); + dxr3spusink_close (DXR3SPUSINK (element)); } break; } @@ -470,7 +471,7 @@ dxr3spusink_set_clut (Dxr3SpuSink * sink, const guint32 * clut) if (ioctl (sink->spu_fd, EM8300_IOCTL_SPU_SETPALETTE, clut_fixed)) fprintf (stderr, "dxr3spusink: failed to set CLUT (%s)\n", - strerror (errno)); + strerror (errno)); } @@ -489,7 +490,7 @@ dxr3spusink_highlight_on (Dxr3SpuSink * sink, unsigned palette, if (ioctl (sink->spu_fd, EM8300_IOCTL_SPU_BUTTON, &btn)) { fprintf (stderr, "dxr3spusink: failed to set spu button (%s)\n", - strerror (errno)); + strerror (errno)); } } @@ -499,7 +500,7 @@ dxr3spusink_highlight_off (Dxr3SpuSink * sink) { if (ioctl (sink->spu_fd, EM8300_IOCTL_SPU_BUTTON, NULL)) { fprintf (stderr, "dxr3spusink: failed to set spu button (%s)\n", - strerror (errno)); + strerror (errno)); } } diff --git a/sys/dxr3/dxr3videosink.c b/sys/dxr3/dxr3videosink.c index 616c12f38a..8080591399 100644 --- a/sys/dxr3/dxr3videosink.c +++ b/sys/dxr3/dxr3videosink.c @@ -63,18 +63,18 @@ enum /* Possible states for the MPEG start code scanner. */ enum { - SCAN_STATE_WAITING, /* Waiting for a code. */ - SCAN_STATE_0, /* 0 seen. */ - SCAN_STATE_00, /* 00 seen. */ - SCAN_STATE_001 /* 001 seen. */ + SCAN_STATE_WAITING, /* Waiting for a code. */ + SCAN_STATE_0, /* 0 seen. */ + SCAN_STATE_00, /* 00 seen. */ + SCAN_STATE_001 /* 001 seen. */ }; /* Possible states for the MPEG sequence parser. */ enum { - PARSE_STATE_WAITING, /* Waiting for the start of a sequence. */ - PARSE_STATE_START, /* Start of sequence seen. */ - PARSE_STATE_PICTURE, /* Picture start seen. */ + PARSE_STATE_WAITING, /* Waiting for the start of a sequence. */ + PARSE_STATE_START, /* Start of sequence seen. */ + PARSE_STATE_PICTURE, /* Picture start seen. */ }; @@ -88,9 +88,9 @@ GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/mpeg, " - "mpegversion = (int) { 1, 2 }, " "systemstream = (boolean) FALSE" - /* width/height/framerate omitted, we don't - * need a parsed stream */ + "mpegversion = (int) { 1, 2 }, " "systemstream = (boolean) FALSE" + /* width/height/framerate omitted, we don't + * need a parsed stream */ ) ); @@ -146,8 +146,9 @@ dxr3videosink_get_type (void) 0, (GInstanceInitFunc) dxr3videosink_init, }; + dxr3videosink_type = g_type_register_static (GST_TYPE_ELEMENT, - "Dxr3VideoSink", &dxr3videosink_info, 0); + "Dxr3VideoSink", &dxr3videosink_info, 0); } return dxr3videosink_type; @@ -267,8 +268,8 @@ dxr3videosink_open (Dxr3VideoSink * sink) sink->video_fd = open (sink->video_filename, O_WRONLY); if (sink->video_fd < 0) { GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, - (_("Could not open video device \"%s\" for writing."), - sink->video_filename), GST_ERROR_SYSTEM); + (_("Could not open video device \"%s\" for writing."), + sink->video_filename), GST_ERROR_SYSTEM); return FALSE; } @@ -279,8 +280,8 @@ dxr3videosink_open (Dxr3VideoSink * sink) sink->control_fd = open (sink->control_filename, O_WRONLY); if (sink->control_fd < 0) { GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE, - (_("Could not open control device \"%s\" for writing."), - sink->control_filename), GST_ERROR_SYSTEM); + (_("Could not open control device \"%s\" for writing."), + sink->control_filename), GST_ERROR_SYSTEM); return FALSE; } @@ -297,15 +298,15 @@ dxr3videosink_close (Dxr3VideoSink * sink) if (close (sink->video_fd) != 0) { GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE, - (_("Could not close video device \"%s\"."), sink->video_filename), - GST_ERROR_SYSTEM); + (_("Could not close video device \"%s\"."), sink->video_filename), + GST_ERROR_SYSTEM); return; } if (close (sink->control_fd) != 0) { GST_ELEMENT_ERROR (sink, RESOURCE, CLOSE, - (_("Could not close control device \"%s\"."), sink->control_filename), - GST_ERROR_SYSTEM); + (_("Could not close control device \"%s\"."), sink->control_filename), + GST_ERROR_SYSTEM); return; } @@ -353,28 +354,28 @@ dxr3videosink_next_start_code (Dxr3VideoSink * sink) switch (sink->scan_state) { case SCAN_STATE_WAITING: - if (c == 0x00) { - sink->scan_state = SCAN_STATE_0; - } - break; + if (c == 0x00) { + sink->scan_state = SCAN_STATE_0; + } + break; case SCAN_STATE_0: - if (c == 0x00) { - sink->scan_state = SCAN_STATE_00; - } else { - sink->scan_state = SCAN_STATE_WAITING; - } - break; + if (c == 0x00) { + sink->scan_state = SCAN_STATE_00; + } else { + sink->scan_state = SCAN_STATE_WAITING; + } + break; case SCAN_STATE_00: - if (c == 0x01) { - sink->scan_state = SCAN_STATE_001; - } else if (c != 0x00) { - sink->scan_state = SCAN_STATE_WAITING; - } - break; + if (c == 0x01) { + sink->scan_state = SCAN_STATE_001; + } else if (c != 0x00) { + sink->scan_state = SCAN_STATE_WAITING; + } + break; case SCAN_STATE_001: - sink->scan_pos++; - sink->scan_state = SCAN_STATE_WAITING; - return c; + sink->scan_pos++; + sink->scan_state = SCAN_STATE_WAITING; + return c; } sink->scan_pos++; @@ -402,8 +403,8 @@ dxr3videosink_discard_data (Dxr3VideoSink * sink, guint cut) sink->cur_buf = NULL; } else { sub = gst_buffer_create_sub (sink->cur_buf, size, - GST_BUFFER_SIZE (sink->cur_buf) - - size); + GST_BUFFER_SIZE (sink->cur_buf) + - size); gst_buffer_unref (sink->cur_buf); sink->cur_buf = sub; } @@ -448,10 +449,10 @@ dxr3videosink_write_data (Dxr3VideoSink * sink, guint cut) while (size > 0) { written = write (sink->video_fd, data, size); if (written < 0) { - GST_ELEMENT_ERROR (sink, RESOURCE, WRITE, - (_("Could not write to device \"%s\"."), sink->video_filename), - GST_ERROR_SYSTEM); - break; + GST_ELEMENT_ERROR (sink, RESOURCE, WRITE, + (_("Could not write to device \"%s\"."), sink->video_filename), + GST_ERROR_SYSTEM); + break; } size = size - written; data = data + written; @@ -476,45 +477,45 @@ dxr3videosink_parse_data (Dxr3VideoSink * sink) switch (sink->parse_state) { case PARSE_STATE_WAITING: - if (code == START_CODE_SEQUENCE_HEADER) { - dxr3videosink_discard_data (sink, 4); - sink->parse_state = PARSE_STATE_START; - sink->cur_ts = sink->last_ts; - } - break; + if (code == START_CODE_SEQUENCE_HEADER) { + dxr3videosink_discard_data (sink, 4); + sink->parse_state = PARSE_STATE_START; + sink->cur_ts = sink->last_ts; + } + break; case PARSE_STATE_START: - switch (code) { - case START_CODE_SEQUENCE_HEADER: - dxr3videosink_discard_data (sink, 4); - sink->cur_ts = sink->last_ts; - break; - case START_CODE_SEQUENCE_END: - dxr3videosink_discard_data (sink, 0); - sink->parse_state = PARSE_STATE_WAITING; - break; - case START_CODE_PICTURE: - sink->parse_state = PARSE_STATE_PICTURE; - break; - } - break; + switch (code) { + case START_CODE_SEQUENCE_HEADER: + dxr3videosink_discard_data (sink, 4); + sink->cur_ts = sink->last_ts; + break; + case START_CODE_SEQUENCE_END: + dxr3videosink_discard_data (sink, 0); + sink->parse_state = PARSE_STATE_WAITING; + break; + case START_CODE_PICTURE: + sink->parse_state = PARSE_STATE_PICTURE; + break; + } + break; case PARSE_STATE_PICTURE: - switch (code) { - case START_CODE_SEQUENCE_HEADER: - dxr3videosink_write_data (sink, 4); - sink->parse_state = PARSE_STATE_START; - sink->cur_ts = sink->last_ts; - break; - case START_CODE_SEQUENCE_END: - dxr3videosink_write_data (sink, 0); - sink->parse_state = PARSE_STATE_WAITING; - break; - case START_CODE_PICTURE: - dxr3videosink_write_data (sink, 4); - break; - } - break; + switch (code) { + case START_CODE_SEQUENCE_HEADER: + dxr3videosink_write_data (sink, 4); + sink->parse_state = PARSE_STATE_START; + sink->cur_ts = sink->last_ts; + break; + case START_CODE_SEQUENCE_END: + dxr3videosink_write_data (sink, 0); + sink->parse_state = PARSE_STATE_WAITING; + break; + case START_CODE_PICTURE: + dxr3videosink_write_data (sink, 4); + break; + } + break; } @@ -548,7 +549,7 @@ dxr3videosink_handle_event (GstPad * pad, GstEvent * event) static guint8 sec[4] = { 0x00, 0x00, 0x01, 0xb7 }; if (sink->cur_buf != NULL) { - dxr3videosink_write_data (sink, 0); + dxr3videosink_write_data (sink, 0); } write (sink->video_fd, &sec, 4); @@ -567,19 +568,19 @@ dxr3videosink_handle_event (GstPad * pad, GstEvent * event) /* fprintf (stderr, "^^^^^^ Discontinuous event has time %.4f\n", */ /* (double) time / GST_SECOND); */ - /* If the SCR in the card is way off, fix it. */ - ioctl (sink->control_fd, EM8300_IOCTL_SCR_GET, &cur_scr); - mpeg_scr = MPEGTIME_TO_DXRTIME (GSTTIME_TO_MPEGTIME (time)); + /* If the SCR in the card is way off, fix it. */ + ioctl (sink->control_fd, EM8300_IOCTL_SCR_GET, &cur_scr); + mpeg_scr = MPEGTIME_TO_DXRTIME (GSTTIME_TO_MPEGTIME (time)); - diff = cur_scr > mpeg_scr ? cur_scr - mpeg_scr : mpeg_scr - cur_scr; - if (diff > 1800) { - unsigned zero = 0; + diff = cur_scr > mpeg_scr ? cur_scr - mpeg_scr : mpeg_scr - cur_scr; + if (diff > 1800) { + unsigned zero = 0; /* fprintf (stderr, "====== Adjusting SCR from video\n"); */ - ioctl (sink->control_fd, EM8300_IOCTL_SCR_SET, &zero); - ioctl (sink->control_fd, EM8300_IOCTL_SCR_SET, &mpeg_scr); - } + ioctl (sink->control_fd, EM8300_IOCTL_SCR_SET, &zero); + ioctl (sink->control_fd, EM8300_IOCTL_SCR_SET, &mpeg_scr); + } } else { /* fprintf (stderr, "^^^^^^ Discontinuous event has no time\n"); */ } @@ -642,9 +643,9 @@ dxr3videosink_change_state (GstElement * element) switch (GST_STATE_TRANSITION (element)) { case GST_STATE_NULL_TO_READY: if (!GST_FLAG_IS_SET (element, DXR3VIDEOSINK_OPEN)) { - if (!dxr3videosink_open (DXR3VIDEOSINK (element))) { - return GST_STATE_FAILURE; - } + if (!dxr3videosink_open (DXR3VIDEOSINK (element))) { + return GST_STATE_FAILURE; + } } break; case GST_STATE_READY_TO_PAUSED: @@ -661,7 +662,7 @@ dxr3videosink_change_state (GstElement * element) break; case GST_STATE_READY_TO_NULL: if (GST_FLAG_IS_SET (element, DXR3VIDEOSINK_OPEN)) { - dxr3videosink_close (DXR3VIDEOSINK (element)); + dxr3videosink_close (DXR3VIDEOSINK (element)); } break; } diff --git a/sys/glsink/gstgl_nvimage.c b/sys/glsink/gstgl_nvimage.c index 1aab5c4f4f..38e6decec9 100644 --- a/sys/glsink/gstgl_nvimage.c +++ b/sys/glsink/gstgl_nvimage.c @@ -55,7 +55,7 @@ typedef struct _GstNvImage GstNvImage; struct _GstNvImage { GstImageData data; - int slot; // < AGP_BUFSLOTS: allocated from AGP mem, otherwise from CPU mem + int slot; // < AGP_BUFSLOTS: allocated from AGP mem, otherwise from CPU mem GstGLImageConnection *conn; }; @@ -154,10 +154,10 @@ gst_gl_nvimage_get_caps (GstImageInfo * info) } caps = gst_caps_append (caps, GST_CAPS_NEW ("nvimage_caps", - "video/x-raw-yuv", - "format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y', 'V', '1', '2')), - "width", GST_PROPS_INT_RANGE (0, 1024), - "height", GST_PROPS_INT_RANGE (0, 1024)) + "video/x-raw-yuv", + "format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y', 'V', '1', '2')), + "width", GST_PROPS_INT_RANGE (0, 1024), + "height", GST_PROPS_INT_RANGE (0, 1024)) ); g_warning ("nvimage returns caps !\n"); return caps; @@ -190,7 +190,7 @@ gst_gl_nvimage_set_caps (GstImageInfo * info, GstCaps * caps) GST_DEBUG ("GL_NVImage: Format is invalid !\n"); return NULL; } - if (0) //conn->port == (XvPortID) -1) + if (0) //conn->port == (XvPortID) -1) { /* this happens if the plugin can't handle the caps, so no warning */ g_free (conn); @@ -266,7 +266,7 @@ gst_gl_nvimage_put_image (GstImageInfo * info, GstImageData * image) if (xinfo->info.demo) { //g_print("Putting image, context is %p\n", glXGetCurrentContext()); - glTranslatef (0.0, 0.0, -5.0); // make it avoid the clipping plane, zoom 2.0 instead + glTranslatef (0.0, 0.0, -5.0); // make it avoid the clipping plane, zoom 2.0 instead glRotatef (180.0 * sin (xinfo->rotX), 1, 0, 0); glRotatef (180.0 * cos (xinfo->rotY), 0, 1, 0); @@ -348,11 +348,11 @@ gst_gl_nvimage_put_image (GstImageInfo * info, GstImageData * image) printf ("Recording frame #%d\n", framenr); glReadPixels (0, 0, img_width, img_height, GL_RGB, GL_UNSIGNED_BYTE, - cap_image_data); + cap_image_data); // invert the pixels for (i = 0; i < img_height; i++) memcpy (cap_image_data2 + i * img_width * 3, - cap_image_data + (img_height - 1 - i) * img_width * 3, img_width * 3); + cap_image_data + (img_height - 1 - i) * img_width * 3, img_width * 3); sprintf (capfilename, "cap%04d.ppm", framenr); FILE *outfile = fopen (capfilename, "wb"); @@ -363,7 +363,7 @@ gst_gl_nvimage_put_image (GstImageInfo * info, GstImageData * image) fprintf (outfile, "%d %d\n", img_width, img_height); fprintf (outfile, "255\n"); fwrite (cap_image_data2, sizeof (char), img_width * img_height * 3, - outfile); + outfile); fclose (outfile); } framenr++; diff --git a/sys/glsink/gstgl_pdrimage.c b/sys/glsink/gstgl_pdrimage.c index 20582ebf31..82ac254a37 100644 --- a/sys/glsink/gstgl_pdrimage.c +++ b/sys/glsink/gstgl_pdrimage.c @@ -55,7 +55,7 @@ typedef struct _GstNvImage GstNvImage; struct _GstNvImage { GstImageData data; - int slot; // < AGP_BUFSLOTS: allocated from AGP mem, otherwise from CPU mem + int slot; // < AGP_BUFSLOTS: allocated from AGP mem, otherwise from CPU mem GstGLImageConnection *conn; }; @@ -143,10 +143,10 @@ gst_gl_nvimage_get_caps (GstImageInfo * info) } caps = gst_caps_append (caps, GST_CAPS_NEW ("xvimage_caps", - "video/raw", - "format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y', 'C', '1', '2')), - "width", GST_PROPS_INT_RANGE (0, 1024), - "height", GST_PROPS_INT_RANGE (0, 1024)) + "video/raw", + "format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y', 'C', '1', '2')), + "width", GST_PROPS_INT_RANGE (0, 1024), + "height", GST_PROPS_INT_RANGE (0, 1024)) ); return caps; } @@ -178,7 +178,7 @@ gst_gl_nvimage_set_caps (GstImageInfo * info, GstCaps * caps) GST_DEBUG (GST_CAT_PLUGIN_INFO, "GL_NVImage: Format is invalid !\n"); return NULL; } - if (0) //conn->port == (XvPortID) -1) + if (0) //conn->port == (XvPortID) -1) { /* this happens if the plugin can't handle the caps, so no warning */ g_free (conn); @@ -216,15 +216,15 @@ gst_gl_nvimage_get_image (GstImageInfo * info, GstImageConnection * conn) image->data.size = nvconn->w * nvconn->h * 3 / 2; - if (slot < AGP_BUFSLOTS) // found an AGP buffer slot + if (slot < AGP_BUFSLOTS) // found an AGP buffer slot { image->data.data = nvconn->m_memory + slot * YUVTEX_SIZE; - image->slot = slot; // store for freeing - nvconn->m_bufslots[slot] = 1; // it is now taken + image->slot = slot; // store for freeing + nvconn->m_bufslots[slot] = 1; // it is now taken } else { g_warning ("Allocating from main memory !"); image->data.data = g_malloc (image->data.size); - image->slot = AGP_BUFSLOTS; // no AGP slot + image->slot = AGP_BUFSLOTS; // no AGP slot } image->conn = nvconn; @@ -325,13 +325,13 @@ gst_gl_nvimage_open_conn (GstImageConnection * conn, GstImageInfo * info) if (!xconn->m_memory) { printf - ("Unable to acquire graphics card mem... will acquire in normal memory.\n"); + ("Unable to acquire graphics card mem... will acquire in normal memory.\n"); for (slot = 0; slot < AGP_BUFSLOTS; slot++) xconn->m_bufslots[slot] = 1; } else { // maybe this fast writable memory, awfully slow to read from, though glPixelDataRangeNV (GL_WRITE_PIXEL_DATA_RANGE_NV, - AGP_BUFSLOTS * YUVTEX_SIZE, xconn->m_memory); + AGP_BUFSLOTS * YUVTEX_SIZE, xconn->m_memory); glEnableClientState (GL_WRITE_PIXEL_DATA_RANGE_NV); for (slot = 0; slot < AGP_BUFSLOTS; slot++) diff --git a/sys/glsink/gstgl_rgbimage.c b/sys/glsink/gstgl_rgbimage.c index 8c61e39091..f836bc50b3 100644 --- a/sys/glsink/gstgl_rgbimage.c +++ b/sys/glsink/gstgl_rgbimage.c @@ -32,8 +32,8 @@ typedef struct _GstGLImageConnection GstGLImageConnection; struct _GstGLImageConnection { GstImageConnection conn; - Display *dpy; // the Xlib drawing context - GLXContext ctx; // The GLX drawing context + Display *dpy; // the Xlib drawing context + GLXContext ctx; // The GLX drawing context gint w, h; gint bpp; @@ -131,15 +131,15 @@ gst_gl_rgbimage_get_caps (GstImageInfo * info) 100, 100, xpad, (attrib.depth + 7) / 8 * 100); if (ximage != NULL) { caps = - GST_CAPS_NEW ("forcing Video RGB", "video/x-raw-rgb", "format", - GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB ")), "depth", GST_PROPS_INT (24), - "bpp", GST_PROPS_INT (24), "red_mask", GST_PROPS_INT (0xff), - "green_mask", GST_PROPS_INT (0xff00), "blue_mask", - GST_PROPS_INT (0xff0000), "endianness", GST_PROPS_INT (G_BIG_ENDIAN), - /*= 1234/4321 (INT) <- endianness */ - "width", GST_PROPS_INT_RANGE (0, TEX_XSIZE), /* can't have videos larger than TEX_SIZE */ - "height", GST_PROPS_INT_RANGE (0, TEX_YSIZE) - ); + GST_CAPS_NEW ("forcing Video RGB", "video/x-raw-rgb", "format", + GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB ")), "depth", GST_PROPS_INT (24), + "bpp", GST_PROPS_INT (24), "red_mask", GST_PROPS_INT (0xff), + "green_mask", GST_PROPS_INT (0xff00), "blue_mask", + GST_PROPS_INT (0xff0000), "endianness", GST_PROPS_INT (G_BIG_ENDIAN), + /*= 1234/4321 (INT) <- endianness */ + "width", GST_PROPS_INT_RANGE (0, TEX_XSIZE), /* can't have videos larger than TEX_SIZE */ + "height", GST_PROPS_INT_RANGE (0, TEX_YSIZE) + ); XDestroyImage (ximage); } @@ -260,7 +260,7 @@ gst_gl_rgbimage_put_image (GstImageInfo * info, GstImageData * image) glEnable (GL_TEXTURE_2D); if (xinfo->info.demo) { - glTranslatef (0.0, 0.0, -5.0); // make it avoid the clipping plane, zoom 2.0 instead + glTranslatef (0.0, 0.0, -5.0); // make it avoid the clipping plane, zoom 2.0 instead glRotatef (180.0 * sin (xinfo->rotX), 1, 0, 0); glRotatef (180.0 * cos (xinfo->rotY), 0, 1, 0); @@ -321,11 +321,11 @@ gst_gl_rgbimage_put_image (GstImageInfo * info, GstImageData * image) printf ("Recording frame #%d\n", framenr); glReadPixels (0, 0, img_width, img_height, GL_RGB, GL_UNSIGNED_BYTE, - cap_image_data); + cap_image_data); // invert the pixels for (i = 0; i < img_height; i++) memcpy (cap_image_data2 + i * img_width * 3, - cap_image_data + (img_height - 1 - i) * img_width * 3, img_width * 3); + cap_image_data + (img_height - 1 - i) * img_width * 3, img_width * 3); sprintf (capfilename, "cap%04d.ppm", framenr); FILE *outfile = fopen (capfilename, "wb"); @@ -336,7 +336,7 @@ gst_gl_rgbimage_put_image (GstImageInfo * info, GstImageData * image) fprintf (outfile, "%d %d\n", img_width, img_height); fprintf (outfile, "255\n"); fwrite (cap_image_data2, sizeof (char), img_width * img_height * 3, - outfile); + outfile); fclose (outfile); } framenr++; diff --git a/sys/glsink/gstglsink.c b/sys/glsink/gstglsink.c index a545c2a84e..6773b31fc3 100644 --- a/sys/glsink/gstglsink.c +++ b/sys/glsink/gstglsink.c @@ -56,13 +56,13 @@ GST_PAD_TEMPLATE_FACTORY (gst_glsink_sink_template_factory, GST_PAD_SINK, GST_PAD_ALWAYS, GST_CAPS_NEW ("glsink_rgbsink", "video/x-raw-rgb", - "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT), - "width", GST_PROPS_INT_RANGE (0, G_MAXINT), - "height", GST_PROPS_INT_RANGE (0, G_MAXINT)), + "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT), + "width", GST_PROPS_INT_RANGE (0, G_MAXINT), + "height", GST_PROPS_INT_RANGE (0, G_MAXINT)), GST_CAPS_NEW ("glsink_yuvsink", "video/x-raw-yuv", - "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT), - "width", GST_PROPS_INT_RANGE (0, G_MAXINT), - "height", GST_PROPS_INT_RANGE (0, G_MAXINT)) + "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT), + "width", GST_PROPS_INT_RANGE (0, G_MAXINT), + "height", GST_PROPS_INT_RANGE (0, G_MAXINT)) ) /* glsink signals and args */ @@ -106,9 +106,9 @@ GST_PAD_TEMPLATE_FACTORY (gst_glsink_sink_template_factory, guint64 frame_time; gint width, height; gboolean muted; - gint demo; // some kind of fun demo mode to let GL show its 3D capabilities - gboolean dumpvideo; // dump the video down to .ppm:s - GstBuffer *last_image; /* not thread safe ? */ + gint demo; // some kind of fun demo mode to let GL show its 3D capabilities + gboolean dumpvideo; // dump the video down to .ppm:s + GstBuffer *last_image; /* not thread safe ? */ GstClock *clock; @@ -189,9 +189,10 @@ GST_PAD_TEMPLATE_FACTORY (gst_glsink_sink_template_factory, 0, (GInstanceInitFunc) gst_glsink_init, }; + videosink_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstGLSink", &videosink_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstGLSink", &videosink_info, + 0); } return videosink_type; } @@ -218,25 +219,25 @@ gst_glsink_class_init (GstGLSinkClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (gobject_class, ARG_WIDTH, g_param_spec_int ("width", "Width", "The video width", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */ - g_object_class_install_property (gobject_class, ARG_HEIGHT, g_param_spec_int ("height", "Height", "The video height", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */ - g_object_class_install_property (gobject_class, ARG_FRAMES_DISPLAYED, g_param_spec_int ("frames_displayed", "Frames Displayed", "The number of frames displayed so far", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (gobject_class, ARG_FRAME_TIME, g_param_spec_int ("frame_time", "Frame time", "The interval between frames", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (gobject_class, ARG_WIDTH, g_param_spec_int ("width", "Width", "The video width", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */ + g_object_class_install_property (gobject_class, ARG_HEIGHT, g_param_spec_int ("height", "Height", "The video height", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */ + g_object_class_install_property (gobject_class, ARG_FRAMES_DISPLAYED, g_param_spec_int ("frames_displayed", "Frames Displayed", "The number of frames displayed so far", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (gobject_class, ARG_FRAME_TIME, g_param_spec_int ("frame_time", "Frame time", "The interval between frames", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ g_object_class_install_property (gobject_class, ARG_HOOK, g_param_spec_pointer ("hook", "Hook", "The object receiving the output", - G_PARAM_WRITABLE)); + G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, ARG_MUTE, g_param_spec_boolean ("mute", "Mute", "mute the output ?", FALSE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_REPAINT, g_param_spec_boolean ("repaint", "Repaint", "repaint the current frame", - FALSE, G_PARAM_WRITABLE)); + FALSE, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, ARG_DEMO, g_param_spec_int ("demo", "Demo", "demo mode (shows 3D capabilities)", 0, - 1, 0, G_PARAM_READWRITE)); + 1, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_DUMP, g_param_spec_boolean ("dump", "Dump", - "stores sequence of frames in .ppm files", FALSE, G_PARAM_READWRITE)); + "stores sequence of frames in .ppm files", FALSE, G_PARAM_READWRITE)); gobject_class->set_property = gst_glsink_set_property; gobject_class->get_property = gst_glsink_get_property; @@ -366,7 +367,7 @@ gst_glsink_buffer_free (GstBufferPool * pool, GstBuffer * buffer, { GstGLSink *sink = GST_GLSINK (gst_buffer_pool_get_user_data (GST_BUFFER_BUFFERPOOL - (buffer))); + (buffer))); gst_glsink_append_cache (sink, (GstImageData *) GST_BUFFER_POOL_PRIVATE (buffer)); @@ -463,8 +464,8 @@ gst_glsink_getcaps (GstPad * pad, GstCaps * caps) gst_glxwindow_hook_context (sink->hook); while (list) { ret = - gst_caps_append (ret, - ((GstImagePlugin *) list->data)->get_caps (sink->hook)); + gst_caps_append (ret, + ((GstImagePlugin *) list->data)->get_caps (sink->hook)); list = g_list_next (list); } @@ -499,7 +500,7 @@ gst_glsink_chain (GstPad * pad, GstData * _data) switch (GST_EVENT_TYPE (event)) { default: - gst_pad_event_default (pad, event); + gst_pad_event_default (pad, event); } return; } @@ -518,11 +519,11 @@ gst_glsink_chain (GstPad * pad, GstData * _data) frame_drops++; return; } - frame_drops = 0; // we made it - reset time + frame_drops = 0; // we made it - reset time GstClockReturn ret; GstClockID id = - gst_clock_new_single_shot_id (sink->clock, GST_BUFFER_TIMESTAMP (buf)); + gst_clock_new_single_shot_id (sink->clock, GST_BUFFER_TIMESTAMP (buf)); ret = gst_element_clock_wait (GST_ELEMENT (sink), id, NULL); gst_clock_id_free (id); @@ -552,7 +553,7 @@ gst_glsink_chain (GstPad * pad, GstData * _data) glClearDepth (1.0f); glClearColor (0, 0, 0, 0); - glEnable (GL_AUTO_NORMAL); // let OpenGL generate the Normals + glEnable (GL_AUTO_NORMAL); // let OpenGL generate the Normals glDisable (GL_BLEND); glDisable (GL_CULL_FACE); @@ -594,19 +595,19 @@ gst_glsink_chain (GstPad * pad, GstData * _data) sink->hook->dumpvideo = sink->dumpvideo; sink->plugin->put_image (sink->hook, - (GstImageData *) GST_BUFFER_POOL_PRIVATE (buf)); + (GstImageData *) GST_BUFFER_POOL_PRIVATE (buf)); sink->last_image = buf; } else { buffer = - gst_buffer_new_from_pool (gst_glsink_get_bufferpool (sink->sinkpad), - 0, GST_BUFFER_SIZE (buf)); + gst_buffer_new_from_pool (gst_glsink_get_bufferpool (sink->sinkpad), + 0, GST_BUFFER_SIZE (buf)); memcpy (GST_BUFFER_DATA (buffer), GST_BUFFER_DATA (buf), - GST_BUFFER_SIZE (buf) > - GST_BUFFER_SIZE (buffer) ? GST_BUFFER_SIZE (buffer) : - GST_BUFFER_SIZE (buf)); + GST_BUFFER_SIZE (buf) > + GST_BUFFER_SIZE (buffer) ? GST_BUFFER_SIZE (buffer) : + GST_BUFFER_SIZE (buf)); sink->plugin->put_image (sink->hook, - (GstImageData *) GST_BUFFER_POOL_PRIVATE (buffer)); + (GstImageData *) GST_BUFFER_POOL_PRIVATE (buffer)); sink->last_image = buffer; gst_buffer_unref (buf); @@ -640,7 +641,7 @@ gst_glsink_set_property (GObject * object, guint prop_id, const GValue * value, break; case ARG_HOOK: if (sink->hook) { - sink->hook->free_info (sink->hook); + sink->hook->free_info (sink->hook); } sink->hook = g_value_get_pointer (value); break; @@ -658,8 +659,8 @@ gst_glsink_set_property (GObject * object, guint prop_id, const GValue * value, break; case ARG_REPAINT: if (sink->last_image != NULL) { - sink->plugin->put_image (sink->hook, - (GstImageData *) GST_BUFFER_POOL_PRIVATE (sink->last_image)); + sink->plugin->put_image (sink->hook, + (GstImageData *) GST_BUFFER_POOL_PRIVATE (sink->last_image)); } break; default: @@ -732,10 +733,10 @@ gst_glsink_change_state (GstElement * element) break; case GST_STATE_PAUSED_TO_READY: if (sink->conn) - sink->conn->close_conn (sink->conn, sink->hook); + sink->conn->close_conn (sink->conn, sink->hook); if (sink->last_image) { - gst_buffer_unref (sink->last_image); - sink->last_image = NULL; + gst_buffer_unref (sink->last_image); + sink->last_image = NULL; } break; case GST_STATE_READY_TO_NULL: diff --git a/sys/glsink/gstglxwindow.c b/sys/glsink/gstglxwindow.c index 8fdacb2f17..cc4da88cde 100644 --- a/sys/glsink/gstglxwindow.c +++ b/sys/glsink/gstglxwindow.c @@ -17,7 +17,7 @@ #include #include #include "gstglsink.h" -#include /* strncmp */ +#include /* strncmp */ /* attributes for a single buffered visual in RGBA format with at least * 4 bits per color and a 16 bit depth buffer */ @@ -41,9 +41,9 @@ static int attrListDbl[] = { }; -GLfloat LightAmbient[] = { 0.1, 0.1, 0.1, 1.0 }; /* reddish ambient light */ -GLfloat LightDiffuse[] = { 0.6, 0.6, 0.6, 1.0 }; /* bluish diffuse light. */ -GLfloat LightPosition[] = { 1.5, 1.5, 1.5, 0.0 }; /* position */ +GLfloat LightAmbient[] = { 0.1, 0.1, 0.1, 1.0 }; /* reddish ambient light */ +GLfloat LightDiffuse[] = { 0.6, 0.6, 0.6, 1.0 }; /* bluish diffuse light. */ +GLfloat LightPosition[] = { 1.5, 1.5, 1.5, 0.0 }; /* position */ void @@ -202,10 +202,10 @@ gst_glxwindow_new (GstElement * sink) { /* create a window in window mode */ new->attr.event_mask = ExposureMask | KeyPressMask | ButtonPressMask | - StructureNotifyMask; + StructureNotifyMask; new->win = XCreateWindow (new->dpy, RootWindow (new->dpy, vi->screen), - new->x, new->y, new->width, new->height, 0, vi->depth, InputOutput, - vi->visual, CWBorderPixel | CWColormap | CWEventMask, &new->attr); + new->x, new->y, new->width, new->height, 0, vi->depth, InputOutput, + vi->visual, CWBorderPixel | CWColormap | CWEventMask, &new->attr); if (!new->win) { g_warning ("create window failed\n"); g_free (new); @@ -215,7 +215,7 @@ gst_glxwindow_new (GstElement * sink) wmDelete = XInternAtom (new->dpy, "WM_DELETE_WINDOW", True); XSetWMProtocols (new->dpy, new->win, &wmDelete, 1); XSetStandardProperties (new->dpy, new->win, title, - title, None, NULL, 0, NULL); + title, None, NULL, 0, NULL); XMapRaised (new->dpy, new->win); } /* connect the glx-context to the window */ @@ -238,14 +238,14 @@ gst_glxwindow_new (GstElement * sink) glClearDepth (1.0f); glClearColor (0, 0, 0, 0); - glLightfv (GL_LIGHT0, GL_AMBIENT, LightAmbient); /* add lighting. (ambient) */ - glLightfv (GL_LIGHT0, GL_DIFFUSE, LightDiffuse); /* add lighting. (diffuse). */ - glLightfv (GL_LIGHT0, GL_POSITION, LightPosition); /* set light position. */ + glLightfv (GL_LIGHT0, GL_AMBIENT, LightAmbient); /* add lighting. (ambient) */ + glLightfv (GL_LIGHT0, GL_DIFFUSE, LightDiffuse); /* add lighting. (diffuse). */ + glLightfv (GL_LIGHT0, GL_POSITION, LightPosition); /* set light position. */ //glEnable(GL_LIGHT0); // Quick And Dirty Lighting (Assumes Light0 Is Set Up) //glEnable(GL_LIGHTING); // Enable Lighting - glDisable (GL_COLOR_MATERIAL); // Enable Material Coloring - glEnable (GL_AUTO_NORMAL); // let OpenGL generate the Normals + glDisable (GL_COLOR_MATERIAL); // Enable Material Coloring + glEnable (GL_AUTO_NORMAL); // let OpenGL generate the Normals glDisable (GL_BLEND); diff --git a/sys/glsink/regcomb_yuvrgb.c b/sys/glsink/regcomb_yuvrgb.c index 54727d1e27..151b8e18b4 100644 --- a/sys/glsink/regcomb_yuvrgb.c +++ b/sys/glsink/regcomb_yuvrgb.c @@ -29,22 +29,23 @@ unsigned int UVwidth = 256, UVheight = 512; int tex_xsize, tex_ysize; void -GenerateRGBTables (unsigned char *Ytable, // Y-palette - unsigned char *Utable, // U-palette - unsigned char *Vtable, // V-palette - float *bias, // bias (fourth vector to be added) - float *Uscale, // scaling color for U - float *Vscale) // scaling color for V +GenerateRGBTables (unsigned char *Ytable, // Y-palette + unsigned char *Utable, // U-palette + unsigned char *Vtable, // V-palette + float *bias, // bias (fourth vector to be added) + float *Uscale, // scaling color for U + float *Vscale) // scaling color for V { int i; - const float mat[9] = { // the modified YUV->RGB matrix + const float mat[9] = { // the modified YUV->RGB matrix +1.130469478f, -0.058755723f, +1.596026304f, +1.130469478f, -0.450515935f, -0.812967512f, +1.130469478f, +1.958477882f, 0.0f }; -#define COMPRESS(a)(0.5f*(a)+128.0f) // counter-piece to EXPAND_NORMAL + +#define COMPRESS(a)(0.5f*(a)+128.0f) // counter-piece to EXPAND_NORMAL #define fCOMPRESS(a) (0.5f*(a)+0.5f); -#define XCLAMP(a) ((a)<0.0f ? 0.0f : ((a)>255.0f ? 255.0f : (a))) // should not be necessary, but what do you know. +#define XCLAMP(a) ((a)<0.0f ? 0.0f : ((a)>255.0f ? 255.0f : (a))) // should not be necessary, but what do you know. bias[0] = fCOMPRESS (-0.842580964f); bias[1] = fCOMPRESS (+0.563287723f); bias[2] = fCOMPRESS (-1.0f); @@ -59,17 +60,17 @@ GenerateRGBTables (unsigned char *Ytable, // Y-palette Vscale[3] = 0.0f; for (i = 0; i < 256; i++) { // Y-table holds unsigned values - Ytable[3 * i] = (unsigned char) XCLAMP (mat[0] * (float) i); // R - Ytable[3 * i + 1] = (unsigned char) XCLAMP (mat[3] * (float) i); // G - Ytable[3 * i + 2] = (unsigned char) XCLAMP (mat[6] * (float) i); // B + Ytable[3 * i] = (unsigned char) XCLAMP (mat[0] * (float) i); // R + Ytable[3 * i + 1] = (unsigned char) XCLAMP (mat[3] * (float) i); // G + Ytable[3 * i + 2] = (unsigned char) XCLAMP (mat[6] * (float) i); // B // U-table holds signed values - Utable[3 * i] = (unsigned char) XCLAMP (COMPRESS (255.0f / 16.0f * mat[1] * (float) i)); // R - Utable[3 * i + 1] = (unsigned char) XCLAMP (COMPRESS (255.0f / 120.0f * mat[4] * (float) i)); // G - Utable[3 * i + 2] = (unsigned char) XCLAMP (COMPRESS (255.0f / 500.0f * mat[7] * (float) i)); // B + Utable[3 * i] = (unsigned char) XCLAMP (COMPRESS (255.0f / 16.0f * mat[1] * (float) i)); // R + Utable[3 * i + 1] = (unsigned char) XCLAMP (COMPRESS (255.0f / 120.0f * mat[4] * (float) i)); // G + Utable[3 * i + 2] = (unsigned char) XCLAMP (COMPRESS (255.0f / 500.0f * mat[7] * (float) i)); // B // V-table holds signed values - Vtable[3 * i] = (unsigned char) XCLAMP (COMPRESS (255.0f / 408.0f * mat[2] * (float) i)); // R - Vtable[3 * i + 1] = (unsigned char) XCLAMP (COMPRESS (255.0f / 210.0f * mat[5] * (float) i)); // G - Vtable[3 * i + 2] = (unsigned char) (128.0f - 14.0f); // G constant + Vtable[3 * i] = (unsigned char) XCLAMP (COMPRESS (255.0f / 408.0f * mat[2] * (float) i)); // R + Vtable[3 * i + 1] = (unsigned char) XCLAMP (COMPRESS (255.0f / 210.0f * mat[5] * (float) i)); // G + Vtable[3 * i + 2] = (unsigned char) (128.0f - 14.0f); // G constant } #undef fCOMPRESS #undef COMPRESS @@ -315,7 +316,7 @@ PowerOfTwo (unsigned int i) // Initializes textures. Call once prior to rendering void -InitYUVPlanes (GLuint * Yhandle, GLuint * Uhandle, GLuint * Vhandle, unsigned int Ywidth, unsigned int Yheight, unsigned int UVwidth, unsigned int UVheight, GLenum filter, // filter should be either GL_NEAREST or GL_LINEAR. Test this! +InitYUVPlanes (GLuint * Yhandle, GLuint * Uhandle, GLuint * Vhandle, unsigned int Ywidth, unsigned int Yheight, unsigned int UVwidth, unsigned int UVheight, GLenum filter, // filter should be either GL_NEAREST or GL_LINEAR. Test this! unsigned char *Ypal, unsigned char *Upal, unsigned char *Vpal) { glGenTextures (1, Yhandle); diff --git a/sys/qcam/dark.c b/sys/qcam/dark.c index e15a53c924..416d37bc4f 100644 --- a/sys/qcam/dark.c +++ b/sys/qcam/dark.c @@ -154,21 +154,21 @@ fixdark (const struct qcam *q, scanbuf * scan) return 0; for (y = 0; y < MAX_HEIGHT; y++) for (x = 0; x < MAX_HEIGHT; x++) - if (master_darkmask1[y][x] < smallest_dm) { - smallest_dm = master_darkmask1[y][x]; + if (master_darkmask1[y][x] < smallest_dm) { + smallest_dm = master_darkmask1[y][x]; #ifdef DEBUG - fprintf (stderr, "Smallest mask is %d at (%d, %d)\n", - smallest_dm, x, y); + fprintf (stderr, "Smallest mask is %d at (%d, %d)\n", + smallest_dm, x, y); #endif - } + } init = 1; } if (brightness < smallest_dm) { #ifdef DEBUG fprintf (stderr, - "Brightness %d (dark current starts at %d), no fixup needed\n", - brightness, smallest_dm); + "Brightness %d (dark current starts at %d), no fixup needed\n", + brightness, smallest_dm); #endif return 1; } @@ -181,16 +181,16 @@ fixdark (const struct qcam *q, scanbuf * scan) for (y = 0; y < max_height; y++) for (x = 0; x < max_width; x++) if (scale == 1) { - darkmask[y][x] = master_darkmask1[y][x]; + darkmask[y][x] = master_darkmask1[y][x]; } else if (scale == 2) { - darkmask[y][x] = master_darkmask2[y][x]; + darkmask[y][x] = master_darkmask2[y][x]; } else if (scale == 4) { - darkmask[y][x] = master_darkmask4[y][x]; + darkmask[y][x] = master_darkmask4[y][x]; } else { #ifdef DEBUG - fprintf (stderr, "Bad transfer_scale in darkmask assignment!\n"); + fprintf (stderr, "Bad transfer_scale in darkmask assignment!\n"); #endif - return 0; + return 0; } do { @@ -202,52 +202,52 @@ fixdark (const struct qcam *q, scanbuf * scan) ccd_x *= 2; ccd_x /= scale; for (x = 0; x < width; x++, ccd_x++) { - val = scan[y * width + x]; - if (brightness < darkmask[ccd_y][ccd_x]) { /* good pixel */ - new_image[y][x] = val; - } else { /* bad pixel */ - /* look at nearby pixels, average the good values */ - pixelcount = 0; - pixeltotal = 0; - if (x > 0) { /* left */ - if (brightness < darkmask[ccd_y][ccd_x - 1]) { - pixelcount++; - pixeltotal += scan[y * width + x - 1]; - } - } - if (x < width - 1) { /* right */ - if (brightness < darkmask[ccd_y][ccd_x + 1]) { - pixelcount++; - pixeltotal += scan[y * width + x + 1]; - } - } - if (y > 0) { /* above */ - if (brightness < darkmask[ccd_y - 1][ccd_x]) { - pixelcount++; - pixeltotal += scan[(y - 1) * width + x]; - } - } - if (y < height - 1) { /* below */ - if (brightness < darkmask[ccd_y + 1][ccd_x]) { - pixelcount++; - pixeltotal += scan[(y + 1) * width + x]; - } - } + val = scan[y * width + x]; + if (brightness < darkmask[ccd_y][ccd_x]) { /* good pixel */ + new_image[y][x] = val; + } else { /* bad pixel */ + /* look at nearby pixels, average the good values */ + pixelcount = 0; + pixeltotal = 0; + if (x > 0) { /* left */ + if (brightness < darkmask[ccd_y][ccd_x - 1]) { + pixelcount++; + pixeltotal += scan[y * width + x - 1]; + } + } + if (x < width - 1) { /* right */ + if (brightness < darkmask[ccd_y][ccd_x + 1]) { + pixelcount++; + pixeltotal += scan[y * width + x + 1]; + } + } + if (y > 0) { /* above */ + if (brightness < darkmask[ccd_y - 1][ccd_x]) { + pixelcount++; + pixeltotal += scan[(y - 1) * width + x]; + } + } + if (y < height - 1) { /* below */ + if (brightness < darkmask[ccd_y + 1][ccd_x]) { + pixelcount++; + pixeltotal += scan[(y + 1) * width + x]; + } + } - if (pixelcount == 0) { /* no valid neighbors! */ - again = 1; - } else { - new_image[y][x] = pixeltotal / pixelcount; - /* mark this pixel as valid, so we don't loop forever */ - darkmask[ccd_y][ccd_x] = 255; - } - } + if (pixelcount == 0) { /* no valid neighbors! */ + again = 1; + } else { + new_image[y][x] = pixeltotal / pixelcount; + /* mark this pixel as valid, so we don't loop forever */ + darkmask[ccd_y][ccd_x] = 255; + } + } } } for (y = 0; y < height; y++) for (x = 0; x < width; x++) - scan[y * width + x] = new_image[y][x]; + scan[y * width + x] = new_image[y][x]; } while (loopcount++ < MAX_LOOPS && again); #ifdef DEBUG diff --git a/sys/qcam/exposure.c b/sys/qcam/exposure.c index b63e364f49..8f18e488a6 100644 --- a/sys/qcam/exposure.c +++ b/sys/qcam/exposure.c @@ -223,7 +223,7 @@ qcip_autoexposure (struct qcam *q, scanbuf * scan) /* set target if it has not been explicitly set */ if (luminance_std_target == -1) { - luminance_std_target = q->bpp == 6 ? 10 : 2; + luminance_std_target = q->bpp == 6 ? 10 : 2; } /* Adjust contrast to reach target luminance standard deviation */ @@ -231,15 +231,15 @@ qcip_autoexposure (struct qcam *q, scanbuf * scan) lum_std_max = luminance_std_target + luminance_std_tolerance; if (lum_std < lum_std_min || lum_std > lum_std_max) { - ret = QCIP_XPSR_RSCN; - if (qc_setcontrast (q, - luminance_std_target - lum_std + qc_getcontrast (q))) { - return QCIP_XPSR_ERR; - } + ret = QCIP_XPSR_RSCN; + if (qc_setcontrast (q, + luminance_std_target - lum_std + qc_getcontrast (q))) { + return QCIP_XPSR_ERR; + } } #ifdef DEBUG fprintf (stderr, "Luminance std/target/tolerance: %d/%d/%d\n", - lum_std, luminance_std_target, luminance_std_tolerance); + lum_std, luminance_std_target, luminance_std_tolerance); #endif break; diff --git a/sys/qcam/gstqcamsrc.c b/sys/qcam/gstqcamsrc.c index 0c68ca13ad..ea6a2c1a27 100644 --- a/sys/qcam/gstqcamsrc.c +++ b/sys/qcam/gstqcamsrc.c @@ -73,9 +73,10 @@ gst_autoexp_mode_get_type (void) {AE_NONE, "3", "None"}, {0, NULL, NULL}, }; + if (!autoexp_mode_type) { autoexp_mode_type = - g_enum_register_static ("GstAutoExposureMode", autoexp_modes); + g_enum_register_static ("GstAutoExposureMode", autoexp_modes); } return autoexp_mode_type; } @@ -140,9 +141,10 @@ gst_qcamsrc_get_type (void) (GInstanceInitFunc) gst_qcamsrc_init, NULL }; + qcamsrc_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstQCamSrc", &qcamsrc_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstQCamSrc", &qcamsrc_info, + 0); } return qcamsrc_type; } @@ -168,37 +170,37 @@ gst_qcamsrc_class_init (GstQCamSrcClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDTH, g_param_spec_int ("width", "width", "width", - 0, 320, DEF_WIDTH, G_PARAM_READWRITE)); + 0, 320, DEF_WIDTH, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HEIGHT, g_param_spec_int ("height", "height", "height", - 0, 240, DEF_HEIGHT, G_PARAM_READWRITE)); + 0, 240, DEF_HEIGHT, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BRIGHTNESS, g_param_spec_int ("brightness", "brightness", "brightness", - 0, 255, DEF_BRIGHTNESS, G_PARAM_READWRITE)); + 0, 255, DEF_BRIGHTNESS, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WHITEBAL, g_param_spec_int ("whitebal", "whitebal", "whitebal", - 0, 255, DEF_WHITEBAL, G_PARAM_READWRITE)); + 0, 255, DEF_WHITEBAL, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_CONTRAST, g_param_spec_int ("contrast", "contrast", "contrast", - 0, 255, DEF_CONTRAST, G_PARAM_READWRITE)); + 0, 255, DEF_CONTRAST, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TOP, g_param_spec_int ("top", "top", "top", - 0, 240, DEF_TOP, G_PARAM_READWRITE)); + 0, 240, DEF_TOP, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LEFT, g_param_spec_int ("left", "left", "left", - 0, 320, DEF_LEFT, G_PARAM_READWRITE)); + 0, 320, DEF_LEFT, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TRANSFER_SCALE, g_param_spec_int ("transfer_scale", "transfer_scale", "transfer_scale", - 1, 4, DEF_TRANSFER_SCALE, G_PARAM_READWRITE)); + 1, 4, DEF_TRANSFER_SCALE, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DEPTH, g_param_spec_int ("depth", "depth", "depth", - 4, 6, DEF_DEPTH, G_PARAM_READWRITE)); + 4, 6, DEF_DEPTH, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PORT, g_param_spec_int ("port", "port", "port", - 0, G_MAXINT, DEF_PORT, G_PARAM_READWRITE)); + 0, G_MAXINT, DEF_PORT, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_AUTOEXP, g_param_spec_enum ("autoexposure", "autoexposure", "autoexposure", - GST_TYPE_AUTOEXP_MODE, DEF_AUTOEXP, G_PARAM_READWRITE)); + GST_TYPE_AUTOEXP_MODE, DEF_AUTOEXP, G_PARAM_READWRITE)); gobject_class->set_property = gst_qcamsrc_set_property; gobject_class->get_property = gst_qcamsrc_get_property; @@ -256,10 +258,10 @@ gst_qcamsrc_get (GstPad * pad) qc_set (qcamsrc->qcam); if (!GST_PAD_CAPS (pad)) { gst_pad_try_set_caps (pad, gst_caps_new_simple ("video/x-raw-yuv", - "format", GST_TYPE_FOURCC, "I420", - "width", G_TYPE_INT, qcamsrc->qcam->width / scale, - "height", G_TYPE_INT, qcamsrc->qcam->height / scale, - "framerate", G_TYPE_DOUBLE, 10., NULL)); + "format", GST_TYPE_FOURCC, "I420", + "width", G_TYPE_INT, qcamsrc->qcam->width / scale, + "height", G_TYPE_INT, qcamsrc->qcam->height / scale, + "framerate", G_TYPE_DOUBLE, 10., NULL)); } scan = qc_scan (qcamsrc->qcam); @@ -324,7 +326,7 @@ gst_qcamsrc_set_property (GObject * object, guint prop_id, const GValue * value, case ARG_AUTOEXP: src->autoexposure = g_value_get_enum (value); if (src->autoexposure != AE_NONE) - qcip_set_autoexposure_mode (src->autoexposure); + qcip_set_autoexposure_mode (src->autoexposure); break; default: break; @@ -395,8 +397,8 @@ gst_qcamsrc_change_state (GstElement * element) if (!GST_FLAG_IS_SET (element, GST_QCAMSRC_OPEN)) { gst_info ("qcamsrc: opening\n"); if (!gst_qcamsrc_open (GST_QCAMSRC (element))) { - gst_info ("qcamsrc: open failed\n"); - return GST_STATE_FAILURE; + gst_info ("qcamsrc: open failed\n"); + return GST_STATE_FAILURE; } } } @@ -431,7 +433,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "qcamsrc", GST_RANK_NONE, - GST_TYPE_QCAMSRC)) + GST_TYPE_QCAMSRC)) return FALSE; return TRUE; diff --git a/sys/qcam/qcam-Linux.c b/sys/qcam/qcam-Linux.c index 2c959e7224..41f7046cb7 100644 --- a/sys/qcam/qcam-Linux.c +++ b/sys/qcam/qcam-Linux.c @@ -82,7 +82,7 @@ int enable_ports (const struct qcam *q) { if (q->port < 0x278) - return 1; /* Better safe than sorry */ + return 1; /* Better safe than sorry */ if (q->port > 0x3bc) return 1; return (ioperm (q->port, 3, 1)); @@ -115,7 +115,7 @@ qc_lock_wait (struct qcam *q, int wait) #if 1 static struct flock sfl; - if (-1 == q->fd) { /* we've yet to open the lock file */ + if (-1 == q->fd) { /* we've yet to open the lock file */ static char lockfile[128]; sprintf (lockfile, "/var/run/LOCK.qcam.0x%x", q->port); @@ -131,7 +131,7 @@ qc_lock_wait (struct qcam *q, int wait) sfl.l_type = F_WRLCK; } #ifdef TESTING - if (0 != fcntl (q->fd, F_SETLK, &sfl)) /* non-blocking set lock */ + if (0 != fcntl (q->fd, F_SETLK, &sfl)) /* non-blocking set lock */ #else if (0 != fcntl (q->fd, wait ? F_SETLKW : F_SETLK, &sfl)) #endif @@ -142,9 +142,9 @@ qc_lock_wait (struct qcam *q, int wait) return 1; fprintf (stderr, "%s - %d: waiting for exclusive lock on fd %d...\n", - __FILE__, __LINE__, q->fd); + __FILE__, __LINE__, q->fd); - if (0 != fcntl (q->fd, F_SETLKW, &sfl)) /* "blocking" set lock */ + if (0 != fcntl (q->fd, F_SETLKW, &sfl)) /* "blocking" set lock */ #endif { perror ("fcntl"); @@ -202,7 +202,7 @@ qc_unlock (struct qcam *q) static struct flock sfl; #if 1 - if (-1 == q->fd) { /* port was not locked */ + if (-1 == q->fd) { /* port was not locked */ return 1; } @@ -220,7 +220,7 @@ qc_unlock (struct qcam *q) char lockfile[128]; sprintf (lockfile, "/var/run/LOCK.qcam.0x%x", q->port); - unlink (lockfile); /* What would I do with an error? */ + unlink (lockfile); /* What would I do with an error? */ #endif return 0; diff --git a/sys/qcam/qcam-lib.c b/sys/qcam/qcam-lib.c index e7208cdca0..c472e57784 100644 --- a/sys/qcam/qcam-lib.c +++ b/sys/qcam/qcam-lib.c @@ -252,8 +252,8 @@ qc_calibrate (struct qcam *q) int count = 0; #endif - qc_command (q, 27); /* AutoAdjustOffset */ - qc_command (q, 0); /* Dummy Parameter, ignored by the camera */ + qc_command (q, 27); /* AutoAdjustOffset */ + qc_command (q, 0); /* Dummy Parameter, ignored by the camera */ /* GetOffset (33) will read 255 until autocalibration */ /* is finished. After that, a value of 1-254 will be */ @@ -294,7 +294,7 @@ qc_init (void) q = malloc (sizeof (struct qcam)); - q->port = 0; /* Port 0 == Autoprobe */ + q->port = 0; /* Port 0 == Autoprobe */ q->port_mode = (QC_ANY | QC_NOTSET); q->width = 160; q->height = 120; @@ -306,11 +306,11 @@ qc_init (void) q->top = 1; q->left = 14; q->mode = -1; - q->fd = -1; /* added initialization of fd member - * BTW, there doesn't seem to be a place to close this fd... - * I think we need a qc_free function. - * - Dave Plonka (plonka@carroll1.cc.edu) - */ + q->fd = -1; /* added initialization of fd member + * BTW, there doesn't seem to be a place to close this fd... + * I think we need a qc_free function. + * - Dave Plonka (plonka@carroll1.cc.edu) + */ return q; } @@ -470,9 +470,9 @@ qc_detect (const struct qcam *q) /* Be liberal in what you accept... */ if (count > 3 && count < 15) - return 1; /* found */ + return 1; /* found */ else - return 0; /* not found */ + return 0; /* not found */ } @@ -498,9 +498,9 @@ qc_reset (struct qcam *q) write_lpdata (q, 0x75); if (read_lpdata (q) != 0x75) { - q->port_mode = (q->port_mode & ~QC_MODE_MASK) | QC_BIDIR; + q->port_mode = (q->port_mode & ~QC_MODE_MASK) | QC_BIDIR; } else { - q->port_mode = (q->port_mode & ~QC_MODE_MASK) | QC_UNIDIR; + q->port_mode = (q->port_mode & ~QC_MODE_MASK) | QC_UNIDIR; } break; @@ -514,7 +514,7 @@ qc_reset (struct qcam *q) write_lpcontrol (q, 0xb); usleep (250); write_lpcontrol (q, 0xe); - (void) qc_setscanmode (q); /* in case port_mode changed */ + (void) qc_setscanmode (q); /* in case port_mode changed */ } @@ -600,7 +600,7 @@ qc_set (struct qcam *q) } else { val = q->width * q->bpp; val2 = (((q->port_mode & QC_MODE_MASK) == QC_BIDIR) ? 24 : 8) * - q->transfer_scale; + q->transfer_scale; } val = (val + val2 - 1) / val2; qc_command (q, 0x13); @@ -639,7 +639,7 @@ qc_readbytes (const struct qcam *q, char buffer[]) } switch (q->port_mode & QC_MODE_MASK) { - case QC_BIDIR: /* Bi-directional Port */ + case QC_BIDIR: /* Bi-directional Port */ write_lpcontrol (q, 0x26); lo = (qc_waithand2 (q, 1) >> 1); hi = (read_lpstatus (q) >> 3) & 0x1f; @@ -647,74 +647,74 @@ qc_readbytes (const struct qcam *q, char buffer[]) lo2 = (qc_waithand2 (q, 0) >> 1); hi2 = (read_lpstatus (q) >> 3) & 0x1f; switch (q->bpp) { - case 4: - buffer[0] = lo & 0xf; - buffer[1] = ((lo & 0x70) >> 4) | ((hi & 1) << 3); - buffer[2] = (hi & 0x1e) >> 1; - buffer[3] = lo2 & 0xf; - buffer[4] = ((lo2 & 0x70) >> 4) | ((hi2 & 1) << 3); - buffer[5] = (hi2 & 0x1e) >> 1; - ret = 6; - break; - case 6: - buffer[0] = lo & 0x3f; - buffer[1] = ((lo & 0x40) >> 6) | (hi << 1); - buffer[2] = lo2 & 0x3f; - buffer[3] = ((lo2 & 0x40) >> 6) | (hi2 << 1); - ret = 4; - break; - default: - fprintf (stderr, "Bad bidir pixel depth %d\n", q->bpp); - ret = -1; - break; + case 4: + buffer[0] = lo & 0xf; + buffer[1] = ((lo & 0x70) >> 4) | ((hi & 1) << 3); + buffer[2] = (hi & 0x1e) >> 1; + buffer[3] = lo2 & 0xf; + buffer[4] = ((lo2 & 0x70) >> 4) | ((hi2 & 1) << 3); + buffer[5] = (hi2 & 0x1e) >> 1; + ret = 6; + break; + case 6: + buffer[0] = lo & 0x3f; + buffer[1] = ((lo & 0x40) >> 6) | (hi << 1); + buffer[2] = lo2 & 0x3f; + buffer[3] = ((lo2 & 0x40) >> 6) | (hi2 << 1); + ret = 4; + break; + default: + fprintf (stderr, "Bad bidir pixel depth %d\n", q->bpp); + ret = -1; + break; } break; - case QC_UNIDIR: /* Unidirectional Port */ + case QC_UNIDIR: /* Unidirectional Port */ write_lpcontrol (q, 6); lo = (qc_waithand (q, 1) & 0xf0) >> 4; write_lpcontrol (q, 0xe); hi = (qc_waithand (q, 0) & 0xf0) >> 4; switch (q->bpp) { - case 4: - buffer[0] = lo; - buffer[1] = hi; - ret = 2; - break; - case 6: - switch (state) { - case 0: - buffer[0] = (lo << 2) | ((hi & 0xc) >> 2); - saved_bits = (hi & 3) << 4; - state = 1; - ret = 1; - break; - case 1: - buffer[0] = lo | saved_bits; - saved_bits = hi << 2; - state = 2; - ret = 1; - break; - case 2: - buffer[0] = ((lo & 0xc) >> 2) | saved_bits; - buffer[1] = ((lo & 3) << 4) | hi; - state = 0; - ret = 2; - break; - default: - fprintf (stderr, "Unidir 6-bit state %d?\n", state); - ret = -1; - break; - } - break; - default: - fprintf (stderr, "Bad unidir pixel depth %d\n", q->bpp); - ret = -1; - break; + case 4: + buffer[0] = lo; + buffer[1] = hi; + ret = 2; + break; + case 6: + switch (state) { + case 0: + buffer[0] = (lo << 2) | ((hi & 0xc) >> 2); + saved_bits = (hi & 3) << 4; + state = 1; + ret = 1; + break; + case 1: + buffer[0] = lo | saved_bits; + saved_bits = hi << 2; + state = 2; + ret = 1; + break; + case 2: + buffer[0] = ((lo & 0xc) >> 2) | saved_bits; + buffer[1] = ((lo & 3) << 4) | hi; + state = 0; + ret = 2; + break; + default: + fprintf (stderr, "Unidir 6-bit state %d?\n", state); + ret = -1; + break; + } + break; + default: + fprintf (stderr, "Bad unidir pixel depth %d\n", q->bpp); + ret = -1; + break; } break; - case QC_SERIAL: /* Serial Interface. Just in case. */ + case QC_SERIAL: /* Serial Interface. Just in case. */ default: fprintf (stderr, "Mode %x not supported\n", q->port_mode); ret = -1; @@ -770,7 +770,7 @@ qc_scan (const struct qcam * q) } if ((q->port_mode & QC_MODE_MASK) == QC_BIDIR) { - write_lpcontrol (q, 0x2e); /* turn port around */ + write_lpcontrol (q, 0x2e); /* turn port around */ write_lpcontrol (q, 0x26); (void) qc_waithand (q, 1); write_lpcontrol (q, 0x2e); @@ -801,18 +801,18 @@ qc_scan (const struct qcam * q) bytes = qc_readbytes (q, buffer); assert (bytes > 0); for (k = 0; k < bytes && (pixels_read + k) < pixels_per_line; k++) { - assert (buffer[k] <= invert); - assert (buffer[k] >= 0); - if (buffer[k] == 0 && invert == 16) { - /* 4bpp is odd (again) -- inverter is 16, not 15, but output - must be 0-15 -- bls */ - buffer[k] = 16; - } - ret[i * pixels_per_line + pixels_read + k] = invert - buffer[k]; + assert (buffer[k] <= invert); + assert (buffer[k] >= 0); + if (buffer[k] == 0 && invert == 16) { + /* 4bpp is odd (again) -- inverter is 16, not 15, but output + must be 0-15 -- bls */ + buffer[k] = 16; + } + ret[i * pixels_per_line + pixels_read + k] = invert - buffer[k]; } pixels_read += bytes; } - (void) qc_readbytes (q, 0); /* reset state machine */ + (void) qc_readbytes (q, 0); /* reset state machine */ } if ((q->port_mode & QC_MODE_MASK) == QC_BIDIR) { diff --git a/sys/qcam/qcam-os.c b/sys/qcam/qcam-os.c index 2c959e7224..41f7046cb7 100644 --- a/sys/qcam/qcam-os.c +++ b/sys/qcam/qcam-os.c @@ -82,7 +82,7 @@ int enable_ports (const struct qcam *q) { if (q->port < 0x278) - return 1; /* Better safe than sorry */ + return 1; /* Better safe than sorry */ if (q->port > 0x3bc) return 1; return (ioperm (q->port, 3, 1)); @@ -115,7 +115,7 @@ qc_lock_wait (struct qcam *q, int wait) #if 1 static struct flock sfl; - if (-1 == q->fd) { /* we've yet to open the lock file */ + if (-1 == q->fd) { /* we've yet to open the lock file */ static char lockfile[128]; sprintf (lockfile, "/var/run/LOCK.qcam.0x%x", q->port); @@ -131,7 +131,7 @@ qc_lock_wait (struct qcam *q, int wait) sfl.l_type = F_WRLCK; } #ifdef TESTING - if (0 != fcntl (q->fd, F_SETLK, &sfl)) /* non-blocking set lock */ + if (0 != fcntl (q->fd, F_SETLK, &sfl)) /* non-blocking set lock */ #else if (0 != fcntl (q->fd, wait ? F_SETLKW : F_SETLK, &sfl)) #endif @@ -142,9 +142,9 @@ qc_lock_wait (struct qcam *q, int wait) return 1; fprintf (stderr, "%s - %d: waiting for exclusive lock on fd %d...\n", - __FILE__, __LINE__, q->fd); + __FILE__, __LINE__, q->fd); - if (0 != fcntl (q->fd, F_SETLKW, &sfl)) /* "blocking" set lock */ + if (0 != fcntl (q->fd, F_SETLKW, &sfl)) /* "blocking" set lock */ #endif { perror ("fcntl"); @@ -202,7 +202,7 @@ qc_unlock (struct qcam *q) static struct flock sfl; #if 1 - if (-1 == q->fd) { /* port was not locked */ + if (-1 == q->fd) { /* port was not locked */ return 1; } @@ -220,7 +220,7 @@ qc_unlock (struct qcam *q) char lockfile[128]; sprintf (lockfile, "/var/run/LOCK.qcam.0x%x", q->port); - unlink (lockfile); /* What would I do with an error? */ + unlink (lockfile); /* What would I do with an error? */ #endif return 0; diff --git a/sys/v4l2/gstv4l2.c b/sys/v4l2/gstv4l2.c index 633ce52e0f..194cb077c4 100644 --- a/sys/v4l2/gstv4l2.c +++ b/sys/v4l2/gstv4l2.c @@ -37,9 +37,9 @@ plugin_init (GstPlugin * plugin) return FALSE; if (!gst_element_register (plugin, "v4l2element", - GST_RANK_NONE, GST_TYPE_V4L2ELEMENT) || + GST_RANK_NONE, GST_TYPE_V4L2ELEMENT) || !gst_element_register (plugin, "v4l2src", - GST_RANK_NONE, GST_TYPE_V4L2SRC)) + GST_RANK_NONE, GST_TYPE_V4L2SRC)) return FALSE; #ifdef ENABLE_NLS diff --git a/sys/v4l2/gstv4l2colorbalance.c b/sys/v4l2/gstv4l2colorbalance.c index 274043d83b..db53d7f9ee 100644 --- a/sys/v4l2/gstv4l2colorbalance.c +++ b/sys/v4l2/gstv4l2colorbalance.c @@ -62,8 +62,8 @@ gst_v4l2_color_balance_channel_get_type (void) }; gst_v4l2_color_balance_channel_type = - g_type_register_static (GST_TYPE_COLOR_BALANCE_CHANNEL, - "GstV4l2ColorBalanceChannel", &v4l2_tuner_channel_info, 0); + g_type_register_static (GST_TYPE_COLOR_BALANCE_CHANNEL, + "GstV4l2ColorBalanceChannel", &v4l2_tuner_channel_info, 0); } return gst_v4l2_color_balance_channel_type; @@ -123,7 +123,7 @@ gst_v4l2_color_balance_set_value (GstColorBalance * balance, /* assert that we're opened and that we're using a known item */ g_return_if_fail (GST_V4L2_IS_OPEN (v4l2element)); g_return_if_fail (gst_v4l2_color_balance_contains_channel (v4l2element, - v4l2channel)); + v4l2channel)); gst_v4l2_set_attribute (v4l2element, v4l2channel->index, value); } @@ -140,7 +140,7 @@ gst_v4l2_color_balance_get_value (GstColorBalance * balance, /* assert that we're opened and that we're using a known item */ g_return_val_if_fail (GST_V4L2_IS_OPEN (v4l2element), 0); g_return_val_if_fail (gst_v4l2_color_balance_contains_channel (v4l2element, - v4l2channel), 0); + v4l2channel), 0); if (!gst_v4l2_get_attribute (v4l2element, v4l2channel->index, &value)) return 0; diff --git a/sys/v4l2/gstv4l2element.c b/sys/v4l2/gstv4l2element.c index 246d494931..1595e87f83 100644 --- a/sys/v4l2/gstv4l2element.c +++ b/sys/v4l2/gstv4l2element.c @@ -138,22 +138,22 @@ gst_v4l2_class_probe_devices (GstV4l2ElementClass * klass, gboolean check) /* detect /dev entries */ for (n = 0; n < 64; n++) { for (base = 0; dev_base[base] != NULL; base++) { - struct stat s; - gchar *device = g_strdup_printf ("%s%d", - dev_base[base], n); + struct stat s; + gchar *device = g_strdup_printf ("%s%d", + dev_base[base], n); - /* does the /dev/ entry exist at all? */ - if (stat (device, &s) == 0) { - /* yes: is a device attached? */ - if ((fd = open (device, O_RDONLY)) > 0 || errno == EBUSY) { - if (fd > 0) - close (fd); + /* does the /dev/ entry exist at all? */ + if (stat (device, &s) == 0) { + /* yes: is a device attached? */ + if ((fd = open (device, O_RDONLY)) > 0 || errno == EBUSY) { + if (fd > 0) + close (fd); - devices = g_list_append (devices, device); - break; - } - } - g_free (device); + devices = g_list_append (devices, device); + break; + } + } + g_free (device); } } @@ -301,19 +301,19 @@ gst_v4l2element_get_type (void) }; v4l2element_type = - g_type_register_static (GST_TYPE_ELEMENT, - "GstV4l2Element", &v4l2element_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, + "GstV4l2Element", &v4l2element_info, 0); g_type_add_interface_static (v4l2element_type, - GST_TYPE_IMPLEMENTS_INTERFACE, &v4l2iface_info); + GST_TYPE_IMPLEMENTS_INTERFACE, &v4l2iface_info); g_type_add_interface_static (v4l2element_type, - GST_TYPE_TUNER, &v4l2_tuner_info); + GST_TYPE_TUNER, &v4l2_tuner_info); g_type_add_interface_static (v4l2element_type, - GST_TYPE_X_OVERLAY, &v4l2_xoverlay_info); + GST_TYPE_X_OVERLAY, &v4l2_xoverlay_info); g_type_add_interface_static (v4l2element_type, - GST_TYPE_COLOR_BALANCE, &v4l2_colorbalance_info); + GST_TYPE_COLOR_BALANCE, &v4l2_colorbalance_info); g_type_add_interface_static (v4l2element_type, - GST_TYPE_PROPERTY_PROBE, &v4l2_propertyprobe_info); + GST_TYPE_PROPERTY_PROBE, &v4l2_propertyprobe_info); } return v4l2element_type; @@ -329,20 +329,20 @@ gst_v4l2_device_get_type (void) if (v4l2_device_type == 0) { static const GFlagsValue values[] = { {V4L2_CAP_VIDEO_CAPTURE, "CAPTURE", - "Device can capture"}, + "Device can capture"}, {V4L2_CAP_VIDEO_OUTPUT, "PLAYBACK", - "Device can playback"}, + "Device can playback"}, {V4L2_CAP_VIDEO_OVERLAY, "OVERLAY", - "Device can do overlay"}, + "Device can do overlay"}, {V4L2_CAP_TUNER, "TUNER", - "Device has a tuner"}, + "Device has a tuner"}, {V4L2_CAP_AUDIO, "AUDIO", - "Device handles audio"}, + "Device handles audio"}, {0, NULL, NULL} }; v4l2_device_type = - g_flags_register_static ("GstV4l2DeviceTypeFlags", values); + g_flags_register_static ("GstV4l2DeviceTypeFlags", values); } return v4l2_device_type; @@ -368,22 +368,22 @@ gst_v4l2element_class_init (GstV4l2ElementClass * klass) g_object_class_install_property (gobject_class, ARG_DEVICE, g_param_spec_string ("device", "Device", "Device location", - NULL, G_PARAM_READWRITE)); + NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_DEVICE_NAME, g_param_spec_string ("device_name", "Device name", - "Name of the device", NULL, G_PARAM_READABLE)); + "Name of the device", NULL, G_PARAM_READABLE)); g_object_class_install_property (gobject_class, ARG_FLAGS, g_param_spec_flags ("flags", "Flags", "Device type flags", - GST_TYPE_V4L2_DEVICE_FLAGS, 0, G_PARAM_READABLE)); + GST_TYPE_V4L2_DEVICE_FLAGS, 0, G_PARAM_READABLE)); g_object_class_install_property (gobject_class, ARG_NORM, g_param_spec_string ("norm", "norm", - "Norm to use", NULL, G_PARAM_READWRITE)); + "Norm to use", NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_CHANNEL, g_param_spec_string ("channel", "channel", - "input/output to switch to", NULL, G_PARAM_READWRITE)); + "input/output to switch to", NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_FREQUENCY, g_param_spec_ulong ("frequency", "frequency", - "frequency to tune to", 0, G_MAXULONG, 0, G_PARAM_READWRITE)); + "frequency to tune to", 0, G_MAXULONG, 0, G_PARAM_READWRITE)); /* signals */ gst_v4l2element_signals[SIGNAL_OPEN] = @@ -462,49 +462,49 @@ gst_v4l2element_set_property (GObject * object, switch (prop_id) { case ARG_DEVICE: if (!GST_V4L2_IS_OPEN (v4l2element)) { - if (v4l2element->device) - g_free (v4l2element->device); - v4l2element->device = g_value_dup_string (value); + if (v4l2element->device) + g_free (v4l2element->device); + v4l2element->device = g_value_dup_string (value); } break; case ARG_NORM: if (GST_V4L2_IS_OPEN (v4l2element)) { - GstTunerNorm *norm = gst_tuner_get_norm (tuner); + GstTunerNorm *norm = gst_tuner_get_norm (tuner); - if (norm) { - gst_tuner_set_norm (tuner, norm); - } + if (norm) { + gst_tuner_set_norm (tuner, norm); + } } else { - g_free (v4l2element->norm); - v4l2element->norm = g_value_dup_string (value); - g_object_notify (object, "norm"); + g_free (v4l2element->norm); + v4l2element->norm = g_value_dup_string (value); + g_object_notify (object, "norm"); } break; case ARG_CHANNEL: if (GST_V4L2_IS_OPEN (v4l2element)) { - GstTunerChannel *channel = gst_tuner_get_channel (tuner); + GstTunerChannel *channel = gst_tuner_get_channel (tuner); - if (channel) { - gst_tuner_set_channel (tuner, channel); - } + if (channel) { + gst_tuner_set_channel (tuner, channel); + } } else { - g_free (v4l2element->channel); - v4l2element->channel = g_value_dup_string (value); - g_object_notify (object, "channel"); + g_free (v4l2element->channel); + v4l2element->channel = g_value_dup_string (value); + g_object_notify (object, "channel"); } break; case ARG_FREQUENCY: if (GST_V4L2_IS_OPEN (v4l2element)) { - GstTunerChannel *channel; + GstTunerChannel *channel; - if (!v4l2element->channel) - return; - channel = gst_tuner_get_channel (tuner); - g_assert (channel); - gst_tuner_set_frequency (tuner, channel, g_value_get_ulong (value)); + if (!v4l2element->channel) + return; + channel = gst_tuner_get_channel (tuner); + g_assert (channel); + gst_tuner_set_frequency (tuner, channel, g_value_get_ulong (value)); } else { - v4l2element->frequency = g_value_get_ulong (value); - g_object_notify (object, "frequency"); + v4l2element->frequency = g_value_get_ulong (value); + g_object_notify (object, "frequency"); } break; default: @@ -532,7 +532,7 @@ gst_v4l2element_get_property (GObject * object, gchar *new = NULL; if (GST_V4L2_IS_OPEN (v4l2element)) - new = v4l2element->vcap.card; + new = v4l2element->vcap.card; g_value_set_string (value, new); break; } @@ -540,7 +540,7 @@ gst_v4l2element_get_property (GObject * object, guint flags = 0; if (GST_V4L2_IS_OPEN (v4l2element)) { - flags |= v4l2element->vcap.capabilities & 30007; + flags |= v4l2element->vcap.capabilities & 30007; } g_value_set_flags (value, flags); break; @@ -578,23 +578,23 @@ gst_v4l2element_change_state (GstElement * element) gst_v4l2_set_display (v4l2element); if (!gst_v4l2_open (v4l2element)) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; gst_v4l2_xoverlay_open (v4l2element); /* emit a signal! whoopie! */ g_signal_emit (G_OBJECT (v4l2element), - gst_v4l2element_signals[SIGNAL_OPEN], 0, v4l2element->device); + gst_v4l2element_signals[SIGNAL_OPEN], 0, v4l2element->device); break; case GST_STATE_READY_TO_NULL: gst_v4l2_xoverlay_close (v4l2element); if (!gst_v4l2_close (v4l2element)) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; /* emit yet another signal! wheehee! */ g_signal_emit (G_OBJECT (v4l2element), - gst_v4l2element_signals[SIGNAL_CLOSE], 0, v4l2element->device); + gst_v4l2element_signals[SIGNAL_CLOSE], 0, v4l2element->device); break; } diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index 5e5cdddc04..bc9c66a27e 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -58,34 +58,34 @@ enum guint32 gst_v4l2_formats[] = { /* from Linux 2.6.0 videodev2.h */ - V4L2_PIX_FMT_RGB332, /* 8 RGB-3-3-2 */ - V4L2_PIX_FMT_RGB555, /* 16 RGB-5-5-5 */ - V4L2_PIX_FMT_RGB565, /* 16 RGB-5-6-5 */ - V4L2_PIX_FMT_RGB555X, /* 16 RGB-5-5-5 BE */ - V4L2_PIX_FMT_RGB565X, /* 16 RGB-5-6-5 BE */ - V4L2_PIX_FMT_BGR24, /* 24 BGR-8-8-8 */ - V4L2_PIX_FMT_RGB24, /* 24 RGB-8-8-8 */ - V4L2_PIX_FMT_BGR32, /* 32 BGR-8-8-8-8 */ - V4L2_PIX_FMT_RGB32, /* 32 RGB-8-8-8-8 */ - V4L2_PIX_FMT_GREY, /* 8 Greyscale */ - V4L2_PIX_FMT_YVU410, /* 9 YVU 4:1:0 */ - V4L2_PIX_FMT_YVU420, /* 12 YVU 4:2:0 */ - V4L2_PIX_FMT_YUYV, /* 16 YUV 4:2:2 */ - V4L2_PIX_FMT_UYVY, /* 16 YUV 4:2:2 */ - V4L2_PIX_FMT_YUV422P, /* 16 YVU422 planar */ - V4L2_PIX_FMT_YUV411P, /* 16 YVU411 planar */ - V4L2_PIX_FMT_Y41P, /* 12 YUV 4:1:1 */ - V4L2_PIX_FMT_NV12, /* 12 Y/CbCr 4:2:0 */ - V4L2_PIX_FMT_NV21, /* 12 Y/CrCb 4:2:0 */ - V4L2_PIX_FMT_YUV410, /* 9 YUV 4:1:0 */ - V4L2_PIX_FMT_YUV420, /* 12 YUV 4:2:0 */ - V4L2_PIX_FMT_YYUV, /* 16 YUV 4:2:2 */ - V4L2_PIX_FMT_HI240, /* 8 8-bit color */ - V4L2_PIX_FMT_MJPEG, /* Motion-JPEG */ - V4L2_PIX_FMT_JPEG, /* JFIF JPEG */ - V4L2_PIX_FMT_DV, /* 1394 */ - V4L2_PIX_FMT_MPEG, /* MPEG */ - V4L2_PIX_FMT_WNVA /* Winnov hw compres */ + V4L2_PIX_FMT_RGB332, /* 8 RGB-3-3-2 */ + V4L2_PIX_FMT_RGB555, /* 16 RGB-5-5-5 */ + V4L2_PIX_FMT_RGB565, /* 16 RGB-5-6-5 */ + V4L2_PIX_FMT_RGB555X, /* 16 RGB-5-5-5 BE */ + V4L2_PIX_FMT_RGB565X, /* 16 RGB-5-6-5 BE */ + V4L2_PIX_FMT_BGR24, /* 24 BGR-8-8-8 */ + V4L2_PIX_FMT_RGB24, /* 24 RGB-8-8-8 */ + V4L2_PIX_FMT_BGR32, /* 32 BGR-8-8-8-8 */ + V4L2_PIX_FMT_RGB32, /* 32 RGB-8-8-8-8 */ + V4L2_PIX_FMT_GREY, /* 8 Greyscale */ + V4L2_PIX_FMT_YVU410, /* 9 YVU 4:1:0 */ + V4L2_PIX_FMT_YVU420, /* 12 YVU 4:2:0 */ + V4L2_PIX_FMT_YUYV, /* 16 YUV 4:2:2 */ + V4L2_PIX_FMT_UYVY, /* 16 YUV 4:2:2 */ + V4L2_PIX_FMT_YUV422P, /* 16 YVU422 planar */ + V4L2_PIX_FMT_YUV411P, /* 16 YVU411 planar */ + V4L2_PIX_FMT_Y41P, /* 12 YUV 4:1:1 */ + V4L2_PIX_FMT_NV12, /* 12 Y/CbCr 4:2:0 */ + V4L2_PIX_FMT_NV21, /* 12 Y/CrCb 4:2:0 */ + V4L2_PIX_FMT_YUV410, /* 9 YUV 4:1:0 */ + V4L2_PIX_FMT_YUV420, /* 12 YUV 4:2:0 */ + V4L2_PIX_FMT_YYUV, /* 16 YUV 4:2:2 */ + V4L2_PIX_FMT_HI240, /* 8 8-bit color */ + V4L2_PIX_FMT_MJPEG, /* Motion-JPEG */ + V4L2_PIX_FMT_JPEG, /* JFIF JPEG */ + V4L2_PIX_FMT_DV, /* 1394 */ + V4L2_PIX_FMT_MPEG, /* MPEG */ + V4L2_PIX_FMT_WNVA /* Winnov hw compres */ }; #define GST_V4L2_FORMAT_COUNT (G_N_ELEMENTS (gst_v4l2_formats)) @@ -150,8 +150,9 @@ gst_v4l2src_get_type (void) gst_v4l2src_init, NULL }; + v4l2src_type = g_type_register_static (GST_TYPE_V4L2ELEMENT, - "GstV4l2Src", &v4l2src_info, 0); + "GstV4l2Src", &v4l2src_info, 0); GST_DEBUG_CATEGORY_INIT (v4l2src_debug, "v4l2src", 0, "v4l2src element"); } return v4l2src_type; @@ -185,16 +186,16 @@ gst_v4l2src_class_init (gpointer g_class, gpointer class_data) g_object_class_install_property (gobject_class, ARG_NUMBUFS, g_param_spec_int ("num_buffers", "num_buffers", "num_buffers", - G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); + G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_BUFSIZE, g_param_spec_int ("buffer_size", "buffer_size", "buffer_size", - G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); + G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); g_object_class_install_property (gobject_class, ARG_USE_FIXED_FPS, g_param_spec_boolean ("use_fixed_fps", "Use Fixed FPS", - "Drop/Insert frames to reach a certain FPS (TRUE) " - "or adapt FPS to suit the number of frabbed frames", - TRUE, G_PARAM_READWRITE)); + "Drop/Insert frames to reach a certain FPS (TRUE) " + "or adapt FPS to suit the number of frabbed frames", + TRUE, G_PARAM_READWRITE)); /* signals */ gst_v4l2src_signals[SIGNAL_FRAME_CAPTURE] = @@ -280,7 +281,7 @@ gst_v4l2src_get_fps (GstV4l2Src * v4l2src) if (!v4l2src->use_fixed_fps && v4l2src->clock != NULL && v4l2src->handled > 0) { /* try to get time from clock master and calculate fps */ GstClockTime time = gst_clock_get_time (v4l2src->clock) - - v4l2src->substract_time; + v4l2src->substract_time; return v4l2src->handled * GST_SECOND / time; } @@ -317,21 +318,21 @@ gst_v4l2src_src_convert (GstPad * pad, switch (src_format) { case GST_FORMAT_TIME: switch (*dest_format) { - case GST_FORMAT_DEFAULT: - *dest_value = src_value * fps / GST_SECOND; - break; - default: - return FALSE; + case GST_FORMAT_DEFAULT: + *dest_value = src_value * fps / GST_SECOND; + break; + default: + return FALSE; } break; case GST_FORMAT_DEFAULT: switch (*dest_format) { - case GST_FORMAT_TIME: - *dest_value = src_value * GST_SECOND / fps; - break; - default: - return FALSE; + case GST_FORMAT_TIME: + *dest_value = src_value * GST_SECOND / fps; + break; + default: + return FALSE; } break; @@ -356,15 +357,15 @@ gst_v4l2src_src_query (GstPad * pad, switch (type) { case GST_QUERY_POSITION: switch (*format) { - case GST_FORMAT_TIME: - *value = v4l2src->handled * GST_SECOND / fps; - break; - case GST_FORMAT_DEFAULT: - *value = v4l2src->handled; - break; - default: - res = FALSE; - break; + case GST_FORMAT_TIME: + *value = v4l2src->handled * GST_SECOND / fps; + break; + case GST_FORMAT_DEFAULT: + *value = v4l2src->handled; + break; + default: + res = FALSE; + break; } break; default: @@ -381,8 +382,8 @@ gst_v4l2src_v4l2fourcc_to_caps (guint32 fourcc) GstStructure *structure = NULL; switch (fourcc) { - case V4L2_PIX_FMT_MJPEG: /* Motion-JPEG */ - case V4L2_PIX_FMT_JPEG: /* JFIF JPEG */ + case V4L2_PIX_FMT_MJPEG: /* Motion-JPEG */ + case V4L2_PIX_FMT_JPEG: /* JFIF JPEG */ structure = gst_structure_new ("video/x-jpeg", NULL); break; case V4L2_PIX_FMT_RGB332: @@ -399,84 +400,84 @@ gst_v4l2src_v4l2fourcc_to_caps (guint32 fourcc) guint32 r_mask = 0, b_mask = 0, g_mask = 0; switch (fourcc) { - case V4L2_PIX_FMT_RGB332: - bpp = depth = 8; - endianness = G_BYTE_ORDER; /* 'like, whatever' */ - r_mask = 0xe0; - g_mask = 0x1c; - b_mask = 0x03; - break; - case V4L2_PIX_FMT_RGB555: - case V4L2_PIX_FMT_RGB555X: - bpp = 16; - depth = 15; - endianness = - fourcc == V4L2_PIX_FMT_RGB555X ? G_BIG_ENDIAN : G_LITTLE_ENDIAN; - r_mask = 0x7c00; - g_mask = 0x03e0; - b_mask = 0x001f; - break; - case V4L2_PIX_FMT_RGB565: - case V4L2_PIX_FMT_RGB565X: - bpp = depth = 16; - endianness = - fourcc == V4L2_PIX_FMT_RGB565X ? G_BIG_ENDIAN : G_LITTLE_ENDIAN; - r_mask = 0xf800; - g_mask = 0x07e0; - b_mask = 0x001f; - case V4L2_PIX_FMT_RGB24: - bpp = depth = 24; - endianness = G_BIG_ENDIAN; - r_mask = 0xff0000; - g_mask = 0x00ff00; - b_mask = 0x0000ff; - break; - case V4L2_PIX_FMT_BGR24: - bpp = depth = 24; - endianness = G_BIG_ENDIAN; - r_mask = 0x0000ff; - g_mask = 0x00ff00; - b_mask = 0xff0000; - break; - case V4L2_PIX_FMT_RGB32: - bpp = depth = 32; - endianness = G_BIG_ENDIAN; - r_mask = 0xff000000; - g_mask = 0x00ff0000; - b_mask = 0x0000ff00; - break; - case V4L2_PIX_FMT_BGR32: - bpp = depth = 32; - endianness = G_BIG_ENDIAN; - r_mask = 0x000000ff; - g_mask = 0x0000ff00; - b_mask = 0x00ff0000; - break; - default: - g_assert_not_reached (); - break; + case V4L2_PIX_FMT_RGB332: + bpp = depth = 8; + endianness = G_BYTE_ORDER; /* 'like, whatever' */ + r_mask = 0xe0; + g_mask = 0x1c; + b_mask = 0x03; + break; + case V4L2_PIX_FMT_RGB555: + case V4L2_PIX_FMT_RGB555X: + bpp = 16; + depth = 15; + endianness = + fourcc == V4L2_PIX_FMT_RGB555X ? G_BIG_ENDIAN : G_LITTLE_ENDIAN; + r_mask = 0x7c00; + g_mask = 0x03e0; + b_mask = 0x001f; + break; + case V4L2_PIX_FMT_RGB565: + case V4L2_PIX_FMT_RGB565X: + bpp = depth = 16; + endianness = + fourcc == V4L2_PIX_FMT_RGB565X ? G_BIG_ENDIAN : G_LITTLE_ENDIAN; + r_mask = 0xf800; + g_mask = 0x07e0; + b_mask = 0x001f; + case V4L2_PIX_FMT_RGB24: + bpp = depth = 24; + endianness = G_BIG_ENDIAN; + r_mask = 0xff0000; + g_mask = 0x00ff00; + b_mask = 0x0000ff; + break; + case V4L2_PIX_FMT_BGR24: + bpp = depth = 24; + endianness = G_BIG_ENDIAN; + r_mask = 0x0000ff; + g_mask = 0x00ff00; + b_mask = 0xff0000; + break; + case V4L2_PIX_FMT_RGB32: + bpp = depth = 32; + endianness = G_BIG_ENDIAN; + r_mask = 0xff000000; + g_mask = 0x00ff0000; + b_mask = 0x0000ff00; + break; + case V4L2_PIX_FMT_BGR32: + bpp = depth = 32; + endianness = G_BIG_ENDIAN; + r_mask = 0x000000ff; + g_mask = 0x0000ff00; + b_mask = 0x00ff0000; + break; + default: + g_assert_not_reached (); + break; } structure = gst_structure_new ("video/x-raw-rgb", - "bpp", G_TYPE_INT, bpp, - "depth", G_TYPE_INT, depth, - "red_mask", G_TYPE_INT, r_mask, - "green_mask", G_TYPE_INT, g_mask, - "blue_mask", G_TYPE_INT, b_mask, - "endianness", G_TYPE_INT, endianness, NULL); + "bpp", G_TYPE_INT, bpp, + "depth", G_TYPE_INT, depth, + "red_mask", G_TYPE_INT, r_mask, + "green_mask", G_TYPE_INT, g_mask, + "blue_mask", G_TYPE_INT, b_mask, + "endianness", G_TYPE_INT, endianness, NULL); break; } - case V4L2_PIX_FMT_GREY: /* 8 Greyscale */ - case V4L2_PIX_FMT_YUV422P: /* 16 YVU422 planar */ - case V4L2_PIX_FMT_YUV411P: /* 16 YVU411 planar */ - case V4L2_PIX_FMT_NV12: /* 12 Y/CbCr 4:2:0 */ - case V4L2_PIX_FMT_NV21: /* 12 Y/CrCb 4:2:0 */ - case V4L2_PIX_FMT_YYUV: /* 16 YUV 4:2:2 */ - case V4L2_PIX_FMT_HI240: /* 8 8-bit color */ + case V4L2_PIX_FMT_GREY: /* 8 Greyscale */ + case V4L2_PIX_FMT_YUV422P: /* 16 YVU422 planar */ + case V4L2_PIX_FMT_YUV411P: /* 16 YVU411 planar */ + case V4L2_PIX_FMT_NV12: /* 12 Y/CbCr 4:2:0 */ + case V4L2_PIX_FMT_NV21: /* 12 Y/CrCb 4:2:0 */ + case V4L2_PIX_FMT_YYUV: /* 16 YUV 4:2:2 */ + case V4L2_PIX_FMT_HI240: /* 8 8-bit color */ /* FIXME: get correct fourccs here */ break; case V4L2_PIX_FMT_YVU410: case V4L2_PIX_FMT_YUV410: - case V4L2_PIX_FMT_YUV420: /* I420/IYUV */ + case V4L2_PIX_FMT_YUV420: /* I420/IYUV */ case V4L2_PIX_FMT_YUYV: case V4L2_PIX_FMT_YVU420: case V4L2_PIX_FMT_UYVY: @@ -484,48 +485,48 @@ gst_v4l2src_v4l2fourcc_to_caps (guint32 fourcc) guint32 fcc = 0; switch (fourcc) { - case V4L2_PIX_FMT_YVU410: - fcc = GST_MAKE_FOURCC ('Y', 'V', 'U', '9'); - break; - case V4L2_PIX_FMT_YUV410: - fcc = GST_MAKE_FOURCC ('Y', 'U', 'V', '9'); - break; - case V4L2_PIX_FMT_YUV420: - fcc = GST_MAKE_FOURCC ('I', '4', '2', '0'); - break; - case V4L2_PIX_FMT_YUYV: - fcc = GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'); - break; - case V4L2_PIX_FMT_YVU420: - fcc = GST_MAKE_FOURCC ('Y', 'V', '1', '2'); - break; - case V4L2_PIX_FMT_UYVY: - fcc = GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'); - break; - case V4L2_PIX_FMT_Y41P: - fcc = GST_MAKE_FOURCC ('Y', '4', '1', 'B'); - break; - default: - g_assert_not_reached (); - break; + case V4L2_PIX_FMT_YVU410: + fcc = GST_MAKE_FOURCC ('Y', 'V', 'U', '9'); + break; + case V4L2_PIX_FMT_YUV410: + fcc = GST_MAKE_FOURCC ('Y', 'U', 'V', '9'); + break; + case V4L2_PIX_FMT_YUV420: + fcc = GST_MAKE_FOURCC ('I', '4', '2', '0'); + break; + case V4L2_PIX_FMT_YUYV: + fcc = GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'); + break; + case V4L2_PIX_FMT_YVU420: + fcc = GST_MAKE_FOURCC ('Y', 'V', '1', '2'); + break; + case V4L2_PIX_FMT_UYVY: + fcc = GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'); + break; + case V4L2_PIX_FMT_Y41P: + fcc = GST_MAKE_FOURCC ('Y', '4', '1', 'B'); + break; + default: + g_assert_not_reached (); + break; } structure = gst_structure_new ("video/x-raw-yuv", - "format", GST_TYPE_FOURCC, fcc, NULL); + "format", GST_TYPE_FOURCC, fcc, NULL); break; } case V4L2_PIX_FMT_DV: structure = - gst_structure_new ("video/x-dv", "systemstream", G_TYPE_BOOLEAN, TRUE, - NULL); + gst_structure_new ("video/x-dv", "systemstream", G_TYPE_BOOLEAN, TRUE, + NULL); break; - case V4L2_PIX_FMT_MPEG: /* MPEG */ + case V4L2_PIX_FMT_MPEG: /* MPEG */ /* someone figure out the MPEG format used... */ break; - case V4L2_PIX_FMT_WNVA: /* Winnov hw compres */ + case V4L2_PIX_FMT_WNVA: /* Winnov hw compres */ break; default: GST_DEBUG ("Unknown fourcc 0x%08x " GST_FOURCC_FORMAT, - fourcc, GST_FOURCC_ARGS (fourcc)); + fourcc, GST_FOURCC_ARGS (fourcc)); break; } #if 0 @@ -552,8 +553,8 @@ gst_v4l2src_get_format_from_fourcc (GstV4l2Src * v4l2src, guint32 fourcc) return fmt; /* special case for jpeg */ if ((fmt->pixelformat == V4L2_PIX_FMT_MJPEG && fourcc == V4L2_PIX_FMT_JPEG) - || (fmt->pixelformat == V4L2_PIX_FMT_JPEG - && fourcc == V4L2_PIX_FMT_MJPEG)) { + || (fmt->pixelformat == V4L2_PIX_FMT_JPEG + && fourcc == V4L2_PIX_FMT_MJPEG)) { return fmt; } walk = g_slist_next (walk); @@ -578,48 +579,48 @@ gst_v4l2_fourcc_from_structure (GstStructure * structure) switch (fourcc) { case GST_MAKE_FOURCC ('I', '4', '2', '0'): case GST_MAKE_FOURCC ('I', 'Y', 'U', 'V'): - fourcc = V4L2_PIX_FMT_YUV420; - break; + fourcc = V4L2_PIX_FMT_YUV420; + break; case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): - fourcc = V4L2_PIX_FMT_YUYV; - break; + fourcc = V4L2_PIX_FMT_YUYV; + break; case GST_MAKE_FOURCC ('Y', '4', '1', 'P'): - fourcc = V4L2_PIX_FMT_Y41P; - break; + fourcc = V4L2_PIX_FMT_Y41P; + break; case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'): - fourcc = V4L2_PIX_FMT_UYVY; - break; + fourcc = V4L2_PIX_FMT_UYVY; + break; case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - fourcc = V4L2_PIX_FMT_YVU420; - break; + fourcc = V4L2_PIX_FMT_YVU420; + break; case GST_MAKE_FOURCC ('R', 'G', 'B', ' '):{ - gint depth, endianness, r_mask; + gint depth, endianness, r_mask; - gst_structure_get_int (structure, "depth", &depth); - gst_structure_get_int (structure, "endianness", &endianness); - gst_structure_get_int (structure, "red_mask", &r_mask); + gst_structure_get_int (structure, "depth", &depth); + gst_structure_get_int (structure, "endianness", &endianness); + gst_structure_get_int (structure, "red_mask", &r_mask); - switch (depth) { - case 8: - fourcc = V4L2_PIX_FMT_RGB332; - break; - case 15: - fourcc = (endianness == G_LITTLE_ENDIAN) ? - V4L2_PIX_FMT_RGB555 : V4L2_PIX_FMT_RGB555X; - break; - case 16: - fourcc = (endianness == G_LITTLE_ENDIAN) ? - V4L2_PIX_FMT_RGB565 : V4L2_PIX_FMT_RGB565X; - break; - case 24: - fourcc = (r_mask == 0xFF) ? V4L2_PIX_FMT_BGR24 : V4L2_PIX_FMT_RGB24; - break; - case 32: - fourcc = (r_mask == 0xFF) ? V4L2_PIX_FMT_BGR32 : V4L2_PIX_FMT_RGB32; - break; - } + switch (depth) { + case 8: + fourcc = V4L2_PIX_FMT_RGB332; + break; + case 15: + fourcc = (endianness == G_LITTLE_ENDIAN) ? + V4L2_PIX_FMT_RGB555 : V4L2_PIX_FMT_RGB555X; + break; + case 16: + fourcc = (endianness == G_LITTLE_ENDIAN) ? + V4L2_PIX_FMT_RGB565 : V4L2_PIX_FMT_RGB565X; + break; + case 24: + fourcc = (r_mask == 0xFF) ? V4L2_PIX_FMT_BGR24 : V4L2_PIX_FMT_RGB24; + break; + case 32: + fourcc = (r_mask == 0xFF) ? V4L2_PIX_FMT_BGR32 : V4L2_PIX_FMT_RGB32; + break; + } default: - break; + break; } } } else if (strcmp (mimetype, "video/x-dv") == 0) { @@ -651,12 +652,12 @@ gst_v4l2src_get_all_caps (void) for (i = 0; i < GST_V4L2_FORMAT_COUNT; i++) { structure = gst_v4l2src_v4l2fourcc_to_caps (gst_v4l2_formats[i]); if (structure) { - gst_structure_set (structure, - "width", GST_TYPE_INT_RANGE, 1, 4096, - "height", GST_TYPE_INT_RANGE, 1, 4096, - "framerate", GST_TYPE_DOUBLE_RANGE, (double) 0, G_MAXDOUBLE, NULL); + gst_structure_set (structure, + "width", GST_TYPE_INT_RANGE, 1, 4096, + "height", GST_TYPE_INT_RANGE, 1, 4096, + "framerate", GST_TYPE_DOUBLE_RANGE, (double) 0, G_MAXDOUBLE, NULL); - gst_caps_append_structure (caps, structure); + gst_caps_append_structure (caps, structure); } } } @@ -680,8 +681,8 @@ gst_v4l2src_fixate (GstPad * pad, const GstCaps * const_caps) for (i = 0; i < gst_caps_get_size (caps); i++) { structure = gst_caps_get_structure (caps, i); changed |= - gst_caps_structure_fixate_field_nearest_int (structure, "width", - G_MAXINT); + gst_caps_structure_fixate_field_nearest_int (structure, "width", + G_MAXINT); } if (changed) return caps; @@ -689,8 +690,8 @@ gst_v4l2src_fixate (GstPad * pad, const GstCaps * const_caps) for (i = 0; i < gst_caps_get_size (caps); i++) { structure = gst_caps_get_structure (caps, i); changed |= - gst_caps_structure_fixate_field_nearest_int (structure, "height", - G_MAXINT); + gst_caps_structure_fixate_field_nearest_int (structure, "height", + G_MAXINT); } if (changed) return caps; @@ -764,7 +765,7 @@ gst_v4l2src_getcaps (GstPad * pad) /* get size delimiters */ if (!gst_v4l2src_get_size_limits (v4l2src, format, - &min_w, &max_w, &min_h, &max_h)) { + &min_w, &max_w, &min_h, &max_h)) { continue; } @@ -773,9 +774,9 @@ gst_v4l2src_getcaps (GstPad * pad) if (structure) { gst_structure_set (structure, - "width", GST_TYPE_INT_RANGE, min_w, max_w, - "height", GST_TYPE_INT_RANGE, min_h, max_h, - "framerate", GST_TYPE_DOUBLE_RANGE, (double) 0, G_MAXDOUBLE, NULL); + "width", GST_TYPE_INT_RANGE, min_w, max_w, + "height", GST_TYPE_INT_RANGE, min_h, max_h, + "framerate", GST_TYPE_DOUBLE_RANGE, (double) 0, G_MAXDOUBLE, NULL); gst_caps_append_structure (caps, structure); } @@ -796,7 +797,7 @@ gst_v4l2src_get (GstPad * pad) if (v4l2src->use_fixed_fps && (fps = gst_v4l2src_get_fps (v4l2src)) == 0) { GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, (NULL), - ("could not get frame rate for element")); + ("could not get frame rate for element")); return NULL; } @@ -818,69 +819,69 @@ gst_v4l2src_get (GstPad * pad) gboolean have_frame = FALSE; do { - /* FIXME: isn't this v4l2 timestamp its own clock?! */ - /* by default, we use the frame once */ - v4l2src->need_writes = 1; + /* FIXME: isn't this v4l2 timestamp its own clock?! */ + /* by default, we use the frame once */ + v4l2src->need_writes = 1; - g_assert (time >= v4l2src->substract_time); - time -= v4l2src->substract_time; + g_assert (time >= v4l2src->substract_time); + time -= v4l2src->substract_time; - /* first check whether we lost any frames according to the device */ - if (v4l2src->last_seq != 0) { - if (v4l2src->pool->buffers[num].buffer.sequence - v4l2src->last_seq > - 1) { - v4l2src->need_writes = - v4l2src->pool->buffers[num].buffer.sequence - v4l2src->last_seq; - g_signal_emit (G_OBJECT (v4l2src), - gst_v4l2src_signals[SIGNAL_FRAME_LOST], 0, - v4l2src->need_writes - 1); - } - } - v4l2src->last_seq = v4l2src->pool->buffers[num].buffer.sequence; + /* first check whether we lost any frames according to the device */ + if (v4l2src->last_seq != 0) { + if (v4l2src->pool->buffers[num].buffer.sequence - v4l2src->last_seq > + 1) { + v4l2src->need_writes = + v4l2src->pool->buffers[num].buffer.sequence - v4l2src->last_seq; + g_signal_emit (G_OBJECT (v4l2src), + gst_v4l2src_signals[SIGNAL_FRAME_LOST], 0, + v4l2src->need_writes - 1); + } + } + v4l2src->last_seq = v4l2src->pool->buffers[num].buffer.sequence; - /* decide how often we're going to write the frame - set - * v4lmjpegsrc->need_writes to (that-1) and have_frame to TRUE - * if we're going to write it - else, just continue. - * - * time is generally the system or audio clock. Let's - * say that we've written one second of audio, then we want - * to have written one second of video too, within the same - * timeframe. This means that if time - begin_time = X sec, - * we want to have written X*fps frames. If we've written - * more - drop, if we've written less - dup... */ - if (v4l2src->handled * (GST_SECOND / fps) - time > - 1.5 * (GST_SECOND / fps)) { - /* yo dude, we've got too many frames here! Drop! DROP! */ - v4l2src->need_writes--; /* -= (v4l2src->handled - (time / fps)); */ - g_signal_emit (G_OBJECT (v4l2src), - gst_v4l2src_signals[SIGNAL_FRAME_DROP], 0); - } else if (v4l2src->handled * (GST_SECOND / fps) - time < - -1.5 * (GST_SECOND / fps)) { - /* this means we're lagging far behind */ - v4l2src->need_writes++; /* += ((time / fps) - v4l2src->handled); */ - g_signal_emit (G_OBJECT (v4l2src), - gst_v4l2src_signals[SIGNAL_FRAME_INSERT], 0); - } + /* decide how often we're going to write the frame - set + * v4lmjpegsrc->need_writes to (that-1) and have_frame to TRUE + * if we're going to write it - else, just continue. + * + * time is generally the system or audio clock. Let's + * say that we've written one second of audio, then we want + * to have written one second of video too, within the same + * timeframe. This means that if time - begin_time = X sec, + * we want to have written X*fps frames. If we've written + * more - drop, if we've written less - dup... */ + if (v4l2src->handled * (GST_SECOND / fps) - time > + 1.5 * (GST_SECOND / fps)) { + /* yo dude, we've got too many frames here! Drop! DROP! */ + v4l2src->need_writes--; /* -= (v4l2src->handled - (time / fps)); */ + g_signal_emit (G_OBJECT (v4l2src), + gst_v4l2src_signals[SIGNAL_FRAME_DROP], 0); + } else if (v4l2src->handled * (GST_SECOND / fps) - time < + -1.5 * (GST_SECOND / fps)) { + /* this means we're lagging far behind */ + v4l2src->need_writes++; /* += ((time / fps) - v4l2src->handled); */ + g_signal_emit (G_OBJECT (v4l2src), + gst_v4l2src_signals[SIGNAL_FRAME_INSERT], 0); + } - if (v4l2src->need_writes > 0) { - have_frame = TRUE; - v4l2src->need_writes--; - } else { - if (!gst_v4l2src_queue_frame (v4l2src, num)) - return NULL; - num = gst_v4l2src_grab_frame (v4l2src); - if (num == -1) - return NULL; - } + if (v4l2src->need_writes > 0) { + have_frame = TRUE; + v4l2src->need_writes--; + } else { + if (!gst_v4l2src_queue_frame (v4l2src, num)) + return NULL; + num = gst_v4l2src_grab_frame (v4l2src); + if (num == -1) + return NULL; + } } while (!have_frame); } g_assert (num != -1); GST_LOG_OBJECT (v4l2src, "buffer %d needs %d writes", num, - v4l2src->need_writes + 1); + v4l2src->need_writes + 1); i = v4l2src->pool->buffers[num].buffer.bytesused > - 0 ? v4l2src->pool->buffers[num].buffer.bytesused : v4l2src->pool-> - buffers[num].length; + 0 ? v4l2src->pool->buffers[num].buffer.bytesused : v4l2src->pool-> + buffers[num].length; /* check if this is the last buffer in the queue. If so do a memcpy to put it back asap to avoid framedrops and deadlocks because of stupid elements */ if (gst_atomic_int_read (&v4l2src->pool->refcount) == v4l2src->breq.count) { @@ -888,8 +889,8 @@ gst_v4l2src_get (GstPad * pad) buf = gst_buffer_new_and_alloc (i); memcpy (GST_BUFFER_DATA (buf), v4l2src->pool->buffers[num].start, i); if (!gst_v4l2src_queue_frame (v4l2src, num)) { - gst_data_unref (GST_DATA (buf)); - return NULL; + gst_data_unref (GST_DATA (buf)); + return NULL; } } else { GST_LOG_OBJECT (v4l2src, "using mmap'd buffer"); @@ -909,13 +910,13 @@ gst_v4l2src_get (GstPad * pad) } else { /* calculate time based on our own clock */ GST_BUFFER_TIMESTAMP (buf) = - GST_TIMEVAL_TO_TIME (v4l2src->pool->buffers[num].buffer.timestamp) - - v4l2src->substract_time; + GST_TIMEVAL_TO_TIME (v4l2src->pool->buffers[num].buffer.timestamp) - + v4l2src->substract_time; } if (v4l2src->need_writes > 0) { v4l2src->cached_buffer = buf; for (i = 0; i < v4l2src->need_writes; i++) { - gst_data_ref (GST_DATA (buf)); + gst_data_ref (GST_DATA (buf)); } } } @@ -939,13 +940,13 @@ gst_v4l2src_set_property (GObject * object, switch (prop_id) { case ARG_NUMBUFS: if (!GST_V4L2_IS_ACTIVE (GST_V4L2ELEMENT (v4l2src))) { - v4l2src->breq.count = g_value_get_int (value); + v4l2src->breq.count = g_value_get_int (value); } break; case ARG_USE_FIXED_FPS: if (!GST_V4L2_IS_ACTIVE (GST_V4L2ELEMENT (v4l2src))) { - v4l2src->use_fixed_fps = g_value_get_boolean (value); + v4l2src->use_fixed_fps = g_value_get_boolean (value); } break; @@ -1005,7 +1006,7 @@ gst_v4l2src_change_state (GstElement * element) switch (transition) { case GST_STATE_NULL_TO_READY: if (!gst_v4l2src_get_capture (v4l2src)) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; break; case GST_STATE_READY_TO_PAUSED: v4l2src->handled = 0; @@ -1016,24 +1017,24 @@ gst_v4l2src_change_state (GstElement * element) case GST_STATE_PAUSED_TO_PLAYING: /* queue all buffer, start streaming capture */ if (!gst_v4l2src_capture_start (v4l2src)) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; g_get_current_time (&time); v4l2src->substract_time = GST_TIMEVAL_TO_TIME (time) - - v4l2src->substract_time; + v4l2src->substract_time; v4l2src->last_seq = 0; break; case GST_STATE_PLAYING_TO_PAUSED: g_get_current_time (&time); v4l2src->substract_time = GST_TIMEVAL_TO_TIME (time) - - v4l2src->substract_time; + v4l2src->substract_time; /* de-queue all queued buffers */ if (!gst_v4l2src_capture_stop (v4l2src)) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; break; case GST_STATE_PAUSED_TO_READY: /* stop capturing, unmap all buffers */ if (!gst_v4l2src_capture_deinit (v4l2src)) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; break; case GST_STATE_READY_TO_NULL: break; diff --git a/sys/v4l2/gstv4l2tuner.c b/sys/v4l2/gstv4l2tuner.c index 5d5626f248..79e3214b83 100644 --- a/sys/v4l2/gstv4l2tuner.c +++ b/sys/v4l2/gstv4l2tuner.c @@ -76,8 +76,8 @@ gst_v4l2_tuner_channel_get_type (void) }; gst_v4l2_tuner_channel_type = - g_type_register_static (GST_TYPE_TUNER_CHANNEL, - "GstV4l2TunerChannel", &v4l2_tuner_channel_info, 0); + g_type_register_static (GST_TYPE_TUNER_CHANNEL, + "GstV4l2TunerChannel", &v4l2_tuner_channel_info, 0); } return gst_v4l2_tuner_channel_type; @@ -117,8 +117,8 @@ gst_v4l2_tuner_norm_get_type (void) }; gst_v4l2_tuner_norm_type = - g_type_register_static (GST_TYPE_TUNER_NORM, - "GstV4l2TunerNorm", &v4l2_tuner_norm_info, 0); + g_type_register_static (GST_TYPE_TUNER_NORM, + "GstV4l2TunerNorm", &v4l2_tuner_norm_info, 0); } return gst_v4l2_tuner_norm_type; @@ -295,7 +295,7 @@ gst_v4l2_tuner_set_frequency (GstTuner * mixer, /* assert that we're opened and that we're using a known item */ g_return_if_fail (GST_V4L2_IS_OPEN (v4l2element)); g_return_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel, - GST_TUNER_CHANNEL_FREQUENCY)); + GST_TUNER_CHANNEL_FREQUENCY)); g_return_if_fail (gst_v4l2_tuner_contains_channel (v4l2element, v4l2channel)); gst_v4l2_get_input (v4l2element, &chan); @@ -319,9 +319,9 @@ gst_v4l2_tuner_get_frequency (GstTuner * mixer, GstTunerChannel * channel) /* assert that we're opened and that we're using a known item */ g_return_val_if_fail (GST_V4L2_IS_OPEN (v4l2element), 0); g_return_val_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel, - GST_TUNER_CHANNEL_FREQUENCY), 0); + GST_TUNER_CHANNEL_FREQUENCY), 0); g_return_val_if_fail (gst_v4l2_tuner_contains_channel (v4l2element, - v4l2channel), 0); + v4l2channel), 0); gst_v4l2_get_input (v4l2element, &chan); if (chan == GST_V4L2_TUNER_CHANNEL (channel)->index && @@ -343,9 +343,9 @@ gst_v4l2_tuner_signal_strength (GstTuner * mixer, GstTunerChannel * channel) /* assert that we're opened and that we're using a known item */ g_return_val_if_fail (GST_V4L2_IS_OPEN (v4l2element), 0); g_return_val_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel, - GST_TUNER_CHANNEL_FREQUENCY), 0); + GST_TUNER_CHANNEL_FREQUENCY), 0); g_return_val_if_fail (gst_v4l2_tuner_contains_channel (v4l2element, - v4l2channel), 0); + v4l2channel), 0); gst_v4l2_get_input (v4l2element, &chan); if (chan == GST_V4L2_TUNER_CHANNEL (channel)->index && diff --git a/sys/v4l2/gstv4l2xoverlay.c b/sys/v4l2/gstv4l2xoverlay.c index 1af62cc1d9..515d846313 100644 --- a/sys/v4l2/gstv4l2xoverlay.c +++ b/sys/v4l2/gstv4l2xoverlay.c @@ -72,7 +72,7 @@ gst_v4l2_xoverlay_open (GstV4l2Element * v4l2element) xwin->display_name = g_strdup (v4l2element->display); if (v4l2element->xwindow_id != 0 && - xwin->display_name && xwin->display_name[0] == ':') { + xwin->display_name && xwin->display_name[0] == ':') { gst_x_window_listener_set_xid (xwin, v4l2element->xwindow_id); } } @@ -85,7 +85,7 @@ gst_v4l2_xoverlay_close (GstV4l2Element * v4l2element) if (xwin != NULL) { if (v4l2element->xwindow_id != 0 && - xwin->display_name && xwin->display_name[0] == ':') { + xwin->display_name && xwin->display_name[0] == ':') { gst_x_window_listener_set_xid (xwin, 0); } diff --git a/sys/v4l2/v4l2-overlay_calls.c b/sys/v4l2/v4l2-overlay_calls.c index d4a10ab7ec..0876879db7 100644 --- a/sys/v4l2/v4l2-overlay_calls.c +++ b/sys/v4l2/v4l2-overlay_calls.c @@ -60,14 +60,14 @@ gst_v4l2_set_display (GstV4l2Element * v4l2element) switch (system (buff)) { case -1: GST_ELEMENT_ERROR (v4l2element, RESOURCE, FAILED, - (_("Could not start v4l-conf.")), GST_ERROR_SYSTEM); + (_("Could not start v4l-conf.")), GST_ERROR_SYSTEM); g_free (buff); return FALSE; case 0: break; default: GST_ELEMENT_ERROR (v4l2element, RESOURCE, FAILED, - (_("Executing v4l-conf failed.")), GST_ERROR_SYSTEM); + (_("Executing v4l-conf failed.")), GST_ERROR_SYSTEM); g_free (buff); return FALSE; } @@ -106,7 +106,7 @@ gst_v4l2_set_window (GstElement * element, if (ioctl (v4l2element->video_fd, VIDIOC_S_FMT, &fmt) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, TOO_LAZY, (NULL), - ("Failed to set the video window: %s", g_strerror (errno))); + ("Failed to set the video window: %s", g_strerror (errno))); return FALSE; } @@ -131,8 +131,8 @@ gst_v4l2_enable_overlay (GstV4l2Element * v4l2element, gboolean enable) if (ioctl (v4l2element->video_fd, VIDIOC_OVERLAY, &doit) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, TOO_LAZY, (NULL), - ("Failed to %s overlay display: %s", - enable ? "enable" : "disable", g_strerror (errno))); + ("Failed to %s overlay display: %s", + enable ? "enable" : "disable", g_strerror (errno))); return FALSE; } diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c index f75ea55065..92de8a42fa 100644 --- a/sys/v4l2/v4l2_calls.c +++ b/sys/v4l2/v4l2_calls.c @@ -56,8 +56,8 @@ gst_v4l2_get_capabilities (GstV4l2Element * v4l2element) if (ioctl (v4l2element->video_fd, VIDIOC_QUERYCAP, &(v4l2element->vcap)) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Error getting %s capabilities: %s", - v4l2element->device, g_strerror (errno))); + ("Error getting %s capabilities: %s", + v4l2element->device, g_strerror (errno))); return FALSE; } @@ -94,14 +94,14 @@ gst_v4l2_fill_lists (GstV4l2Element * v4l2element) input.index = n; if (ioctl (v4l2element->video_fd, VIDIOC_ENUMINPUT, &input) < 0) { - if (errno == EINVAL) - break; /* end of enumeration */ - else { - GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to get %d in input enumeration for %s: %s", - n, v4l2element->device, g_strerror (errno))); - return FALSE; - } + if (errno == EINVAL) + break; /* end of enumeration */ + else { + GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), + ("Failed to get %d in input enumeration for %s: %s", + n, v4l2element->device, g_strerror (errno))); + return FALSE; + } } v4l2channel = g_object_new (GST_TYPE_V4L2_TUNER_CHANNEL, NULL); @@ -110,34 +110,34 @@ gst_v4l2_fill_lists (GstV4l2Element * v4l2element) channel->flags = GST_TUNER_CHANNEL_INPUT; v4l2channel->index = n; if (input.type == V4L2_INPUT_TYPE_TUNER) { - struct v4l2_tuner vtun; + struct v4l2_tuner vtun; - v4l2channel->tuner = input.tuner; - channel->flags |= GST_TUNER_CHANNEL_FREQUENCY; + v4l2channel->tuner = input.tuner; + channel->flags |= GST_TUNER_CHANNEL_FREQUENCY; - vtun.index = input.tuner; - if (ioctl (v4l2element->video_fd, VIDIOC_G_TUNER, &vtun) < 0) { - GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to get tuner %d settings on %s: %s", - input.tuner, v4l2element->device, g_strerror (errno))); - g_object_unref (G_OBJECT (channel)); - return FALSE; - } - channel->min_frequency = vtun.rangelow; - channel->max_frequency = vtun.rangehigh; - channel->min_signal = 0; - channel->max_signal = 0xffff; + vtun.index = input.tuner; + if (ioctl (v4l2element->video_fd, VIDIOC_G_TUNER, &vtun) < 0) { + GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), + ("Failed to get tuner %d settings on %s: %s", + input.tuner, v4l2element->device, g_strerror (errno))); + g_object_unref (G_OBJECT (channel)); + return FALSE; + } + channel->min_frequency = vtun.rangelow; + channel->max_frequency = vtun.rangehigh; + channel->min_signal = 0; + channel->max_signal = 0xffff; } if (input.audioset) { - /* we take the first. We don't care for - * the others for now */ - while (!(input.audioset & (1 << v4l2channel->audio))) - v4l2channel->audio++; - channel->flags |= GST_TUNER_CHANNEL_AUDIO; + /* we take the first. We don't care for + * the others for now */ + while (!(input.audioset & (1 << v4l2channel->audio))) + v4l2channel->audio++; + channel->flags |= GST_TUNER_CHANNEL_AUDIO; } v4l2element->channels = - g_list_append (v4l2element->channels, (gpointer) channel); + g_list_append (v4l2element->channels, (gpointer) channel); } } else { /* outputs */ @@ -148,14 +148,14 @@ gst_v4l2_fill_lists (GstV4l2Element * v4l2element) output.index = n; if (ioctl (v4l2element->video_fd, VIDIOC_ENUMOUTPUT, &output) < 0) { - if (errno == EINVAL) - break; /* end of enumeration */ - else { - GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to get %d in output enumeration for %s: %s", - n, v4l2element->device, g_strerror (errno))); - return FALSE; - } + if (errno == EINVAL) + break; /* end of enumeration */ + else { + GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), + ("Failed to get %d in output enumeration for %s: %s", + n, v4l2element->device, g_strerror (errno))); + return FALSE; + } } v4l2channel = g_object_new (GST_TYPE_V4L2_TUNER_CHANNEL, NULL); @@ -164,15 +164,15 @@ gst_v4l2_fill_lists (GstV4l2Element * v4l2element) channel->flags = GST_TUNER_CHANNEL_OUTPUT; v4l2channel->index = n; if (output.audioset) { - /* we take the first. We don't care for - * the others for now */ - while (!(output.audioset & (1 << v4l2channel->audio))) - v4l2channel->audio++; - channel->flags |= GST_TUNER_CHANNEL_AUDIO; + /* we take the first. We don't care for + * the others for now */ + while (!(output.audioset & (1 << v4l2channel->audio))) + v4l2channel->audio++; + channel->flags |= GST_TUNER_CHANNEL_AUDIO; } v4l2element->channels = - g_list_append (v4l2element->channels, (gpointer) channel); + g_list_append (v4l2element->channels, (gpointer) channel); } } @@ -185,12 +185,12 @@ gst_v4l2_fill_lists (GstV4l2Element * v4l2element) standard.index = n; if (ioctl (v4l2element->video_fd, VIDIOC_ENUMSTD, &standard) < 0) { if (errno == EINVAL) - break; /* end of enumeration */ + break; /* end of enumeration */ else { - GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to get %d in norm enumeration for %s: %s", - n, v4l2element->device, g_strerror (errno))); - return FALSE; + GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), + ("Failed to get %d in norm enumeration for %s: %s", + n, v4l2element->device, g_strerror (errno))); + return FALSE; } } @@ -198,7 +198,7 @@ gst_v4l2_fill_lists (GstV4l2Element * v4l2element) norm = GST_TUNER_NORM (v4l2norm); norm->label = g_strdup (standard.name); norm->fps = (gfloat) standard.frameperiod.denominator / - standard.frameperiod.numerator; + standard.frameperiod.numerator; v4l2norm->index = standard.id; v4l2element->norms = g_list_append (v4l2element->norms, (gpointer) norm); @@ -217,15 +217,15 @@ gst_v4l2_fill_lists (GstV4l2Element * v4l2element) control.id = n; if (ioctl (v4l2element->video_fd, VIDIOC_QUERYCTRL, &control) < 0) { if (errno == EINVAL) { - if (n < V4L2_CID_PRIVATE_BASE) - continue; - else - break; + if (n < V4L2_CID_PRIVATE_BASE) + continue; + else + break; } else { - GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to get %d in control enumeration for %s: %s", - n, v4l2element->device, g_strerror (errno))); - return FALSE; + GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), + ("Failed to get %d in control enumeration for %s: %s", + n, v4l2element->device, g_strerror (errno))); + return FALSE; } } if (control.flags & V4L2_CTRL_FLAG_DISABLED) @@ -245,12 +245,12 @@ gst_v4l2_fill_lists (GstV4l2Element * v4l2element) case V4L2_CID_EXPOSURE: case V4L2_CID_AUTOGAIN: case V4L2_CID_GAIN: - /* we only handle these for now */ - break; + /* we only handle these for now */ + break; default: - DEBUG ("ControlID %s (%d) unhandled, FIXME", control.name, n); - control.id++; - break; + DEBUG ("ControlID %s (%d) unhandled, FIXME", control.name, n); + control.id++; + break; } if (n != control.id) continue; @@ -267,20 +267,20 @@ gst_v4l2_fill_lists (GstV4l2Element * v4l2element) menu.id = n; for (i = 0;; i++) { - menu.index = i; - if (ioctl (v4l2element->video_fd, VIDIOC_QUERYMENU, &menu) < 0) { - if (errno == EINVAL) - break; /* end of enumeration */ - else { - GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to get %d in menu enumeration for %s: %s", - n, v4l2element->device, g_strerror (errno))); - return FALSE; - } - } - mptr = g_malloc (sizeof (menu)); - memcpy (mptr, &menu, sizeof (menu)); - menus = g_list_append (menus, mptr); + menu.index = i; + if (ioctl (v4l2element->video_fd, VIDIOC_QUERYMENU, &menu) < 0) { + if (errno == EINVAL) + break; /* end of enumeration */ + else { + GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), + ("Failed to get %d in menu enumeration for %s: %s", + n, v4l2element->device, g_strerror (errno))); + return FALSE; + } + } + mptr = g_malloc (sizeof (menu)); + memcpy (mptr, &menu, sizeof (menu)); + menus = g_list_append (menus, mptr); } } v4l2element->menus = g_list_append (v4l2element->menus, menus); @@ -288,20 +288,20 @@ gst_v4l2_fill_lists (GstV4l2Element * v4l2element) switch (control.type) { case V4L2_CTRL_TYPE_INTEGER: - channel->min_value = control.minimum; - channel->max_value = control.maximum; - break; + channel->min_value = control.minimum; + channel->max_value = control.maximum; + break; case V4L2_CTRL_TYPE_BOOLEAN: - channel->min_value = FALSE; - channel->max_value = TRUE; - break; + channel->min_value = FALSE; + channel->max_value = TRUE; + break; default: - channel->min_value = channel->max_value = 0; - break; + channel->min_value = channel->max_value = 0; + break; } v4l2element->colors = g_list_append (v4l2element->colors, - (gpointer) channel); + (gpointer) channel); } return TRUE; @@ -352,7 +352,7 @@ gst_v4l2_set_defaults (GstV4l2Element * v4l2element) gst_tuner_set_channel (tuner, channel); } else { channel = - GST_TUNER_CHANNEL (gst_tuner_get_channel (GST_TUNER (v4l2element))); + GST_TUNER_CHANNEL (gst_tuner_get_channel (GST_TUNER (v4l2element))); v4l2element->channel = g_strdup (channel->label); gst_tuner_channel_changed (tuner, channel); g_object_notify (G_OBJECT (v4l2element), "channel"); @@ -392,8 +392,8 @@ gst_v4l2_open (GstV4l2Element * v4l2element) v4l2element->video_fd = open (v4l2element->device, O_RDWR); if (!GST_V4L2_IS_OPEN (v4l2element)) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, OPEN_READ_WRITE, - (_("Could not open device \"%s\" for reading and writing."), - v4l2element->device), GST_ERROR_SYSTEM); + (_("Could not open device \"%s\" for reading and writing."), + v4l2element->device), GST_ERROR_SYSTEM); goto error; } @@ -406,8 +406,8 @@ gst_v4l2_open (GstV4l2Element * v4l2element) if (GST_IS_V4L2SRC (v4l2element) && !(v4l2element->vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, NOT_FOUND, - (_("Device \"%s\" is not a capture device."), v4l2element->device), - ("Capabilities: 0x%x", v4l2element->vcap.capabilities)); + (_("Device \"%s\" is not a capture device."), v4l2element->device), + ("Capabilities: 0x%x", v4l2element->vcap.capabilities)); goto error; } @@ -474,8 +474,8 @@ gst_v4l2_get_norm (GstV4l2Element * v4l2element, v4l2_std_id * norm) if (ioctl (v4l2element->video_fd, VIDIOC_G_STD, norm) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to get the current norm for device %s: %s", - v4l2element->device, g_strerror (errno))); + ("Failed to get the current norm for device %s: %s", + v4l2element->device, g_strerror (errno))); return FALSE; } @@ -498,8 +498,8 @@ gst_v4l2_set_norm (GstV4l2Element * v4l2element, v4l2_std_id norm) if (ioctl (v4l2element->video_fd, VIDIOC_S_STD, &norm) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to set norm 0x%llx for device %s: %s", - norm, v4l2element->device, g_strerror (errno))); + ("Failed to set norm 0x%llx for device %s: %s", + norm, v4l2element->device, g_strerror (errno))); return FALSE; } @@ -523,8 +523,8 @@ gst_v4l2_get_input (GstV4l2Element * v4l2element, gint * input) if (ioctl (v4l2element->video_fd, VIDIOC_G_INPUT, &n) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to get current input on device %s: %s", - v4l2element->device, g_strerror (errno))); + ("Failed to get current input on device %s: %s", + v4l2element->device, g_strerror (errno))); return FALSE; } @@ -549,8 +549,8 @@ gst_v4l2_set_input (GstV4l2Element * v4l2element, gint input) if (ioctl (v4l2element->video_fd, VIDIOC_S_INPUT, &input) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to set input %d on device %s: %s", - input, v4l2element->device, g_strerror (errno))); + ("Failed to set input %d on device %s: %s", + input, v4l2element->device, g_strerror (errno))); return FALSE; } @@ -574,8 +574,8 @@ gst_v4l2_get_output (GstV4l2Element * v4l2element, gint * output) if (ioctl (v4l2element->video_fd, VIDIOC_G_OUTPUT, &n) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to get current output on device %s: %s", - v4l2element->device, g_strerror (errno))); + ("Failed to get current output on device %s: %s", + v4l2element->device, g_strerror (errno))); return FALSE; } @@ -600,8 +600,8 @@ gst_v4l2_set_output (GstV4l2Element * v4l2element, gint output) if (ioctl (v4l2element->video_fd, VIDIOC_S_OUTPUT, &output) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to set output %d on device %s: %s", - output, v4l2element->device, g_strerror (errno))); + ("Failed to set output %d on device %s: %s", + output, v4l2element->device, g_strerror (errno))); return FALSE; } @@ -627,8 +627,8 @@ gst_v4l2_get_frequency (GstV4l2Element * v4l2element, freq.tuner = tunernum; if (ioctl (v4l2element->video_fd, VIDIOC_G_FREQUENCY, &freq) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to get current tuner frequency for device %s: %s", - v4l2element->device, g_strerror (errno))); + ("Failed to get current tuner frequency for device %s: %s", + v4l2element->device, g_strerror (errno))); return FALSE; } @@ -661,8 +661,8 @@ gst_v4l2_set_frequency (GstV4l2Element * v4l2element, if (ioctl (v4l2element->video_fd, VIDIOC_S_FREQUENCY, &freq) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to set tuner frequency to %lu for device %s: %s", - frequency, v4l2element->device, g_strerror (errno))); + ("Failed to set tuner frequency to %lu for device %s: %s", + frequency, v4l2element->device, g_strerror (errno))); return FALSE; } @@ -688,8 +688,8 @@ gst_v4l2_signal_strength (GstV4l2Element * v4l2element, tuner.index = tunernum; if (ioctl (v4l2element->video_fd, VIDIOC_G_TUNER, &tuner) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to get signal strength for device %s: %s", - v4l2element->device, g_strerror (errno))); + ("Failed to get signal strength for device %s: %s", + v4l2element->device, g_strerror (errno))); return FALSE; } @@ -719,8 +719,8 @@ gst_v4l2_get_attribute (GstV4l2Element * v4l2element, if (ioctl (v4l2element->video_fd, VIDIOC_G_CTRL, &control) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to get value for control %d on device %s: %s", - attribute_num, v4l2element->device, g_strerror (errno))); + ("Failed to get value for control %d on device %s: %s", + attribute_num, v4l2element->device, g_strerror (errno))); return FALSE; } @@ -751,8 +751,8 @@ gst_v4l2_set_attribute (GstV4l2Element * v4l2element, if (ioctl (v4l2element->video_fd, VIDIOC_S_CTRL, &control) < 0) { GST_ELEMENT_ERROR (v4l2element, RESOURCE, SETTINGS, (NULL), - ("Failed to set value %d for control %d on device %s: %s", - value, attribute_num, v4l2element->device, g_strerror (errno))); + ("Failed to set value %d for control %d on device %s: %s", + value, attribute_num, v4l2element->device, g_strerror (errno))); return FALSE; } diff --git a/sys/v4l2/v4l2src_calls.c b/sys/v4l2/v4l2src_calls.c index 00d710ebe1..a2db4f2bd5 100644 --- a/sys/v4l2/v4l2src_calls.c +++ b/sys/v4l2/v4l2src_calls.c @@ -70,19 +70,19 @@ gst_v4l2src_fill_format_list (GstV4l2Src * v4l2src) format->index = n; format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (ioctl (GST_V4L2ELEMENT (v4l2src)->video_fd, VIDIOC_ENUM_FMT, - format) < 0) { + format) < 0) { if (errno == EINVAL) { - break; /* end of enumeration */ + break; /* end of enumeration */ } else { - GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, (NULL), - ("failed to get number %d in pixelformat enumeration for %s: %s", - n, GST_V4L2ELEMENT (v4l2src)->device, g_strerror (errno))); - g_free (format); - return FALSE; + GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, (NULL), + ("failed to get number %d in pixelformat enumeration for %s: %s", + n, GST_V4L2ELEMENT (v4l2src)->device, g_strerror (errno))); + g_free (format); + return FALSE; } } GST_LOG_OBJECT (v4l2src, "got format" GST_FOURCC_FORMAT, - GST_FOURCC_ARGS (format->pixelformat)); + GST_FOURCC_ARGS (format->pixelformat)); v4l2src->formats = g_slist_prepend (v4l2src->formats, format); } @@ -118,11 +118,11 @@ gst_v4l2src_queue_frame (GstV4l2Src * v4l2src, guint i) GST_LOG_OBJECT (v4l2src, "queueing frame %u", i); if (ioctl (GST_V4L2ELEMENT (v4l2src)->video_fd, VIDIOC_QBUF, - &v4l2src->pool->buffers[i].buffer) < 0) { + &v4l2src->pool->buffers[i].buffer) < 0) { GST_ELEMENT_ERROR (v4l2src, RESOURCE, WRITE, - (_("Could not write to device \"%s\"."), - GST_V4L2ELEMENT (v4l2src)->device), - ("Error queueing buffer %u on device %s", i, g_strerror (errno))); + (_("Could not write to device \"%s\"."), + GST_V4L2ELEMENT (v4l2src)->device), + ("Error queueing buffer %u on device %s", i, g_strerror (errno))); return FALSE; } @@ -146,8 +146,8 @@ gst_v4l2src_grab_frame (GstV4l2Src * v4l2src) /* if the sync() got interrupted, we can retry */ if (errno != EINTR) { GST_ELEMENT_ERROR (v4l2src, RESOURCE, SYNC, (NULL), - ("could not sync on a buffer on device %s: %s", - GST_V4L2ELEMENT (v4l2src)->device, g_strerror (errno))); + ("could not sync on a buffer on device %s: %s", + GST_V4L2ELEMENT (v4l2src)->device, g_strerror (errno))); return -1; } GST_DEBUG_OBJECT (v4l2src, "grab got interrupted"); @@ -174,10 +174,10 @@ gst_v4l2src_get_capture (GstV4l2Src * v4l2src) v4l2src->format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (ioctl (GST_V4L2ELEMENT (v4l2src)->video_fd, VIDIOC_G_FMT, - &v4l2src->format) < 0) { + &v4l2src->format) < 0) { GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, (NULL), - ("failed to get pixelformat for device %s: %s", - GST_V4L2ELEMENT (v4l2src)->device, g_strerror (errno))); + ("failed to get pixelformat for device %s: %s", + GST_V4L2ELEMENT (v4l2src)->device, g_strerror (errno))); return FALSE; } @@ -209,11 +209,11 @@ gst_v4l2src_set_capture (GstV4l2Src * v4l2src, v4l2src->format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (ioctl (GST_V4L2ELEMENT (v4l2src)->video_fd, VIDIOC_S_FMT, - &v4l2src->format) < 0) { + &v4l2src->format) < 0) { GST_ELEMENT_ERROR (v4l2src, RESOURCE, SETTINGS, (NULL), - ("failed to set pixelformat to %s @ %dx%d for device %s: %s", - fmt->description, width, height, GST_V4L2ELEMENT (v4l2src)->device, - g_strerror (errno))); + ("failed to set pixelformat to %s @ %dx%d for device %s: %s", + fmt->description, width, height, GST_V4L2ELEMENT (v4l2src)->device, + g_strerror (errno))); return FALSE; } @@ -250,21 +250,21 @@ gst_v4l2src_capture_init (GstV4l2Src * v4l2src) v4l2src->breq.type = v4l2src->format.type; v4l2src->breq.memory = V4L2_MEMORY_MMAP; if (ioctl (GST_V4L2ELEMENT (v4l2src)->video_fd, VIDIOC_REQBUFS, - &v4l2src->breq) < 0) { + &v4l2src->breq) < 0) { GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ, - (_("Could not get buffers from device \"%s\"."), - GST_V4L2ELEMENT (v4l2src)->device), - ("error requesting %d buffers: %s", v4l2src->breq.count, - g_strerror (errno))); + (_("Could not get buffers from device \"%s\"."), + GST_V4L2ELEMENT (v4l2src)->device), + ("error requesting %d buffers: %s", v4l2src->breq.count, + g_strerror (errno))); return FALSE; } if (v4l2src->breq.count < GST_V4L2_MIN_BUFFERS) { GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ, - (_("Could not get enough buffers from device \"%s\"."), - GST_V4L2ELEMENT (v4l2src)->device), - ("we received %d, we want at least %d", v4l2src->breq.count, - GST_V4L2_MIN_BUFFERS)); + (_("Could not get enough buffers from device \"%s\"."), + GST_V4L2ELEMENT (v4l2src)->device), + ("we received %d, we want at least %d", v4l2src->breq.count, + GST_V4L2_MIN_BUFFERS)); v4l2src->breq.count = buffers; return FALSE; } @@ -292,19 +292,19 @@ gst_v4l2src_capture_init (GstV4l2Src * v4l2src) buffer->buffer.index = n; buffer->buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (ioctl (GST_V4L2ELEMENT (v4l2src)->video_fd, VIDIOC_QUERYBUF, - &buffer->buffer) < 0) { + &buffer->buffer) < 0) { GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ, (NULL), - ("Could not get buffer properties of buffer %d: %s", n, - g_strerror (errno))); + ("Could not get buffer properties of buffer %d: %s", n, + g_strerror (errno))); gst_v4l2src_capture_deinit (v4l2src); return FALSE; } buffer->start = - mmap (0, buffer->buffer.length, PROT_READ | PROT_WRITE, MAP_SHARED, - GST_V4L2ELEMENT (v4l2src)->video_fd, buffer->buffer.m.offset); + mmap (0, buffer->buffer.length, PROT_READ | PROT_WRITE, MAP_SHARED, + GST_V4L2ELEMENT (v4l2src)->video_fd, buffer->buffer.m.offset); if (buffer->start == MAP_FAILED) { GST_ELEMENT_ERROR (v4l2src, RESOURCE, READ, (NULL), - ("Could not mmap video buffer %d: %s", n, g_strerror (errno))); + ("Could not mmap video buffer %d: %s", n, g_strerror (errno))); buffer->start = 0; gst_v4l2src_capture_deinit (v4l2src); return FALSE; @@ -344,8 +344,8 @@ gst_v4l2src_capture_start (GstV4l2Src * v4l2src) if (ioctl (GST_V4L2ELEMENT (v4l2src)->video_fd, VIDIOC_STREAMON, &type) < 0) { GST_ELEMENT_ERROR (v4l2src, RESOURCE, OPEN_READ, (NULL), - ("Error starting streaming capture from device %s: %s", - GST_V4L2ELEMENT (v4l2src)->device, g_strerror (errno))); + ("Error starting streaming capture from device %s: %s", + GST_V4L2ELEMENT (v4l2src)->device, g_strerror (errno))); return FALSE; } @@ -372,8 +372,8 @@ gst_v4l2src_capture_stop (GstV4l2Src * v4l2src) * on the non-queued ones */ if (ioctl (GST_V4L2ELEMENT (v4l2src)->video_fd, VIDIOC_STREAMOFF, &type) < 0) { GST_ELEMENT_ERROR (v4l2src, RESOURCE, CLOSE, (NULL), - ("Error stopping streaming capture from device %s: %s", - GST_V4L2ELEMENT (v4l2src)->device, g_strerror (errno))); + ("Error stopping streaming capture from device %s: %s", + GST_V4L2ELEMENT (v4l2src)->device, g_strerror (errno))); return FALSE; } @@ -445,7 +445,7 @@ gst_v4l2src_capture_deinit (GstV4l2Src * v4l2src) buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (ioctl (GST_V4L2ELEMENT (v4l2src)->video_fd, VIDIOC_DQBUF, &buffer) < 0) GST_WARNING_OBJECT (v4l2src, - "Could not dequeue buffer on uninitialization"); + "Could not dequeue buffer on uninitialization"); } if (gst_atomic_int_dec_and_test (&v4l2src->pool->refcount)) { /* we're last thing that used all this */ diff --git a/sys/vcd/vcdsrc.c b/sys/vcd/vcdsrc.c index b2868628db..cb6389b2eb 100644 --- a/sys/vcd/vcdsrc.c +++ b/sys/vcd/vcdsrc.c @@ -97,8 +97,9 @@ vcdsrc_get_type (void) 0, (GInstanceInitFunc) vcdsrc_init, }; + vcdsrc_type = - g_type_register_static (GST_TYPE_ELEMENT, "VCDSrc", &vcdsrc_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "VCDSrc", &vcdsrc_info, 0); } return vcdsrc_type; } @@ -121,13 +122,13 @@ vcdsrc_class_init (VCDSrcClass * klass) parent_class = g_type_class_peek_parent (klass); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATION, g_param_spec_string ("location", "location", "location", NULL, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TRACK, g_param_spec_int ("track", "track", "track", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BYTESPERREAD, g_param_spec_int ("bytesperread", "bytesperread", "bytesperread", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_OFFSET, g_param_spec_int ("offset", "offset", "offset", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOCATION, g_param_spec_string ("location", "location", "location", NULL, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TRACK, g_param_spec_int ("track", "track", "track", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BYTESPERREAD, g_param_spec_int ("bytesperread", "bytesperread", "bytesperread", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_OFFSET, g_param_spec_int ("offset", "offset", "offset", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MAX_ERRORS, g_param_spec_int ("max-errors", "", "", 0, G_MAXINT, 16, - G_PARAM_READWRITE)); + G_PARAM_READWRITE)); gobject_class->set_property = vcdsrc_set_property; gobject_class->get_property = vcdsrc_get_property; @@ -170,13 +171,13 @@ vcdsrc_set_property (GObject * object, guint prop_id, const GValue * value, /* g_return_if_fail(!GST_FLAG_IS_SET(src,GST_STATE_RUNNING)); */ if (src->device) - g_free (src->device); + g_free (src->device); /* clear the filename if we get a NULL (is that possible?) */ if (g_value_get_string (value) == NULL) - src->device = NULL; + src->device = NULL; /* otherwise set the new filename */ else - src->device = g_strdup (g_value_get_string (value)); + src->device = g_strdup (g_value_get_string (value)); break; case ARG_TRACK: src->track = g_value_get_int (value); @@ -276,7 +277,7 @@ read_sector: } fprintf (stderr, "%s while reading raw data from cdrom at %d:%d:%d\n", - strerror (errno), msf->cdmsf_min0, msf->cdmsf_sec0, msf->cdmsf_frame0); + strerror (errno), msf->cdmsf_min0, msf->cdmsf_sec0, msf->cdmsf_frame0); vcdsrc->curoffset += 1; /* Or we can return a zero-filled buffer. Which is better? */ @@ -327,14 +328,14 @@ vcdsrc_open_file (VCDSrc * src) /* exit(1);*/ } fprintf (stderr, "VCDSrc: track begins at %d:%d:%d\n", - src->tracks[i].cdte_addr.msf.minute, - src->tracks[i].cdte_addr.msf.second, - src->tracks[i].cdte_addr.msf.frame); + src->tracks[i].cdte_addr.msf.minute, + src->tracks[i].cdte_addr.msf.second, + src->tracks[i].cdte_addr.msf.frame); } src->trackoffset = (((src->tracks[src->track - 1].cdte_addr.msf.minute * 60) + - src->tracks[src->track - 1].cdte_addr.msf.second) * 75) + + src->tracks[src->track - 1].cdte_addr.msf.second) * 75) + src->tracks[src->track - 1].cdte_addr.msf.frame; fprintf (stderr, "VCDSrc: track offset is %ld\n", src->trackoffset); @@ -372,7 +373,7 @@ vcdsrc_change_state (GstElement * element) } else { if (!GST_FLAG_IS_SET (element, VCDSRC_OPEN)) { if (!vcdsrc_open_file (VCDSRC (element))) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; } } @@ -387,9 +388,9 @@ vcdsrc_recalculate (VCDSrc * vcdsrc) if (GST_FLAG_IS_SET (vcdsrc, VCDSRC_OPEN)) { /* calculate track offset (beginning of track) */ vcdsrc->trackoffset = - (((vcdsrc->tracks[vcdsrc->track - 1].cdte_addr.msf.minute * 60) + - vcdsrc->tracks[vcdsrc->track - 1].cdte_addr.msf.second) * 75) + - vcdsrc->tracks[vcdsrc->track - 1].cdte_addr.msf.frame; + (((vcdsrc->tracks[vcdsrc->track - 1].cdte_addr.msf.minute * 60) + + vcdsrc->tracks[vcdsrc->track - 1].cdte_addr.msf.second) * 75) + + vcdsrc->tracks[vcdsrc->track - 1].cdte_addr.msf.frame; fprintf (stderr, "VCDSrc: track offset is %ld\n", vcdsrc->trackoffset); } }