[gst-devel] IP cameras

chmario chmario at hotmail.com
Fri Oct 8 21:23:26 CEST 2010


Ok I am now using gst_pad_get_negotiated_caps and got different caps:
video/x-raw-rgb: fields = 10
field0: width type: gint
field1: height type: gint
field2: framerate type: GstFraction
field3: bpp type: gint
field4: depth type: gint
field5: red_mask type: gint
field6: green_mask type: gint
field7: blue_mask type: gint
field8: endianness type: gint
field9: interlaced type: gboolean

width and height are set to gint, that is good.  But I am still not able to
get width and hight
I have this code:
GstCaps *videoCaps =gst_pad_get_negotiated_caps(srcPad);
const GstStructure *str;
unsigned int nCaps = gst_caps_get_size(videoCaps);
for(unsigned int i=0; i < nCaps; i++)
{
  cout << "cap" << i << ": "<< endl;
  str = gst_caps_get_structure (videoCaps, i);
  cout << gst_structure_get_name (str)<< ": fields = " <<
gst_structure_n_fields (str) << endl;
  for(int j=0; j< gst_structure_n_fields (str); j++)
 {
   cout << "field" << j << ": " << gst_structure_nth_field_name(str, j)<< "
type: ";
   cout << g_type_name(gst_structure_get_field_type(str,
gst_structure_nth_field_name(str, j)))<< endl;
 }
 if ((!gst_structure_get_uint (str, "width", &width)) ||
!gst_structure_get_int (str, "height", &height))
 {
			cerr << "dimension information not found!" << endl;
 }
 cout << width << "x" << height << endl;
}

the command line result is:
cap0: 
video/x-raw-rgb: fields = 10
field0: width type: gint
field1: height type: gint
field2: framerate type: GstFraction
field3: bpp type: gint
field4: depth type: gint
field5: red_mask type: gint
field6: green_mask type: gint
field7: blue_mask type: gint
field8: endianness type: gint
field9: interlaced type: gboolean
dimention information not found!
0x0

-----
MChC
-- 
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/IP-cameras-tp2954912p2968906.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list