GST_LOG_OBJECT (adder, "Forwarding event %p (%s)", event,
GST_EVENT_TYPE_NAME (event));
- ret = TRUE;
data.event = event;
data.flush = flush;
GstBuffer * outbuf)
{
GstAudioConvert *this = GST_AUDIO_CONVERT (base);
- gboolean res;
gint insize, outsize;
gint samples;
gpointer src, dst;
/* get in/output sizes, to see if the buffers we got are of correct
* sizes */
- if (!(res = audio_convert_get_sizes (&this->ctx, samples, &insize, &outsize)))
+ if (!audio_convert_get_sizes (&this->ctx, samples, &insize, &outsize))
goto error;
if (insize == 0 || outsize == 0)
/* and convert the samples */
if (!GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_GAP)) {
- if (!(res = audio_convert_convert (&this->ctx, src, dst,
- samples, gst_buffer_is_writable (inbuf))))
+ if (!audio_convert_convert (&this->ctx, src, dst,
+ samples, gst_buffer_is_writable (inbuf)))
goto convert_error;
} else {
/* Create silence buffer */
GstPadDirection direction, GstCaps * caps, guint size, GstCaps * othercaps,
guint * othersize)
{
- GstCaps *srccaps, *sinkcaps;
gboolean ret = TRUE;
guint32 ratio_den, ratio_num;
gint inrate, outrate, gcd;
GST_LOG_OBJECT (base, "asked to transform size %d in direction %s",
size, direction == GST_PAD_SINK ? "SINK" : "SRC");
- if (direction == GST_PAD_SINK) {
- sinkcaps = caps;
- srccaps = othercaps;
- } else {
- sinkcaps = othercaps;
- srccaps = caps;
- }
/* Get sample width -> bytes_per_samp, channels, inrate, outrate */
ret =
GstBuffer * outbuf)
{
GstAudioResample *resample = GST_AUDIO_RESAMPLE (base);
- guint8 *data;
gulong size;
GstClockTime timestamp;
- guint outsamples, insamples;
+ guint insamples;
GstFlowReturn ret;
if (resample->state == NULL) {
gst_audio_resample_get_funcs (resample->width, resample->fp);
}
- data = GST_BUFFER_DATA (inbuf);
size = GST_BUFFER_SIZE (inbuf);
timestamp = GST_BUFFER_TIMESTAMP (inbuf);
insamples = GST_BUFFER_SIZE (inbuf) / resample->channels;
insamples /= (resample->width / 8);
- outsamples = GST_BUFFER_SIZE (outbuf) / resample->channels;
- outsamples /= (resample->width / 8);
-
if (GST_CLOCK_TIME_IS_VALID (timestamp)
&& !GST_CLOCK_TIME_IS_VALID (resample->next_ts)) {
resample->next_ts = timestamp;
gst_ffmpegcsp_class_init (GstFFMpegCspClass * klass)
{
GObjectClass *gobject_class;
- GstElementClass *gstelement_class;
GstBaseTransformClass *gstbasetransform_class;
gobject_class = (GObjectClass *) klass;
- gstelement_class = (GstElementClass *) klass;
gstbasetransform_class = (GstBaseTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
lum[0] = p[0];
cb[0] = p[1];
cr[0] = p[3];
- cb++;
- cr++;
}
p1 += src->linesize[0];
lum1 += dst->linesize[0];
lum[0] = p[1];
cb[0] = p[0];
cr[0] = p[2];
- cb++;
- cr++;
}
p1 += src->linesize[0];
lum1 += dst->linesize[0];
lum[0] = p[0];
cb[0] = p[3];
cr[0] = p[1];
- cb++;
- cr++;
}
p1 += src->linesize[0];
lum1 += dst->linesize[0];
/* YUV to YUV planar */
if (is_yuv_planar (dst_pix) && is_yuv_planar (src_pix)) {
- int x_shift, y_shift, w, h, xy_shift;
+ int x_shift, y_shift, xy_shift;
void (*resize_func) (uint8_t * dst, int dst_wrap,
const uint8_t * src, int src_wrap, int width, int height);
- /* compute chroma size of the smallest dimensions */
- w = dst_width;
- h = dst_height;
- if (dst_pix->x_chroma_shift >= src_pix->x_chroma_shift)
- w >>= dst_pix->x_chroma_shift;
- else
- w >>= src_pix->x_chroma_shift;
- if (dst_pix->y_chroma_shift >= src_pix->y_chroma_shift)
- h >>= dst_pix->y_chroma_shift;
- else
- h >>= src_pix->y_chroma_shift;
-
x_shift = (dst_pix->x_chroma_shift - src_pix->x_chroma_shift);
y_shift = (dst_pix->y_chroma_shift - src_pix->y_chroma_shift);
xy_shift = ((x_shift & 0xf) << 4) | (y_shift & 0xf);
{
GObjectClass *gobject_klass;
GstElementClass *gstelement_klass;
- GstBinClass *gstbin_klass;
gobject_klass = (GObjectClass *) klass;
gstelement_klass = (GstElementClass *) klass;
- gstbin_klass = (GstBinClass *) klass;
parent_class = g_type_class_peek_parent (klass);
gst_element_set_state (element, GST_STATE_NULL);
gst_bin_remove (GST_BIN (decode_bin), element);
} else {
- guint sig;
-
GST_DEBUG_OBJECT (decode_bin, "linked on pad %s:%s",
GST_DEBUG_PAD_NAME (usedsrcpad));
/* The link worked, now figure out what it was that we connected */
/* make sure we catch unlink signals */
- sig = g_signal_connect (G_OBJECT (pad), "unlinked",
+ g_signal_connect (G_OBJECT (pad), "unlinked",
G_CALLBACK (unlinked), decode_bin);
/* now that we added the element we can try to continue autoplugging
{
GObjectClass *gobject_klass;
GstElementClass *gstelement_klass;
- GstBinClass *gstbin_klass;
gobject_klass = (GObjectClass *) klass;
gstelement_klass = (GstElementClass *) klass;
- gstbin_klass = (GstBinClass *) klass;
parent_class = g_type_class_peek_parent (klass);
{
GstElementFactory *srcfactory;
GstElementClass *elemclass;
- GList *templates, *walk;
+ GList *walk;
const gchar *klass;
gint potential_src_pads = 0;
* might produce */
elemclass = GST_ELEMENT_GET_CLASS (srcelement);
- walk = templates = gst_element_class_get_pad_template_list (elemclass);
+ walk = gst_element_class_get_pad_template_list (elemclass);
while (walk != NULL) {
GstPadTemplate *templ;
data.type = type;
/* get the feature list using the filter */
- list =
- gst_default_registry_feature_filter ((GstPluginFeatureFilter)
+ list = gst_default_registry_feature_filter ((GstPluginFeatureFilter)
element_filter, FALSE, &data);
/* convert to an array */
}
/* check if the pad is the active sinkpad */
-static gboolean
+static inline gboolean
gst_input_selector_is_active_sinkpad (GstInputSelector * sel, GstPad * pad)
{
- GstSelectorPad *selpad;
gboolean res;
- selpad = GST_SELECTOR_PAD_CAST (pad);
-
GST_INPUT_SELECTOR_LOCK (sel);
res = (pad == sel->active_sinkpad);
GST_INPUT_SELECTOR_UNLOCK (sel);
gst_object_ref (bin);
gst_object_sink (bin);
- videosinkpad = subpsinkpad = srcpad = NULL;
+ subpsinkpad = srcpad = NULL;
/* first try to hook the text pad to the custom sink */
if (playsink->subp_sink) {
GstFormat format;
guint64 amount;
gdouble rate;
- gboolean flush, intermediate, res, eos;
+ gboolean flush, intermediate, eos;
guint64 duration;
GST_INFO_OBJECT (playsink, "Handling step-done message");
gst_event_new_step (GST_FORMAT_TIME, duration, rate, flush,
intermediate);
- if (!(res =
- gst_element_send_event (playsink->audiochain->chain.bin,
- event))) {
+ if (!gst_element_send_event (playsink->audiochain->chain.bin, event)) {
GST_DEBUG_OBJECT (playsink, "Event failed when sent to audio sink");
}
}
}
static void gst_stream_selector_dispose (GObject * object);
-static void gst_stream_selector_finalize (GObject * object);
static void gst_stream_selector_init (GstStreamSelector * sel);
static void gst_stream_selector_base_init (GstStreamSelectorClass * klass);
parent_class = g_type_class_peek_parent (klass);
gobject_class->dispose = gst_stream_selector_dispose;
- gobject_class->finalize = gst_stream_selector_finalize;
gobject_class->set_property =
GST_DEBUG_FUNCPTR (gst_stream_selector_set_property);
}
static void
-gst_stream_selector_finalize (GObject * object)
-{
- GstStreamSelector *sel;
-
- sel = GST_STREAM_SELECTOR (object);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
gst_stream_selector_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
}
/* check if the pad is the active sinkpad */
-static gboolean
+static inline gboolean
gst_stream_selector_is_active_sinkpad (GstStreamSelector * sel, GstPad * pad)
{
- GstSelectorPad *selpad;
gboolean res;
- selpad = GST_SELECTOR_PAD_CAST (pad);
-
GST_OBJECT_LOCK (sel);
res = (pad == sel->active_sinkpad);
GST_OBJECT_UNLOCK (sel);
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
case GST_STATE_CHANGE_READY_TO_PAUSED:
- if (!gst_tcp_client_sink_start (GST_TCP_CLIENT_SINK (element)))
+ if (!gst_tcp_client_sink_start (sink))
goto start_failure;
break;
default:
switch (transition) {
case GST_STATE_CHANGE_READY_TO_NULL:
- gst_tcp_client_sink_stop (GST_TCP_CLIENT_SINK (element));
+ gst_tcp_client_sink_stop (sink);
default:
break;
}
GstVideoScale *videoscale;
GstCaps *ret;
GstStructure *structure;
- const GValue *par;
- gint method;
/* this function is always called with a simple caps */
g_return_val_if_fail (GST_CAPS_IS_SIMPLE (caps), NULL);
videoscale = GST_VIDEO_SCALE (trans);
- GST_OBJECT_LOCK (videoscale);
- method = videoscale->method;
- GST_OBJECT_UNLOCK (videoscale);
-
- structure = gst_caps_get_structure (caps, 0);
-
ret = gst_caps_copy (caps);
structure = gst_structure_copy (gst_caps_get_structure (ret, 0));
gst_caps_merge_structure (ret, gst_structure_copy (structure));
/* if pixel aspect ratio, make a range of it */
- if ((par = gst_structure_get_value (structure, "pixel-aspect-ratio"))) {
+ if (gst_structure_get_value (structure, "pixel-aspect-ratio")) {
gst_structure_set (structure,
"pixel-aspect-ratio", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
int x_increment;
int i;
int j;
- int x;
int xacc;
if (dest->height == 1)
acc = 0;
for (i = 0; i < dest->height; i++) {
j = acc >> 16;
- x = acc & 0xffff;
xacc = 0;
vs_scanline_resample_nearest_RGBA (dest->pixels + i * dest->stride,
int x_increment;
int i;
int j;
- int x;
int xacc;
if (dest->height == 1)
acc = 0;
for (i = 0; i < dest->height; i++) {
j = acc >> 16;
- x = acc & 0xffff;
xacc = 0;
vs_scanline_resample_nearest_RGB (dest->pixels + i * dest->stride,
int x_increment;
int i;
int j;
- int x;
int xacc;
if (dest->height == 1)
acc = 0;
for (i = 0; i < dest->height; i++) {
j = acc >> 16;
- x = acc & 0xffff;
xacc = 0;
vs_scanline_resample_nearest_YUYV (dest->pixels + i * dest->stride,
int x_increment;
int i;
int j;
- int x;
int xacc;
if (dest->height == 1)
acc = 0;
for (i = 0; i < dest->height; i++) {
j = acc >> 16;
- x = acc & 0xffff;
xacc = 0;
vs_scanline_resample_nearest_UYVY (dest->pixels + i * dest->stride,
int x_increment;
int i;
int j;
- int x;
int xacc;
if (dest->height == 1)
acc = 0;
for (i = 0; i < dest->height; i++) {
j = acc >> 16;
- x = acc & 0xffff;
xacc = 0;
vs_scanline_resample_nearest_Y (dest->pixels + i * dest->stride,
int x_increment;
int i;
int j;
- int x;
int xacc;
if (dest->height == 1)
acc = 0;
for (i = 0; i < dest->height; i++) {
j = acc >> 16;
- x = acc & 0xffff;
xacc = 0;
vs_scanline_resample_nearest_Y16 (dest->pixels + i * dest->stride,
int x_increment;
int i;
int j;
- int x;
int xacc;
if (dest->height == 1)
acc = 0;
for (i = 0; i < dest->height; i++) {
j = acc >> 16;
- x = acc & 0xffff;
xacc = 0;
vs_scanline_resample_nearest_RGB565 (dest->pixels + i * dest->stride,
int x_increment;
int i;
int j;
- int x;
int xacc;
if (dest->height == 1)
acc = 0;
for (i = 0; i < dest->height; i++) {
j = acc >> 16;
- x = acc & 0xffff;
xacc = 0;
vs_scanline_resample_nearest_RGB555 (dest->pixels + i * dest->stride,
gst_video_test_src_getcaps (GstBaseSrc * bsrc)
{
static GstCaps *capslist = NULL;
- GstVideoTestSrc *videotestsrc;
-
- videotestsrc = GST_VIDEO_TEST_SRC (bsrc);
if (!capslist) {
GstCaps *caps;