if(!templ){
GstCaps *caps;
GstCaps *caps1 = GST_CAPS_NEW("src","video/x-raw-yuv",
- "width", GST_PROPS_INT_RANGE (0, G_MAXINT),
- "height", GST_PROPS_INT_RANGE (0, G_MAXINT),
+ "width", GST_PROPS_INT_RANGE (1, G_MAXINT),
+ "height", GST_PROPS_INT_RANGE (1, G_MAXINT),
"framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT));
GstCaps *caps2 = GST_CAPS_NEW("src","video/x-raw-rgb",
- "width", GST_PROPS_INT_RANGE (0, G_MAXINT),
- "height", GST_PROPS_INT_RANGE (0, G_MAXINT),
+ "width", GST_PROPS_INT_RANGE (1, G_MAXINT),
+ "height", GST_PROPS_INT_RANGE (1, G_MAXINT),
"framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT));
caps = gst_caps_intersect(caps1, gst_videotestsrc_get_capslist ());
GstCaps *caps1 = gst_caps_copy_1(caps);
GstPadLinkReturn ret;
+ gst_caps_set(caps1, "framerate", GST_PROPS_FLOAT((float)videotestsrc->rate));
+ gst_caps_set(caps1, "width", GST_PROPS_INT(videotestsrc->width));
+ gst_caps_set(caps1, "height", GST_PROPS_INT(videotestsrc->height));
+
+ //g_print("%s\n", gst_caps_to_string(caps1));
+
ret = gst_pad_try_set_caps(pad, caps1);
if (ret != GST_PAD_LINK_OK &&
}
if (caps == NULL) {
- GST_DEBUG (
- "videotestsrc: no suitable opposite-side caps found");
+ GST_DEBUG ("videotestsrc: no suitable opposite-side caps found");
return GST_PAD_LINK_REFUSED;
}
GST_DEBUG ("videotestsrc: using fourcc element %p %s\n",
videotestsrc->fourcc, videotestsrc->fourcc->name);
- gst_caps_get_int (caps, "width", &videotestsrc->width);
- gst_caps_get_int (caps, "height", &videotestsrc->height);
- gst_caps_get_float (caps, "framerate", &videotestsrc->rate);
+ if(videotestsrc->width==0){
+ gst_caps_get_int (caps, "width", &videotestsrc->width);
+ }
+ if(videotestsrc->height==0){
+ gst_caps_get_int (caps, "height", &videotestsrc->height);
+ }
+ if(videotestsrc->rate==0){
+ gst_caps_get_float (caps, "framerate", &videotestsrc->rate);
+ }
videotestsrc->bpp = videotestsrc->fourcc->bitspp;
GST_CAPS_NEW("ack","video/x-raw-yuv",
"width",GST_PROPS_INT_RANGE(16,4096),
"height",GST_PROPS_INT_RANGE(16,4096),
- "framerate", GST_PROPS_FLOAT_RANGE(0, G_MAXFLOAT)),
+ "framerate", GST_PROPS_FLOAT(vts->rate)),
GST_CAPS_NEW("ack","video/x-raw-rgb",
"width",GST_PROPS_INT_RANGE(16,4096),
"height",GST_PROPS_INT_RANGE(16,4096),
- "framerate", GST_PROPS_FLOAT_RANGE(0, G_MAXFLOAT)));
+ "framerate", GST_PROPS_FLOAT(vts->rate)));
}
/* ref intersection and return it */
newsize = (videotestsrc->width * videotestsrc->height * videotestsrc->bpp) >> 3;
- GST_DEBUG ("size=%ld %dx%d", newsize, videotestsrc->width, videotestsrc->height);
+ GST_DEBUG ("size=%ld %dx%d\n", newsize, videotestsrc->width, videotestsrc->height);
buf = NULL;
if (videotestsrc->pool) {
struct fourcc_list_struct *paintinfo_find_by_caps(GstCaps *caps)
{
int i;
+ const char *mimetype = gst_caps_get_mime(caps);
+ guint32 format;
- for (i = 0; i < n_fourccs; i++) {
- GstCaps *c;
-
- c = gst_caps_intersect(caps,paint_get_caps(fourcc_list + i));
- if(c){
- return fourcc_list + i;
+ if(strcmp(mimetype, "video/x-raw-yuv")==0){
+ char *s;
+ int fourcc;
+
+ gst_caps_get(caps, "format", &format);
+ for (i = 0; i < n_fourccs; i++) {
+ s = fourcc_list[i].fourcc;
+ g_print("testing " GST_FOURCC_FORMAT " and %s\n",
+ GST_FOURCC_ARGS(format), s);
+ fourcc = GST_MAKE_FOURCC (s[0], s[1], s[2], s[3]);
+ if(fourcc == format){
+ return fourcc_list + i;
+ }
}
+ }else if(strcmp(mimetype, "video/x-raw-yuv")==0){
+ g_warning("video/x-raw-rgb not implemented");
+ return NULL;
+ }else{
+ g_warning("unknown format");
+ return NULL;
}
+
+ g_warning("format not found");
+
return NULL;
}