how can i know the result of "cap negotiation"

宋喜佳 songxijia2009 at gmail.com
Sun Sep 4 18:51:53 PDT 2011


Thank you , Stas Sergeev !

I wanna describe my question more details. here i use the follow command,

gst-launch filesrc location=/some/path/video-file ! xxx-videodecoder !
yyy-videosink,

Here i know the srcpad of  xxx-videodecoder is as following:
Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw-yuv
                 format: UYVY
              framerate: [ 0/1, 2147483647/1 ]
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
      video/x-raw-yuv
                 format: NV12
              framerate: [ 0/1, 2147483647/1 ]
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
      video/x-raw-yuv
                 format: I420
              framerate: [ 0/1, 2147483647/1 ]
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]

and the sinkpad of yyy-videosink is as following:

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw-yuv
                 format: UYVY
              framerate: [ 0/1, 2147483647/1 ]
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
      video/x-raw-yuv
                 format: Y8C8
              framerate: [ 0/1, 2147483647/1 ]
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
      video/x-raw-yuv
                 format: NV16
              framerate: [ 0/1, 2147483647/1 ]
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
      video/x-raw-yuv
                 format: NV12
              framerate: [ 0/1, 2147483647/1 ]
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]

and now how can i konw the actual format flowing between the srcpad of
decoder and sinkpad of videosink ?
UYVY or NV12 ? and width, and height... ? how can i know them in this
example? and how can i program using C languge to get these info ?


2011/9/4 宋喜佳 <songxijia2009 at gmail.com>:
> Hi friends,
> Maybe it is really a simple question, but I am afraid that i do not
> now the answer. that is how can i know the final result of cap
> negotiation. the caps of a pad tell us all of possible formats it can
> support, but at actual running time, how can i know the format it is
> using?
> for example, we know the ffmpegcolorspace plugin support  many formats
> at its srcpad, but at running time ,when linked to a sink element
> ,which supports many formats too, how can i know the final format they
> use after cap negotiation ? ( I program with  C language)
>
> thank you in advance!
>
> Xijia
>



-- 

TEL.:0431-84627053-8336
Mobile:15044157175
QQ:870578087


More information about the gstreamer-devel mailing list