Re: Fetching GstBuffer Flags in GStreamer1

hi Timm;

I think this case requires an API addition to GStreamer, instead of trying to work around it in Perl. GstBuffer should get a get_flags() method to replace the macro - as macros have always been fairly unfriendly to language bindings.

you should file a bug against GStreamer.


On Wednesday, December 24, 2014, Timm Murray <tmurray wumpus-cave net> wrote:
After a little more investigation into the C code, GST_BUFFER_FLAG_IS_SET calls into GstMiniObject to check the flags.  There is a mini_object() method on GstBuffer, so I gave this a try:

if(! ($data_buf->mini_object->flags & 'flag_delta_unit') ) {
    $is_key_frame = 1;

That leaves me with the error "Could not get field 'dispose' at . . . " with the line number pointing to the 'if' statement above.

The original GStreamer module has a little xs code to help with the flags on GstBuffer.  That might be the way to go for GStreamer1, too, but I'd like to see if we can do this in Perl first.


On Tue, Dec 23, 2014 at 8:55 AM, Timm Murray <tmurray wumpus-cave net> wrote:
I have an application that sends a video stream to a client over a custom protocol. When the client first connects, we need to wait until the next keyframe so the client can decode it sensibly.  Alternatively, the client could read a flag in the protocol and wait for a keyframe on its end.  Either way, we need to check the GstBuffer flags for a keyframe.

The C code to do this would be:

    // it's a keyframe

GstBufferFlags is itself an enum.  The issue is that GST_BUFFER_FLAG_IS_SET() is itself a C macro rather than a straight function.  So is GST_BUFFER_FLAGS().  There doesn't seem to be any other mechanisim in GstBuffer for checking the flags.  I'm not sure how the introspection bindings would have picked up the macros.


[ ] ebassi []

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]