2006-05-09 Tim-Philipp Müller <tim at centricular dot net>
+ * ext/pango/gsttextoverlay.c: (gst_text_overlay_valign_get_type),
+ (gst_text_overlay_halign_get_type),
+ (gst_text_overlay_wrap_mode_get_type):
+ * ext/theora/theoradec.c: (theora_handle_type_packet),
+ (theora_handle_data_packet):
+ * ext/theora/theoraenc.c: (gst_border_mode_get_type),
+ (theora_enc_sink_setcaps), (theora_enc_chain):
+ * gst-libs/gst/cdda/gstcddabasesrc.c:
+ (gst_cdda_base_src_mode_get_type):
+ * gst/audiotestsrc/gstaudiotestsrc.c:
+ (gst_audiostestsrc_wave_get_type):
+ * gst/playback/gststreaminfo.c: (gst_stream_type_get_type):
+ * gst/tcp/gstfdset.c: (gst_fdset_mode_get_type):
+ * gst/tcp/gstmultifdsink.c: (gst_recover_policy_get_type),
+ (gst_sync_method_get_type), (gst_unit_type_get_type),
+ (gst_client_status_get_type):
+ * gst/videoscale/gstvideoscale.c:
+ (gst_video_scale_method_get_type):
+ * gst/videotestsrc/gstvideotestsrc.c:
+ (gst_video_test_src_pattern_get_type):
+ * gst/videotestsrc/videotestsrc.c: (paint_setup_I420),
+ (paint_setup_YV12), (paint_setup_YUY2), (paint_setup_UYVY),
+ (paint_setup_YVYU), (paint_setup_IYU2), (paint_setup_Y41B),
+ (paint_setup_Y42B), (paint_setup_Y800), (paint_setup_YVU9),
+ (paint_setup_YUV9), (paint_setup_RGB888), (paint_setup_BGR888),
+ (paint_setup_RGB565), (paint_setup_xRGB1555):
+ Const-ify GEnumValue and GFlagsValue arrays. Use
+ GST_ROUND_UP_* macros instead of home-made ones.
+
+2006-05-09 Tim-Philipp Müller <tim at centricular dot net>
+
* configure.ac:
Require core CVS for the new newsegment stuff.
gst_text_overlay_valign_get_type (void)
{
static GType text_overlay_valign_type = 0;
- static GEnumValue text_overlay_valign[] = {
+ static const GEnumValue text_overlay_valign[] = {
{GST_TEXT_OVERLAY_VALIGN_BASELINE, "baseline", "baseline"},
{GST_TEXT_OVERLAY_VALIGN_BOTTOM, "bottom", "bottom"},
{GST_TEXT_OVERLAY_VALIGN_TOP, "top", "top"},
gst_text_overlay_halign_get_type (void)
{
static GType text_overlay_halign_type = 0;
- static GEnumValue text_overlay_halign[] = {
+ static const GEnumValue text_overlay_halign[] = {
{GST_TEXT_OVERLAY_HALIGN_LEFT, "left", "left"},
{GST_TEXT_OVERLAY_HALIGN_CENTER, "center", "center"},
{GST_TEXT_OVERLAY_HALIGN_RIGHT, "right", "right"},
gst_text_overlay_wrap_mode_get_type (void)
{
static GType text_overlay_wrap_mode_type = 0;
- static GEnumValue text_overlay_wrap_mode[] = {
+ static const GEnumValue text_overlay_wrap_mode[] = {
{GST_TEXT_OVERLAY_WRAP_MODE_NONE, "none", "none"},
{GST_TEXT_OVERLAY_WRAP_MODE_WORD, "word", "word"},
{GST_TEXT_OVERLAY_WRAP_MODE_CHAR, "char", "char"},
}
}
-#define ROUND_UP_2(x) (((x) + 1) & ~1)
-#define ROUND_UP_4(x) (((x) + 3) & ~3)
-#define ROUND_UP_8(x) (((x) + 7) & ~7)
-
static GstFlowReturn
theora_handle_comment_packet (GstTheoraDec * dec, ogg_packet * packet)
{
if (dec->crop) {
/* add black borders to make width/height/offsets even. we need this because
* we cannot express an offset to the peer plugin. */
- dec->width = ROUND_UP_2 (dec->info.frame_width + (dec->info.offset_x & 1));
+ dec->width =
+ GST_ROUND_UP_2 (dec->info.frame_width + (dec->info.offset_x & 1));
dec->height =
- ROUND_UP_2 (dec->info.frame_height + (dec->info.offset_y & 1));
+ GST_ROUND_UP_2 (dec->info.frame_height + (dec->info.offset_y & 1));
dec->offset_x = dec->info.offset_x & ~1;
dec->offset_y = dec->info.offset_y & ~1;
} else {
/* should get the stride from the caps, for now we round up to the nearest
* multiple of 4 because some element needs it. chroma needs special
* treatment, see videotestsrc. */
- stride_y = ROUND_UP_4 (width);
- stride_uv = ROUND_UP_8 (width) / 2;
+ stride_y = GST_ROUND_UP_4 (width);
+ stride_uv = GST_ROUND_UP_8 (width) / 2;
out_size = stride_y * height + stride_uv * cheight * 2;
gst_border_mode_get_type (void)
{
static GType border_mode_type = 0;
- static GEnumValue border_mode[] = {
+ static const GEnumValue border_mode[] = {
{BORDER_NONE, "No Border", "none"},
{BORDER_BLACK, "Black Border", "black"},
{BORDER_MIRROR, "Mirror image in borders", "mirror"},
return border_mode_type;
}
-#define ROUND_UP_2(x) (((x) + 1) & ~1)
-#define ROUND_UP_4(x) (((x) + 3) & ~3)
-#define ROUND_UP_8(x) (((x) + 7) & ~7)
-
/* taken from theora/lib/toplevel.c */
static int
_ilog (unsigned int v)
/* center image if needed */
if (enc->center) {
/* make sure offset is even, for easier decoding */
- enc->offset_x = ROUND_UP_2 ((enc->info_width - enc->width) / 2);
- enc->offset_y = ROUND_UP_2 ((enc->info_height - enc->height) / 2);
+ enc->offset_x = GST_ROUND_UP_2 ((enc->info_width - enc->width) / 2);
+ enc->offset_y = GST_ROUND_UP_2 ((enc->info_height - enc->height) / 2);
} else {
enc->offset_x = 0;
enc->offset_y = 0;
cheight = height / 2;
/* source strides as defined in videotestsrc */
- src_y_stride = ROUND_UP_4 (width);
- src_uv_stride = ROUND_UP_8 (width) / 2;
+ src_y_stride = GST_ROUND_UP_4 (width);
+ src_uv_stride = GST_ROUND_UP_8 (width) / 2;
/* destination strides from the real picture width */
dst_y_stride = enc->info_width;
dest_v = yuv.v = yuv.u + y_size / 4;
src_y = GST_BUFFER_DATA (buffer);
- src_u = src_y + src_y_stride * ROUND_UP_2 (height);
- src_v = src_u + src_uv_stride * ROUND_UP_2 (height) / 2;
+ src_u = src_y + src_y_stride * GST_ROUND_UP_2 (height);
+ src_v = src_u + src_uv_stride * GST_ROUND_UP_2 (height) / 2;
if (enc->border != BORDER_NONE) {
/* fill top border */
gst_cdda_base_src_mode_get_type (void)
{
static GType mode_type; /* 0 */
- static GEnumValue modes[] = {
+ static const GEnumValue modes[] = {
{GST_CDDA_BASE_SRC_MODE_NORMAL, "Stream consists of a single track",
"normal"},
{GST_CDDA_BASE_SRC_MODE_CONTINUOUS, "Stream consists of the whole disc",
gst_audiostestsrc_wave_get_type (void)
{
static GType audiostestsrc_wave_type = 0;
- static GEnumValue audiostestsrc_waves[] = {
+ static const GEnumValue audiostestsrc_waves[] = {
{GST_AUDIO_TEST_SRC_WAVE_SINE, "Sine", "sine"},
{GST_AUDIO_TEST_SRC_WAVE_SQUARE, "Square", "square"},
{GST_AUDIO_TEST_SRC_WAVE_SAW, "Saw", "saw"},
gst_stream_type_get_type (void)
{
static GType stream_type_type = 0;
- static GEnumValue stream_type[] = {
+ static const GEnumValue stream_type[] = {
{GST_STREAM_TYPE_UNKNOWN, "Unknown stream", "unknown"},
{GST_STREAM_TYPE_AUDIO, "Audio stream", "audio"},
{GST_STREAM_TYPE_VIDEO, "Video stream", "video"},
gst_fdset_mode_get_type (void)
{
static GType fdset_mode_type = 0;
- static GEnumValue fdset_mode[] = {
+ static const GEnumValue fdset_mode[] = {
{GST_FDSET_MODE_SELECT, "Select", "select"},
{GST_FDSET_MODE_POLL, "Poll", "poll"},
{GST_FDSET_MODE_EPOLL, "EPoll", "epoll"},
gst_recover_policy_get_type (void)
{
static GType recover_policy_type = 0;
- static GEnumValue recover_policy[] = {
+ static const GEnumValue recover_policy[] = {
{GST_RECOVER_POLICY_NONE,
"Do not try to recover", "none"},
{GST_RECOVER_POLICY_RESYNC_LATEST,
gst_sync_method_get_type (void)
{
static GType sync_method_type = 0;
- static GEnumValue sync_method[] = {
+ static const GEnumValue sync_method[] = {
{GST_SYNC_METHOD_LATEST,
"Serve starting from the latest buffer", "latest"},
{GST_SYNC_METHOD_NEXT_KEYFRAME,
gst_unit_type_get_type (void)
{
static GType unit_type_type = 0;
- static GEnumValue unit_type[] = {
+ static const GEnumValue unit_type[] = {
{GST_UNIT_TYPE_BUFFERS, "Buffers", "buffers"},
{GST_UNIT_TYPE_BYTES, "Bytes", "bytes"},
{GST_UNIT_TYPE_TIME, "Time", "time"},
gst_client_status_get_type (void)
{
static GType client_status_type = 0;
- static GEnumValue client_status[] = {
+ static const GEnumValue client_status[] = {
{GST_CLIENT_STATUS_OK, "ok", "ok"},
{GST_CLIENT_STATUS_CLOSED, "Closed", "closed"},
{GST_CLIENT_STATUS_REMOVED, "Removed", "removed"},
gst_video_scale_method_get_type (void)
{
static GType video_scale_method_type = 0;
- static GEnumValue video_scale_methods[] = {
+ static const GEnumValue video_scale_methods[] = {
{GST_VIDEO_SCALE_NEAREST, "Nearest Neighbour", "nearest-neighbour"},
{GST_VIDEO_SCALE_BILINEAR, "Bilinear", "bilinear"},
{0, NULL, NULL},
gst_video_test_src_pattern_get_type (void)
{
static GType video_test_src_pattern_type = 0;
- static GEnumValue pattern_types[] = {
+ static const GEnumValue pattern_types[] = {
{GST_VIDEO_TEST_SRC_SMPTE, "SMPTE 100% color bars", "smpte"},
{GST_VIDEO_TEST_SRC_SNOW, "Random (television snow)", "snow"},
{GST_VIDEO_TEST_SRC_BLACK, "100% Black", "black"},
}
}
-#define ROUND_UP_2(x) (((x)+1)&~1)
-#define ROUND_UP_4(x) (((x)+3)&~3)
-#define ROUND_UP_8(x) (((x)+7)&~7)
-
static void
paint_setup_I420 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
- p->ystride = ROUND_UP_4 (p->width);
- p->up = p->yp + p->ystride * ROUND_UP_2 (p->height);
- p->ustride = ROUND_UP_8 (p->width) / 2;
- p->vp = p->up + p->ustride * ROUND_UP_2 (p->height) / 2;
- p->vstride = ROUND_UP_8 (p->ystride) / 2;
- p->endptr = p->vp + p->vstride * ROUND_UP_2 (p->height) / 2;
+ p->ystride = GST_ROUND_UP_4 (p->width);
+ p->up = p->yp + p->ystride * GST_ROUND_UP_2 (p->height);
+ p->ustride = GST_ROUND_UP_8 (p->width) / 2;
+ p->vp = p->up + p->ustride * GST_ROUND_UP_2 (p->height) / 2;
+ p->vstride = GST_ROUND_UP_8 (p->ystride) / 2;
+ p->endptr = p->vp + p->vstride * GST_ROUND_UP_2 (p->height) / 2;
}
static void
paint_setup_YV12 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
- p->ystride = ROUND_UP_4 (p->width);
- p->vp = p->yp + p->ystride * ROUND_UP_2 (p->height);
- p->vstride = ROUND_UP_8 (p->ystride) / 2;
- p->up = p->vp + p->vstride * ROUND_UP_2 (p->height) / 2;
- p->ustride = ROUND_UP_8 (p->ystride) / 2;
- p->endptr = p->up + p->ustride * ROUND_UP_2 (p->height) / 2;
+ p->ystride = GST_ROUND_UP_4 (p->width);
+ p->vp = p->yp + p->ystride * GST_ROUND_UP_2 (p->height);
+ p->vstride = GST_ROUND_UP_8 (p->ystride) / 2;
+ p->up = p->vp + p->vstride * GST_ROUND_UP_2 (p->height) / 2;
+ p->ustride = GST_ROUND_UP_8 (p->ystride) / 2;
+ p->endptr = p->up + p->ustride * GST_ROUND_UP_2 (p->height) / 2;
}
static void
p->yp = dest;
p->up = dest + 1;
p->vp = dest + 3;
- p->ystride = ROUND_UP_2 (p->width) * 2;
+ p->ystride = GST_ROUND_UP_2 (p->width) * 2;
p->endptr = dest + p->ystride * p->height;
}
p->yp = dest + 1;
p->up = dest;
p->vp = dest + 2;
- p->ystride = ROUND_UP_2 (p->width) * 2;
+ p->ystride = GST_ROUND_UP_2 (p->width) * 2;
p->endptr = dest + p->ystride * p->height;
}
p->yp = dest;
p->up = dest + 3;
p->vp = dest + 1;
- p->ystride = ROUND_UP_2 (p->width * 2);
+ p->ystride = GST_ROUND_UP_2 (p->width * 2);
p->endptr = dest + p->ystride * p->height;
}
p->yp = dest + 1;
p->up = dest + 0;
p->vp = dest + 2;
- p->ystride = ROUND_UP_4 (p->width * 3);
+ p->ystride = GST_ROUND_UP_4 (p->width * 3);
p->endptr = dest + p->ystride * p->height;
}
paint_setup_Y41B (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
- p->ystride = ROUND_UP_4 (p->width);
+ p->ystride = GST_ROUND_UP_4 (p->width);
p->up = p->yp + p->ystride * p->height;
- p->ustride = ROUND_UP_8 (p->width) / 4;
+ p->ustride = GST_ROUND_UP_8 (p->width) / 4;
p->vp = p->up + p->ustride * p->height;
- p->vstride = ROUND_UP_8 (p->width) / 4;
+ p->vstride = GST_ROUND_UP_8 (p->width) / 4;
p->endptr = p->vp + p->vstride * p->height;
}
paint_setup_Y42B (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
- p->ystride = ROUND_UP_4 (p->width);
+ p->ystride = GST_ROUND_UP_4 (p->width);
p->up = p->yp + p->ystride * p->height;
- p->ustride = ROUND_UP_8 (p->width) / 2;
+ p->ustride = GST_ROUND_UP_8 (p->width) / 2;
p->vp = p->up + p->ustride * p->height;
- p->vstride = ROUND_UP_8 (p->width) / 2;
+ p->vstride = GST_ROUND_UP_8 (p->width) / 2;
p->endptr = p->vp + p->vstride * p->height;
}
{
/* untested */
p->yp = dest;
- p->ystride = ROUND_UP_4 (p->width);
+ p->ystride = GST_ROUND_UP_4 (p->width);
p->endptr = dest + p->ystride * p->height;
}
static void
paint_setup_YVU9 (paintinfo * p, unsigned char *dest)
{
- int h = ROUND_UP_4 (p->height);
+ int h = GST_ROUND_UP_4 (p->height);
p->yp = dest;
- p->ystride = ROUND_UP_4 (p->width);
- p->vp = p->yp + p->ystride * ROUND_UP_4 (p->height);
- p->vstride = ROUND_UP_4 (p->ystride / 4);
- p->up = p->vp + p->vstride * ROUND_UP_4 (h / 4);
- p->ustride = ROUND_UP_4 (p->ystride / 4);
- p->endptr = p->up + p->ustride * ROUND_UP_4 (h / 4);
+ p->ystride = GST_ROUND_UP_4 (p->width);
+ p->vp = p->yp + p->ystride * GST_ROUND_UP_4 (p->height);
+ p->vstride = GST_ROUND_UP_4 (p->ystride / 4);
+ p->up = p->vp + p->vstride * GST_ROUND_UP_4 (h / 4);
+ p->ustride = GST_ROUND_UP_4 (p->ystride / 4);
+ p->endptr = p->up + p->ustride * GST_ROUND_UP_4 (h / 4);
}
static void
paint_setup_YUV9 (paintinfo * p, unsigned char *dest)
{
/* untested */
- int h = ROUND_UP_4 (p->height);
+ int h = GST_ROUND_UP_4 (p->height);
p->yp = dest;
- p->ystride = ROUND_UP_4 (p->width);
+ p->ystride = GST_ROUND_UP_4 (p->width);
p->up = p->yp + p->ystride * h;
- p->ustride = ROUND_UP_4 (p->ystride / 4);
- p->vp = p->up + p->ustride * ROUND_UP_4 (h / 4);
- p->vstride = ROUND_UP_4 (p->ystride / 4);
- p->endptr = p->vp + p->vstride * ROUND_UP_4 (h / 4);
+ p->ustride = GST_ROUND_UP_4 (p->ystride / 4);
+ p->vp = p->up + p->ustride * GST_ROUND_UP_4 (h / 4);
+ p->vstride = GST_ROUND_UP_4 (p->ystride / 4);
+ p->endptr = p->vp + p->vstride * GST_ROUND_UP_4 (h / 4);
}
static void
p->yp = dest + 0;
p->up = dest + 1;
p->vp = dest + 2;
- p->ystride = ROUND_UP_4 (p->width * 3);
+ p->ystride = GST_ROUND_UP_4 (p->width * 3);
p->endptr = p->dest + p->ystride * p->height;
}
p->yp = dest + 2;
p->up = dest + 1;
p->vp = dest + 0;
- p->ystride = ROUND_UP_4 (p->width * 3);
+ p->ystride = GST_ROUND_UP_4 (p->width * 3);
p->endptr = p->dest + p->ystride * p->height;
}
paint_setup_RGB565 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
- p->ystride = ROUND_UP_4 (p->width * 2);
+ p->ystride = GST_ROUND_UP_4 (p->width * 2);
p->endptr = p->dest + p->ystride * p->height;
}
paint_setup_xRGB1555 (paintinfo * p, unsigned char *dest)
{
p->yp = dest;
- p->ystride = ROUND_UP_4 (p->width * 2);
+ p->ystride = GST_ROUND_UP_4 (p->width * 2);
p->endptr = p->dest + p->ystride * p->height;
}