Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6721993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:23:41+00:00 2026-05-26T09:23:41+00:00

There some code in one gstreamer-plugin: static GstFlowReturn gst_ebml_peek_id_full (GstEbmlRead * ebml, guint32 *

  • 0

There some code in one gstreamer-plugin:

static GstFlowReturn
gst_ebml_peek_id_full (GstEbmlRead * ebml, guint32 * id, guint64 * length,
    guint * prefix)
{
  GstFlowReturn ret;

  ret = gst_ebml_peek_id_length (id, length, prefix,
      (GstPeekData) gst_ebml_read_peek, (gpointer) gst_ebml_read_br (ebml),
      ebml->el, gst_ebml_read_get_pos (ebml));
  if (ret != GST_FLOW_OK)
    return ret;

  GST_LOG_OBJECT (ebml->el, "id 0x%x at offset 0x%" G_GINT64_MODIFIER "x"
      " of length %" G_GUINT64_FORMAT ", prefix %d", *id,
      gst_ebml_read_get_pos (ebml), *length, *prefix);

Now see the 4:th argument to gst_ebml_peek_id_length () is

(GstPeekData) gst_ebml_read_peek

where gst_ebml_read_peek is another function whose definition is:

static const guint8 *
gst_ebml_read_peek (GstByteReader * br, guint peek)
{
  const guint8 *data = NULL;

  if (G_LIKELY (gst_byte_reader_peek_data (br, peek, &data)))
    return data;
  else
    return NULL;
}

Now I want to ask you is: gst_ebml_read_peek has two input argument in definition, so how can it be called (in the upper code) without arguments?

Edit:
You can find this code at
http://gstreamer.freedesktop.org/data/coverage/lcov/gst-plugins-good/gst/matroska/ebml-read.c.gcov.html

From around line 194.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:23:42+00:00Added an answer on May 26, 2026 at 9:23 am

    Here is a simpler example doing a similar thing:

    #include <stdio.h>
    
    typedef int (*binaryop)(int, int);
    
    static int add(int a, int b) {
      return a + b;
    }
    
    static int mul(int a, int b) {
      return a * b;
    }
    
    static void print_result(binaryop op, int a, int b) {
      printf("%d\n", op(a, b));
    }
    
    int main() {
      print_result(add, 2, 3);
      print_result(mul, 5, 7);
      return 0;
    }
    

    The print_result function takes another function as a parameter, which it then calls. When you just write add without the parentheses, the function is not yet called. It is only called in a function call expression, and that looks like this: function_name(arguments).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any codeplex license that allows some one to use my code any
So I ran some static code analyzer over some c code and one thing
I'm using .net. Is there some code somewhere that can change $11,456.50 -> eleven
There's some code in our project that looks a bit like this: Private Sub
There is some code that I'm trying to convert from IList to IEnumerable :
is there some ruby code I can use to install a gem from a
i'm using DbSimple, but there is some code which i could write into another
I am reading WIX script written by others. There are some code really confuses
I am writing a document with Emacs. As you know, there are some code
Is there some magic existing code in MVC 2 to Html.Encode() strings and allow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.