how can i know the result of "cap negotiation"

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

how can i know the result of "cap negotiation"

宋喜佳
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
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how can i know the result of "cap negotiation"

Stas Sergeev
04.09.2011 13:36, 宋喜佳 wrote:

> 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)
Use gst_pad_set_setcaps_function() to register your
own handler for the caps negotiation on pad.
But if you use the ghostpad (you probably do not),
you are out of luck, but the patch here may help:
https://bugzilla.gnome.org/show_bug.cgi?id=658076
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how can i know the result of "cap negotiation"

宋喜佳
In reply to this post by 宋喜佳
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 宋喜佳 <[hidden email]>:

> 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
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how can i know the result of "cap negotiation"

Stas Sergeev
05.09.2011 05:51, 宋喜佳 wrote
> and now how can i konw the actual format flowing between the srcpad of
> decoder and sinkpad of videosink ?
By installing the handler with
gst_pad_set_setcaps_function().
You can also get the caps directly from
the buffer if you need.

> 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 ?
See examples of gst_pad_set_setcaps_function() in google. :)
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how can i know the result of "cap negotiation"

Wim Taymans
In reply to this post by 宋喜佳
On 09/04/2011 11:36 AM, 宋喜佳 wrote:
> 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?

Use the caps property on the pad or use gst_pad_get_negotiated_caps() on
linked pads.

Wim

> 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
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel